Add instructions for testnet2 deployment ops #31

Merged
nabarun merged 17 commits from pm-setup-stage2 into main 2024-10-30 12:05:55 +00:00
6 changed files with 592 additions and 507 deletions
Showing only changes of commit a82d68be0e - Show all commits

View File

@ -18,6 +18,8 @@ Stacks to run a node for laconic testnet
Follow steps in [testnet-onboarding-validator.md](./testnet-onboarding-validator.md) to onboard your participant and join as a validator on the LORO testnet
Follow steps in [Upgrade to testnet2](../testnet-onboarding-validator.md#upgrade-to-testnet2) to upgrade your testnet node for testnet2
## Run testnet Nitro Node
Follow steps in [testnet-nitro-node.md](./testnet-nitro-node.md) to run you Nitro node for the testnet

File diff suppressed because it is too large Load Diff

View File

@ -48,14 +48,6 @@
sudo chown dev:dev /srv/laconicd/stage1-laconicd-export.tar.gz
```
* Get the exports locally:
```bash
scp dev@<deployments-server-hostname>:/srv/laconicd/stage1-laconicd-export.tar.gz </path/to/local/directory>
# These files are to be used in the next initialization step, scp them over to the stage2 deploment machine
```
## Initialize stage2
* Copy over the stage1 state and node export archive to stage2 deployment machine
@ -98,6 +90,12 @@
* Skips staking and validator data
* Copy over the genesis file outside data directory:
```bash
cp stage2-deployment/data/laconicd-data/config/genesis.json stage2-deployment
```
## Start stage2
* Start the stage2 deployment:
@ -127,10 +125,10 @@
* Get the genesis file:
```bash
scp dev@<deployments-server-hostname>:/srv/laconicd/stage2-deployment/data/laconicd-data/config/genesis.json </path/to/local/directory>
scp dev@<deployments-server-hostname>:/srv/laconicd/stage2-deployment/genesis.json </path/to/local/directory>
```
* Now users can follow the steps to [Upgrade to testnet stage2](../testnet-onboarding-validator.md#upgrade-to-testnet-stage2)
* Now users can follow the steps to [Upgrade to testnet2](../testnet-onboarding-validator.md#upgrade-to-testnet2)
## Bank Transfer

View File

@ -1,25 +0,0 @@
#!/bin/bash
# Exit on error
set -e
set -u
NODE_HOME="$HOME/.laconicd"
stage2_genesis="$NODE_HOME/tmp-stage2/genesis.json"
if [ ! -f ${stage2_genesis} ]; then
echo "stage2 genesis file not found, exiting..."
exit 1
fi
# Remove data but keep keys
laconicd cometbft unsafe-reset-all
# Use provided genesis config
cp $stage2_genesis $NODE_HOME/config/genesis.json
# Set chain id in config
chain_id=$(jq -r '.chain_id' $stage2_genesis)
laconicd config set client chain-id $chain_id --home $NODE_HOME
echo "Node data reset and ready for stage2!"

View File

@ -0,0 +1,25 @@
#!/bin/bash
# Exit on error
set -e
set -u
NODE_HOME="$HOME/.laconicd"
testnet2_genesis="$NODE_HOME/tmp-testnet2/genesis.json"
if [ ! -f ${testnet2_genesis} ]; then
echo "testnet2 genesis file not found, exiting..."
exit 1
fi
# Remove data but keep keys
laconicd cometbft unsafe-reset-all
# Use provided genesis config
cp $testnet2_genesis $NODE_HOME/config/genesis.json
# Set chain id in config
chain_id=$(jq -r '.chain_id' $testnet2_genesis)
laconicd config set client chain-id $chain_id --home $NODE_HOME
echo "Node data reset and ready for testnet2!"

View File

@ -280,18 +280,28 @@ laconic-so deployment --dir testnet-laconicd-deployment start
sudo rm -r testnet-laconicd-deployment
```
## Upgrade to testnet stage2
## Upgrade to testnet2
### Prerequisites
* Testnet stage2 genesis file and peer node address
* testnet2 genesis file and peer node address
* Mnemonic from the [wallet](https://wallet.laconic.com)
* Have a testnet stage1 node running
* A testnet stage1 node
### Setup
* Stop the stage1 node:
```bash
# In dir where stage1 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
@ -318,20 +328,17 @@ laconic-so deployment --dir testnet-laconicd-deployment start
### Create a deployment
* The existing deployment used for stage1 can be used for stage2
* The existing stage1 deployment can be used for testnet2
* Copy over the published testnet genesis file (`.json`) to data directory in deployment (`testnet-laconicd-deployment/data/laconicd-data/tmp-stage2`):
* Copy over the published testnet2 genesis file (`.json`) to data directory in deployment (`testnet-laconicd-deployment/data/laconicd-data/tmp-testnet2`):
```bash
# In dir where stage1 deployment (`testnet-laconicd-deployment`) exists
TESTNET_DEPLOYMENT=$(pwd)/testnet-laconicd-deployment
# Example
mkdir -p $TESTNET_DEPLOYMENT/data/laconicd-data/tmp-stage2
cp genesis.json $TESTNET_DEPLOYMENT/data/laconicd-data/tmp-stage2/genesis.json
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 stage2:
* Run script to reset node data and upgrade for testnet2:
```bash
cd ~/cerc/testnet-laconicd-stack
@ -339,7 +346,7 @@ laconic-so deployment --dir testnet-laconicd-deployment start
docker run -it \
-v $TESTNET_DEPLOYMENT/data/laconicd-data:/root/.laconicd \
-v ./ops/stage2:/scripts \
cerc/laconicd:local bash -c "/scripts/upgrade-node-to-stage2.sh"
cerc/laconicd:local bash -c "/scripts/upgrade-node-to-testnet2.sh"
cd $TESTNET_DEPLOYMENT
```
@ -352,7 +359,7 @@ laconic-so deployment --dir testnet-laconicd-deployment start
CERC_CHAIN_ID=laconic-testnet-2
# Comma separated list of nodes to keep persistent connections to
# Example: "node-1-id@laconicd-testnet2.laconic.com:26656"
# Example: "node-1-id@laconicd-testnet2.laconic.com:36656"
# Use the provided node id
CERC_PEERS=""