2024-06-24 07:30:16 +00:00
|
|
|
# fixturenet-laconicd-stack
|
|
|
|
|
2024-06-25 06:43:22 +00:00
|
|
|
Instructions for running a laconicd fixturenet along with registry CLI and console
|
|
|
|
|
2024-06-24 07:30:16 +00:00
|
|
|
## Setup
|
|
|
|
|
2024-06-25 06:43:22 +00:00
|
|
|
* Clone the stack repos:
|
2024-06-24 07:30:16 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-laconicd-stack
|
2024-06-25 06:43:22 +00:00
|
|
|
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack
|
2024-06-24 07:30:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
* Clone required repositories:
|
|
|
|
|
|
|
|
```bash
|
2024-06-25 06:43:22 +00:00
|
|
|
# laconicd
|
2024-06-24 07:30:16 +00:00
|
|
|
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd setup-repositories
|
2024-06-25 06:43:22 +00:00
|
|
|
|
|
|
|
# laconic cli and console
|
|
|
|
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories
|
2024-06-24 07:30:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
* Build the container images:
|
|
|
|
|
|
|
|
```bash
|
2024-06-25 06:43:22 +00:00
|
|
|
# laconicd
|
2024-06-24 07:30:16 +00:00
|
|
|
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd build-containers
|
2024-06-25 06:43:22 +00:00
|
|
|
|
|
|
|
# laconic cli and console
|
|
|
|
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers
|
2024-06-24 07:30:16 +00:00
|
|
|
```
|
|
|
|
|
2024-06-25 06:43:22 +00:00
|
|
|
This should create the following docker images locally:
|
|
|
|
|
2024-07-23 12:26:14 +00:00
|
|
|
* `cerc/laconicd`
|
|
|
|
* `cerc/laconic-registry-cli`
|
2024-06-25 06:43:22 +00:00
|
|
|
* `cerc/webapp-base`
|
2024-07-23 12:26:14 +00:00
|
|
|
* `cerc/laconic-console-host`
|
2024-06-25 06:43:22 +00:00
|
|
|
|
2024-06-24 07:30:16 +00:00
|
|
|
## Create a deployment
|
|
|
|
|
2024-06-25 06:43:22 +00:00
|
|
|
* Create spec files for the deployment:
|
2024-06-24 07:30:16 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy init --output fixturenet-laconicd-spec.yml
|
2024-06-25 06:43:22 +00:00
|
|
|
|
|
|
|
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy init --output laconic-console-spec.yml
|
2024-06-24 07:30:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
* Edit `network` in the spec file to map container ports to host ports as required:
|
|
|
|
|
|
|
|
```bash
|
2024-07-05 11:50:40 +00:00
|
|
|
# fixturenet-laconicd-spec.yml
|
2024-06-24 07:30:16 +00:00
|
|
|
...
|
|
|
|
network:
|
|
|
|
ports:
|
|
|
|
laconicd:
|
|
|
|
- '6060:6060'
|
|
|
|
- '26657:26657'
|
|
|
|
- '26656:26656'
|
|
|
|
- '9473:9473'
|
|
|
|
- '9090:9090'
|
|
|
|
- '1317:1317'
|
2024-06-25 06:43:22 +00:00
|
|
|
|
|
|
|
# laconic-console-spec.yml
|
|
|
|
...
|
|
|
|
network:
|
|
|
|
ports:
|
|
|
|
console:
|
|
|
|
- '8080:80'
|
2024-06-24 07:30:16 +00:00
|
|
|
```
|
|
|
|
|
2024-06-25 06:43:22 +00:00
|
|
|
* Create deployment from the spec files:
|
2024-06-24 07:30:16 +00:00
|
|
|
|
|
|
|
```bash
|
2024-07-11 13:49:27 +00:00
|
|
|
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy create --spec-file fixturenet-laconicd-spec.yml --deployment-dir fixturenet-laconicd-deployment
|
2024-06-25 06:43:22 +00:00
|
|
|
|
|
|
|
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 fixturenet-laconicd-deployment/deployment.yml laconic-console-deployment/deployment.yml
|
|
|
|
```
|
|
|
|
|
2024-07-08 05:27:30 +00:00
|
|
|
* (Optional) Copy over an existing genesis file (`.json`) to data directory in deployment (`fixturenet-laconicd-deployment/data/genesis-config`):
|
2024-07-05 11:50:40 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
# Example
|
|
|
|
cp genesis.json fixturenet-laconicd-deployment/data/genesis-config/genesis.json
|
|
|
|
```
|
|
|
|
|
2024-06-25 06:43:22 +00:00
|
|
|
## Configuration
|
|
|
|
|
2024-07-05 11:50:40 +00:00
|
|
|
* Inside the `fixturenet-laconicd-deployment` deployment directory, open `config.env` file and set the following env variable:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Optional
|
|
|
|
|
2024-08-08 07:44:18 +00:00
|
|
|
# Set to true to enable adding participants functionality of the onboarding module (default: false)
|
2024-07-05 11:50:40 +00:00
|
|
|
ONBOARDING_ENABLED=
|
2024-08-08 07:44:18 +00:00
|
|
|
|
|
|
|
# Staking amount to use for the default validator account (default: 1000000000000000)
|
|
|
|
STAKING_AMOUNT=
|
|
|
|
|
|
|
|
# Enable authority auctions (default: false)
|
|
|
|
AUTHORITY_AUCTION_ENABLED=true
|
|
|
|
|
|
|
|
# Authority auctions commits duration (in secs) (default: 24hrs)
|
|
|
|
AUTHORITY_AUCTION_COMMITS_DURATION=3600
|
|
|
|
|
|
|
|
# Authority auctions reveals duration (in secs) (default: 24hrs)
|
|
|
|
AUTHORITY_AUCTION_REVEALS_DURATION=3600
|
|
|
|
|
|
|
|
# Authority grace period (set bond to authority within this) (in secs) (default: 2 * 24hrs)
|
|
|
|
AUTHORITY_GRACE_PERIOD=7200
|
2024-08-09 11:06:30 +00:00
|
|
|
|
|
|
|
# Node moniker (default: "localtestnet")
|
|
|
|
MONIKER=
|
2024-08-10 07:02:36 +00:00
|
|
|
|
|
|
|
# Chain ID of the network (default: "laconic_9000-1")
|
|
|
|
CHAINID=
|
2024-07-05 11:50:40 +00:00
|
|
|
```
|
|
|
|
|
2024-06-25 06:43:22 +00:00
|
|
|
* Inside the `laconic-console-deployment` deployment directory, open `config.env` file and set following env variables:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Optional CLI configuration
|
|
|
|
|
|
|
|
# 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=
|
|
|
|
|
2024-07-30 11:53:03 +00:00
|
|
|
# Max fees for txs (default: 200000alnt)
|
2024-06-25 06:43:22 +00:00
|
|
|
CERC_LACONICD_FEES=
|
2024-06-24 07:30:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Start the deployment
|
|
|
|
|
|
|
|
```bash
|
|
|
|
laconic-so deployment --dir fixturenet-laconicd-deployment start
|
2024-06-25 06:43:22 +00:00
|
|
|
laconic-so deployment --dir laconic-console-deployment start
|
2024-06-24 07:30:16 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Check status
|
|
|
|
|
|
|
|
* To list down and monitor the running containers:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# With status
|
|
|
|
docker ps -a
|
|
|
|
|
|
|
|
# Follow logs for laconicd container
|
|
|
|
laconic-so deployment --dir fixturenet-laconicd-deployment logs laconicd -f
|
|
|
|
```
|
|
|
|
|
2024-06-25 06:43:22 +00:00
|
|
|
* 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 exec cli "laconic registry status"
|
|
|
|
```
|
|
|
|
|
|
|
|
## Perform operations
|
|
|
|
|
|
|
|
* Example (bond creation):
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Get the PK from your node
|
|
|
|
ALICE_PK=$(echo y | laconic-so deployment --dir fixturenet-laconicd-deployment exec laconicd "laconicd keys export alice --unarmored-hex --unsafe")
|
|
|
|
|
|
|
|
# Create a bond:
|
2024-07-30 11:53:03 +00:00
|
|
|
laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry bond create --type alnt --quantity 1000000000000 --user-key $ALICE_PK" | jq -r '.bondId'
|
2024-06-25 06:43:22 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Demo
|
|
|
|
|
|
|
|
* Follow the [records-demo](./records-demo.md) to try loading data into registry
|
|
|
|
|
2024-06-24 07:30:16 +00:00
|
|
|
## Clean up
|
|
|
|
|
|
|
|
* Stop all services running in the background:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Stop the docker containers
|
|
|
|
laconic-so deployment --dir fixturenet-laconicd-deployment stop
|
|
|
|
```
|
|
|
|
|
|
|
|
* To stop all services and also delete data:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# Stop the docker containers
|
|
|
|
laconic-so deployment --dir fixturenet-laconicd-deployment stop --delete-volumes
|
|
|
|
|
|
|
|
# Remove deployment directory (deployment will have to be recreated for a re-run)
|
2024-08-10 06:39:45 +00:00
|
|
|
sudo rm -r fixturenet-laconicd-deployment
|
2024-06-24 07:30:16 +00:00
|
|
|
```
|