From 4b2821839f09841d8e71919de19b00269043b2c1 Mon Sep 17 00:00:00 2001 From: Nabarun Date: Sat, 14 Jun 2025 09:18:23 +0530 Subject: [PATCH 01/11] Add update steps for multisig deployment --- docs/run-first-validator.md | 2 +- playbooks/cosmos-multisig-app/README.md | 48 +++++++++++++++++++++---- 2 files changed, 42 insertions(+), 8 deletions(-) diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index 8429312..7b24e2b 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -138,7 +138,7 @@ - Run the following steps in machine where [the genesis file is to be generated (machine 3)](#build-laconicd-to-generate-genesis-file) -- Copy over compressed `testnet-state.zst` file to target machine +- Copy over compressed `testnet-state.zst` file in previous steps from machine 1 to machine 3 - Set envs: diff --git a/playbooks/cosmos-multisig-app/README.md b/playbooks/cosmos-multisig-app/README.md index ad3c19b..000761a 100644 --- a/playbooks/cosmos-multisig-app/README.md +++ b/playbooks/cosmos-multisig-app/README.md @@ -8,7 +8,6 @@ This playbook sets up the Cosmos Multisig application for managing multisig wall - [ansible](../README.md#ansible-installation) - If running playbook to setup deployment on remote machine, the following need to be installed in remote: - [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install) - - [yq](https://github.com/mikefarah/yq?tab=readme-ov-file#wget) ## Configuration @@ -26,7 +25,6 @@ This playbook sets up the Cosmos Multisig application for managing multisig wall * Update `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.yml` with your node configuration: ```yaml - # TODO: Update with example domains mapped to ports next_public_node_addresses: '["https://laconicd-mainnet.laconic.com"]' node_rest_endpoint: "https://api.laconicd-mainnet.laconic.com" ``` @@ -37,14 +35,20 @@ This playbook sets up the Cosmos Multisig application for managing multisig wall ```bash # Parent directory where the deployment directory will live export DATA_DIRECTORY= + export MULTISIG_DEPLOYMENT_DIR=cosmos-multisig-deployment ``` +* Copy the inventory file: + ```bash + cp ~/cerc/laconicd-stack/playbooks/hosts.ini.example ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini + ``` + ### Local Setup * Setup and start the multisig app: ```bash - ansible-playbook -v -i hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit local + ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit local ``` * Access the app at @@ -52,16 +56,14 @@ This playbook sets up the Cosmos Multisig application for managing multisig wall ### Remote Setup * Create and configure hosts.ini: - * Copy the example file: - ```bash - cp ~/cerc/laconicd-stack/playbooks/hosts.ini.example ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini - ``` + * Edit `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini` and update the remote host details: ```ini [remote] # Replace with your actual remote host details remote_host ansible_host=your.remote.host ansible_user=your_remote_user ansible_ssh_common_args='-o ForwardAgent=yes' ``` + * Verify SSH connection using Ansible ping: ```bash ansible all -m ping -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini --limit remote_host @@ -81,6 +83,38 @@ This playbook sets up the Cosmos Multisig application for managing multisig wall laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR logs -f cosmos-multisig-ui ``` +## Update + +- Set environment variables for the deployment: + ```bash + # Parent directory where the deployment directory will live + export DATA_DIRECTORY= + + export MULTISIG_DEPLOYMENT_DIR=cosmos-multisig-deployment + ``` + +- Stop the deployment: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR stop + ``` + +- Update `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.yml` with required values + +- Run ansible playbook to deploy again: + + - For local host + + ```bash + ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit local + ``` + + - For remote host (check that remote is configured properly in `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini`) + + ```bash + ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit remote_host + ``` + ## Clean up - To stop the deployment: -- 2.45.2 From cb1853f140c6ce364558101a01d3984f50279e59 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Sat, 14 Jun 2025 12:57:53 +0530 Subject: [PATCH 02/11] Add steps for multisig app usage --- README.md | 4 + config/network.json | 8 +- docs/run-first-validator.md | 74 +++++++++++++++++-- docs/run-validator.md | 55 +++++++++++++- playbooks/cosmos-multisig-app/README.md | 65 +++++++++------- .../cosmos-multisig-vars.example.yml | 2 +- .../cosmos-multisig-app/multisig-usage.md | 55 ++++++++++++++ .../first-validator/setup-first-validator.yml | 9 ++- playbooks/tmkms/setup-tmkms.yml | 5 +- playbooks/validator/setup-validator.yml | 12 ++- 10 files changed, 246 insertions(+), 43 deletions(-) create mode 100644 playbooks/cosmos-multisig-app/multisig-usage.md diff --git a/README.md b/README.md index 91d8036..74ea3ae 100644 --- a/README.md +++ b/README.md @@ -19,3 +19,7 @@ - **Run A Validator Node:** Follow steps in [run-validator.md](docs/run-validator.md) to run a mainnet validator node - **Update Service Provider:** Follow steps in [update-service-provider.md](docs/update-service-provider.md) to migrate your service provider from SAPO testnet to mainnet + +## Multisig App + +- Usage guide is available at [multisig-usage.md](./playbooks/cosmos-multisig-app/multisig-usage.md) diff --git a/config/network.json b/config/network.json index ce66559..413fbd6 100644 --- a/config/network.json +++ b/config/network.json @@ -19,6 +19,11 @@ "coinDenom": "ALNT", "coinMinimalDenom": "alnt", "coinDecimals": 0 + }, + { + "coinDenom": "LPS", + "coinMinimalDenom": "alps", + "coinDecimals": 18 } ], "feeCurrencies": [ @@ -39,7 +44,6 @@ "coinDecimals": 0 }, "features": [ - "stargate", - "ibc-transfer" + "stargate" ] } diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index 7b24e2b..4ca33f8 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -91,6 +91,11 @@ - Copy over the `priv_validator_key.json` located at `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json` to the machine where the TMKMS service is to be setup (machine 4) + ```bash + # Example command to transfer file from machine 2 to machine 4 (run on machine 2) + scp -C $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json @: + ``` + ## Setup TMKMS - For integrating TMKMS with laconicd, follow steps below in the machine where the TMKMS service is to be setup (machine 4) @@ -134,20 +139,25 @@ - The compressed zst file will be generated at `/export/testnet-state.zst` +- Copy over the compressed `testnet-state.zst` file to the machine where the genesis file is to be generated (machine 3) + + ```bash + # Example command to transfer file from machine 1 to machine 3 (run on machine 1) + scp -C /export/testnet-state.zst @: + ``` + ## Generate mainnet genesis file - Run the following steps in machine where [the genesis file is to be generated (machine 3)](#build-laconicd-to-generate-genesis-file) -- Copy over compressed `testnet-state.zst` file in previous steps from machine 1 to machine 3 - - Set envs: ```bash - # Path where exported testnet state JSON file will be created - export EXPORTED_STATE_PATH= + # File path where exported testnet state JSON file will be created + export EXPORTED_STATE_PATH= - # Path where LPS distribution JSON file will be created - export LPS_DISTRIBUTION_PATH= + # File path where LPS distribution JSON file will be created + export LPS_DISTRIBUTION_PATH= export EARLY_SUPPORTS_ACC_ADDR= @@ -328,7 +338,7 @@ ``` - Query the early supports account balance: - + ```bash # Set the early supports account address export EARLY_SUPPORTS_ACC_ADDR= @@ -371,6 +381,54 @@ - Update `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/config.env` with required values +- Start the node deployment: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR start + ``` + +## Rebuild Images + +- Follow these steps to rebuild the images for TMKMS and node in case of any code changes + +### TMKMS + +- Run these steps in the machine where the TMKMS service is setup (machine 4) + +- Stop the TMKMS deployment: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/tmkms-deployment stop + ``` + +- Run ansible playbook to rebuild the TMKMS image: + + ```bash + BUILD_ONLY=true ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/setup-tmkms.yml + ``` + +- Start the TMKMS deployment: + + ```bash + ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/run-tmkms.yml + ``` + +### Node + +- Run these steps in the machine where the mainnet node is setup (machine 2) + +- Stop the node deployment: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR stop + ``` + +- Run ansible playbook to rebuild the node image: + + ```bash + BUILD_ONLY=true ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/setup-first-validator.yml + ``` + - Start the node deployment: ```bash @@ -413,6 +471,6 @@ The following files should show up: - node-addresses.yml - config/mainnet-genesis.json - - config/staking-amount.json + - config/staking-amount.json - Submit a PR with the genesis file, staking amount file and node address so that it is available to other validators diff --git a/docs/run-validator.md b/docs/run-validator.md index fc1f7b8..af1a7a2 100644 --- a/docs/run-validator.md +++ b/docs/run-validator.md @@ -102,7 +102,12 @@ ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/setup-validator.yml ``` -- Copy over the `priv_validator_key.json` located at `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json` to the machine from where the TMKMS service is to be setup (machine 4) +- Copy over the `priv_validator_key.json` located at `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json` to the machine where the TMKMS service is to be setup (machine 4) + + ```bash + # Example command to transfer file from machine 2 to machine 4 (run on machine 2) + scp -C $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json @: + ``` ## Setup TMKMS @@ -288,6 +293,54 @@ - Update `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/config.env` with required values +- Start the node deployment: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR start + ``` + +## Rebuild Images + +- Follow these steps to rebuild the images for TMKMS and node in case of any code changes + +### TMKMS + +- Run these steps in the machine where the TMKMS service is setup (machine 4) + +- Stop the TMKMS deployment: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/tmkms-deployment stop + ``` + +- Run ansible playbook to rebuild the TMKMS image: + + ```bash + BUILD_ONLY=true ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/setup-tmkms.yml + ``` + +- Start the TMKMS deployment: + + ```bash + ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/run-tmkms.yml + ``` + +### Node + +- Run these steps in the machine where the mainnet node is setup (machine 2) + +- Stop the node deployment: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR stop + ``` + +- Run ansible playbook to rebuild the node image: + + ```bash + BUILD_ONLY=true ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/setup-validator.yml + ``` + - Start the node deployment: ```bash diff --git a/playbooks/cosmos-multisig-app/README.md b/playbooks/cosmos-multisig-app/README.md index 000761a..f4c5a82 100644 --- a/playbooks/cosmos-multisig-app/README.md +++ b/playbooks/cosmos-multisig-app/README.md @@ -11,19 +11,20 @@ This playbook sets up the Cosmos Multisig application for managing multisig wall ## Configuration -* Fetch the stack: +- Fetch the stack: ```bash laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull ``` -* Copy the example variables file: +- Copy the example variables file: ```bash cp ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.yml ``` -* Update `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.yml` with your node configuration: +- Update `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.yml` with your node configuration: + ```yaml next_public_node_addresses: '["https://laconicd-mainnet.laconic.com"]' node_rest_endpoint: "https://api.laconicd-mainnet.laconic.com" @@ -31,65 +32,73 @@ This playbook sets up the Cosmos Multisig application for managing multisig wall ## Setup Steps -* Set common environment variables: - ```bash - # Parent directory where the deployment directory will live - export DATA_DIRECTORY= - - export MULTISIG_DEPLOYMENT_DIR=cosmos-multisig-deployment - ``` +- Set common environment variables: + + ```bash + # Parent directory where the deployment directory will live + export DATA_DIRECTORY= + + export MULTISIG_DEPLOYMENT_DIR=cosmos-multisig-deployment + ``` + +- Copy the inventory file: -* Copy the inventory file: ```bash cp ~/cerc/laconicd-stack/playbooks/hosts.ini.example ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ``` ### Local Setup -* Setup and start the multisig app: +- Setup and start the multisig app: + ```bash ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit local ``` -* Access the app at +- Access the app at ### Remote Setup -* Create and configure hosts.ini: +- Create and configure hosts.ini: + + - Edit `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini` and update the remote host details: - * Edit `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini` and update the remote host details: ```ini [remote] # Replace with your actual remote host details remote_host ansible_host=your.remote.host ansible_user=your_remote_user ansible_ssh_common_args='-o ForwardAgent=yes' ``` - * Verify SSH connection using Ansible ping: + - Verify SSH connection using Ansible ping: + ```bash ansible all -m ping -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini --limit remote_host ``` -* Run the playbook targeting the remote host: +- Run the playbook targeting the remote host: + ```bash ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit remote_host ``` -* Access the app at +- Access the app at ## Check Status -* Check app logs: - ```bash - laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR logs -f cosmos-multisig-ui - ``` +- Check app logs: + + ```bash + laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR logs -f cosmos-multisig-ui + ``` ## Update - Set environment variables for the deployment: + ```bash # Parent directory where the deployment directory will live - export DATA_DIRECTORY= - + export DATA_DIRECTORY= + export MULTISIG_DEPLOYMENT_DIR=cosmos-multisig-deployment ``` @@ -104,11 +113,11 @@ This playbook sets up the Cosmos Multisig application for managing multisig wall - Run ansible playbook to deploy again: - For local host - + ```bash ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit local ``` - + - For remote host (check that remote is configured properly in `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini`) ```bash @@ -118,12 +127,14 @@ This playbook sets up the Cosmos Multisig application for managing multisig wall ## Clean up - To stop the deployment: + ```bash laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR stop ``` - To stop and delete all data: + ```bash laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR stop --delete-volumes sudo rm -rf $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR - ``` + ``` diff --git a/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml b/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml index 0abc814..5122874 100644 --- a/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml +++ b/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml @@ -29,7 +29,7 @@ next_public_display_denom: "ALNT" next_public_display_denom_exponent: 0 # JSON array of asset definitions, including denom units, base, name, display, and symbol -next_public_assets: '[{"denom_units":[{"denom":"alnt","exponent":0}],"base":"alnt","name":"Laconic Token","display":"ALNT","symbol":"alnt"}]' +next_public_assets: '[{"denom_units":[{"denom":"alnt","exponent":0}],"base":"alnt","name":"Laconic Token","display":"ALNT","symbol":"alnt"},{"denom_units":[{"denom":"lps","exponent":18},{"denom":"alps","exponent":0}],"base":"alps","name":"Laconic Prepaid Service","display":"LPS","symbol":"LPS"}]' # Default gas price for transactions next_public_gas_price: "0.001alnt" diff --git a/playbooks/cosmos-multisig-app/multisig-usage.md b/playbooks/cosmos-multisig-app/multisig-usage.md new file mode 100644 index 0000000..e73557a --- /dev/null +++ b/playbooks/cosmos-multisig-app/multisig-usage.md @@ -0,0 +1,55 @@ +# Multisig Usage + +## Create a Multisig + +- On opening the app, a prompt will be shown to add Laconic Mainnet network to you Keplr wallet. Click on `Approve` + +- Go to home and click on `I don't have a multisig` + +- Add the addresses of accounts which have performed at least one tx on chain + +- Set the threshold as required (if threshold is set to N out of N members then all the validators have to sign the tx) + +- Click on `Submit` and `Create multisig` + +## Import Accounts in Keplr + +- Add the accounts in Keplr wallet for signing the transaction + + - Open Keplr wallet and click on the user icon in the top right corner + + - Click on `Add wallet`, then select `Import an existing wallet` and go to `Use recovery phrase or private key` + + - Select the `Private key` tab and then paste the private key of the account and click on import + + - Set a name for the wallet (used when connecting wallet to app for signing transaction) and click on next + + - Search for `Laconic Mainnet` and select it, then click on `Save` + + - Other accounts can be added in a similar manner + +- Send funds to the generated multisig address using Keplr + + - Open Keplr wallet and select the account from which you wish to transfer the funds to the multisig address + + - Search for `Laconic Mainnet` and select the network. Select `Send` and paste the multisig address and set desired amount and click on `Next` and approve the transaction + +## Send Transaction From Multisig Address + +- In the multisig app, Go to `home`, paste your multisig address and click on `Use this multisig` + +- You will see the multisig members and holdings for the address + +- Click on `Create new transaction` and then click on `Bank Send` under `Add New Msg` + +- Enter the recipient address, amount to be transfered and memo (optional) + +- Click on create transaction + +- Under Choose wallet to sign, click on `Connect Keplr` + +- After connecting the wallet, click on `Sign transaction` and approve the transaction + +- Repeat the above steps for other members of the multisig to sign the transaction + +- Once the transaction is signed by required number of validators (as set in the threshold), click on `Broadcast Transaction` diff --git a/playbooks/first-validator/setup-first-validator.yml b/playbooks/first-validator/setup-first-validator.yml index da20b0a..459af51 100644 --- a/playbooks/first-validator/setup-first-validator.yml +++ b/playbooks/first-validator/setup-first-validator.yml @@ -9,6 +9,7 @@ spec_file: "{{data_directory}}/laconicd-spec.yml" spec_template: "./templates/specs/spec-template.yml.j2" build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}" + BUILD_ONLY: "{{ lookup('env', 'BUILD_ONLY') | default(false) | bool }}" tasks: - name: Include setup tasks ansible.builtin.import_tasks: ../setup.yml @@ -18,7 +19,7 @@ msg: >- Required environment variables are not set. Please export both DATA_DIRECTORY and MAINNET_DEPLOYMENT_DIR before running the playbook. - when: lookup('env', 'DATA_DIRECTORY') == '' or lookup('env', 'MAINNET_DEPLOYMENT_DIR') == '' + when: not BUILD_ONLY and (lookup('env', 'DATA_DIRECTORY') == '' or lookup('env', 'MAINNET_DEPLOYMENT_DIR') == '') - name: Setup required repositories shell: > @@ -30,18 +31,22 @@ laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers {{ build_args }} - name: Create deployment spec file + when: not BUILD_ONLY shell: | laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy init --output {{ spec_file }} - name: Replace network section in spec_file + when: not BUILD_ONLY shell: > {{ yq_path }} eval '(.network) = load("{{ spec_template }}").network' -i {{ spec_file }} - name: Create deployment from spec file + when: not BUILD_ONLY shell: | laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy create --spec-file {{ spec_file }} --deployment-dir {{data_directory}}/{{ mainnet_deployment_dir }} - name: Create config.env + when: not BUILD_ONLY copy: dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/config.env" content: | @@ -53,6 +58,7 @@ mode: '0777' - name: Initialize laconicd node + when: not BUILD_ONLY shell: | docker run -i \ -v {{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data:/root/.laconicd \ @@ -62,6 +68,7 @@ cerc/laconicd:local bash -c "/scripts/setup-laconicd.sh" - name: Ensure tmp directory exists inside laconicd-data + when: not BUILD_ONLY file: path: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp" state: directory diff --git a/playbooks/tmkms/setup-tmkms.yml b/playbooks/tmkms/setup-tmkms.yml index 643040f..468af00 100644 --- a/playbooks/tmkms/setup-tmkms.yml +++ b/playbooks/tmkms/setup-tmkms.yml @@ -6,13 +6,14 @@ tmkms_deployment_dir: "{{ lookup('env', 'TMKMS_DEPLOYMENT_DIR') | default('tmkms-deployment', true) }}" tmkms_spec_file: "{{data_directory}}/tmkms-spec.yml" build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}" + BUILD_ONLY: "{{ lookup('env', 'BUILD_ONLY') | default(false) | bool }}" tasks: - name: Fail if DATA_DIRECTORY env var is not set fail: msg: >- Required environment variable DATA_DIRECTORY is not set. Please export DATA_DIRECTORY before running the playbook. - when: lookup('env', 'DATA_DIRECTORY') == '' + when: not BUILD_ONLY and lookup('env', 'DATA_DIRECTORY') == '' - name: Fetch tmkms stack shell: | @@ -23,9 +24,11 @@ laconic-so --stack ~/cerc/tmkms-stack/stack-orchestrator/stacks/tmkms build-containers {{ build_args }} - name: Create tmkms deployment spec file + when: not BUILD_ONLY shell: | laconic-so --stack ~/cerc/tmkms-stack/stack-orchestrator/stacks/tmkms deploy init --output {{ tmkms_spec_file }} - name: Create tmkms deployment from spec file + when: not BUILD_ONLY shell: | laconic-so --stack ~/cerc/tmkms-stack/stack-orchestrator/stacks/tmkms deploy create --spec-file {{ tmkms_spec_file }} --deployment-dir {{data_directory}}/{{ tmkms_deployment_dir }} diff --git a/playbooks/validator/setup-validator.yml b/playbooks/validator/setup-validator.yml index bd9a028..593ffe1 100644 --- a/playbooks/validator/setup-validator.yml +++ b/playbooks/validator/setup-validator.yml @@ -9,6 +9,7 @@ spec_file: "{{data_directory}}/laconicd-validator-spec.yml" spec_template: "./templates/specs/spec-template.yml.j2" build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}" + BUILD_ONLY: "{{ lookup('env', 'BUILD_ONLY') | default(false) | bool }}" tasks: - name: Include setup tasks ansible.builtin.import_tasks: ../setup.yml @@ -18,14 +19,14 @@ msg: >- Required environment variables are not set. Please export both DATA_DIRECTORY and MAINNET_DEPLOYMENT_DIR before running the playbook. - when: lookup('env', 'DATA_DIRECTORY') == '' or lookup('env', 'MAINNET_DEPLOYMENT_DIR') == '' + when: not BUILD_ONLY and (lookup('env', 'DATA_DIRECTORY') == '' or lookup('env', 'MAINNET_DEPLOYMENT_DIR') == '') - name: Fail if required key files are not defined fail: msg: >- Required key files are not defined. Please set genesis_file and staking_amount_file in validator-vars.yml. - when: not genesis_file or not staking_amount_file + when: not BUILD_ONLY and (not genesis_file or not staking_amount_file) - name: Setup required repositories shell: > @@ -37,18 +38,22 @@ laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers {{ build_args }} - name: Create deployment spec file + when: not BUILD_ONLY shell: | laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy init --output {{ spec_file }} - name: Replace network section in spec_file + when: not BUILD_ONLY shell: > {{ yq_path }} eval '(.network) = load("{{ spec_template }}").network' -i {{ spec_file }} - name: Create deployment from spec file + when: not BUILD_ONLY shell: | laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy create --spec-file {{ spec_file }} --deployment-dir {{data_directory}}/{{ mainnet_deployment_dir }} - name: Create config.env + when: not BUILD_ONLY copy: dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/config.env" content: | @@ -61,18 +66,21 @@ mode: '0777' - name: Ensure tmp directory exists inside laconicd-data + when: not BUILD_ONLY file: path: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp" state: directory mode: '0755' - name: Copy genesis file to laconicd-data tmp directory + when: not BUILD_ONLY copy: src: "{{ genesis_file }}" dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp/genesis.json" mode: '0644' - name: Initialize laconicd node + when: not BUILD_ONLY shell: | docker run -i \ -v {{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data:/root/.laconicd \ -- 2.45.2 From 0ee20c5137a28f8548a38520f0d08faef28839fa Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Sat, 14 Jun 2025 13:29:54 +0530 Subject: [PATCH 03/11] Configure alps in multisig app --- config/network.json | 4 ++-- .../cosmos-multisig-app/cosmos-multisig-vars.example.yml | 2 +- playbooks/cosmos-multisig-app/multisig-usage.md | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/config/network.json b/config/network.json index 413fbd6..f49a594 100644 --- a/config/network.json +++ b/config/network.json @@ -21,9 +21,9 @@ "coinDecimals": 0 }, { - "coinDenom": "LPS", + "coinDenom": "ALPS", "coinMinimalDenom": "alps", - "coinDecimals": 18 + "coinDecimals": 0 } ], "feeCurrencies": [ diff --git a/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml b/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml index 5122874..7ab283b 100644 --- a/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml +++ b/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml @@ -29,7 +29,7 @@ next_public_display_denom: "ALNT" next_public_display_denom_exponent: 0 # JSON array of asset definitions, including denom units, base, name, display, and symbol -next_public_assets: '[{"denom_units":[{"denom":"alnt","exponent":0}],"base":"alnt","name":"Laconic Token","display":"ALNT","symbol":"alnt"},{"denom_units":[{"denom":"lps","exponent":18},{"denom":"alps","exponent":0}],"base":"alps","name":"Laconic Prepaid Service","display":"LPS","symbol":"LPS"}]' +next_public_assets: '[{"denom_units":[{"denom":"alnt","exponent":0}],"base":"alnt","name":"Laconic Token","display":"ALNT","symbol":"alnt"},{"denom_units":[{"denom":"alps","exponent":0}],"base":"alps","name":"Laconic Prepaid Service","display":"ALPS","symbol":"alps"}]' # Default gas price for transactions next_public_gas_price: "0.001alnt" diff --git a/playbooks/cosmos-multisig-app/multisig-usage.md b/playbooks/cosmos-multisig-app/multisig-usage.md index e73557a..382881f 100644 --- a/playbooks/cosmos-multisig-app/multisig-usage.md +++ b/playbooks/cosmos-multisig-app/multisig-usage.md @@ -32,7 +32,11 @@ - Open Keplr wallet and select the account from which you wish to transfer the funds to the multisig address - - Search for `Laconic Mainnet` and select the network. Select `Send` and paste the multisig address and set desired amount and click on `Next` and approve the transaction + - Search for `Laconic Mainnet`, choose the token you wish to send and select the network + + - Select `Send` and paste the multisig address and set desired amount + + - Click on `Next` and approve the transaction ## Send Transaction From Multisig Address @@ -44,6 +48,8 @@ - Enter the recipient address, amount to be transfered and memo (optional) + - You can either select `alnt` or `alps` as denom + - Click on create transaction - Under Choose wallet to sign, click on `Connect Keplr` -- 2.45.2 From 5266f2dc63501b807218e064ba0c5999d6394d83 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Sat, 14 Jun 2025 14:04:52 +0530 Subject: [PATCH 04/11] Update instructions to add laconic mainnet network in wallet --- README.md | 34 ++++++++++++++++++++++++++++++++++ docs/update-deployments.md | 5 ----- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 74ea3ae..e65bffa 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,37 @@ ## Multisig App - Usage guide is available at [multisig-usage.md](./playbooks/cosmos-multisig-app/multisig-usage.md) + +## Configure Wallet for Mainnet + +- To use , you need to add `laconic-mainnet` network in your wallet + +- Go to + +- If the wallet has not been initialized, click on `Create Wallet` and create a new wallet + +- Click on `Add Network` and filling in required details: + + ```bash + # Set network type + Network Type: COSMOS + + # Chain ID of the network + Chain ID: laconic-mainnet + + # Name of the network + Network Name: Laconic Mainnet + + # RPC endpoint of the mainnet node + New RPC URL: https://laconicd-mainnet.laconic.com + + # Coin type + Coin Type: 118 + + # Address prefix + Address Prefix: laconic + + # Native denom and gas price + Native denom: alnt + Gas Price: 0.001alnt + ``` diff --git a/docs/update-deployments.md b/docs/update-deployments.md index 0a6aa42..97f3571 100644 --- a/docs/update-deployments.md +++ b/docs/update-deployments.md @@ -39,9 +39,6 @@ Instructions to reset / update the deployments ```bash # URL for the deploy app so that wallet can work with it CERC_ALLOWED_URLS=https://deploy.laconic.com,https://store.laconic.com - - # RPC URL for the mainnet node - CERC_LACONICD_RPC_URL="https://laconicd-mainnet.laconic.com" ``` * Restart the deployment: @@ -57,8 +54,6 @@ Instructions to reset / update the deployments * The web wallet can now be viewed at -* Add `laconic-mainnet` network by clicking on `Add Network` and filling in required details - ## laconic-console * Deployment dir: `/srv/console/laconic-console-deployment` -- 2.45.2 From 4515fba9975c345936f215052bd19150a0d74918 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Sat, 14 Jun 2025 16:12:12 +0530 Subject: [PATCH 05/11] Update readme steps --- docs/run-first-validator.md | 32 +++++++++++++++++++------------- docs/update-deployments.md | 15 +++++++++++++++ 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/docs/run-first-validator.md b/docs/run-first-validator.md index 4ca33f8..27a101b 100644 --- a/docs/run-first-validator.md +++ b/docs/run-first-validator.md @@ -117,10 +117,16 @@ - Run the following steps in machine where the testnet node is already running (machine 1) +- Export the testnet deployment directory as environment variable: + + ```bash + export TESTNET_DEPLOYMENT_DIR= + ``` + - Get your private key from testnet deployment: ```bash - laconic-so deployment --dir exec laconicd "laconicd keys export --unarmored-hex --unsafe --keyring-backend test" + laconic-so deployment --dir $TESTNET_DEPLOYMENT_DIR exec laconicd "laconicd keys export --unarmored-hex --unsafe --keyring-backend test" ``` NOTE: Store this key securely as it is needed in later steps @@ -128,23 +134,16 @@ - Stop the node for SAPO testnet: ```bash - laconic-so deployment --dir stop + laconic-so deployment --dir $TESTNET_DEPLOYMENT_DIR stop ``` - Run script to export state from testnet chain: ```bash - ~/cerc/laconicd-stack/scripts/export-testnet-state.sh + ~/cerc/laconicd-stack/scripts/export-testnet-state.sh $TESTNET_DEPLOYMENT_DIR ``` - - The compressed zst file will be generated at `/export/testnet-state.zst` - -- Copy over the compressed `testnet-state.zst` file to the machine where the genesis file is to be generated (machine 3) - - ```bash - # Example command to transfer file from machine 1 to machine 3 (run on machine 1) - scp -C /export/testnet-state.zst @: - ``` + - The compressed zst file will be generated at `$TESTNET_DEPLOYMENT_DIR/export/testnet-state.zst` ## Generate mainnet genesis file @@ -165,13 +164,20 @@ export DATA_DIRECTORY= ``` +- Copy over the compressed `testnet-state.zst` file: + + ```bash + # Example command to transfer file from machine 1 to machine 3 + scp -C @:/export/testnet-state.zst + ``` + - Extract the testnet-state JSON file: ```bash - zstd -dc /testnet-state.zst > $EXPORTED_STATE_PATH + zstd -dc /testnet-state.zst > $EXPORTED_STATE_PATH # Remove zst folder - rm -rf /testnet-state.zst + rm -rf /testnet-state.zst ``` - Generate LPS lockup distribution JSON file diff --git a/docs/update-deployments.md b/docs/update-deployments.md index 97f3571..22a67df 100644 --- a/docs/update-deployments.md +++ b/docs/update-deployments.md @@ -121,6 +121,21 @@ Instructions to reset / update the deployments CERC_LACONICD_CHAIN_ID=laconic-mainnet ``` +* Update the code for shopify app in [theme/sections/main-product.liquid](https://git.vdb.to/cerc-io/shopify/pulls/13/files#diff-971bd0e0a616c3feaecf3205ac98a23296a5a0d7) to use the correct chain ID + + ```bash + ... +