From 509a249ced881a2852b6f485bfcf1b872e325dc6 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 16 Aug 2024 12:24:34 +0530 Subject: [PATCH 1/5] Add instructions to rebuild laconicd enabling slashing module --- ops/stage0-to-stage1.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ops/stage0-to-stage1.md b/ops/stage0-to-stage1.md index 56550aa..5fc5e04 100644 --- a/ops/stage0-to-stage1.md +++ b/ops/stage0-to-stage1.md @@ -51,6 +51,10 @@ Once all the participants have completed their onboarding, stage0 laconicd chain # Validator allocation: 2000000000000000 (10^15) ./scripts/generate-stage1-genesis-using-allocations.sh $DEPLOYMENTS_DIR/stage0-deployment 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 @@ -69,6 +73,24 @@ Once all the participants have completed their onboarding, stage0 laconicd chain cp ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd/output/genesis.json stage1-deployment/data/genesis-config/genesis.json ``` +* Rebuild laconicd container with latest code 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 + ``` + * Start the stage1 deployment: ```bash -- 2.45.2 From 59a1562c7f446b02cf46ff5bfc19ff98f231acdd Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 16 Aug 2024 13:04:40 +0530 Subject: [PATCH 2/5] Add a step to fetch updated stage1 genesis gen scripts --- ops/stage0-to-stage1.md | 44 +++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/ops/stage0-to-stage1.md b/ops/stage0-to-stage1.md index 5fc5e04..f57613f 100644 --- a/ops/stage0-to-stage1.md +++ b/ops/stage0-to-stage1.md @@ -36,7 +36,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: +* 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 + ``` + +* Fetch updated scripts in fixturenet-laconicd-stack: + + ```bash + laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-laconicd-stack --pull + ``` + +* Use the scripts in fixturenet-laconicd-stack to generate genesis file for stage1 using onboarding participants from stage0 chain with token allocations: ```bash cd /srv/laconicd @@ -73,24 +97,6 @@ Once all the participants have completed their onboarding, stage0 laconicd chain cp ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd/output/genesis.json stage1-deployment/data/genesis-config/genesis.json ``` -* Rebuild laconicd container with latest code 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 - ``` - * Start the stage1 deployment: ```bash -- 2.45.2 From eb272a307cc470bdd91b7221b32e3b5c3484e892 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 16 Aug 2024 16:35:24 +0530 Subject: [PATCH 3/5] Update stage1 instructions to generate genesis from subscribers CSV --- ops/stage0-to-stage1.md | 44 +++++++++++++++++++++++++++++++++-------- scripts/README.md | 2 +- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/ops/stage0-to-stage1.md b/ops/stage0-to-stage1.md index f57613f..7f64643 100644 --- a/ops/stage0-to-stage1.md +++ b/ops/stage0-to-stage1.md @@ -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,29 @@ 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 + ``` + +* Create a CSV with subscribers who have onboarded as participants: + + ```bash + # Change to scripts dir + cd ~/cerc/testnet-laconicd-stack/scripts + + # Install dependencies and build + yarn && yarn build + + # Run script + yarn map-subscribers-to-participants --subscribers-csv /srv/laconicd/csvs/subscribers.csv --output /srv/laconicd/csvs/subscribed-participants.csv + + # This should create the CSV file at /srv/laconicd/csvs/subscribed-participants.csv + ``` + ## Halt stage0 * Confirm the the currently running node is for stage0 chain: @@ -36,6 +63,12 @@ Once all the participants have completed their onboarding, stage0 laconicd chain ## Start stage1 +* 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 @@ -54,13 +87,7 @@ Once all the participants have completed their onboarding, stage0 laconicd chain laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd build-containers --force-rebuild ``` -* Fetch updated scripts in fixturenet-laconicd-stack: - - ```bash - laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-laconicd-stack --pull - ``` - -* Use the scripts in fixturenet-laconicd-stack to generate genesis file for stage1 using onboarding participants from stage0 chain with token allocations: +* 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 @@ -73,7 +100,8 @@ 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 is 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 diff --git a/scripts/README.md b/scripts/README.md index 195a41b..dc131e4 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,4 +1,4 @@ -# cli +# scripts ## Prerequisites -- 2.45.2 From 2e9475f7152e1ba59ca1bf9bc9213cdbb6b438e1 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 16 Aug 2024 16:37:48 +0530 Subject: [PATCH 4/5] Fix typo --- ops/stage0-to-stage1.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ops/stage0-to-stage1.md b/ops/stage0-to-stage1.md index 7f64643..de2d42e 100644 --- a/ops/stage0-to-stage1.md +++ b/ops/stage0-to-stage1.md @@ -100,7 +100,7 @@ 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) - # These amounts is used only if funding amount is not present in the input CSV + # 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", -- 2.45.2 From 49d29276f47c6188f0b561807854f29ea77b17ad Mon Sep 17 00:00:00 2001 From: Nabarun Date: Fri, 16 Aug 2024 20:21:03 +0530 Subject: [PATCH 5/5] Run map-subscribers-to-participants script on local system --- ops/stage0-to-stage1.md | 57 +++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 17 deletions(-) diff --git a/ops/stage0-to-stage1.md b/ops/stage0-to-stage1.md index de2d42e..ab41614 100644 --- a/ops/stage0-to-stage1.md +++ b/ops/stage0-to-stage1.md @@ -24,21 +24,50 @@ Once all the participants have completed their onboarding, stage0 laconicd chain laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull ``` -* Create a CSV with subscribers who have onboarded as participants: +* List the participants on stage0: ```bash - # Change to scripts dir - cd ~/cerc/testnet-laconicd-stack/scripts - - # Install dependencies and build - yarn && yarn build - - # Run script - yarn map-subscribers-to-participants --subscribers-csv /srv/laconicd/csvs/subscribers.csv --output /srv/laconicd/csvs/subscribed-participants.csv - - # This should create the CSV file at /srv/laconicd/csvs/subscribed-participants.csv + 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 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@:/srv/laconicd/csvs/subscribed-participants.csv + ``` + ## Halt stage0 * Confirm the the currently running node is for stage0 chain: @@ -49,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 -- 2.45.2