Add playbooks to run TMKMS service (#14)
Part of https://www.notion.so/Create-stacks-for-mainnet-1f2a6b22d4728034be4be2c51decf94e Co-authored-by: Shreerang Kale <shreerangkale@gmail.com> Reviewed-on: #14 Co-authored-by: shreerang <shreerang@noreply.git.vdb.to> Co-committed-by: shreerang <shreerang@noreply.git.vdb.to>
This commit was merged in pull request #14.
This commit is contained in:
+94
-66
@@ -14,6 +14,8 @@
|
||||
|
||||
- LPS distribution Google spreadsheet URL or CSV file path
|
||||
|
||||
- Machine 4: Where the TMKMS service is to be setup
|
||||
|
||||
- Following tools are required in all machines:
|
||||
|
||||
- [ansible](playbooks/README.md#ansible-installation)
|
||||
@@ -53,6 +55,9 @@
|
||||
|
||||
# Set desired key name
|
||||
key_name: "laconic-validator"
|
||||
|
||||
# Enable TMKMS
|
||||
tmkms_enabled: true
|
||||
```
|
||||
|
||||
- Export the data directory and mainnet deployment directory as environment variables:
|
||||
@@ -81,6 +86,25 @@
|
||||
|
||||
NOTE: This public key is required in [next step to generate the genesis file](#generate-mainnet-genesis-file)
|
||||
|
||||
- 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)
|
||||
|
||||
## Setup TMKMS
|
||||
|
||||
- For integrating TMKMS with laconicd, follow steps below in the machine where the TMKMS service is to be setup (machine 4)
|
||||
|
||||
- Export the data directory and TMKMS deployment directory as environment variables:
|
||||
|
||||
```bash
|
||||
# Parent directory where the deployment directory will live
|
||||
export DATA_DIRECTORY=
|
||||
```
|
||||
|
||||
- Run ansible playbook to setup the TMKMS service:
|
||||
|
||||
```bash
|
||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/setup-tmkms.yml
|
||||
```
|
||||
|
||||
## Export testnet state
|
||||
|
||||
- Run the following steps in machine where the testnet node is already running (machine 1)
|
||||
@@ -177,72 +201,41 @@
|
||||
|
||||
## Run node
|
||||
|
||||
- Run the following steps in the machine where the mainnet node is setup (machine 2)
|
||||
### Start TMKMS
|
||||
|
||||
### Setup TMKMS (Optional but Recommended)
|
||||
- Run these steps in the machine where [the TMKMS service is setup (machine 4)](#setup-tmkms)
|
||||
|
||||
<!-- Reference: https://docs.osmosis.zone/osmosis-core/keys/tmkms/#setup-tmkms -->
|
||||
|
||||
- For integrating existing TMKMS with laconicd, follow steps below in the machine where TMKMS is setup
|
||||
|
||||
- Set `$TMKMS_HOME` to the directory path containing TMKMS config files
|
||||
- Copy the example variables file:
|
||||
|
||||
```bash
|
||||
# Contents of tmkms config directory
|
||||
ls -l $TMKMS_HOME
|
||||
drwxrwxr-x 2 ... schema
|
||||
drwx------ 2 ... secrets
|
||||
drwxrwxr-x 2 ... state
|
||||
-rw-rw-r-- 1 ... tmkms.toml
|
||||
cp ~/cerc/laconicd-stack/playbooks/tmkms/tmkms-vars.example.yml ~/cerc/laconicd-stack/playbooks/tmkms/tmkms-vars.yml
|
||||
```
|
||||
|
||||
- Update the TMKMS configuration file `$TMKMS_HOME/tmkms.toml`:
|
||||
- Update `~/cerc/laconicd-stack/playbooks/tmkms/tmkms-vars.yml` with required values:
|
||||
|
||||
```toml
|
||||
[[chain]]
|
||||
id = "laconic-mainnet"
|
||||
key_format = { type = "cosmos-json", account_key_prefix = "laconicpub", consensus_key_prefix = "laconicvalconspub" }
|
||||
# Replace <TMKMS_HOME> with absolute path to tmkms config directory
|
||||
state_file = "<TMKMS_HOME>/state/priv_validator_state.json"
|
||||
NOTE: Use the `priv_validator_key.json` file copied from the node setup machine (Machine 2) in [previous step](#setup-node)
|
||||
|
||||
[[validator]]
|
||||
chain_id = "laconic-mainnet"
|
||||
# Replace <NODE_IP> with actual IP address of the laconicd node
|
||||
addr = "tcp://<NODE_IP>:26659"
|
||||
# Replace <TMKMS_HOME> with absolute path to tmkms config directory
|
||||
secret_key = "<TMKMS_HOME>/secrets/kms-identity.key"
|
||||
protocol_version = "v0.34"
|
||||
reconnect = true
|
||||
```yaml
|
||||
# Absolute path to the node's private validator key file
|
||||
priv_validator_key_file_path: "</path/to/priv_validator_key.json>"
|
||||
|
||||
[[providers.softsign]]
|
||||
key_type = "consensus"
|
||||
# Replace <TMKMS_HOME> with absolute path to tmkms config directory
|
||||
path = "<TMKMS_HOME>/secrets/priv_validator_key"
|
||||
chain_ids = ["laconic-mainnet"]
|
||||
# Set the IP address of the machine where the laconicd node is setup
|
||||
node_ip: "<NODE_PUBLIC_IP_ADDRESS>"
|
||||
|
||||
# Set the port of the laconicd node
|
||||
node_port: "26659"
|
||||
```
|
||||
|
||||
- Copy your validator key to TMKMS:
|
||||
|
||||
- The validator key in laconicd node deployment is present at `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json`
|
||||
|
||||
- Place the validator key file in TMKMS config directory at `$TMKMS_HOME/secrets/`
|
||||
|
||||
- Import the private validator key into tmkms:
|
||||
|
||||
```bash
|
||||
tmkms softsign import $TMKMS_HOME/secrets/priv_validator_key.json $TMKMS_HOME/secrets/priv_validator_key
|
||||
```
|
||||
|
||||
- Remove the JSON key file
|
||||
|
||||
```bash
|
||||
rm $TMKMS_HOME/secrets/priv_validator_key.json
|
||||
```
|
||||
|
||||
- Start TMKMS:
|
||||
- Run ansible playbook to run the TMKMS:
|
||||
|
||||
```bash
|
||||
tmkms start --config $TMKMS_HOME/tmkms.toml
|
||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/run-tmkms.yml
|
||||
```
|
||||
|
||||
- Check logs to ensure that TMKMS is running:
|
||||
|
||||
```bash
|
||||
laconic-so deployment --dir $DATA_DIRECTORY/tmkms-deployment logs tmkms -f
|
||||
```
|
||||
|
||||
- Expected example output:
|
||||
@@ -251,29 +244,24 @@
|
||||
INFO tmkms::commands::start: tmkms 0.14.0 starting up...
|
||||
INFO tmkms::keyring: [keyring:softsign] added consensus Ed25519 key: {"@type":"/cosmos.crypto.ed25519.PubKey","key":"T24No1A1FmetNRVCOSg2G2XAKWh97oBXuELdAD6DFgw="}
|
||||
INFO tmkms::connection::tcp: KMS node ID: 7f5fd8dae8953e964e7e56edd4700f597ea0d45c
|
||||
ERROR tmkms::client: [laconic-mainnet@tcp://localhost:26659] I/O error: Connection refused (os error 111)
|
||||
ERROR tmkms::client: [laconic-mainnet@tcp://<node-ip>:26659] I/O error: Connection refused (os error 111)
|
||||
```
|
||||
|
||||
NOTE: The errors dissapear once the laconicd node starts
|
||||
|
||||
- Note the pubkey logged at start for comparing later with validator pubkey on chain
|
||||
- Note the pubkey logged at start for comparing later with validator pubkey on chain
|
||||
|
||||
- Enable TMKMS in the laconicd node configuration:
|
||||
### Start node
|
||||
|
||||
```bash
|
||||
# Set TMKMS_ENABLED to true in the node's config.env
|
||||
echo "TMKMS_ENABLED=true" >> $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/config.env
|
||||
```
|
||||
- Run the following steps in the machine where [the mainnet node is setup (machine 2)](#setup-node)
|
||||
|
||||
- Remove the validator key from node deployment as it is no longer required:
|
||||
|
||||
```bash
|
||||
rm $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json
|
||||
```
|
||||
|
||||
NOTE: Store it safely offline in case of an emergency
|
||||
|
||||
### Start node
|
||||
```bash
|
||||
rm -rf $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json
|
||||
```
|
||||
|
||||
- Copy the genesis file to the mainnet deployment tmp directory:
|
||||
|
||||
@@ -293,7 +281,7 @@
|
||||
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR logs laconicd -f
|
||||
```
|
||||
|
||||
- If TMKMS has been configured verify that validator and TMKMS pubkeys match:
|
||||
- Verify that validator and TMKMS pubkeys match:
|
||||
|
||||
- Get validator pubkey on chain
|
||||
|
||||
@@ -331,6 +319,46 @@
|
||||
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd "laconicd query bank balances $EARLY_SUPPORTS_ACC_ADDR"
|
||||
```
|
||||
|
||||
## Update config
|
||||
|
||||
- Run following steps to update the config for TMKMS and node
|
||||
|
||||
### 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_DIR stop
|
||||
```
|
||||
|
||||
- Update `~/cerc/laconicd-stack/playbooks/tmkms/tmkms-vars.yml` with required values
|
||||
|
||||
- Run ansible playbook to run the TMKMS:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
- 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
|
||||
```
|
||||
|
||||
## Publish required artifacts
|
||||
|
||||
- Run the following steps in machine where the genesis file and staking amount files are generated (machine 3)
|
||||
|
||||
+110
-62
@@ -16,6 +16,12 @@
|
||||
|
||||
- [ansible](playbooks/README.md#ansible-installation)
|
||||
|
||||
- Machine 4: Where the TMKMS service is to be setup
|
||||
|
||||
- laconicd-stack
|
||||
|
||||
- [ansible](playbooks/README.md#ansible-installation)
|
||||
|
||||
- [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install) is required in all machines
|
||||
|
||||
- To fetch laconicd-stack:
|
||||
@@ -71,6 +77,9 @@
|
||||
# Set persistent peers (comma-separated list of node IDs and addresses)
|
||||
# You can find the list of available peers in https://git.vdb.to/cerc-io/laconicd-stack/src/branch/main/node-addresses.yml
|
||||
cerc_peers: "<node-id>@<node-host>:26656,<node-id>@<node-host>:26656"
|
||||
|
||||
# Enable TMKMS
|
||||
tmkms_enabled: true
|
||||
```
|
||||
|
||||
- Export the data directory and mainnet deployment directory as environment variables:
|
||||
@@ -89,80 +98,80 @@
|
||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/setup-validator.yml
|
||||
```
|
||||
|
||||
### Setup TMKMS (Optional but Recommended)
|
||||
- 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)
|
||||
|
||||
<!-- Reference: https://docs.osmosis.zone/osmosis-core/keys/tmkms/#setup-tmkms -->
|
||||
## Setup TMKMS
|
||||
|
||||
- For integrating existing TMKMS with laconicd, follow steps below in the machine where TMKMS is setup
|
||||
- For integrating TMKMS with laconicd, follow steps below in the machine where the TMKMS service is to be setup (machine 4)
|
||||
|
||||
- Set `$TMKMS_HOME` to the directory path containing TMKMS config files
|
||||
- Export the data directory as environment variable:
|
||||
|
||||
```bash
|
||||
# Contents of tmkms config directory
|
||||
ls -l $TMKMS_HOME
|
||||
drwxrwxr-x 2 ... schema
|
||||
drwx------ 2 ... secrets
|
||||
drwxrwxr-x 2 ... state
|
||||
-rw-rw-r-- 1 ... tmkms.toml
|
||||
# Parent directory where the deployment directory will live
|
||||
export DATA_DIRECTORY=
|
||||
```
|
||||
|
||||
- Update the TMKMS configuration file `$TMKMS_HOME/tmkms.toml`:
|
||||
- Run ansible playbook to setup the TMKMS service:
|
||||
|
||||
```toml
|
||||
[[chain]]
|
||||
id = "laconic-mainnet"
|
||||
key_format = { type = "cosmos-json", account_key_prefix = "laconicpub", consensus_key_prefix = "laconicvalconspub" }
|
||||
# Replace <TMKMS_HOME> with absolute path to tmkms config directory
|
||||
state_file = "<TMKMS_HOME>/state/priv_validator_state.json"
|
||||
|
||||
[[validator]]
|
||||
chain_id = "laconic-mainnet"
|
||||
# Replace <NODE_IP> with actual IP address of the laconicd node
|
||||
addr = "tcp://<NODE_IP>:26659"
|
||||
# Replace <TMKMS_HOME> with absolute path to tmkms config directory
|
||||
secret_key = "<TMKMS_HOME>/secrets/kms-identity.key"
|
||||
protocol_version = "v0.34"
|
||||
reconnect = true
|
||||
|
||||
[[providers.softsign]]
|
||||
key_type = "consensus"
|
||||
# Replace <TMKMS_HOME> with absolute path to tmkms config directory
|
||||
path = "<TMKMS_HOME>/secrets/priv_validator_key"
|
||||
chain_ids = ["laconic-mainnet"]
|
||||
```bash
|
||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/setup-tmkms.yml
|
||||
```
|
||||
|
||||
- Copy your validator key to TMKMS:
|
||||
## Run Node
|
||||
|
||||
- The validator key in laconicd node deployment is present at `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json`
|
||||
### Start TMKMS
|
||||
|
||||
- Place the validator key file in TMKMS config directory at `$TMKMS_HOME/secrets/`
|
||||
- Run the following steps in the machine where [the TMKMS service is setup (Machine 4)](#setup-tmkms)
|
||||
|
||||
- Import the private validator key into tmkms:
|
||||
- Copy the example variables file:
|
||||
|
||||
```bash
|
||||
cp ~/cerc/laconicd-stack/playbooks/tmkms/tmkms-vars.example.yml ~/cerc/laconicd-stack/playbooks/tmkms/tmkms-vars.yml
|
||||
```
|
||||
|
||||
- Update `~/cerc/laconicd-stack/playbooks/tmkms/tmkms-vars.yml` with required values:
|
||||
|
||||
NOTE: Use the `priv_validator_key.json` file copied from the node setup machine (Machine 2) in [previous step](#setup-node)
|
||||
|
||||
```yaml
|
||||
# Absolute path to the node's private validator key file
|
||||
priv_validator_key_file_path: "</path/to/priv_validator_key.json>"
|
||||
|
||||
# Set the IP address of the machine where the laconicd node is setup
|
||||
node_ip: "<NODE_PUBLIC_IP_ADDRESS>"
|
||||
|
||||
# Set the port of the laconicd node
|
||||
node_port: "26659"
|
||||
```
|
||||
|
||||
- Run ansible playbook to run the TMKMS:
|
||||
|
||||
```bash
|
||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/run-tmkms.yml
|
||||
```
|
||||
|
||||
- Check logs to ensure that TMKMS is running:
|
||||
|
||||
```bash
|
||||
laconic-so deployment --dir $DATA_DIRECTORY/tmkms-deployment logs tmkms -f
|
||||
```
|
||||
|
||||
- Expected example output:
|
||||
|
||||
```bash
|
||||
tmkms softsign import $TMKMS_HOME/secrets/priv_validator_key.json $TMKMS_HOME/secrets/priv_validator_key
|
||||
INFO tmkms::commands::start: tmkms 0.14.0 starting up...
|
||||
INFO tmkms::keyring: [keyring:softsign] added consensus Ed25519 key: {"@type":"/cosmos.crypto.ed25519.PubKey","key":"T24No1A1FmetNRVCOSg2G2XAKWh97oBXuELdAD6DFgw="}
|
||||
INFO tmkms::connection::tcp: KMS node ID: 7f5fd8dae8953e964e7e56edd4700f597ea0d45c
|
||||
ERROR tmkms::client: [laconic-mainnet@<node-ip>:26659] I/O error: Connection refused (os error 111)
|
||||
```
|
||||
|
||||
- Remove the JSON key file
|
||||
NOTE: The errors dissapear once the laconicd node starts
|
||||
|
||||
```bash
|
||||
rm $TMKMS_HOME/secrets/priv_validator_key.json
|
||||
```
|
||||
- Note the pubkey logged at start for comparing later with validator pubkey on chain
|
||||
|
||||
- Start TMKMS:
|
||||
### Start Node
|
||||
|
||||
```bash
|
||||
tmkms start --config $TMKMS_HOME/tmkms.toml
|
||||
```
|
||||
|
||||
- Enable TMKMS in the laconicd node configuration:
|
||||
|
||||
```bash
|
||||
# Set TMKMS_ENABLED to true in the node's config.env
|
||||
echo "TMKMS_ENABLED=true" >> $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/config.env
|
||||
```
|
||||
|
||||
## Start Node
|
||||
- Run the following steps in the machine where [the validator node is setup (machine 2)](#setup-node)
|
||||
|
||||
- Start the laconicd node:
|
||||
|
||||
@@ -188,8 +197,6 @@
|
||||
|
||||
- Run these steps in a machine from where [the create-validator transaction is to be signed (machine 3)](#build-laconicd-to-create-validator)
|
||||
|
||||
This command clones the entire repository into the `~/cerc` folder, which includes the genesis file published by the first validator.
|
||||
|
||||
- Copy the example variables file:
|
||||
|
||||
```bash
|
||||
@@ -215,7 +222,6 @@
|
||||
|
||||
```bash
|
||||
export DATA_DIRECTORY=<data-directory>
|
||||
export MAINNET_DEPLOYMENT_DIR=mainnet-validator-deployment
|
||||
```
|
||||
|
||||
- Run ansible playbook to create validator on running chain:
|
||||
@@ -234,16 +240,58 @@
|
||||
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'laconicd query staking validators'
|
||||
```
|
||||
|
||||
- If TMKMS has been configured, remove the validator key from node deployment as it is no longer required:
|
||||
|
||||
```bash
|
||||
rm $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json
|
||||
```
|
||||
- Remove the validator key from node deployment as TMKMS is configured:
|
||||
|
||||
NOTE: Store it safely offline in case of an emergency
|
||||
|
||||
```bash
|
||||
rm -rf $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json
|
||||
```
|
||||
|
||||
## Update config
|
||||
|
||||
- Run following steps to update the config for TMKMS and node
|
||||
|
||||
### 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
|
||||
```
|
||||
|
||||
- Update `~/cerc/laconicd-stack/playbooks/tmkms/tmkms-vars.yml` with required values
|
||||
|
||||
- Run ansible playbook to run the TMKMS:
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
- 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
|
||||
```
|
||||
|
||||
## Register Your Node
|
||||
|
||||
- Run the following steps in the machine where the mainnet node is setup (machine 2)
|
||||
|
||||
- Get your node's address:
|
||||
|
||||
```bash
|
||||
|
||||
Reference in New Issue
Block a user