Add instructions to run stage1 with slashing module (#23)

Part of [laconicd testnet validator enrollment](#19)
Requires cerc-io/laconicd#53 and cerc-io/fixturenet-laconicd-stack#13

Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Reviewed-on: #23
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
Prathamesh Musale 2024-08-16 14:52:45 +00:00 committed by nabarun
parent 5ce343566e
commit 98e882bf28
2 changed files with 88 additions and 9 deletions

View File

@ -2,6 +2,10 @@
Once all the participants have completed their onboarding, stage0 laconicd chain can be halted and stage1 chain can be initialized and started
## Prerequisite
* A CSV having the subscribers (`subscribers.csv`) placed at `/srv/laconicd/csvs`
## Login
* Log in as `dev` user on the deployments VM
@ -12,6 +16,58 @@ Once all the participants have completed their onboarding, stage0 laconicd chain
cd /srv
```
## Map subscribers to participants
* Fetch updated scripts in testnet-laconicd-stack:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull
```
* List the participants on stage0:
```bash
cd /src/laconicd
laconic-so deployment --dir stage0-deployment exec laconicd "laconicd query onboarding list"
```
* Create a CSV with subscribers who have onboarded as participants:
NOTE: The following script can be run locally (as it will use <https://laconicd.laconic.com> endpoint by default)
* Clone this repo
```bash
git clone git@git.vdb.to:cerc-io/testnet-laconicd-stack.git
```
* Build
```bash
# Change to scripts dir
cd testnet-laconicd-stack/scripts
# Install dependencies and build
yarn && yarn build
```
* Run script
```bash
# subscribers.csv is the CSV from beehiv
yarn map-subscribers-to-participants --subscribers-csv /path/to/subscribers.csv --output subscribed-participants.csv
# This should create the CSV file at subscribed-participants.csv
# The participants in CSV can be filtered further
```
* Copy over the file to deployments VM
```bash
scp ./subscribed-participants.csv dev@<deployments-server-hostname>:/srv/laconicd/csvs/subscribed-participants.csv
```
## Halt stage0
* Confirm the the currently running node is for stage0 chain:
@ -22,12 +78,6 @@ Once all the participants have completed their onboarding, stage0 laconicd chain
laconic-so deployment --dir stage0-deployment logs laconicd -f --tail 30
```
* List the participants on stage0:
```bash
laconic-so deployment --dir stage0-deployment exec laconicd "laconicd query onboarding list"
```
* Stop the stage0 deployment:
```bash
@ -36,7 +86,31 @@ Once all the participants have completed their onboarding, stage0 laconicd chain
## Start stage1
* Use the scripts in fixturenet-laconicd stack to generate genesis file for stage1 using onboarding participants from stage0 chain with token allocations:
* Fetch updated scripts in fixturenet-laconicd-stack:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-laconicd-stack --pull
```
* Rebuild laconicd container with `>=v0.1.7` to enable `slashing` module:
```bash
# laconicd source
cd ~/cerc/laconicd
# Pull latest changes
git pull
# Confirm the latest commit hash
git log
# Rebuild the containers
cd /srv/laconicd
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd build-containers --force-rebuild
```
* Use the scripts in fixturenet-laconicd-stack to generate genesis file for stage1 using CSV with subscribed participants with token allocations:
```bash
cd /srv/laconicd
@ -49,7 +123,12 @@ Once all the participants have completed their onboarding, stage0 laconicd chain
# Generate the genesis file
# Participant allocation: 1000000000000 (10^12)
# Validator allocation: 2000000000000000 (10^15)
./scripts/generate-stage1-genesis-using-allocations.sh $DEPLOYMENTS_DIR/stage0-deployment 1000000000000 2000000000000000
# These amounts are used only if funding amount is not present in the input CSV
./scripts/generate-stage1-genesis-from-csv.sh /srv/laconicd/csvs/subscribed-participants.csv 1000000000000 2000000000000000
# If you see the error "Error: genesis.json file already exists: /root/.laconicd/config/genesis.json",
# remove the temporary data directory and try again
sudo rm -rf stage1-genesis
# Expected output:
# Genesis file for stage1 written to output/genesis.json

View File

@ -1,4 +1,4 @@
# cli
# scripts
## Prerequisites