Add steps to setup stage0 deployment from scratch

This commit is contained in:
Prathamesh Musale 2024-08-09 10:24:07 +05:30
parent 3b6985adb7
commit 1e1055d1cb

View File

@ -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: <https://git.vdb.to/cerc-io/fixturenet-laconicd-stack/src/branch/main/stack-orchestrator/stacks/fixturenet-laconicd>
* Source repo: <https://git.vdb.to/cerc-io/laconicd>
* 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 <<EOF > 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:
* <https://laconicd.laconic.com> 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