2024-10-17 11:53:08 +00:00
|
|
|
# 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
|
|
|
|
```
|
|
|
|
|
2024-10-18 04:33:29 +00:00
|
|
|
## 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
|
2024-10-18 07:06:39 +00:00
|
|
|
sudo tar -czf /srv/laconicd/stage1-laconicd-export.tar.gz --exclude="./data" --exclude="./tmp" -C $STAGE1_DEPLOYMENT/data/laconicd-data .
|
2024-10-18 04:33:29 +00:00
|
|
|
sudo chown dev:dev /srv/laconicd/stage1-laconicd-export.tar.gz
|
|
|
|
```
|
|
|
|
|
2024-10-17 11:53:08 +00:00
|
|
|
## Initialize stage2
|
|
|
|
|
2024-10-18 04:33:29 +00:00
|
|
|
* Copy over the stage1 state and node export archive to stage2 deployment machine
|
2024-10-17 11:53:08 +00:00
|
|
|
|
2024-10-18 04:33:29 +00:00
|
|
|
* Extract the stage1 state and node config to stage2 deployment dir:
|
2024-10-17 11:53:08 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
# On stage2 deployment machine
|
|
|
|
cd /srv/laconicd
|
|
|
|
|
2024-10-18 04:33:29 +00:00
|
|
|
# Unarchive
|
2024-10-18 07:06:39 +00:00
|
|
|
tar -xzf stage1-laconicd-export.tar.gz -C stage2-deployment/data/laconicd-data
|
2024-10-18 04:33:29 +00:00
|
|
|
|
|
|
|
# Verify contents
|
|
|
|
ll stage2-deployment/data/laconicd-data
|
2024-10-17 11:53:08 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
* Initialize stage2 chain:
|
|
|
|
|
|
|
|
```bash
|
2024-10-17 12:38:07 +00:00
|
|
|
DEPLOYMENT_DIR=$(pwd)
|
2024-10-17 11:53:08 +00:00
|
|
|
|
|
|
|
cd ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd
|
|
|
|
|
2024-10-22 08:01:41 +00:00
|
|
|
STAGE2_CHAIN_ID=laconic-testnet-2
|
2024-10-18 04:33:29 +00:00
|
|
|
./scripts/initialize-stage2.sh $DEPLOYMENT_DIR/stage2-deployment $STAGE2_CHAIN_ID LaconicStage2 os 1000000000000000
|
2024-10-17 11:53:08 +00:00
|
|
|
|
2024-10-21 11:44:16 +00:00
|
|
|
# Enter the keyring passphrase for account from stage1 when prompted
|
|
|
|
|
2024-10-17 11:53:08 +00:00
|
|
|
cd $DEPLOYMENT_DIR
|
|
|
|
```
|
|
|
|
|
2024-10-18 04:33:29 +00:00
|
|
|
* Resets the node data (`unsafe-reset-all`)
|
2024-10-17 11:53:08 +00:00
|
|
|
|
|
|
|
* Initializes the `stage2-deployment` node
|
|
|
|
|
2024-10-18 04:33:29 +00:00
|
|
|
* Generates the genesis file for stage2 with stage1 state
|
|
|
|
|
|
|
|
* Carries over accounts, balances and laconicd modules from stage1
|
|
|
|
|
|
|
|
* Skips staking and validator data
|
|
|
|
|
2024-10-22 09:31:13 +00:00
|
|
|
* Copy over the genesis file outside data directory:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cp stage2-deployment/data/laconicd-data/config/genesis.json stage2-deployment
|
|
|
|
```
|
|
|
|
|
2024-10-17 11:53:08 +00:00
|
|
|
## 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
|
2024-10-22 08:01:41 +00:00
|
|
|
echo $(laconic-so deployment --dir stage2-deployment exec laconicd "laconicd cometbft show-node-id")@laconicd-testnet2.laconic.com:36656
|
2024-10-17 11:53:08 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
* Get the genesis file:
|
|
|
|
|
|
|
|
```bash
|
2024-10-22 09:31:13 +00:00
|
|
|
scp dev@<deployments-server-hostname>:/srv/laconicd/stage2-deployment/genesis.json </path/to/local/directory>
|
2024-10-17 11:53:08 +00:00
|
|
|
```
|
|
|
|
|
2024-10-22 09:31:13 +00:00
|
|
|
* Now users can follow the steps to [Upgrade to testnet2](../testnet-onboarding-validator.md#upgrade-to-testnet2)
|
2024-10-17 11:53:08 +00:00
|
|
|
|
|
|
|
## 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}"
|
|
|
|
```
|