Update testnet-laconicd stack instructions to include cli and console

This commit is contained in:
Prathamesh Musale 2024-06-20 12:52:48 +05:30
parent f5060d3e22
commit 2eb842083d
2 changed files with 66 additions and 8 deletions

View File

@ -35,7 +35,7 @@ Instructions for running laconic registry CLI and console
* Create a spec file for the deployment: * Create a spec file for the deployment:
```bash ```bash
laconic-so --stack /home/prathamesh/deepstack/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy init --output laconic-console-spec.yml laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy init --output laconic-console-spec.yml
``` ```
* Edit `network` in the spec file to map container ports to host ports as required: * Edit `network` in the spec file to map container ports to host ports as required:
@ -104,7 +104,7 @@ Instructions for running laconic registry CLI and console
```bash ```bash
# Example # Example
laconic-so --dir laconic-console-deployment deploy exec cli "laconic registry status" laconic-so deployment --dir laconic-console-deployment deploy exec cli "laconic registry status"
``` ```
## Check status ## Check status

View File

@ -1,4 +1,4 @@
# laconicd-testnet # testnet-laconicd
Instructions for running a laconicd testnet full node and joining as a validator Instructions for running a laconicd testnet full node and joining as a validator
@ -25,18 +25,29 @@ Instructions for running a laconicd testnet full node and joining as a validator
* Clone required repositories: * Clone required repositories:
```bash ```bash
# laconicd
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd setup-repositories laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd setup-repositories
# laocnic cli and console
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories
``` ```
* Build the container images: * Build the container images:
```bash ```bash
# laconicd
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd build-containers laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd build-containers
# laocnic cli and console
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers
``` ```
This should create the following docker images locally: This should create the following docker images locally:
* `cerc/laconic2d` * `cerc/laconic2d`
* `cerc/laconic2-registry-cli`
* `cerc/webapp-base`
* `cerc/laconic-console-host`
## Create a deployment ## Create a deployment
@ -44,11 +55,14 @@ Instructions for running a laconicd testnet full node and joining as a validator
```bash ```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd deploy init --output testnet-laconicd-spec.yml laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/testnet-laconicd deploy init --output testnet-laconicd-spec.yml
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy init --output laconic-console-spec.yml
``` ```
* Edit `network` in the spec file to map container ports to host ports as required: * Edit `network` in both the spec files to map container ports to host ports as required:
```bash ```bash
# testnet-laconicd-spec.yml
... ...
network: network:
ports: ports:
@ -59,12 +73,24 @@ Instructions for running a laconicd testnet full node and joining as a validator
- '9473:9473' - '9473:9473'
- '9090:9090' - '9090:9090'
- '1317:1317' - '1317:1317'
# laconic-console-spec.yml
...
network:
ports:
laconic-console:
- '8080:80'
``` ```
* Create a deployment from the spec file: * Create deployments from the spec files:
```bash ```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 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
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy create --spec-file laconic-console-spec.yml --deployment-dir laconic-console-deployment
# Place them both in the same namespace (cluster)
cp testnet-laconicd-deployment/deployment.yml laconic-console-deployment/deployment.yml
``` ```
* Copy over the published testnet genesis file (`.json`) to data directory in deployment (`testnet-laconicd-deployment/data/laconicd-data/tmp`): * Copy over the published testnet genesis file (`.json`) to data directory in deployment (`testnet-laconicd-deployment/data/laconicd-data/tmp`):
@ -77,7 +103,7 @@ Instructions for running a laconicd testnet full node and joining as a validator
## Configuration ## Configuration
* Inside the deployment directory, open `config.env` file and set following env variables: * Inside the `testnet-laconicd-deployment` deployment directory, open `config.env` file and set following env variables:
```bash ```bash
# Comma separated list of nodes to keep persistent connections to # Comma separated list of nodes to keep persistent connections to
@ -96,10 +122,31 @@ Instructions for running a laconicd testnet full node and joining as a validator
CERC_LOGLEVEL= CERC_LOGLEVEL=
``` ```
## Start the deployment * Inside the `laconic-console-deployment` deployment directory, open `config.env` file and set following env variables:
```bash
# CLI configuration
# laconicd chain id (default: laconic_9000-1)
CERC_LACONICD_CHAIN_ID=
# Gas limit for txs (default: 200000)
CERC_LACONICD_GAS=
# Max fees for txs (default: 200000photon)
CERC_LACONICD_FEES=
# Console configuration
# Laconicd (hosted) GQL endpoint (default: http://localhost:9473)
LACONIC_HOSTED_ENDPOINT=
```
## Start the deployments
```bash ```bash
laconic-so deployment --dir testnet-laconicd-deployment start laconic-so deployment --dir testnet-laconicd-deployment start
laconic-so deployment --dir laconic-console-deployment start
``` ```
## Check status ## Check status
@ -122,6 +169,15 @@ laconic-so deployment --dir testnet-laconicd-deployment start
# `catching_up: false` indicates that node is completely synced # `catching_up: false` indicates that node is completely synced
``` ```
* View the laconic console at <http://localhost:8080>
* Use the cli service for registry CLI operations:
```bash
# Example
laconic-so deployment --dir laconic-console-deployment deploy exec cli "laconic registry status"
```
## Join as testnet validator ## Join as testnet validator
* Create / import a new key pair: * Create / import a new key pair:
@ -181,7 +237,7 @@ laconic-so deployment --dir testnet-laconicd-deployment start
## Clean up ## Clean up
* Stop all services running in the background: * Stop all `testnet-laconicd` services running in the background:
```bash ```bash
# Stop the docker containers # Stop the docker containers
@ -197,3 +253,5 @@ laconic-so deployment --dir testnet-laconicd-deployment start
# 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 rm -r testnet-laconicd-deployment
``` ```
* For `laconic-console`, see [laconic-console clean up](../laconic-console/README.md#clean-up)