From 391dcb57b47d999811599daf46fbbc073bbb0e27 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Wed, 7 Aug 2024 13:35:17 +0000 Subject: [PATCH] Add instructions for testnet validator onboarding (#17) Part of [laconicd testnet validator enrollment](https://www.notion.so/laconicd-testnet-validator-enrollment-6fc1d3cafcc64fef8c5ed3affa27c675) Co-authored-by: IshaVenikar Reviewed-on: https://git.vdb.to/cerc-io/testnet-laconicd-stack/pulls/17 Co-authored-by: Prathamesh Musale Co-committed-by: Prathamesh Musale --- .../stacks/testnet-laconicd/README.md | 4 +- testnet-onboarding-demo.md | 2 +- testnet-onboarding-validator.md | 245 ++++++++++++++++++ 3 files changed, 248 insertions(+), 3 deletions(-) create mode 100644 testnet-onboarding-validator.md diff --git a/stack-orchestrator/stacks/testnet-laconicd/README.md b/stack-orchestrator/stacks/testnet-laconicd/README.md index bc3ac27..78e7560 100644 --- a/stack-orchestrator/stacks/testnet-laconicd/README.md +++ b/stack-orchestrator/stacks/testnet-laconicd/README.md @@ -222,7 +222,7 @@ laconic-so deployment --dir laconic-console-deployment start # Edit the staking amount and other fields as required # Replace with your node's moniker in command below - laconic-so deployment --dir testnet-laconicd-deployment exec laconicd 'cat < -validator.json + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd 'cat < my-validator.json { "pubkey": $(laconicd cometbft show-validator), "amount": "900000000alnt", @@ -238,7 +238,7 @@ laconic-so deployment --dir laconic-console-deployment start * Create a validator: ```bash - laconic-so deployment --dir testnet-laconicd-deployment exec laconicd 'laconicd tx staking create-validator -validator.json \ + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd 'laconicd tx staking create-validator my-validator.json \ --fees 500000alnt \ --chain-id=laconic_9000-1 \ --from ' diff --git a/testnet-onboarding-demo.md b/testnet-onboarding-demo.md index fc1098f..1515805 100644 --- a/testnet-onboarding-demo.md +++ b/testnet-onboarding-demo.md @@ -985,7 +985,7 @@ - Send transaction request to the wallet - From wallet, approve and send transaction to laconicd chain - Repeat onboarding for other (Charlies's) account by clicking on the web app header "Testnet Onboarding" - - List the participants on stage 1 (run in the directory where laconicd deployment was created): + - List the participants on stage 0 (run in the directory where laconicd deployment was created): ```bash laconic-so deployment --dir stage0-deployment exec laconicd "laconicd query onboarding list" diff --git a/testnet-onboarding-validator.md b/testnet-onboarding-validator.md new file mode 100644 index 0000000..50a0b60 --- /dev/null +++ b/testnet-onboarding-validator.md @@ -0,0 +1,245 @@ +# testnet-onboarding-validator + +## Onboard as a participant / validator on stage0 + +* Visit and click on `Create wallet` + * Save the mnemonic for further usage + +* Register your laconic address as a participant using the [Onboarding App](https://loro-signup.laconic.com/) + + * Read and accept the `Terms and Conditions` + + * Connect testnet-onboarding app to the wallet: + + * Click on `CONNECT WALLET` button on the testnet-onboarding app + + * Click on the WalletConnect icon on the top right corner in the wallet + + * If using the wallet website, enter WalletConnect URI for pairing + + * In the onboarding app, choose your nitro and laconicd account to onboard + + * Sign using the nitro key + + * Approve sign request on Wallet + + * Select the desired participant role (`Validator` or `Participant`) and accept the onboarding terms and conditions + + * In the next step, fund your laconic account by clicking on the `REQUEST TOKENS FROM FAUCET` button; ensure that the displayed balance is updated + + * Send transaction request to the wallet + + * From wallet, approve and send transaction to laconicd chain + +## Join as a validator on stage1 + +### Prerequisites + +* Minimum hardware requirements: + + ```bash + RAM: 8-16GB + Disk space: 200GB + CPU: 2 cores + ``` + +* Testnet genesis file and peer node address + +* Mnemonic from the [wallet](https://wallet.laconic.com) + +* Participant onboarded on stage0 + +### Setup + +* Clone the stack repo: + + ```bash + laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack + ``` + +* Clone required repositories: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd setup-repositories --pull + + # If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories and re-run the command + ``` + +* Build the container images: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd build-containers + ``` + + This should create the following docker images locally: + + * `cerc/laconicd` + +### Create a deployment + +* Create a spec file for the deployment: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd deploy init --output testnet-laconicd-spec.yml + ``` + +* Edit `network` in the spec file to map container ports to host ports as required: + + ```bash + # testnet-laconicd-spec.yml + ... + network: + ports: + laconicd: + - '6060:6060' + - '26657:26657' + - '26656:26656' + - '9473:9473' + - '9090:9090' + - '1317:1317' + ``` + +* Create the deployment from the spec file: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd deploy create --spec-file testnet-laconicd-spec.yml --deployment-dir testnet-laconicd-deployment + ``` + +* Copy over the published testnet genesis file (`.json`) to data directory in deployment (`testnet-laconicd-deployment/data/laconicd-data/tmp`): + + ```bash + # Example + mkdir -p testnet-laconicd-deployment/data/laconicd-data/tmp + cp genesis.json testnet-laconicd-deployment/data/laconicd-data/tmp/genesis.json + ``` + +### Configuration + +* Inside the `testnet-laconicd-deployment` deployment directory, open `config.env` file and set following env variables: + + ```bash + # Comma separated list of nodes to keep persistent connections to + # Example: "node-1-id@laconicd.laconic.com:26656" + # Use the provided node id + CERC_PEERS="" + + # A custom human readable name for this node (default: TestnetNode) + CERC_MONIKER= + ``` + +### Start the deployment + +```bash +laconic-so deployment --dir testnet-laconicd-deployment start +``` + +### Check status + +* To list down and monitor the running containers: + + ```bash + # With status + docker ps -a + + # Follow logs for laconicd container + laconic-so deployment --dir testnet-laconicd-deployment logs laconicd -f + ``` + +* Check the sync status of your node: + + ```bash + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd status | jq .sync_info" + + # `catching_up: false` indicates that node is completely synced + ``` + +* After the node has caught up, view current list of staking validators: + + ```bash + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd query staking validators" + ``` + + * Confirm that in the list of validators, your node moniker does not exist + +### Join as testnet validator + +* Import a key pair: + + ```bash + KEY_NAME=alice + + # Restore existing key with mnemonic seed phrase + # You will be prompted to enter mnemonic seed + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd keys add $KEY_NAME --recover" + + # Query the keystore for your account's address + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd keys show $KEY_NAME -a" + ``` + +* Check balance for your account: + + ```bash + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd query bank balances " + ``` + +* Create required validator configuration: + + ```bash + # Note: + # Edit the staking amount and other fields as required + # Replace with your node's moniker in command below + + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd 'cat < my-validator.json + { + "pubkey": $(laconicd cometbft show-validator), + "amount": "1000000000000000alnt", + "moniker": "", + "commission-rate": "0.1", + "commission-max-rate": "0.2", + "commission-max-change-rate": "0.01", + "min-self-delegation": "1" + } + EOF' + ``` + +* Create a validator: + + ```bash + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd tx staking create-validator my-validator.json \ + --fees 500000alnt \ + --chain-id=laconic_9000-1 \ + --from $KEY_NAME" + ``` + +* View staking validators: + + ```bash + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd query staking validators" + ``` + + * Check that in the list of validators `` exists + +* View validator set: + + ```bash + laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd query consensus comet validator-set" + ``` + +### Clean up + +* Stop all `testnet-laconicd` services running in the background: + + ```bash + # Stop the docker containers + laconic-so deployment --dir testnet-laconicd-deployment stop + ``` + +* To stop all services and also delete data: + + ```bash + # Stop the docker containers + laconic-so deployment --dir testnet-laconicd-deployment stop --delete-volumes + + # Remove deployment directory (deployment will have to be recreated for a re-run) + rm -r testnet-laconicd-deployment + ```