Add steps for multisig app usage
This commit is contained in:
parent
cba2a0e6e5
commit
b640d9433d
@ -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)
|
||||
|
@ -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"
|
||||
]
|
||||
}
|
||||
|
@ -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 <user>@<machine-ip-address>:<absolute-path-to-desired-destination-directory>
|
||||
```
|
||||
|
||||
## 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 `<absolute-path-to-testnet-deployment>/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 <absolute-path-to-testnet-deployment>/export/testnet-state.zst <user>@<machine-ip-address>:<absolute-path-to-desired-destination-directory>
|
||||
```
|
||||
|
||||
## 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=<absolute-path-to-be-exported-testnet-state-json>
|
||||
# File path where exported testnet state JSON file will be created
|
||||
export EXPORTED_STATE_PATH=<absolute/path/to/testnet-state.json>
|
||||
|
||||
# Path where LPS distribution JSON file will be created
|
||||
export LPS_DISTRIBUTION_PATH=<absolute-path-to-be-generated-distribution-json>
|
||||
# File path where LPS distribution JSON file will be created
|
||||
export LPS_DISTRIBUTION_PATH=<absolute/path/to/distribution.json>
|
||||
|
||||
export EARLY_SUPPORTS_ACC_ADDR=<account-address-controlled-by-laconic-foundation>
|
||||
|
||||
@ -328,7 +338,7 @@
|
||||
```
|
||||
|
||||
- Query the early supports account balance:
|
||||
|
||||
|
||||
```bash
|
||||
# Set the early supports account address
|
||||
export EARLY_SUPPORTS_ACC_ADDR=<account-address-controlled-by-laconic-foundation>
|
||||
@ -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
|
||||
|
@ -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 <user>@<machine-ip-address>:<absolute-path-to-desired-destination-directory>
|
||||
```
|
||||
|
||||
## 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
|
||||
|
@ -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=<path/to/deployments/directory>
|
||||
|
||||
export MULTISIG_DEPLOYMENT_DIR=cosmos-multisig-deployment
|
||||
```
|
||||
- Set common environment variables:
|
||||
|
||||
```bash
|
||||
# Parent directory where the deployment directory will live
|
||||
export DATA_DIRECTORY=<absolute/path/to/deployments/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 <http://localhost:7000/laconic>
|
||||
- Access the app at <http://localhost:7000/laconic-mainnet>
|
||||
|
||||
### 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 <http://your.remote.host:7000/laconic>
|
||||
- Access the app at <http://your.remote.host:7000/laconic-mainnet>
|
||||
|
||||
## 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=<path/to/deployments/directory>
|
||||
|
||||
export DATA_DIRECTORY=<absolute/path/to/deployments/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
|
||||
```
|
||||
```
|
||||
|
@ -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"
|
||||
|
55
playbooks/cosmos-multisig-app/multisig-usage.md
Normal file
55
playbooks/cosmos-multisig-app/multisig-usage.md
Normal file
@ -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`
|
@ -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
|
||||
|
@ -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 }}
|
||||
|
@ -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 \
|
||||
|
Loading…
Reference in New Issue
Block a user