From 1e1055d1cb970ef312f3909c6fd8e0eaea7ee8c2 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 9 Aug 2024 10:24:07 +0530 Subject: [PATCH] Add steps to setup stage0 deployment from scratch --- ops/deployments-from-scratch.md | 137 ++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 ops/deployments-from-scratch.md diff --git a/ops/deployments-from-scratch.md b/ops/deployments-from-scratch.md new file mode 100644 index 0000000..fd3c170 --- /dev/null +++ b/ops/deployments-from-scratch.md @@ -0,0 +1,137 @@ +# deployments-from-scratch + +## Login + +* Log in as `dev` user on the deployments VM + +* All the deployments are placed in the `/srv` directory: + + ```bash + cd /srv + ``` + +## stage0 laconicd + +* Stack: + +* Source repo: + +* Target dir: `/srv/laconicd/stage0-deployment` + + * Cleanup an existing deployment if required: + + ```bash + cd /srv/laconicd + + # Stop the deployment + laconic-so deployment --dir stage0-deployment stop --delete-volumes + + # Remove the deployment dir + sudo rm -rf stage0-deployment + + # Remove the existing spec file + rm stage0-spec.yml + ``` + +### Setup + +* Clone the stack repo: + + ```bash + laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-laconicd-stack --pull + + # This should clone the fixturenet-laconicd-stack repo at `/home/dev/cerc/fixturenet-laconicd-stack` + ``` + +* Clone required repositories: + + ```bash + laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd setup-repositories --pull + + # This should clone the laconicd repo at `/home/dev/cerc/laconicd` + ``` + +* Build the container images: + + ```bash + laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd build-containers --force-rebuild + + # This should create the "cerc/laconicd" Docker image + ``` + +### Deployment + +* Create a spec file for the deployment: + + ```bash + laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy init --output stage0-spec.yml + ``` + +* Edit network in the spec file to map container ports to host ports: + + ```bash + # stage0-spec.yml + network: + ports: + laconicd: + - '6060' + - '127.0.0.1:26657:26657' + - '26656' + - '127.0.0.1:9473:9473' + - '127.0.0.1:9090:9090' + - '127.0.0.1:1317:1317' + ``` + +* Create a deployment from the spec file: + + ```bash + laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy create --spec-file stage0-spec.yml --deployment-dir stage0-deployment + ``` + +* Update the configuration: + + ```bash + cat < stage0-deployment/config.env + # Set to true to enable adding participants functionality of the onboarding module + ONBOARDING_ENABLED=true + EOF + ``` + +### Start + +* Start the deployment: + + ```bash + laconic-so deployment --dir stage0-deployment start + ``` + +* Check status: + + ```bash + # List down the containers and check health status + docker ps -a | grep laconicd + + # Follow logs for laconicd container, check that new blocks are getting created + laconic-so deployment --dir stage0-deployment logs laconicd -f + ``` + +* Verify that endpoint is now publicly accessible: + + * is pointed to the node's RPC endpoint + + * Check status query: + + ```bash + curl https://laconicd.laconic.com/status | jq + + # Expected output: + # JSON with `node_info`, `sync_info` and `validator_info` + ``` + +## faucet + +## testnet-onboarding-app + +## laconic-wallet-web + +## stage1 laconicd