From a91f0144508af1819213d52399b44f5f07e4efe0 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Fri, 9 Aug 2024 12:03:19 +0530 Subject: [PATCH] Add steps to setup console deployment --- ops/deployments-from-scratch.md | 237 +++++++++++++++++++++++++++++++- 1 file changed, 234 insertions(+), 3 deletions(-) diff --git a/ops/deployments-from-scratch.md b/ops/deployments-from-scratch.md index 8322aa2..56f9743 100644 --- a/ops/deployments-from-scratch.md +++ b/ops/deployments-from-scratch.md @@ -10,7 +10,7 @@ cd /srv ``` -
+
stage0 laconicd ## stage0 laconicd @@ -135,6 +135,9 @@
+
+ faucet + ## faucet * Stack: @@ -233,9 +236,9 @@ ```bash # List down the containers and check health status - docker ps -a | grep laconicd + docker ps -a | grep faucet - # Follow logs for laconicd container, check that new blocks are getting created + # Check logs for faucet container laconic-so deployment --dir laconic-faucet-deployment logs faucet -f ``` @@ -252,10 +255,238 @@ # {"error":"address is required"} ``` +
+ +
+ laconic-console + ## laconic-console +* Stack: + +* Source repos: + * + * + +* Target dir: `/srv/console/laconic-console-deployment` + + * Cleanup an existing deployment if required: + + ```bash + cd /srv/console + + # Stop the deployment + laconic-so deployment --dir laconic-console-deployment stop --delete-volumes + + # Remove the deployment dir + sudo rm -rf laconic-console-deployment + + # Remove the existing spec file + rm laconic-console-spec.yml + ``` + +### Setup + +* Clone the stack repo: + + ```bash + laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull + + # This should clone the testnet-laconicd-stack repo at `/home/dev/cerc/testnet-laconicd-stack` + ``` + +* Clone required repositories: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories --pull + + # This should clone the laconic-registry-cli repo at `/home/dev/cerc/laconic-registry-cli`, laconic-console repo at `/home/dev/cerc/laconic-console` + ``` + +* Build the container images: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers --force-rebuild + + # This should create the Docker images: "cerc/laconic-registry-cli", "cerc/webapp-base", "cerc/laconic-console-host" + ``` + +### Deployment + +* Create a spec file for the deployment: + + ```bash + cd /srv/console + + 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: + + ```bash + network: + ports: + laconic-console: + - '127.0.0.1:4001:80' + ``` + +* Create a deployment from the spec file: + + ```bash + 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 + ``` + +* Update the configuration: + + ```bash + cat < laconic-console-deployment/config.env + # Laconicd (hosted) GQL endpoint + LACONIC_HOSTED_ENDPOINT=https://laconicd.laconic.com + EOF + ``` + +### Start + +* Start the deployment: + + ```bash + laconic-so deployment --dir laconic-console-deployment start + ``` + +* Check status: + + ```bash + # List down the container + docker ps -a | grep console + + # Follow logs for laconicd container, check that new blocks are getting created + laconic-so deployment --dir laconic-console-deployment logs console -f + ``` + +* The laconic console can now be viewed at + +
+ +
+ testnet-onboarding-app + ## testnet-onboarding-app +* Stack: + +* Source repos: + * + * + +* Target dir: `/srv/console/laconic-console-deployment` + + * Cleanup an existing deployment if required: + + ```bash + cd /srv/console + + # Stop the deployment + laconic-so deployment --dir laconic-console-deployment stop --delete-volumes + + # Remove the deployment dir + sudo rm -rf laconic-console-deployment + + # Remove the existing spec file + rm laconic-console-spec.yml + ``` + +### Setup + +* Clone the stack repo: + + ```bash + laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull + + # This should clone the testnet-laconicd-stack repo at `/home/dev/cerc/testnet-laconicd-stack` + ``` + +* Clone required repositories: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories --pull + + # This should clone the laconic-registry-cli repo at `/home/dev/cerc/laconic-registry-cli`, laconic-console repo at `/home/dev/cerc/laconic-console` + ``` + +* Build the container images: + + ```bash + laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers --force-rebuild + + # This should create the Docker images: "cerc/laconic-registry-cli", "cerc/webapp-base", "cerc/laconic-console-host" + ``` + +### Deployment + +* Create a spec file for the deployment: + + ```bash + cd /srv/console + + 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: + + ```bash + network: + ports: + laconic-console: + - '127.0.0.1:4001:80' + ``` + +* Create a deployment from the spec file: + + ```bash + 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 + ``` + +* Update the configuration: + + ```bash + cat < laconic-console-deployment/config.env + # Laconicd (hosted) GQL endpoint + LACONIC_HOSTED_ENDPOINT=https://laconicd.laconic.com + EOF + ``` + +### Start + +* Start the deployment: + + ```bash + laconic-so deployment --dir laconic-console-deployment start + ``` + +* Check status: + + ```bash + # List down the container + docker ps -a | grep console + + # Follow logs for laconicd container, check that new blocks are getting created + laconic-so deployment --dir laconic-console-deployment logs console -f + ``` + +* The laconic console can now be viewed at + +
+ +
+ laconic-console + ## laconic-wallet-web +
+ +
+ stage1 laconicd + ## stage1 laconicd + +