Clean up files and update instructions

This commit is contained in:
Prathamesh Musale 2024-06-18 12:08:10 +05:30
parent a37e5ab1f2
commit 961b8cbea7
5 changed files with 116 additions and 85 deletions

View File

@ -1,8 +1,8 @@
services: services:
laconicd: laconicd:
restart: no restart: unless-stopped
image: cerc/laconic2d:local image: cerc/laconic2d:local
command: ["/bin/sh", "-c", "/opt/run-laconicd.sh"] command: ["bash", "-c", "/opt/run-laconicd.sh"]
environment: environment:
CERC_MONIKER: ${CERC_MONIKER:-TestnetNode} CERC_MONIKER: ${CERC_MONIKER:-TestnetNode}
CERC_CHAIN_ID: ${CERC_CHAIN_ID:-laconic_9000-1} CERC_CHAIN_ID: ${CERC_CHAIN_ID:-laconic_9000-1}
@ -10,13 +10,9 @@ services:
CERC_PEERS: ${CERC_PEERS} CERC_PEERS: ${CERC_PEERS}
CERC_LOGLEVEL: ${CERC_LOGLEVEL:-info} CERC_LOGLEVEL: ${CERC_LOGLEVEL:-info}
volumes: volumes:
- laconicd-data:/root/.laconicd/data - laconicd-data:/root/.laconicd
- laconicd-config:/root/.laconicd/config - laconicd-config:/root/.laconicd/config
- laconicd-keyring:/root/.laconicd/keyring-test
- ../config/laconicd/scripts/run-laconicd.sh:/opt/run-laconicd.sh - ../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: ports:
- "6060" - "6060"
- "26657" - "26657"
@ -40,5 +36,3 @@ services:
volumes: volumes:
laconicd-data: laconicd-data:
laconicd-config:
laconicd-keyring:

View File

@ -1,2 +0,0 @@
#!/bin/sh
laconicd keys show mykey | grep address | cut -d ' ' -f 3

View File

@ -1,2 +0,0 @@
#!/bin/sh
echo y | laconicd keys export mykey --unarmored-hex --unsafe

View File

@ -1,84 +1,108 @@
# laconicd-full-node # 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 * Minimum hardware requirements:
- Disk space: 200GB
- CPU: 2 cores
## Clone the stack repo ```bash
RAM: 8-16GB
Disk space: 200GB
CPU: 2 cores
```
```bash * Testnet genesis file (file or an URL) and peer node addresses
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack
```
## Clone required repositories ## Setup
```bash * Clone the stack repo:
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node setup-repositories
```
## Build the fixturenet-eth containers ```bash
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack
```
```bash * Clone required repositories:
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node build-containers
```
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 * Build the container images:
* cerc/laconic-registry-cli
* cerc/webapp-base
* cerc/laconic-console-host
## 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 This should create the following docker images locally:
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconicd-full-node deploy init --output laconic-full-node-spec.yml
```
## 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 * Create a spec file for the deployment:
...
network:
# TODO: UPDATE
ports:
laconicd:
- '6060:6060'
- '26657:26657'
- '26656:26656'
- '9473:9473'
- '9090:9090'
- '1317:1317'
```
## 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 * Edit `network` in the spec file to map container ports to host ports as required:
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
```
### 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 ```bash
# Example 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
cp genesis.json laconic-full-node-deployment/data/laconicd-config/ ```
```
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 ```bash
# TODO: UPDATE # Example
# External Filecoin (ETH RPC) endpoint to point the watcher to mkdir -p laconic-full-node-deployment/data/laconicd-data/config
CERC_PEERS="" 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 ## Start the deployment
@ -88,7 +112,21 @@ laconic-so deployment --dir laconic-full-node-deployment start
## Check status ## Check status
<!-- TODO --> * To list down and monitor the running containers:
```bash
# With status
docker ps -a
# Check logs for a container
docker logs -f <CONTAINER_ID>
```
* Check the sync status of your node:
```bash
docker exec -it <LACONICD_CONTAINER_ID> status | jq .sync_info
```
## Join as testnet validator ## Join as testnet validator
@ -98,12 +136,19 @@ laconic-so deployment --dir laconic-full-node-deployment start
## Clean up ## Clean up
Stop all services running in the background: * Stop all services running in the background:
```bash ```bash
laconic-so deployment --dir laconic-full-node-deployment stop # 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:
<!-- TODO --> ```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
```

View File

@ -1,10 +1,10 @@
version: "1.1" version: "1.0"
name: laconicd-full-node name: laconicd-full-node
description: "Laconicd full node" description: "Laconicd full node"
repos: repos:
- cerc-io/laconic2d - git.vdb.to/cerc-io/laconic2d@pm-stack-changes
- cerc-io/laconic-registry-cli@laconic2 - git.vdb.to/cerc-io/laconic-registry-cli@laconic2
- cerc-io/laconic-console@laconic2 - git.vdb.to/cerc-io/laconic-console@laconic2
containers: containers:
- cerc/laconic2d - cerc/laconic2d
- cerc/laconic-registry-cli - cerc/laconic-registry-cli
@ -13,7 +13,3 @@ containers:
pods: pods:
- laconicd-full-node - laconicd-full-node
- laconic-console - laconic-console
config:
cli:
key: laconicd.mykey
address: laconicd.myaddress