Update instructions for stage1 to stage2 migration

This commit is contained in:
Prathamesh Musale 2024-10-18 10:03:29 +05:30
parent e313969088
commit 1f82257749
2 changed files with 44 additions and 9 deletions

View File

@ -29,18 +29,48 @@
# Stopping this deployment marks the end of testnet stage1 # Stopping this deployment marks the end of testnet stage1
``` ```
## Export stage1 state
* Export the chain state:
```bash
STAGE1_DEPLOYMENT=/srv/laconicd/stage1-deployment
docker run -it \
-v $STAGE1_DEPLOYMENT/data/laconicd-data:/root/.laconicd \
cerc/laconicd:local bash -c "laconicd export | jq > /root/.laconicd/stage1-state.json"
```
* Archive the state and node config and keys:
```bash
sudo tar -czf /srv/laconicd/stage1-laconicd-export.tar.gz --exclude="./data" -C $STAGE1_DEPLOYMENT/data/laconicd-data .
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 ## Initialize stage2
* Copy over the `stage1-deployment` dir to stage2 deployment machine * Copy over the stage1 state and node export archive to stage2 deployment machine
* Copy over the stage1 node data to stage2 deployment dir: * Extract the stage1 state and node config to stage2 deployment dir:
```bash ```bash
# On stage2 deployment machine # On stage2 deployment machine
cd /srv/laconicd cd /srv/laconicd
STAGE1_DEPLOYMENT= # Unarchive
cp -r $STAGE1_DEPLOYMENT/data/laconicd-data stage2-deployment/data tar -xzf stage1-laconicd-config.tar.gz -C stage2-deployment/data/laconicd-data
# Verify contents
ll stage2-deployment/data/laconicd-data
``` ```
* Initialize stage2 chain: * Initialize stage2 chain:
@ -51,17 +81,21 @@
cd ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd cd ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd
STAGE2_CHAIN_ID=laconic_9000-2 STAGE2_CHAIN_ID=laconic_9000-2
./scripts/initialize-stage2.sh $DEPLOYMENT_DIR/stage2-deployment $STAGE2_CHAIN_ID 1000000000000000 ./scripts/initialize-stage2.sh $DEPLOYMENT_DIR/stage2-deployment $STAGE2_CHAIN_ID LaconicStage2 os 1000000000000000
cd $DEPLOYMENT_DIR cd $DEPLOYMENT_DIR
``` ```
* Exports the data from stage1 * Resets the node data (`unsafe-reset-all`)
* Generates the genesis file for stage2
* Initializes the `stage2-deployment` node * Initializes the `stage2-deployment` node
* Generates the genesis file for stage2 with stage1 state
* Carries over accounts, balances and laconicd modules from stage1
* Skips staking and validator data
## Start stage2 ## Start stage2
* Start the stage2 deployment: * Start the stage2 deployment:
@ -85,6 +119,7 @@
* Get the node id: * Get the node id:
```bash ```bash
# TODO: Update
echo $(laconic-so deployment --dir stage1-deployment exec laconicd "laconicd cometbft show-node-id")@laconicd.laconic.com:26656 echo $(laconic-so deployment --dir stage1-deployment exec laconicd "laconicd cometbft show-node-id")@laconicd.laconic.com:26656
``` ```

View File

@ -368,7 +368,7 @@ laconic-so deployment --dir testnet-laconicd-deployment start
See [Check status](#check-status) to follow sync status of your node See [Check status](#check-status) to follow sync status of your node
See [Join as testnet validator](#join-as-testnet-validator) to join / rejoin as a validator using laconicd CLI See [Join as testnet validator](#join-as-testnet-validator) to join as a validator using laconicd CLI
### Clean up ### Clean up