# fixturenet-laconicd-stack Instructions for running a laconicd fixturenet along with registry CLI and console ## Setup * Clone the stack repos: ```bash laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-laconicd-stack laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack ``` * Clone required repositories: ```bash # laconicd laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd setup-repositories # laocnic cli and console laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories ``` * Build the container images: ```bash # laconicd laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd build-containers # laocnic cli and console laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers ``` This should create the following docker images locally: * `cerc/laconic2d` * `cerc/laconic2-registry-cli` * `cerc/webapp-base` * `cerc/laconic2-console-host` ## Create a deployment * Create spec files for the deployment: ```bash laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy init --output fixturenet-laconicd-spec.yml laconic-so --stack ~/cerc/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 # testnet-laconicd-spec.yml ... network: ports: laconicd: - '6060:6060' - '26657:26657' - '26656:26656' - '9473:9473' - '9090:9090' - '1317:1317' # laconic-console-spec.yml ... network: ports: console: - '8080:80' ``` * Create deployment from the spec files: ```bash 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 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 ``` ## Configuration * 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= # Max fees for txs (default: 200000photon) CERC_LACONICD_FEES= ``` ## Start the deployment ```bash laconic-so deployment --dir fixturenet-laconicd-deployment start laconic-so deployment --dir laconic-console-deployment start ``` ## 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 ``` * View the laconic console at * Use the cli service for registry CLI operations: ```bash # Example laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry status" ``` ## Demo * Follow the [records-demo](./records-demo.md) to try loading data into registry ## 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) rm -r fixturenet-laconicd-deployment ```