diff --git a/stack-orchestrator/compose/docker-compose-laconicd-full-node.yml b/stack-orchestrator/compose/docker-compose-laconicd-full-node.yml index 8e0d331..b59f709 100644 --- a/stack-orchestrator/compose/docker-compose-laconicd-full-node.yml +++ b/stack-orchestrator/compose/docker-compose-laconicd-full-node.yml @@ -1,8 +1,8 @@ services: laconicd: - restart: no + restart: unless-stopped image: cerc/laconic2d:local - command: ["/bin/sh", "-c", "/opt/run-laconicd.sh"] + command: ["bash", "-c", "/opt/run-laconicd.sh"] environment: CERC_MONIKER: ${CERC_MONIKER:-TestnetNode} CERC_CHAIN_ID: ${CERC_CHAIN_ID:-laconic_9000-1} @@ -10,13 +10,9 @@ services: CERC_PEERS: ${CERC_PEERS} CERC_LOGLEVEL: ${CERC_LOGLEVEL:-info} volumes: - - laconicd-data:/root/.laconicd/data + - laconicd-data:/root/.laconicd - laconicd-config:/root/.laconicd/config - - laconicd-keyring:/root/.laconicd/keyring-test - ../config/laconicd/scripts/run-laconicd.sh:/opt/run-laconicd.sh - - ../config/laconicd/scripts/export-mykey.sh:/docker-entrypoint-scripts.d/export-mykey.sh - - ../config/laconicd/scripts/export-myaddress.sh:/docker-entrypoint-scripts.d/export-myaddress.sh - # TODO: determine which of the ports below is really needed ports: - "6060" - "26657" @@ -40,5 +36,3 @@ services: volumes: laconicd-data: - laconicd-config: - laconicd-keyring: diff --git a/stack-orchestrator/config/laconicd/scripts/export-myaddress.sh b/stack-orchestrator/config/laconicd/scripts/export-myaddress.sh deleted file mode 100644 index e454c0b..0000000 --- a/stack-orchestrator/config/laconicd/scripts/export-myaddress.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -laconicd keys show mykey | grep address | cut -d ' ' -f 3 diff --git a/stack-orchestrator/config/laconicd/scripts/export-mykey.sh b/stack-orchestrator/config/laconicd/scripts/export-mykey.sh deleted file mode 100644 index 1a5be86..0000000 --- a/stack-orchestrator/config/laconicd/scripts/export-mykey.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo y | laconicd keys export mykey --unarmored-hex --unsafe diff --git a/stack-orchestrator/stacks/laconicd-full-node/README.md b/stack-orchestrator/stacks/laconicd-full-node/README.md index 54acada..41f21df 100644 --- a/stack-orchestrator/stacks/laconicd-full-node/README.md +++ b/stack-orchestrator/stacks/laconicd-full-node/README.md @@ -1,84 +1,108 @@ # laconicd-full-node -Instructions for deploying a laconicd full node along with steps to join testnet as a validator post genesis +Instructions for running a laconicd testnet full node and joining as a validator -Minimum hardware requirements: +## Prerequisites -- RAM: 8-16GB -- Disk space: 200GB -- CPU: 2 cores +* Minimum hardware requirements: -## Clone the stack repo + ```bash + RAM: 8-16GB + Disk space: 200GB + CPU: 2 cores + ``` -```bash -laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack -``` +* Testnet genesis file (file or an URL) and peer node addresses -## Clone required repositories +## Setup -```bash -laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node setup-repositories -``` +* Clone the stack repo: -## Build the fixturenet-eth containers + ```bash + laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack + ``` -```bash -laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node build-containers -``` +* Clone required repositories: -This should create several container images in the local image registry: + ```bash + laconic-so --stack /home/prathamesh/deepstack/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node setup-repositories + ``` -* cerc/laconic2d -* cerc/laconic-registry-cli -* cerc/webapp-base -* cerc/laconic-console-host +* Build the container images: -## Create a spec file for the deployment + ```bash + laconic-so --stack /home/prathamesh/deepstack/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node build-containers + ``` -```bash -laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node deploy init --output laconic-full-node-spec.yml -``` + This should create the following docker images locally: -## Ports + * `cerc/laconic2d` + * `cerc/laconic-registry-cli` + * `cerc/webapp-base` + * `cerc/laconic-console-host` -Edit `network` in the spec file to map container ports to host ports as required: +## Create a deployment -```bash -... -network: - # TODO: UPDATE - ports: - laconicd: - - '6060:6060' - - '26657:26657' - - '26656:26656' - - '9473:9473' - - '9090:9090' - - '1317:1317' -``` +* Create a spec file for the deployment: -## Create a deployment from the spec file + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node deploy init --output laconic-full-node-spec.yml + ``` -```bash -laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node deploy create --spec-file laconic-full-node-spec.yml --deployment-dir laconic-full-node-deployment -``` +* Edit `network` in the spec file to map container ports to host ports as required: -### Configuration + ```bash + ... + network: + # TODO: UPDATE + ports: + laconicd: + - '6060:6060' + - '26657:26657' + - '26656:26656' + - '9473:9473' + - '9090:9090' + - '1317:1317' + ``` -Copy genesis file to the deployment data directory: +* Create a deployment from the spec file: -```bash -# Example -cp genesis.json laconic-full-node-deployment/data/laconicd-config/ -``` + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node deploy create --spec-file laconic-full-node-spec.yml --deployment-dir laconic-full-node-deployment + ``` -Inside deployment directory, open the `config.env` file and set following env variables: +* (Optional) Copy over the genesis file (`.json`) to config data directory in deployment (`laconic-full-node-deployment/data/laconicd-data/config`): -```bash -# TODO: UPDATE -# External Filecoin (ETH RPC) endpoint to point the watcher to -CERC_PEERS="" -``` + ```bash + # Example + mkdir -p laconic-full-node-deployment/data/laconicd-data/config + cp genesis.json laconic-full-node-deployment/data/laconicd-config/genesis.json + ``` + +## Configuration + +* Inside the deployment directory, open `config.env` file and set following env variables: + + ```bash + # Comma separated list of nodes to keep persistent connections to + # Example: "node-1-id@node-1-host:26656,node-2-id@node-2-host:26656" + CERC_PEERS="" + + # Optional + + # A custom human readable name for this node (default: TestnetNode) + CERC_MONIKER= + + # Network chain ID (default: laconic_9000-1) + CERC_CHAIN_ID= + + # Genesis file URL + # Not required if a genesis file is placed in the config data directory in previous steps + CERC_GENESIS_FILE_URL= + + # Output log level (default: info) + CERC_LOGLEVEL= + ``` ## Start the deployment @@ -88,7 +112,21 @@ laconic-so deployment --dir laconic-full-node-deployment start ## Check status - +* To list down and monitor the running containers: + + ```bash + # With status + docker ps -a + + # Check logs for a container + docker logs -f + ``` + +* Check the sync status of your node: + + ```bash + docker exec -it status | jq .sync_info + ``` ## Join as testnet validator @@ -98,12 +136,19 @@ laconic-so deployment --dir laconic-full-node-deployment start ## Clean up -Stop all services running in the background: +* Stop all services running in the background: -```bash -laconic-so deployment --dir laconic-full-node-deployment stop -``` + ```bash + # Stop the docker containers + laconic-so deployment --dir laconic-full-node-deployment stop + ``` -Clear volumes created by this stack: +* To stop all services and also delete data: - + ```bash + # Stop the docker containers + laconic-so deployment --dir laconic-full-node-deployment stop --delete-volumes + + # Remove deployment directory (deployment will have to be recreated for a re-run) + rm -r laconic-full-node-deployment + ``` diff --git a/stack-orchestrator/stacks/laconicd-full-node/stack.yml b/stack-orchestrator/stacks/laconicd-full-node/stack.yml index 22acea8..f09b495 100644 --- a/stack-orchestrator/stacks/laconicd-full-node/stack.yml +++ b/stack-orchestrator/stacks/laconicd-full-node/stack.yml @@ -1,10 +1,10 @@ -version: "1.1" +version: "1.0" name: laconicd-full-node description: "Laconicd full node" repos: - - cerc-io/laconic2d - - cerc-io/laconic-registry-cli@laconic2 - - cerc-io/laconic-console@laconic2 + - git.vdb.to/cerc-io/laconic2d@pm-stack-changes + - git.vdb.to/cerc-io/laconic-registry-cli@laconic2 + - git.vdb.to/cerc-io/laconic-console@laconic2 containers: - cerc/laconic2d - cerc/laconic-registry-cli @@ -13,7 +13,3 @@ containers: pods: - laconicd-full-node - laconic-console -config: - cli: - key: laconicd.mykey - address: laconicd.myaddress