Add instructions for testnet2 deployment ops (#31)

Part of [Create a public laconicd testnet](https://www.notion.so/Create-a-public-laconicd-testnet-896a11bdd8094eff8f1b49c0be0ca3b8)

- Add instructions to setup stage2 laconicd deployment
- Add instructions for stage1 to stage2 migration
- Add a script and instructions for users to upgrade their nodes to testnet stage2

Reviewed-on: cerc-io/testnet-laconicd-stack#31
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
2024-10-30 12:05:54 +00:00
committed by nabarun
parent a8ffb987b1
commit eef72ec9c3
12 changed files with 1092 additions and 572 deletions
+111 -1
View File
@@ -63,6 +63,8 @@
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack
# See stack documentation stack-orchestrator/stacks/testnet-laconicd/README.md for more details
```
* Clone required repositories:
@@ -126,6 +128,8 @@
* Inside the `testnet-laconicd-deployment` deployment directory, open `config.env` file and set following env variables:
```bash
CERC_CHAIN_ID=laconic_9000-1
# Comma separated list of nodes to keep persistent connections to
# Example: "node-1-id@laconicd.laconic.com:26656"
# Use the provided node id
@@ -197,12 +201,15 @@ laconic-so deployment --dir testnet-laconicd-deployment start
* From wallet, approve and send transaction to stage1 laconicd chain
<a name="create-validator-using-cli"></a>
* Alternatively, create a validator using the laconicd CLI:
* Import a key pair:
```bash
KEY_NAME=alice
CHAIN_ID=laconic_9000-1
# Restore existing key with mnemonic seed phrase
# You will be prompted to enter mnemonic seed
@@ -243,7 +250,7 @@ laconic-so deployment --dir testnet-laconicd-deployment start
```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 \
--chain-id=$CHAIN_ID \
--from $KEY_NAME"
```
@@ -280,6 +287,109 @@ laconic-so deployment --dir testnet-laconicd-deployment start
sudo rm -r testnet-laconicd-deployment
```
## Upgrade to SAPO testnet
### Prerequisites
* SAPO testnet (testnet2) genesis file and peer node address
* A testnet stage1 node
* For setting up a fresh testnet2 node, follow [Join as a validator](#join-as-a-validator-on-stage1) instead, but use testnet2 chain id (`laconic-testnet-2`)
### Setup
* Stop the stage1 node:
```bash
# In dir where stage1 node deployment (`testnet-laconicd-deployment`) exists
TESTNET_DEPLOYMENT=$(pwd)/testnet-laconicd-deployment
laconic-so deployment --dir testnet-laconicd-deployment stop --delete-volumes
```
* Clone / pull the stack repo:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull
```
* Clone / pull the 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
```
Note: Make sure the latest `cerc-io/laconicd` changes have been pulled
* Build the container images:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd build-containers --force-rebuild
```
This should create the following docker images locally with latest changes:
* `cerc/laconicd`
### Create a deployment
* The existing stage1 deployment can be used for testnet2
* Copy over the published testnet2 genesis file (`.json`) to data directory in deployment (`testnet-laconicd-deployment/data/laconicd-data/tmp-testnet2`):
```bash
# Example
mkdir -p $TESTNET_DEPLOYMENT/data/laconicd-data/tmp-testnet2
cp genesis.json $TESTNET_DEPLOYMENT/data/laconicd-data/tmp-testnet2/genesis.json
```
* Run script to reset node data and upgrade for testnet2:
```bash
cd ~/cerc/testnet-laconicd-stack
docker run -it \
-v $TESTNET_DEPLOYMENT/data/laconicd-data:/root/.laconicd \
-v ./ops/stage2:/scripts \
cerc/laconicd:local bash -c "/scripts/upgrade-node-to-testnet2.sh"
cd -
```
### Configuration
* Inside the `testnet-laconicd-deployment` deployment directory, open `config.env` file and set following env variables:
```bash
CERC_CHAIN_ID=laconic-testnet-2
# Comma separated list of nodes to keep persistent connections to
# Example: "node-1-id@laconicd-sapo.laconic.com:36656"
# Use the provided node id
CERC_PEERS=""
# A custom human readable name for this node
CERC_MONIKER=
```
### Start the deployment
```bash
laconic-so deployment --dir testnet-laconicd-deployment start
```
See [Check status](#check-status) to follow sync status of your node
See [Join as testnet validator](#create-validator-using-cli) to join as a validator using laconicd CLI (use chain id `laconic-testnet-2`)
### Clean up
* Same as [Clean up](#clean-up)
## Troubleshooting
* If you face any issues in the onboarding app or the web-wallet, clear your browser cache and reload