From 9b6b951270852fd796bfcab3aca3851db4a49ada Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Thu, 17 Oct 2024 17:23:08 +0530 Subject: [PATCH] Add instructions for halting testnet stage1 and starting stage2 --- README.md | 1 + ops/stage1-to-stage2.md | 116 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 117 insertions(+) create mode 100644 ops/stage1-to-stage2.md diff --git a/README.md b/README.md index ea70127..2400fed 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Stacks to run a node for laconic testnet - [Update deployments after code changes](./ops/update-deployments.md) - [Halt stage0 and start stage1](./ops/stage0-to-stage1.md) +- [Halt stage1 and start stage2](./ops/stage1-to-stage2.md) - [Create deployments from scratch (for reference only)](./ops/deployments-from-scratch.md) - [Deploy and transfer new tokens for nitro operations](./ops/nitro-token-ops.md) diff --git a/ops/stage1-to-stage2.md b/ops/stage1-to-stage2.md new file mode 100644 index 0000000..0f64ce5 --- /dev/null +++ b/ops/stage1-to-stage2.md @@ -0,0 +1,116 @@ +# Halt stage1 and start stage2 + +## Login + +* Log in as `dev` user on the deployments VM + +* All the deployments are placed in the `/srv` directory: + + ```bash + cd /srv + ``` + +## Halt stage1 + +* Confirm the the currently running node is for stage1 chain: + + ```bash + # On stage1 deployment machine + cd /srv/laconicd + + laconic-so deployment --dir stage1-deployment logs laconicd -f --tail 30 + ``` + +* Stop the stage1 deployment: + + ```bash + laconic-so deployment --dir stage1-deployment stop + + # Stopping this deployment marks the end of testnet stage1 + ``` + +## Initialize stage2 + +* Copy over the `stage1-deployment` dir to stage2 deployment machine + +* Copy over the stage1 node data to stage2 deployment dir: + + ```bash + # On stage2 deployment machine + cd /srv/laconicd + + STAGE1_DEPLOYMENT= + cp -r $STAGE1_DEPLOYMENT/data/laconicd-data stage2-deployment/data + ``` + +* Initialize stage2 chain: + + ```bash + DEPLOYMENT_DIR=$pwd + + 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 + + cd $DEPLOYMENT_DIR + ``` + + * Exports the data from stage1 + + * Generates the genesis file for stage2 + + * Initializes the `stage2-deployment` node + +## Start stage2 + +* Start the stage2 deployment: + + ```bash + laconic-so deployment --dir stage2-deployment start + ``` + +* Check status of stage2 laconicd: + + ```bash + # List down the container and check health status + docker ps -a | grep laconicd + + # Follow logs for laconicd container, check that new blocks are getting created + laconic-so deployment --dir stage2-deployment logs laconicd -f + ``` + +* Get the node's peer adddress and stage2 genesis file to share with the participants: + + * Get the node id: + + ```bash + echo $(laconic-so deployment --dir stage1-deployment exec laconicd "laconicd cometbft show-node-id")@laconicd.laconic.com:26656 + ``` + + * Get the genesis file: + + ```bash + scp dev@:/srv/laconicd/stage2-deployment/data/laconicd-data/config/genesis.json + ``` + +* Now users can follow the steps to [Upgrade to testnet stage2](https://git.vdb.to/cerc-io/testnet-laconicd-stack/src/branch/main/testnet-onboarding-validator.md#upgrade-to-testnet-stage2) + +## Bank Transfer + +* Transfer tokens to an address: + + ```bash + cd /srv/laconicd + + RECEIVER_ADDRESS= + AMOUNT= + + laconic-so deployment --dir stage2-deployment exec laconicd "laconicd tx bank send alice ${RECEIVER_ADDRESS} ${AMOUNT}alnt --from alice --fees 1000000alnt" + ``` + +* Check balance: + + ```bash + laconic-so deployment --dir stage2-deployment exec laconicd "laconicd query bank balances ${RECEIVER_ADDRESS}" + ```