2024-06-19 11:53:29 +00:00
|
|
|
# laconic-console
|
2024-06-19 12:13:34 +00:00
|
|
|
|
|
|
|
Instructions for running laconic registry CLI and console
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
|
|
|
* laconicd RPC and GQL endpoints
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
* Clone the stack repo:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack
|
|
|
|
```
|
|
|
|
|
|
|
|
* Clone required repositories:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories
|
|
|
|
```
|
|
|
|
|
|
|
|
* Build the container images:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers
|
|
|
|
```
|
|
|
|
|
|
|
|
This should create the following docker images locally:
|
|
|
|
|
|
|
|
* `cerc/laconic2-registry-cli`
|
|
|
|
|
|
|
|
## Create a deployment
|
|
|
|
|
|
|
|
* Create a spec file for the deployment:
|
|
|
|
|
|
|
|
```bash
|
2024-06-20 05:22:38 +00:00
|
|
|
laconic-so --stack /home/prathamesh/deepstack/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:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
...
|
|
|
|
network:
|
|
|
|
ports:
|
|
|
|
laconic-console:
|
|
|
|
- '8080:80'
|
2024-06-19 12:13:34 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
* Create a deployment from the spec file:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
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
|
|
|
|
```
|
|
|
|
|
|
|
|
## Configuration
|
|
|
|
|
|
|
|
* Inside the deployment directory, open `config.env` file and set following env variables:
|
|
|
|
|
|
|
|
```bash
|
2024-06-20 05:22:38 +00:00
|
|
|
# All optional
|
|
|
|
|
2024-06-20 06:50:30 +00:00
|
|
|
# CLI configuration
|
|
|
|
|
|
|
|
# laconicd RPC endpoint (default: http://laconicd:26657)
|
2024-06-20 05:22:38 +00:00
|
|
|
CERC_LACONICD_RPC_ENDPOINT=
|
2024-06-20 06:50:30 +00:00
|
|
|
|
|
|
|
# laconicd GQL endpoint (default: http://laconicd:9473/api)
|
2024-06-20 05:22:38 +00:00
|
|
|
CERC_LACONICD_GQL_ENDPOINT=
|
|
|
|
|
2024-06-20 06:50:30 +00:00
|
|
|
# laconicd chain id (default: laconic_9000-1)
|
|
|
|
CERC_LACONICD_CHAIN_ID=
|
|
|
|
|
|
|
|
# laconicd user private key for txs
|
|
|
|
CERC_LACONICD_USER_KEY=
|
|
|
|
|
|
|
|
# laconicd bond id for txs
|
|
|
|
CERC_LACONICD_BOND_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)
|
2024-06-20 05:22:38 +00:00
|
|
|
LACONIC_HOSTED_ENDPOINT=
|
2024-06-19 12:13:34 +00:00
|
|
|
```
|
|
|
|
|
2024-06-20 06:50:30 +00:00
|
|
|
## Run
|
|
|
|
|
|
|
|
* Start the deployment:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
laconic-so deployment --dir laconic-console-deployment start
|
|
|
|
```
|
|
|
|
|
|
|
|
* View the laconic console at <http://localhost:8080>
|
|
|
|
|
|
|
|
* Use the `cli` service for registry CLI operations:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Example
|
|
|
|
laconic-so --dir laconic-console-deployment deploy exec cli "laconic registry status"
|
|
|
|
```
|
|
|
|
|
|
|
|
## Check status
|
|
|
|
|
|
|
|
* To list down and monitor the running containers:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# With status
|
|
|
|
docker ps -a
|
|
|
|
|
|
|
|
# Follow logs for console container
|
|
|
|
laconic-so deployment --dir laconic-console-deployment logs console -f
|
|
|
|
```
|
|
|
|
|
|
|
|
## Clean up
|
2024-06-20 05:22:38 +00:00
|
|
|
|
2024-06-20 06:50:30 +00:00
|
|
|
* Stop all services running in the background:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Stop the docker containers
|
|
|
|
laconic-so deployment --dir laconic-console-deployment stop
|
|
|
|
```
|
|
|
|
|
|
|
|
* To stop all services and also delete data:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Stop the docker containers
|
|
|
|
laconic-so deployment --dir laconic-console-deployment stop --delete-volumes
|
|
|
|
|
|
|
|
# Remove deployment directory (deployment will have to be recreated for a re-run)
|
|
|
|
rm -r laconic-console-deployment
|
|
|
|
```
|