From 524a57d26c2784ea2cabc2908eabceeadd0f9dad Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 18 Oct 2024 10:03:29 +0530 Subject: [PATCH] Update instructions for stage1 to stage2 migration --- ops/stage1-to-stage2.md | 51 +++++++++++++++++++++++++++------ testnet-onboarding-validator.md | 2 +- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/ops/stage1-to-stage2.md b/ops/stage1-to-stage2.md index b2db30f..a513b21 100644 --- a/ops/stage1-to-stage2.md +++ b/ops/stage1-to-stage2.md @@ -29,18 +29,48 @@ # 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@:/srv/laconicd/stage1-laconicd-export.tar.gz + + # 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-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 # On stage2 deployment machine cd /srv/laconicd - STAGE1_DEPLOYMENT= - cp -r $STAGE1_DEPLOYMENT/data/laconicd-data stage2-deployment/data + # Unarchive + tar -xzf stage1-laconicd-config.tar.gz -C stage2-deployment/data/laconicd-data + + # Verify contents + ll stage2-deployment/data/laconicd-data ``` * Initialize stage2 chain: @@ -51,17 +81,21 @@ cd ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd 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 ``` - * Exports the data from stage1 - - * Generates the genesis file for stage2 + * Resets the node data (`unsafe-reset-all`) * 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 the stage2 deployment: @@ -85,6 +119,7 @@ * Get the node id: ```bash + # TODO: Update echo $(laconic-so deployment --dir stage1-deployment exec laconicd "laconicd cometbft show-node-id")@laconicd.laconic.com:26656 ``` diff --git a/testnet-onboarding-validator.md b/testnet-onboarding-validator.md index c8b1fcb..827678c 100644 --- a/testnet-onboarding-validator.md +++ b/testnet-onboarding-validator.md @@ -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 [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