Add laconic-console stack instructions

This commit is contained in:
Prathamesh Musale 2024-06-20 12:20:30 +05:30
parent 8ee7040298
commit f5060d3e22
4 changed files with 88 additions and 19 deletions

View File

@ -1,19 +1,22 @@
services: services:
cli: cli:
image: cerc/laconic2-registry-cli:local image: cerc/laconic2-registry-cli:local
command: ["bash", "-c", "/app/create-config.sh && tail -f /dev/null"]
environment: environment:
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
CERC_LACONICD_RPC_ENDPOINT: ${CERC_LACONICD_RPC_ENDPOINT:-http://laconicd:26657} CERC_LACONICD_RPC_ENDPOINT: ${CERC_LACONICD_RPC_ENDPOINT:-http://laconicd:26657}
CERC_LACONICD_GQL_ENDPOINT: ${CERC_LACONICD_GQL_ENDPOINT:-http://laconicd:9473/api} CERC_LACONICD_GQL_ENDPOINT: ${CERC_LACONICD_GQL_ENDPOINT:-http://laconicd:9473/api}
CERC_CHAIN_ID: ${CERC_CHAIN_ID:-laconic_9000-1} CERC_LACONICD_CHAIN_ID: ${CERC_LACONICD_CHAIN_ID:-laconic_9000-1}
CERC_LOGLEVEL: ${CERC_LOGLEVEL:-info} CERC_LACONICD_USER_KEY: ${CERC_LACONICD_USER_KEY}
CERC_LACONICD_BOND_ID: ${CERC_LACONICD_BOND_ID}
CERC_LACONICD_GAS: ${CERC_LACONICD_GAS:-200000}
CERC_LACONICD_FEES: ${CERC_LACONICD_FEES:-200000photon}
volumes: volumes:
- ../config/laconic-console/create-config.sh:/app/create-config.sh - ../config/laconic-console/cli/create-config.sh:/app/create-config.sh
- laconic-registry-data:/laconic-registry-data - laconic-registry-data:/laconic-registry-data
extra_hosts: extra_hosts:
- "host.docker.internal:host-gateway" - "host.docker.internal:host-gateway"
laconic-console: console:
restart: unless-stopped restart: unless-stopped
image: cerc/laconic2-console-host:local image: cerc/laconic2-console-host:local
environment: environment:

View File

@ -13,9 +13,11 @@ services:
registry: registry:
rpcEndpoint: ${CERC_LACONICD_RPC_ENDPOINT} rpcEndpoint: ${CERC_LACONICD_RPC_ENDPOINT}
gqlEndpoint: ${CERC_LACONICD_GQL_ENDPOINT} gqlEndpoint: ${CERC_LACONICD_GQL_ENDPOINT}
userKey: ${CERC_USER_KEY} userKey: ${CERC_LACONICD_USER_KEY}
bondId: ${CERC_BOND_ID} bondId: ${CERC_LACONICD_BOND_ID}
chainId: ${CERC_CHAIN_ID} chainId: ${CERC_LACONICD_CHAIN_ID}
gas: 200000 gas: ${CERC_LACONICD_GAS}
fees: 200000photon fees: ${CERC_LACONICD_FEES}
EOF EOF
echo "Exported config to $config_file"

View File

@ -16,4 +16,5 @@ RUN echo "Installing dependencies and building laconic-registry-cli" && \
RUN npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/ RUN npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/
RUN yarn global add file:$PWD RUN yarn global add file:$PWD
CMD ["bash", "-c", "tail -f /dev/null"] # Default command sleeps forever so docker doesn't kill it
CMD ["bash", "-c", "while :; do sleep 600; done"]

View File

@ -61,16 +61,79 @@ Instructions for running laconic registry CLI and console
```bash ```bash
# All optional # All optional
CERC_LACONICD_RPC_ENDPOINT= # CLI configuration
CERC_LACONICD_GQL_ENDPOINT=
CERC_CHAIN_ID=
CERC_LOGLEVEL=
# laconicd RPC endpoint (default: http://laconicd:26657)
CERC_LACONICD_RPC_ENDPOINT=
# laconicd GQL endpoint (default: http://laconicd:9473/api)
CERC_LACONICD_GQL_ENDPOINT=
# 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)
LACONIC_HOSTED_ENDPOINT= LACONIC_HOSTED_ENDPOINT=
``` ```
## Start the deployment ## Run
```bash * Start the deployment:
laconic-so deployment --dir laconic-console-deployment start
``` ```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
* 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
```