Add monikers to laconicd stage0 and stage1 nodes (#20)

Part of [laconicd testnet validator enrollment](cerc-io/testnet-laconicd-stack#19)

Reviewed-on: cerc-io/testnet-laconicd-stack#20
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
This commit is contained in:
Nabarun 2024-08-09 12:58:59 +00:00 committed by nabarun
parent 1a2024cde1
commit 9df6a71145
3 changed files with 142 additions and 136 deletions

View File

@ -99,6 +99,9 @@
cat <<EOF > stage0-deployment/config.env cat <<EOF > stage0-deployment/config.env
# Set to true to enable adding participants functionality of the onboarding module # Set to true to enable adding participants functionality of the onboarding module
ONBOARDING_ENABLED=true ONBOARDING_ENABLED=true
# A custom human readable name for this node
MONIKER=LaconicStage0
EOF EOF
``` ```
@ -135,6 +138,131 @@
</details> </details>
<details open>
<summary>faucet</summary>
## faucet
* Stack: <https://git.vdb.to/cerc-io/testnet-laconicd-stack/src/branch/main/stack-orchestrator/stacks/laconic-faucet>
* Source repo: <https://git.vdb.to/cerc-io/laconic-faucet>
* Target dir: `/srv/faucet/laconic-faucet-deployment`
* Cleanup an existing deployment if required:
```bash
cd /srv/faucet
# Stop the deployment
laconic-so deployment --dir laconic-faucet-deployment stop
# Remove the deployment dir
sudo rm -rf laconic-faucet-deployment
# Remove the existing spec file
rm laconic-faucet-spec.yml
```
### Setup
* Clone the stack repo:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull
# This should clone the testnet-laconicd-stack repo at `/home/dev/cerc/testnet-laconicd-stack`
```
* Clone required repositories:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet setup-repositories --pull
# This should clone the laconicd repo at `/home/dev/cerc/laconic-faucet
```
* Build the container images:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet build-containers --force-rebuild
# This should create the "cerc/laconic-faucet" Docker image
```
### Deployment
* Create a spec file for the deployment:
```bash
cd /srv/faucet
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet deploy init --output laconic-faucet-spec.yml
```
* Edit network in the spec file to map container ports to host ports:
```bash
# laconic-faucet-spec.yml
network:
ports:
faucet:
- '127.0.0.1:4000:3000'
```
* Create a deployment from the spec file:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet deploy create --spec-file laconic-faucet-spec.yml --deployment-dir laconic-faucet-deployment
# Place in the same namespace as stage0
cp /srv/laconicd/stage0-deployment/deployment.yml laconic-faucet-deployment/deployment.yml
```
* Update the configuration:
```bash
# Get the faucet account key from stage0 deployment
export FAUCET_ACCOUNT_PK=$(laconic-so deployment --dir /srv/laconicd/stage0-deployment exec laconicd "echo y | laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe")
cat <<EOF > laconic-faucet-deployment/config.env
CERC_FAUCET_KEY=$FAUCET_ACCOUNT_PK
EOF
```
### Start
* Start the deployment:
```bash
laconic-so deployment --dir laconic-faucet-deployment start
```
* Check status:
```bash
# List down the containers and check health status
docker ps -a | grep faucet
# Check logs for faucet container
laconic-so deployment --dir laconic-faucet-deployment logs faucet -f
```
* Verify that endpoint is now publicly accessible:
* <https://faucet.laconic.com> is pointed to the faucet endpoint
* Check faucet:
```bash
curl -X POST https://faucet.laconic.com/faucet
# Expected output:
# {"error":"address is required"}
```
</details>
<details open> <details open>
<summary>testnet-onboarding-app</summary> <summary>testnet-onboarding-app</summary>
@ -417,6 +545,8 @@
AUTHORITY_AUCTION_COMMITS_DURATION=3600 AUTHORITY_AUCTION_COMMITS_DURATION=3600
AUTHORITY_AUCTION_REVEALS_DURATION=3600 AUTHORITY_AUCTION_REVEALS_DURATION=3600
AUTHORITY_GRACE_PERIOD=7200 AUTHORITY_GRACE_PERIOD=7200
MONIKER=LaconicStage1
EOF EOF
``` ```
@ -426,128 +556,6 @@
</details> </details>
<details open>
<summary>faucet</summary>
## faucet
* Stack: <https://git.vdb.to/cerc-io/testnet-laconicd-stack/src/branch/main/stack-orchestrator/stacks/laconic-faucet>
* Source repo: <https://git.vdb.to/cerc-io/laconic-faucet>
* Target dir: `/srv/faucet/laconic-faucet-deployment`
* Cleanup an existing deployment if required:
```bash
cd /srv/faucet
# Stop the deployment
laconic-so deployment --dir laconic-faucet-deployment stop
# Remove the deployment dir
sudo rm -rf laconic-faucet-deployment
# Remove the existing spec file
rm laconic-faucet-spec.yml
```
### Setup
* Clone the stack repo:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull
# This should clone the testnet-laconicd-stack repo at `/home/dev/cerc/testnet-laconicd-stack`
```
* Clone required repositories:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet setup-repositories --pull
# This should clone the laconicd repo at `/home/dev/cerc/laconic-faucet
```
* Build the container images:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet build-containers --force-rebuild
# This should create the "cerc/laconic-faucet" Docker image
```
### Deployment
* Create a spec file for the deployment:
```bash
cd /srv/faucet
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet deploy init --output laconic-faucet-spec.yml
```
* Edit network in the spec file to map container ports to host ports:
```bash
# laconic-faucet-spec.yml
network:
ports:
faucet:
- '127.0.0.1:4000:3000'
```
* Create a deployment from the spec file:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet deploy create --spec-file laconic-faucet-spec.yml --deployment-dir laconic-faucet-deployment
```
* Update the configuration:
```bash
# Get the faucet account key from stage0 deployment
export FAUCET_ACCOUNT_PK=$(laconic-so deployment --dir /srv/laconicd/stage0-deployment exec laconicd "echo y | laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe")
cat <<EOF > laconic-faucet-deployment/config.env
CERC_FAUCET_KEY=$FAUCET_ACCOUNT_PK
EOF
```
### Start
* Start the deployment:
```bash
laconic-so deployment --dir laconic-faucet-deployment start
```
* Check status:
```bash
# List down the containers and check health status
docker ps -a | grep faucet
# Check logs for faucet container
laconic-so deployment --dir laconic-faucet-deployment logs faucet -f
```
* Verify that endpoint is now publicly accessible:
* <https://faucet.laconic.com> is pointed to the faucet endpoint
* Check faucet:
```bash
curl -X POST https://faucet.laconic.com/faucet
# Expected output:
# {"error":"address is required"}
```
</details>
<details open> <details open>
<summary>laconic-console</summary> <summary>laconic-console</summary>

View File

@ -98,10 +98,9 @@ Instructions to reset / update the deployments
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app build-containers --force-rebuild laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app build-containers --force-rebuild
``` ```
* Update the configuration, if required: * Update the configuration, if required in `onboarding-app-deployment/config.env`:
```bash ```bash
cat <<EOF > onboarding-app-deployment/config.env
WALLET_CONNECT_ID=63... WALLET_CONNECT_ID=63...
CERC_REGISTRY_GQL_ENDPOINT="https://laconicd.laconic.com/api" CERC_REGISTRY_GQL_ENDPOINT="https://laconicd.laconic.com/api"
@ -110,7 +109,8 @@ Instructions to reset / update the deployments
CERC_FAUCET_ENDPOINT="https://faucet.laconic.com" CERC_FAUCET_ENDPOINT="https://faucet.laconic.com"
CERC_WALLET_META_URL="https://loro-signup.laconic.com" CERC_WALLET_META_URL="https://loro-signup.laconic.com"
EOF
CERC_STAKING_AMOUNT=1000000000000000
```` ````
* Restart the deployment: * Restart the deployment:
@ -148,12 +148,10 @@ Instructions to reset / update the deployments
laconic-so --stack ~/cerc/laconic-wallet-web/stack/stack-orchestrator/stack/laconic-wallet-web build-containers --force-rebuild laconic-so --stack ~/cerc/laconic-wallet-web/stack/stack-orchestrator/stack/laconic-wallet-web build-containers --force-rebuild
``` ```
* Update the configuration, if required: * Update the configuration, if required in `laconic-wallet-web-deployment/config.env`:
```bash ```bash
cat <<EOF > laconic-wallet-web-deployment/config.env
WALLET_CONNECT_ID=63... WALLET_CONNECT_ID=63...
EOF
``` ```
* Restart the deployment: * Restart the deployment:
@ -204,15 +202,13 @@ Instructions to reset / update the deployments
mkdir stage1-deployment/data/genesis-config mkdir stage1-deployment/data/genesis-config
``` ```
* Update the configuration, if required: * Update the configuration, if required in `stage1-deployment/config.env`:
```bash ```bash
cat <<EOF > stage1-deployment/config.env
AUTHORITY_AUCTION_ENABLED=true AUTHORITY_AUCTION_ENABLED=true
AUTHORITY_AUCTION_COMMITS_DURATION=3600 AUTHORITY_AUCTION_COMMITS_DURATION=3600
AUTHORITY_AUCTION_REVEALS_DURATION=3600 AUTHORITY_AUCTION_REVEALS_DURATION=3600
AUTHORITY_GRACE_PERIOD=7200 AUTHORITY_GRACE_PERIOD=7200
EOF
``` ```
* Follow [stage0-to-stage1.md](./stage0-to-stage1.md) to generate the genesis file for stage1 and start the deployment * Follow [stage0-to-stage1.md](./stage0-to-stage1.md) to generate the genesis file for stage1 and start the deployment
@ -239,13 +235,11 @@ Instructions to reset / update the deployments
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers --force-rebuild laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers --force-rebuild
``` ```
* Update the configuration, if required: * Update the configuration, if required in `laconic-console-deployment/config.env`:
```bash ```bash
cat <<EOF > laconic-console-deployment/config.env
# Laconicd (hosted) GQL endpoint # Laconicd (hosted) GQL endpoint
LACONIC_HOSTED_ENDPOINT=https://laconicd.laconic.com LACONIC_HOSTED_ENDPOINT=https://laconicd.laconic.com
EOF
``` ```
* Restart the deployment: * Restart the deployment:

View File

@ -13,7 +13,7 @@
* Visit the confirmation link sent on the registered email (email delivery might take a few minutes) * Visit the confirmation link sent on the registered email (email delivery might take a few minutes)
* It should take you to the `Testnet Onboarding` page * It should take you to the `Testnet Onboarding` app
* Note: The confirmation link will only work the first time, visit <https://loro-signup.laconic.com/sign-with-nitro-key> for further attempts if required * Note: The confirmation link will only work the first time, visit <https://loro-signup.laconic.com/sign-with-nitro-key> for further attempts if required
@ -171,10 +171,14 @@ laconic-so deployment --dir testnet-laconicd-deployment start
### Join as testnet validator ### Join as testnet validator
* Open the wallet: <https://wallet.laconic.com/>
* Create a validator from the onboarding app: * Create a validator from the onboarding app:
* Visit the [validator creation](https://loro-signup.laconic.com/validator) page * Visit the [validator creation](https://loro-signup.laconic.com/validator) page
* If required, connect testnet-onboarding app to the wallet with which onboarding was done on stage0
* Select the Laconic account (same as the one used while onboarding) using which you wish to send the create validator request * Select the Laconic account (same as the one used while onboarding) using which you wish to send the create validator request
* This should display the details of your onboarded participant * This should display the details of your onboarded participant
@ -273,7 +277,7 @@ laconic-so deployment --dir testnet-laconicd-deployment start
laconic-so deployment --dir testnet-laconicd-deployment stop --delete-volumes laconic-so deployment --dir testnet-laconicd-deployment stop --delete-volumes
# Remove deployment directory (deployment will have to be recreated for a re-run) # Remove deployment directory (deployment will have to be recreated for a re-run)
rm -r testnet-laconicd-deployment sudo rm -r testnet-laconicd-deployment
``` ```
## Troubleshooting ## Troubleshooting