2024-08-07 13:35:17 +00:00
# testnet-onboarding-validator
## Onboard as a participant / validator on stage0
* Visit < https: // wallet . laconic . com /> and click on `Create wallet`
* Save the mnemonic for further usage
2024-08-09 10:18:11 +00:00
* Register your laconic address as a participant using the [Onboarding App ](https://loro-signup.laconic.com )
2024-08-07 13:35:17 +00:00
* Read and accept the `Terms and Conditions`
2024-08-09 10:18:11 +00:00
* On next page, enter your email to register to join the LORO testnet
* Visit the confirmation link sent on the registered email (email delivery might take a few minutes)
2024-08-09 12:58:59 +00:00
* It should take you to the `Testnet Onboarding` app
2024-08-09 10:18:11 +00:00
* 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
2024-08-07 13:35:17 +00:00
* Connect testnet-onboarding app to the wallet:
* Click on `CONNECT WALLET` button on the testnet-onboarding app
* Click on the WalletConnect icon on the top right corner in the wallet
* If using the wallet website, enter WalletConnect URI for pairing
* In the onboarding app, choose your nitro and laconicd account to onboard
* Sign using the nitro key
* Approve sign request on Wallet
* Select the desired participant role (`Validator` or `Participant` ) and accept the onboarding terms and conditions
* In the next step, fund your laconic account by clicking on the `REQUEST TOKENS FROM FAUCET` button; ensure that the displayed balance is updated
* Send transaction request to the wallet
2024-08-09 09:44:05 +00:00
* From wallet, approve and send transaction to stage0 laconicd chain
2024-08-07 13:35:17 +00:00
## Join as a validator on stage1
### Prerequisites
* Minimum hardware requirements:
```bash
RAM: 8-16GB
Disk space: 200GB
CPU: 2 cores
```
* Testnet genesis file and peer node address
* Mnemonic from the [wallet ](https://wallet.laconic.com )
* Participant onboarded on stage0
### Setup
* Clone the stack repo:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack
2024-10-30 12:05:54 +00:00
# See stack documentation stack-orchestrator/stacks/testnet-laconicd/README.md for more details
2024-08-07 13:35:17 +00:00
```
* Clone required repositories:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd setup-repositories --pull
# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories and re-run the command
```
* Build the container images:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd build-containers
```
This should create the following docker images locally:
* `cerc/laconicd`
### Create a deployment
* Create a spec file for the deployment:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd deploy init --output testnet-laconicd-spec.yml
```
* Edit `network` in the spec file to map container ports to host ports as required:
```bash
# testnet-laconicd-spec.yml
...
network:
ports:
laconicd:
- '6060:6060'
- '26657:26657'
- '26656:26656'
- '9473:9473'
- '9090:9090'
- '1317:1317'
```
* Create the deployment from the spec file:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd deploy create --spec-file testnet-laconicd-spec.yml --deployment-dir testnet-laconicd-deployment
```
* Copy over the published testnet genesis file (`.json`) to data directory in deployment (`testnet-laconicd-deployment/data/laconicd-data/tmp`):
```bash
# Example
mkdir -p testnet-laconicd-deployment/data/laconicd-data/tmp
cp genesis.json testnet-laconicd-deployment/data/laconicd-data/tmp/genesis.json
```
### Configuration
* Inside the `testnet-laconicd-deployment` deployment directory, open `config.env` file and set following env variables:
```bash
2024-10-30 12:05:54 +00:00
CERC_CHAIN_ID=laconic_9000-1
2024-08-07 13:35:17 +00:00
# Comma separated list of nodes to keep persistent connections to
# Example: "node-1-id@laconicd.laconic.com:26656"
# Use the provided node id
CERC_PEERS=""
2024-08-09 09:44:05 +00:00
# A custom human readable name for this node
2024-08-07 13:35:17 +00:00
CERC_MONIKER=
```
### Start the deployment
```bash
laconic-so deployment --dir testnet-laconicd-deployment start
```
### Check status
* To list down and monitor the running containers:
```bash
# With status
docker ps -a
# Follow logs for laconicd container
laconic-so deployment --dir testnet-laconicd-deployment logs laconicd -f
```
* Check the sync status of your node:
```bash
laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd status | jq .sync_info"
# `catching_up: false` indicates that node is completely synced
```
2024-08-09 10:18:11 +00:00
* After the node has caught up, view current list of validators:
2024-08-07 13:35:17 +00:00
```bash
laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd query staking validators"
```
* Confirm that in the list of validators, your node moniker does not exist
### Join as testnet validator
2024-08-09 12:58:59 +00:00
* Open the wallet: < https: // wallet . laconic . com />
2024-08-09 09:44:05 +00:00
* Create a validator from the onboarding app:
2024-08-07 13:35:17 +00:00
2024-08-09 09:44:05 +00:00
* Visit the [validator creation ](https://loro-signup.laconic.com/validator ) page
2024-08-07 13:35:17 +00:00
2024-08-09 12:58:59 +00:00
* If required, connect testnet-onboarding app to the wallet with which onboarding was done on stage0
2024-08-09 09:44:05 +00:00
* Select the Laconic account (same as the one used while onboarding) using which you wish to send the create validator request
2024-08-07 13:35:17 +00:00
2024-08-09 09:44:05 +00:00
* This should display the details of your onboarded participant
2024-08-07 13:35:17 +00:00
2024-08-09 09:44:05 +00:00
* You can proceed if the participant has `validator` role
2024-08-07 13:35:17 +00:00
2024-08-09 09:44:05 +00:00
* Enter your node's moniker (use the same one used while [configuring ](#configuration ) the `testnet-laconicd-deployment` )
2024-08-07 13:35:17 +00:00
2024-08-09 09:44:05 +00:00
* Fetch and enter your validator's pubkey:
2024-08-07 13:35:17 +00:00
2024-08-09 09:44:05 +00:00
```bash
laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd cometbft show-validator" | jq -r .key
```
2024-08-07 13:35:17 +00:00
2024-08-09 09:44:05 +00:00
* Send the transaction request to wallet
2024-08-07 13:35:17 +00:00
2024-08-09 09:44:05 +00:00
* From wallet, approve and send transaction to stage1 laconicd chain
2024-08-07 13:35:17 +00:00
2024-10-30 12:05:54 +00:00
< a name = "create-validator-using-cli" > < / a >
2024-08-09 09:44:05 +00:00
* Alternatively, create a validator using the laconicd CLI:
* Import a key pair:
```bash
KEY_NAME=alice
2024-10-30 12:05:54 +00:00
CHAIN_ID=laconic_9000-1
2024-08-09 09:44:05 +00:00
# Restore existing key with mnemonic seed phrase
# You will be prompted to enter mnemonic seed
laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd keys add $KEY_NAME --recover"
# Query the keystore for your account's address
laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd keys show $KEY_NAME -a"
```
* Check balance for your account:
```bash
laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd query bank balances < account-address > "
```
* Create required validator configuration:
```bash
# Note:
# Edit the staking amount and other fields as required
# Replace < your-node-moniker > with your node's moniker in command below
laconic-so deployment --dir testnet-laconicd-deployment exec laconicd 'cat < < EOF > my-validator.json
{
"pubkey": $(laconicd cometbft show-validator),
"amount": "1000000000000000alnt",
"moniker": "< your-node-moniker > ",
"commission-rate": "0.1",
"commission-max-rate": "0.2",
"commission-max-change-rate": "0.01",
"min-self-delegation": "1"
}
EOF'
```
* Create a validator:
```bash
laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd tx staking create-validator my-validator.json \
--fees 500000alnt \
2024-10-30 12:05:54 +00:00
--chain-id=$CHAIN_ID \
2024-08-09 09:44:05 +00:00
--from $KEY_NAME"
```
2024-08-07 13:35:17 +00:00
2024-08-09 10:18:11 +00:00
* View validators:
2024-08-07 13:35:17 +00:00
```bash
laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd query staking validators"
```
* Check that in the list of validators `<your-node-moniker>` exists
* View validator set:
```bash
laconic-so deployment --dir testnet-laconicd-deployment exec laconicd "laconicd query consensus comet validator-set"
```
### Clean up
* Stop all `testnet-laconicd` services running in the background:
```bash
# Stop the docker containers
laconic-so deployment --dir testnet-laconicd-deployment stop
```
* To stop all services and also delete data:
```bash
# Stop the docker containers
laconic-so deployment --dir testnet-laconicd-deployment stop --delete-volumes
# Remove deployment directory (deployment will have to be recreated for a re-run)
2024-08-09 12:58:59 +00:00
sudo rm -r testnet-laconicd-deployment
2024-08-07 13:35:17 +00:00
```
2024-08-09 09:44:05 +00:00
2024-10-30 12:05:54 +00:00
## Upgrade to SAPO testnet
### Prerequisites
2024-12-03 01:08:32 +00:00
* SAPO testnet (testnet2) [genesis file ](./ops/stage2/genesis.json ) and peers (see below)
2024-10-30 12:05:54 +00:00
### Setup
2024-12-03 01:08:32 +00:00
* If running, stop the stage1 node:
2024-10-30 12:05:54 +00:00
```bash
# In dir where stage1 node deployment (`testnet-laconicd-deployment`) exists
TESTNET_DEPLOYMENT=$(pwd)/testnet-laconicd-deployment
laconic-so deployment --dir testnet-laconicd-deployment stop --delete-volumes
```
* Clone / pull the stack repo:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull
```
2024-12-03 01:08:32 +00:00
* Ensure you are on tag v0.1.10
2024-10-30 12:05:54 +00:00
* Clone / pull the required repositories:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd setup-repositories --pull
# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories and re-run the command
```
Note: Make sure the latest `cerc-io/laconicd` changes have been pulled
* Build the container images:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd build-containers --force-rebuild
```
This should create the following docker images locally with latest changes:
* `cerc/laconicd`
### Create a deployment
2024-12-03 01:08:32 +00:00
* Create a deployment from spec file:
2024-10-30 12:05:54 +00:00
2024-12-03 01:08:32 +00:00
```
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd deploy create --spec-file testnet-laconicd-spec.yml --deployment-dir stage-2-testnet-laconicd-deployment
```
2024-10-30 12:05:54 +00:00
2024-12-03 01:08:32 +00:00
* Copy over the published testnet2 genesis file (`.json`) to data directory in deployment (`stage-2-testnet-laconicd-deployment/data/laconicd-data/tmp-testnet2`):
2024-10-30 12:05:54 +00:00
```bash
2024-12-03 01:08:32 +00:00
# Example
mkdir -p stage-2-testnet-laconicd-deployment/data/laconicd-data/tmp-testnet2
cp genesis.json stage-2-testnet-laconicd-deployment/data/laconicd-data/tmp-testnet2/genesis.json
2024-10-30 12:05:54 +00:00
```
### Configuration
2024-12-03 01:08:32 +00:00
* Inside the `stage-2-testnet-laconicd-deployment` deployment directory, open `config.env` file and set following env variables:
2024-10-30 12:05:54 +00:00
```bash
CERC_CHAIN_ID=laconic-testnet-2
2024-12-03 01:08:32 +00:00
CERC_PEERS="bd56622c525a4dfce1e388a7b8c0cb072200797b@5.9.80.214:26103,289f10e94156f47c67bc26a8af747a58e8014f15@148.251.49.108:26656,72cd2f50dff154408cc2c7650a94c2141624b657@65.21.237.194:26656,21322e4fa90c485ff3cb9617438deec4acfa1f0b@143.198.37.25:26656"
2024-10-30 12:05:54 +00:00
# A custom human readable name for this node
2024-12-03 01:08:32 +00:00
CERC_MONIKER="my-node"
2024-10-30 12:05:54 +00:00
```
### Start the deployment
```bash
2024-12-03 01:08:32 +00:00
laconic-so deployment --dir stage-2-testnet-laconicd-deployment start
2024-10-30 12:05:54 +00:00
```
See [Check status ](#check-status ) to follow sync status of your node
See [Join as testnet validator ](#create-validator-using-cli ) to join as a validator using laconicd CLI (use chain id `laconic-testnet-2` )
### Clean up
* Same as [Clean up ](#clean-up )
2024-08-09 09:44:05 +00:00
## Troubleshooting
* If you face any issues in the onboarding app or the web-wallet, clear your browser cache and reload