2024-08-09 10:18:11 +00:00
# Create deployments from scratch (for reference only)
## Login
2024-09-17 13:55:55 +00:00
* Log in as `dev` user on the deployments machine
2024-08-09 10:18:11 +00:00
* All the deployments are placed in the `/srv` directory:
```bash
cd /srv
```
2024-09-12 13:31:17 +00:00
## Prerequisites
* Local:
* Clone the `cerc-io/testnet-ops` repository:
```bash
git clone git@git.vdb.to:cerc-io/testnet-ops.git
```
* Ansible: see [installation ](https://git.vdb.to/cerc-io/testnet-ops#installation )
2024-09-17 13:55:55 +00:00
* On deployments machine(s):
2024-09-12 13:31:17 +00:00
2024-09-17 13:55:55 +00:00
* laconic-so: see [installation ](https://git.vdb.to/cerc-io/testnet-ops/src/branch/main/stack-orchestrator-setup/README.md#setup-stack-orchestrator )
2024-09-12 13:31:17 +00:00
2024-10-21 11:07:01 +00:00
< details open >
2024-10-22 09:31:13 +00:00
< summary > stage0 laconicd< / summary >
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
## stage0 laconicd
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / fixturenet-laconicd-stack / src / branch / main / stack-orchestrator / stacks / fixturenet-laconicd >
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
* Source repo: < https: // git . vdb . to / cerc-io / laconicd >
* Target dir: `/srv/laconicd/stage0-deployment`
2024-10-21 11:07:01 +00:00
* Cleanup an existing deployment if required:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/laconicd
2024-10-21 11:07:01 +00:00
# Stop the deployment
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir stage0-deployment stop --delete-volumes
2024-10-21 11:07:01 +00:00
# Remove the deployment dir
2024-10-22 09:31:13 +00:00
sudo rm -rf stage0-deployment
# Remove the existing spec file
rm stage0-spec.yml
2024-10-21 11:07:01 +00:00
```
### Setup
* Clone the stack repo:
```bash
2024-10-22 09:31:13 +00:00
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`
2024-10-21 11:07:01 +00:00
```
* Clone required repositories:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd setup-repositories --pull
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
# This should clone the laconicd repo at `/home/dev/cerc/laconicd`
2024-10-21 11:07:01 +00:00
```
* Build the container images:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd build-containers --force-rebuild
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
# This should create the "cerc/laconicd" Docker image
2024-10-21 11:07:01 +00:00
```
2024-10-22 09:31:13 +00:00
### Deployment
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
* Create a spec file for the deployment:
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
```bash
cd /srv/laconicd
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
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:
2024-10-21 11:07:01 +00:00
```bash
2024-10-22 09:31:13 +00:00
# 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'
2024-10-21 11:07:01 +00:00
```
2024-10-22 09:31:13 +00:00
* Create a deployment from the spec file:
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy create --spec-file stage0-spec.yml --deployment-dir stage0-deployment
```
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
* Update the configuration:
2024-10-21 11:07:01 +00:00
```bash
2024-10-22 09:31:13 +00:00
cat < < EOF > stage0-deployment/config.env
# Set to true to enable adding participants functionality of the onboarding module
ONBOARDING_ENABLED=true
# A custom human readable name for this node
MONIKER=LaconicStage0
EOF
2024-10-21 11:07:01 +00:00
```
2024-10-22 09:31:13 +00:00
### Start
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
* Start the deployment:
2024-10-21 11:07:01 +00:00
```bash
2024-10-22 09:31:13 +00:00
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
2024-10-21 11:07:01 +00:00
```
2024-10-22 09:31:13 +00:00
* 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`
```
2024-10-21 11:07:01 +00:00
< / details >
2024-09-12 13:31:17 +00:00
< details open >
2024-10-22 09:31:13 +00:00
< summary > faucet< / summary >
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
## faucet
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / testnet-laconicd-stack / src / branch / main / stack-orchestrator / stacks / laconic-faucet >
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Source repo: < https: // git . vdb . to / cerc-io / laconic-faucet >
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Target dir: `/srv/faucet/laconic-faucet-deployment`
2024-09-12 13:31:17 +00:00
2024-09-17 13:55:55 +00:00
* Cleanup an existing deployment if required:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd /srv/faucet
2024-09-12 13:31:17 +00:00
# Stop the deployment
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir laconic-faucet-deployment stop
2024-09-12 13:31:17 +00:00
# Remove the deployment dir
2024-10-22 09:31:13 +00:00
sudo rm -rf laconic-faucet-deployment
# Remove the existing spec file
rm laconic-faucet-spec.yml
2024-10-21 11:07:01 +00:00
```
2024-09-12 13:31:17 +00:00
### Setup
2024-10-22 09:31:13 +00:00
* Clone the stack repo:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
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`
2024-09-12 13:31:17 +00:00
```
2024-10-22 09:31:13 +00:00
* Clone required repositories:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet setup-repositories --pull
# This should clone the laconicd repo at `/home/dev/cerc/laconic-faucet
2024-09-12 13:31:17 +00:00
```
2024-10-22 09:31:13 +00:00
* Build the container images:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet build-containers --force-rebuild
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
# This should create the "cerc/laconic-faucet" Docker image
```
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
### Deployment
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Create a spec file for the deployment:
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
```bash
cd /srv/faucet
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet deploy init --output laconic-faucet-spec.yml
2024-09-12 13:31:17 +00:00
```
2024-10-22 09:31:13 +00:00
* Edit network in the spec file to map container ports to host ports:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
# laconic-faucet-spec.yml
network:
ports:
faucet:
- '127.0.0.1:4000:3000'
```
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Create a deployment from the spec file:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-faucet deploy create --spec-file laconic-faucet-spec.yml --deployment-dir laconic-faucet-deployment
# Place in the same namespace as stage0
cp /srv/laconicd/stage0-deployment/deployment.yml laconic-faucet-deployment/deployment.yml
2024-09-12 13:31:17 +00:00
```
2024-10-22 09:31:13 +00:00
* Update the configuration:
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
```bash
# Get the faucet account key from stage0 deployment
export FAUCET_ACCOUNT_PK=$(laconic-so deployment --dir /srv/laconicd/stage0-deployment exec laconicd "echo y | laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe")
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
cat < < EOF > laconic-faucet-deployment/config.env
CERC_FAUCET_KEY=$FAUCET_ACCOUNT_PK
EOF
```
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
### Start
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Start the deployment:
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir laconic-faucet-deployment start
```
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Check status:
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
```bash
# List down the containers and check health status
docker ps -a | grep faucet
# Check logs for faucet container
laconic-so deployment --dir laconic-faucet-deployment logs faucet -f
```
* Verify that endpoint is now publicly accessible:
* < https: // faucet . laconic . com > is pointed to the faucet endpoint
* Check faucet:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
curl -X POST https://faucet.laconic.com/faucet
2024-09-12 13:31:17 +00:00
# Expected output:
2024-10-22 09:31:13 +00:00
# {"error":"address is required"}
2024-09-12 13:31:17 +00:00
```
< / details >
< details open >
2024-10-22 09:31:13 +00:00
< summary > Shopify< / summary >
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
## Shopify
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / testnet-laconicd-stack / src / branch / main / stack-orchestrator / stacks / laconic-shopify >
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Source repo: < https: // git . vdb . to / cerc-io / shopify >
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Target dir: `/srv/shopify/laconic-shopify-deployment`
2024-09-12 13:31:17 +00:00
2024-09-17 13:55:55 +00:00
* Cleanup an existing deployment if required:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd /srv/shopify
2024-09-12 13:31:17 +00:00
# Stop the deployment
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir laconic-shopify-deployment stop
2024-09-12 13:31:17 +00:00
# Remove the deployment dir
2024-10-22 09:31:13 +00:00
sudo rm -rf laconic-shopify-deployment
# Remove the existing spec file
rm laconic-shopify-spec.yml
2024-09-12 13:31:17 +00:00
```
### Setup
2024-10-22 09:31:13 +00:00
* Clone the stack repo:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
# This should clone the testnet-laconicd-stack repo at `/home/dev/cerc/testnet-laconicd-stack`
2024-09-12 13:31:17 +00:00
```
2024-10-22 09:31:13 +00:00
* Clone required repositories:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify setup-repositories --pull
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
# This should clone the laconicd repos at `/home/dev/cerc/shopify` and `/home/dev/cerc/laconic-faucet`
2024-09-12 13:31:17 +00:00
```
2024-10-22 09:31:13 +00:00
* Build the container images:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify build-containers --force-rebuild
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
# This should create the "cerc/laconic-shopify" and "cerc/laconic-shopify-faucet" Docker images
2024-09-12 13:31:17 +00:00
```
2024-10-22 09:31:13 +00:00
### Deployment
* Create a spec file for the deployment:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd /srv/shopify
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify deploy init --output laconic-shopify-spec.yml
2024-09-12 13:31:17 +00:00
```
2024-10-22 09:31:13 +00:00
* Create a deployment from the spec file:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify deploy create --spec-file laconic-shopify-spec.yml --deployment-dir laconic-shopify-deployment
2024-09-12 13:31:17 +00:00
```
2024-10-22 09:31:13 +00:00
* Inside the `laconic-shopify-deployment` deployment directory, open `config.env` file and set following env variables:
2024-09-12 13:31:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
# Shopify GraphQL URL
CERC_SHOPIFY_GRAPHQL_URL='https://6h071x-zw.myshopify.com/admin/api/2024-10/graphql.json'
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
# Access token for Shopify API
CERC_SHOPIFY_ACCESS_TOKEN=
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
# Delay for fetching orders in milliseconds
CERC_FETCH_ORDER_DELAY=10000
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
# Number of line items per order in Get Orders GraphQL query
CERC_ITEMS_PER_ORDER=10
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
# Private key of a funded faucet account
CERC_FAUCET_KEY=
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
# laconicd RPC endpoint
CERC_LACONICD_RPC_ENDPOINT='https://laconicd-sapo.laconic.com'
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
# laconicd chain id
CERC_LACONICD_CHAIN_ID=laconic-testnet-2
2024-10-21 11:07:01 +00:00
2024-10-22 09:31:13 +00:00
# laconicd address prefix
CERC_LACONICD_PREFIX=laconic
# laconicd gas price
CERC_LACONICD_GAS_PRICE=0.001
2024-09-12 13:31:17 +00:00
```
2024-10-22 09:31:13 +00:00
### Start
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
* Start the deployment:
2024-09-12 13:31:17 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir laconic-shopify-deployment start
```
* Check status:
2024-09-17 13:55:55 +00:00
```bash
2024-10-22 09:31:13 +00:00
# Check logs for faucet and shopify containers
laconic-so deployment --dir laconic-shopify-deployment logs shopify -f
laconic-so deployment --dir laconic-shopify-deployment logs faucet -f
2024-09-17 13:55:55 +00:00
```
2024-09-12 13:31:17 +00:00
< / details >
2024-08-09 10:18:11 +00:00
< details open >
2024-10-22 09:31:13 +00:00
< summary > testnet-onboarding-app< / summary >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
## testnet-onboarding-app
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / testnet-onboarding-app-stack / src / branch / main / stack-orchestrator / stacks / onboarding-app >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Source repo: < https: // git . vdb . to / cerc-io / testnet-onboarding-app >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Target dir: `/srv/app/onboarding-app-deployment`
2024-08-09 10:18:11 +00:00
* Cleanup an existing deployment if required:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/app
2024-08-09 10:18:11 +00:00
# Stop the deployment
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir onboarding-app-deployment
2024-08-09 10:18:11 +00:00
# Remove the deployment dir
2024-10-22 09:31:13 +00:00
sudo rm -rf onboarding-app-deployment
2024-08-09 10:18:11 +00:00
# Remove the existing spec file
2024-10-22 09:31:13 +00:00
rm onboarding-app-spec.yml
2024-08-09 10:18:11 +00:00
```
### Setup
* Clone the stack repo:
```bash
2024-10-22 09:31:13 +00:00
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-onboarding-app-stack --pull
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# This should clone the testnet-onboarding-app-stack repo at `/home/dev/cerc/testnet-onboarding-app-stack`
2024-08-09 10:18:11 +00:00
```
* Clone required repositories:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app setup-repositories --pull
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# This should clone the testnet-onboarding-app repo at `/home/dev/cerc/testnet-onboarding-app`
2024-08-09 10:18:11 +00:00
```
* Build the container images:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app build-containers --force-rebuild
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# This should create the Docker image "cerc/testnet-onboarding-app" locally
2024-08-09 10:18:11 +00:00
```
### Deployment
* Create a spec file for the deployment:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/app
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app deploy init --output onboarding-app-spec.yml
2024-08-09 10:18:11 +00:00
```
* Edit network in the spec file to map container ports to host ports:
```bash
network:
ports:
2024-10-22 09:31:13 +00:00
testnet-onboarding-app:
- '127.0.0.1:3000:80'
2024-08-09 10:18:11 +00:00
```
* Create a deployment from the spec file:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app deploy create --spec-file onboarding-app-spec.yml --deployment-dir onboarding-app-deployment
2024-08-09 10:18:11 +00:00
```
* Update the configuration:
```bash
2024-10-22 09:31:13 +00:00
cat < < EOF > onboarding-app-deployment/config.env
WALLET_CONNECT_ID=63...
2024-08-19 10:12:29 +00:00
2024-10-22 09:31:13 +00:00
CERC_REGISTRY_GQL_ENDPOINT="https://laconicd.laconic.com/api"
CERC_LACONICD_RPC_ENDPOINT="https://laconicd.laconic.com"
CERC_FAUCET_ENDPOINT="https://faucet.laconic.com"
CERC_WALLET_META_URL="https://loro-signup.laconic.com"
2024-08-09 10:18:11 +00:00
EOF
```
### Start
* Start the deployment:
```bash
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir onboarding-app-deployment start
2024-08-09 10:18:11 +00:00
```
* Check status:
```bash
2024-10-22 09:31:13 +00:00
# List down the container
docker ps -a | grep testnet-onboarding-app
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# Follow logs for testnet-onboarding-app container, wait for the build to finish
laconic-so deployment --dir onboarding-app-deployment logs testnet-onboarding-app -f
2024-08-09 10:18:11 +00:00
```
2024-10-22 09:31:13 +00:00
* The onboarding app can now be viewed at < https: // loro-signup . laconic . com >
2024-08-09 10:18:11 +00:00
< / details >
2024-08-09 12:58:59 +00:00
< details open >
2024-10-22 09:31:13 +00:00
< summary > laconic-wallet-web< / summary >
2024-08-09 12:58:59 +00:00
2024-10-22 09:31:13 +00:00
## laconic-wallet-web
2024-08-09 12:58:59 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / laconic-wallet-web / src / branch / main / stack / stack-orchestrator / stack / laconic-wallet-web >
2024-08-09 12:58:59 +00:00
2024-10-22 09:31:13 +00:00
* Source repo: < https: // git . vdb . to / cerc-io / laconic-wallet-web >
2024-08-09 12:58:59 +00:00
2024-10-22 09:31:13 +00:00
* Target dir: `/srv/wallet/laconic-wallet-web-deployment`
2024-08-09 12:58:59 +00:00
* Cleanup an existing deployment if required:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/wallet
2024-08-09 12:58:59 +00:00
# Stop the deployment
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir laconic-wallet-web-deployment
2024-08-09 12:58:59 +00:00
# Remove the deployment dir
2024-10-22 09:31:13 +00:00
sudo rm -rf laconic-wallet-web-deployment
2024-08-09 12:58:59 +00:00
# Remove the existing spec file
2024-10-22 09:31:13 +00:00
rm laconic-wallet-web-spec.yml
2024-08-09 12:58:59 +00:00
```
### Setup
* Clone the stack repo:
```bash
2024-10-22 09:31:13 +00:00
laconic-so fetch-stack git.vdb.to/cerc-io/laconic-wallet-web --pull
2024-08-09 12:58:59 +00:00
2024-10-22 09:31:13 +00:00
# This should clone the laconic-wallet-web repo at `/home/dev/cerc/laconic-wallet-web`
2024-08-09 12:58:59 +00:00
```
* Build the container images:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/laconic-wallet-web/stack/stack-orchestrator/stack/laconic-wallet-web build-containers --force-rebuild
2024-08-09 12:58:59 +00:00
2024-10-22 09:31:13 +00:00
# This should create the Docker image "cerc/laconic-wallet-web" locally
2024-08-09 12:58:59 +00:00
```
### Deployment
* Create a spec file for the deployment:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/wallet
2024-08-09 12:58:59 +00:00
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/laconic-wallet-web/stack/stack-orchestrator/stack/laconic-wallet-web deploy init --output laconic-wallet-web-spec.yml
2024-08-09 12:58:59 +00:00
```
* Edit network in the spec file to map container ports to host ports:
```bash
network:
ports:
2024-10-22 09:31:13 +00:00
laconic-wallet-web:
- '127.0.0.1:5000:80'
2024-08-09 12:58:59 +00:00
```
* Create a deployment from the spec file:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/laconic-wallet-web/stack/stack-orchestrator/stack/laconic-wallet-web deploy create --spec-file laconic-wallet-web-spec.yml --deployment-dir laconic-wallet-web-deployment
2024-08-09 12:58:59 +00:00
```
* Update the configuration:
```bash
2024-10-22 09:31:13 +00:00
cat < < EOF > laconic-wallet-web-deployment/config.env
WALLET_CONNECT_ID=63...
2024-08-09 12:58:59 +00:00
EOF
```
### Start
* Start the deployment:
```bash
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir laconic-wallet-web-deployment start
2024-08-09 12:58:59 +00:00
```
* Check status:
```bash
2024-10-22 09:31:13 +00:00
# List down the container
docker ps -a | grep laconic-wallet-web
2024-08-09 12:58:59 +00:00
2024-10-22 09:31:13 +00:00
# Follow logs for laconic-wallet-web container, wait for the build to finish
laconic-so deployment --dir laconic-wallet-web-deployment logs laconic-wallet-web -f
2024-08-09 12:58:59 +00:00
```
2024-10-22 09:31:13 +00:00
* The web wallet can now be viewed at < https: // wallet . laconic . com >
2024-08-09 12:58:59 +00:00
< / details >
2024-10-30 05:00:17 +00:00
< details open >
2024-10-22 09:31:13 +00:00
< summary > stage1 laconicd< / summary >
2024-10-30 05:00:17 +00:00
2024-10-22 09:31:13 +00:00
## stage1 laconicd
2024-10-30 05:00:17 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / fixturenet-laconicd-stack / src / branch / main / stack-orchestrator / stacks / fixturenet-laconicd >
2024-10-30 05:00:17 +00:00
2024-10-22 09:31:13 +00:00
* Source repo: < https: // git . vdb . to / cerc-io / laconicd >
2024-10-30 05:00:17 +00:00
2024-10-22 09:31:13 +00:00
* Target dir: `/srv/laconicd/stage1-deployment`
2024-10-30 05:00:17 +00:00
* Cleanup an existing deployment if required:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/laconicd
2024-10-30 05:00:17 +00:00
# Stop the deployment
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir stage1-deployment stop --delete-volumes
2024-10-30 05:00:17 +00:00
# Remove the deployment dir
2024-10-22 09:31:13 +00:00
sudo rm -rf stage1-deployment
2024-10-30 05:00:17 +00:00
# Remove the existing spec file
2024-10-22 09:31:13 +00:00
rm stage1-spec.yml
2024-10-30 05:00:17 +00:00
```
### Setup
2024-10-22 09:31:13 +00:00
* Same as that for [stage0-laconicd ](#stage0-laconicd ), not required if already done for stage0
2024-10-30 05:00:17 +00:00
2024-10-22 09:31:13 +00:00
### Deployment
2024-10-30 05:00:17 +00:00
2024-10-22 09:31:13 +00:00
* Create a spec file for the deployment:
2024-10-30 05:00:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd /srv/laconicd
2024-10-30 05:00:17 +00:00
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy init --output stage1-spec.yml
2024-10-30 05:00:17 +00:00
```
2024-10-22 09:31:13 +00:00
* Edit network in the spec file to map container ports to host ports:
2024-10-30 05:00:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
# stage1-spec.yml
network:
ports:
laconicd:
- '6060'
- '127.0.0.1:26657:26657'
- '26656:26656'
- '127.0.0.1:9473:9473'
- '127.0.0.1:9090:9090'
- '127.0.0.1:1317:1317'
2024-10-30 05:00:17 +00:00
```
* Create a deployment from the spec file:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy create --spec-file stage1-spec.yml --deployment-dir stage1-deployment
2024-10-30 05:00:17 +00:00
```
2024-10-22 09:31:13 +00:00
* Update the configuration:
2024-10-30 05:00:17 +00:00
```bash
2024-10-22 09:31:13 +00:00
cat < < EOF > stage1-deployment/config.env
AUTHORITY_AUCTION_ENABLED=true
AUTHORITY_AUCTION_COMMITS_DURATION=3600
AUTHORITY_AUCTION_REVEALS_DURATION=3600
AUTHORITY_GRACE_PERIOD=7200
2024-10-30 05:00:17 +00:00
2024-10-22 09:31:13 +00:00
MONIKER=LaconicStage1
EOF
2024-10-30 05:00:17 +00:00
```
### Start
2024-10-22 09:31:13 +00:00
* Follow [stage0-to-stage1.md ](./stage0-to-stage1.md ) to halt stage0 deployment, generate the genesis file for stage1 and start the stage1 deployment
2024-10-30 05:00:17 +00:00
< / details >
2024-08-09 10:18:11 +00:00
< details open >
2024-10-22 09:31:13 +00:00
< summary > laconic-console< / summary >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
## laconic-console
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / testnet-laconicd-stack / src / branch / main / stack-orchestrator / stacks / laconic-console >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Source repos:
* < https: // git . vdb . to / cerc-io / laconic-registry-cli >
* < https: // git . vdb . to / cerc-io / laconic-console >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Target dir: `/srv/console/laconic-console-deployment`
2024-08-09 10:18:11 +00:00
* Cleanup an existing deployment if required:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/console
2024-08-09 10:18:11 +00:00
# Stop the deployment
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir laconic-console-deployment stop --delete-volumes
2024-08-09 10:18:11 +00:00
# Remove the deployment dir
2024-10-22 09:31:13 +00:00
sudo rm -rf laconic-console-deployment
2024-08-09 10:18:11 +00:00
# Remove the existing spec file
2024-10-22 09:31:13 +00:00
rm laconic-console-spec.yml
2024-08-09 10:18:11 +00:00
```
### Setup
* Clone the stack repo:
```bash
2024-10-22 09:31:13 +00:00
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# This should clone the testnet-laconicd-stack repo at `/home/dev/cerc/testnet-laconicd-stack`
2024-08-09 10:18:11 +00:00
```
* Clone required repositories:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories --pull
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# This should clone the laconic-registry-cli repo at `/home/dev/cerc/laconic-registry-cli` , laconic-console repo at `/home/dev/cerc/laconic-console`
2024-08-09 10:18:11 +00:00
```
* Build the container images:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers --force-rebuild
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# This should create the Docker images: "cerc/laconic-registry-cli", "cerc/webapp-base", "cerc/laconic-console-host"
2024-08-09 10:18:11 +00:00
```
### Deployment
* Create a spec file for the deployment:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/console
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy init --output laconic-console-spec.yml
2024-08-09 10:18:11 +00:00
```
* Edit network in the spec file to map container ports to host ports:
```bash
network:
ports:
2024-10-22 09:31:13 +00:00
console:
- '127.0.0.1:4001:80'
2024-08-09 10:18:11 +00:00
```
* Create a deployment from the spec file:
```bash
2024-10-22 09:31:13 +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
2024-08-09 10:18:11 +00:00
```
* Update the configuration:
```bash
2024-10-22 09:31:13 +00:00
cat < < EOF > laconic-console-deployment/config.env
# Laconicd (hosted) GQL endpoint
LACONIC_HOSTED_ENDPOINT=https://laconicd.laconic.com
2024-08-09 10:18:11 +00:00
EOF
```
### Start
* Start the deployment:
```bash
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir laconic-console-deployment start
2024-08-09 10:18:11 +00:00
```
* Check status:
```bash
# List down the container
2024-10-22 09:31:13 +00:00
docker ps -a | grep console
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# Follow logs for console container
laconic-so deployment --dir laconic-console-deployment logs console -f
2024-08-09 10:18:11 +00:00
```
2024-10-22 09:31:13 +00:00
* The laconic console can now be viewed at < https: // loro-console . laconic . com >
2024-08-09 10:18:11 +00:00
< / details >
2024-10-22 09:39:07 +00:00
---
2024-08-09 10:18:11 +00:00
< details open >
2024-10-22 09:31:13 +00:00
< summary > deploy-backend< / summary >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
## Deploy Backend
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / snowballtools-base-api-stack / src / branch / main / stack-orchestrator / stacks / snowballtools-base-backend >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Source repo: < https: // git . vdb . to / cerc-io / snowballtools-base >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Target dir: `/srv/deploy-backend/backend-deployment`
2024-08-09 10:18:11 +00:00
* Cleanup an existing deployment if required:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/deploy-backend
2024-08-09 10:18:11 +00:00
# Stop the deployment
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir backend-deployment stop --delete-volumes
2024-08-09 10:18:11 +00:00
# Remove the deployment dir
2024-10-22 09:31:13 +00:00
sudo rm -rf backend-deployment
2024-08-09 10:18:11 +00:00
# Remove the existing spec file
2024-10-22 09:31:13 +00:00
rm backend-deployment-spec.yml
2024-08-09 10:18:11 +00:00
```
### Setup
* Clone the stack repo:
```bash
2024-10-22 09:31:13 +00:00
laconic-so fetch-stack git.vdb.to/cerc-io/snowballtools-base-api-stack --pull
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# This should clone the snowballtools-base-api-stack repo at `/home/dev/cerc/snowballtools-base-api-stack`
```
* Clone required repositories:
```bash
laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend setup-repositories --git-ssh --pull
# This should clone the snowballtools-base repo at `/home/dev/cerc/snowballtools-base`
2024-08-09 10:18:11 +00:00
```
* Build the container images:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend build-containers --force-rebuild
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# This should create the Docker images: "cerc/snowballtools-base-backend" and "cerc/snowballtools-base-backend-base"
```
* Push the images to the container registry. The container registry will be set up while setting up a service provider
```bash
laconic-so deployment --dir backend-deployment push-images
2024-08-09 10:18:11 +00:00
```
### Deployment
* Create a spec file for the deployment:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/backend-deployment
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend deploy init --output backend-deployment-spec.yml --config SNOWBALL_BACKEND_CONFIG_FILE_PATH=/config/prod.toml
2024-08-09 10:18:11 +00:00
```
2024-10-22 09:31:13 +00:00
* Edit the spec file to deploy the stack to k8s:
2024-08-09 10:18:11 +00:00
```bash
2024-10-22 09:31:13 +00:00
stack:
/home/dev/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend
deploy-to: k8s
kube-config: /home/dev/.kube/config-vs-narwhal.yaml
image-registry: container-registry.apps.vaasl.io/laconic-registry
config:
SNOWBALL_BACKEND_CONFIG_FILE_PATH: /config/prod.toml
2024-08-09 10:18:11 +00:00
network:
ports:
2024-10-22 09:31:13 +00:00
deploy-backend:
- '8000'
http-proxy:
- host-name: deploy-backend.apps.vaasl.io
routes:
- path: '/'
proxy-to: deploy-backend:8000
volumes:
data:
configmaps:
config: ./configmaps/config
2024-08-09 10:18:11 +00:00
```
* Create a deployment from the spec file:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend deploy create --deployment-dir backend-deployment --spec-file backend-deployment-spec.yml
# This should create the deployment directory at `/srv/deploy-backend/backend-deployment`
2024-08-09 10:18:11 +00:00
```
2024-10-22 09:31:13 +00:00
* Modify file `backend-deployment/kubeconfig.yml` if required
```
apiVersion: v1
...
contexts:
- context:
cluster: ** *
user: ** *
name: default
...
```
NOTE: `context.name` must be default to use with SO
* Fetch the config template file for the snowball backend:
2024-08-09 10:18:11 +00:00
```bash
2024-10-22 09:31:13 +00:00
# Place in snowball deployment directory
wget -O /srv/deploy-backend/backend-deployment/configmaps/config/prod.toml https://git.vdb.to/cerc-io/testnet-laconicd-stack/raw/branch/main/ops/configs/backend-deployment.toml
2024-08-09 10:18:11 +00:00
```
2024-10-22 09:31:13 +00:00
* Setup private key and bond. If not already setup, execute the following commands in the directory containing `stage2-deployment`
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Create a new account and fetch the private key
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir stage2-deployment exec laconicd "laconicd keys add deploy"
# - address: laconic1yr758d5vkg28text073vlzdjdgd7ud6w729tww
...
export deployKey=$(laconic-so deployment --dir stage2-deployment exec laconicd "echo y | laconicd keys export deploy --keyring-backend test --unarmored-hex --unsafe")
# ...
# txhash: 262D380259AC06024F87C909EB0BF7814CEC26CDF527B003C4C10631E1DB5893
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Send tokens to this account
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir stage2-deployment exec laconicd "laconicd tx bank send alice laconic1yr758d5vkg28text073vlzdjdgd7ud6w729tww 1000000000000000000alnt --from alice --fees 200000alnt -y"
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Create a bond using this account
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry bond create --type alnt --quantity 1000000000000 --user-key $deployKey" | jq -r '.bondId'
# 15e5bc37c40f67adc9ab498fa3fa50b090770f9bb56b27d71714a99138df9a22
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Set bond id
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```bash
export bondId=15e5bc37c40f67adc9ab498fa3fa50b090770f9bb56b27d71714a99138df9a22
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Register authority. Execute the following commands in the directory containing `laconic-console-testnet2-deployment`
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Reserve an authority
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry authority reserve deploy-vaasl --txKey $deployKey"
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Obtain the auction ID
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry authority whois deploy-vaasl --txKey $deployKey"
# "auction": {
# "id": "73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1"
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Commit a bid using the auction ID. A reveal file will be generated
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry auction bid commit 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 5000000 alnt --chain-id laconic-testnet-2 --txKey $deployKey"
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# {"reveal_file":"/app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json"}
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Reveal a bid using the auction ID and the reveal file generated from the bid commit
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry auction bid reveal 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 /app/out/bafyreiewi4osqyvrnljwwcb36fn6sr5iidfpuznqkz52gxc5ztt3jt4zmy.json --chain-id laconic-testnet-2 --txKey $deployKey"
# {"success": true}
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Verify status after the auction ends. It should list a completed status and a winner
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```
laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry auction get 73e0b082a198c396009ce748804a9060c674a10045365d262c1584f99d2771c1 -txKey $deployKey"
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Set the authority using a bond ID.
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry authority bond set deploy-vaasl $bondId --txKey $deployKey"
# {"success": true}
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Verify the authority has been registered.
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir laconic-console-testnet2-deployment exec cli "laconic registry authority whois deploy-vaasl --txKey $deployKey"
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Update `/srv/snowball/snowball-deployment/data/config/prod.toml` . Replace `<redacted>` with your credentials. Use the `userKey` , `bondId` and `authority` that you set up
### Start
* Start the deployment:
2024-08-09 10:18:11 +00:00
```bash
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir backend-deployment start
2024-08-09 10:18:11 +00:00
```
2024-10-22 09:31:13 +00:00
* Check status:
2024-08-09 10:18:11 +00:00
```bash
2024-10-22 09:31:13 +00:00
# Follow logs for snowball container
laconic-so deployment --dir backend-deployment logs snowballtools-base-backend -f
2024-08-09 10:18:11 +00:00
```
2024-10-22 09:31:13 +00:00
< / details >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
< details open >
< summary > deploy-frontend< / summary >
## Deploy Frontend
* Source repo: < https: // git . vdb . to / cerc-io / snowballtools-base >
### Prerequisites
* Node.js
* Yarn
### Setup
* On your local machine, clone the `snowballtools-base` repo:
```bash
git clone git@git.vdb.to:cerc-io/snowballtools-base.git
```
* Install dependencies:
```bash
cd snowballtools-base
yarn install
```
* In the deployer package, create required env:
```bash
cd packages/deployer
cp .env.example .env
```
Set the required variables:
```bash
REGISTRY_BOND_ID=< bond-id >
DEPLOYER_LRN=lrn://vaasl-provider/deployers/webapp-deployer-api.apps.vaasl.io
AUTHORITY=vaasl
```
Note: The bond id should be set to the `vaasl` authority
* Update required laconic config. You can use the same `userKey` and `bondId` used for deploying backend:
```bash
# Replace < user-pk > and < bond-id >
cat < < EOF > config.yml
services:
registry:
rpcEndpoint: https://laconicd-sapo.laconic.com
gqlEndpoint: https://laconicd-sapo.laconic.com/api
userKey: < user-pk >
bondId: < bond-id >
chainId: laconic-testnet-2
gasPrice: 0.001alnt
EOF
```
Note: The `userKey` account should own the authority `vaasl`
### Run
* Run frontend deployment script:
```bash
./deploy-frontend.sh
```
Follow deployment logs on the deployer UI
2024-08-09 10:18:11 +00:00
< / details >
< details open >
2024-10-22 09:31:13 +00:00
< summary > stage2 laconicd< / summary >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
## stage2 laconicd
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / fixturenet-laconicd-stack / src / branch / main / stack-orchestrator / stacks / fixturenet-laconicd >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Source repo: < https: // git . vdb . to / cerc-io / laconicd >
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Target dir: `/srv/laconicd/stage2-deployment`
2024-08-09 10:18:11 +00:00
* Cleanup an existing deployment if required:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/laconicd
2024-08-09 10:18:11 +00:00
# Stop the deployment
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir stage2-deployment stop --delete-volumes
2024-08-09 10:18:11 +00:00
# Remove the deployment dir
2024-10-22 09:31:13 +00:00
sudo rm -rf stage2-deployment
2024-08-09 10:18:11 +00:00
# Remove the existing spec file
2024-10-22 09:31:13 +00:00
rm stage2-spec.yml
2024-08-09 10:18:11 +00:00
```
### Setup
2024-10-22 09:31:13 +00:00
* Create a tag for existing stage1 laconicd image:
2024-08-09 10:18:11 +00:00
```bash
2024-10-22 09:31:13 +00:00
docker tag cerc/laconicd:local cerc/laconicd-stage1:local
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Same as that for [stage0-laconicd ](#stage0-laconicd )
### Deployment
* Create a spec file for the deployment:
```bash
cd /srv/laconicd
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy init --output stage2-spec.yml
2024-08-09 10:18:11 +00:00
```
2024-10-22 09:31:13 +00:00
* Edit network in the spec file to map container ports to host ports:
2024-08-09 10:18:11 +00:00
```bash
2024-10-22 09:31:13 +00:00
# stage2-spec.yml
network:
ports:
laconicd:
- '6060'
- '127.0.0.1:36657:26657'
- '36656:26656'
- '127.0.0.1:3473:9473'
- '127.0.0.1:3090:9090'
- '127.0.0.1:3317:1317'
```
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
* Create a deployment from the spec file:
```bash
laconic-so --stack ~/cerc/fixturenet-laconicd-stack/stack-orchestrator/stacks/fixturenet-laconicd deploy create --spec-file stage2-spec.yml --deployment-dir stage2-deployment
2024-08-09 10:18:11 +00:00
```
2024-10-22 09:31:13 +00:00
### Start
* Follow [stage1-to-stage2.md ](./stage1-to-stage2.md ) to halt stage1 deployment, initialize the stage2 chain and start stage2 deployment
< / details >
< details open >
< summary > laconic-console-testnet2< / summary >
## laconic-console-testnet2
* Stack: < https: // git . vdb . to / cerc-io / testnet-laconicd-stack / src / branch / main / stack-orchestrator / stacks / laconic-console >
* Source repos:
* < https: // git . vdb . to / cerc-io / laconic-registry-cli >
* < https: // git . vdb . to / cerc-io / laconic-console >
* Target dir: `/srv/console/laconic-console-testnet2-deployment`
* Cleanup an existing deployment if required:
2024-08-09 10:18:11 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd /srv/console
2024-08-09 10:18:11 +00:00
2024-10-22 09:31:13 +00:00
# Stop the deployment
laconic-so deployment --dir laconic-console-testnet2-deployment stop --delete-volumes
# Remove the deployment dir
sudo rm -rf laconic-console-testnet2-deployment
# Remove the existing spec file
rm laconic-console-testnet2-spec.yml
```
### Setup
* Create tags for existing stage1 images:
```bash
docker tag cerc/laconic-console-host:local cerc/laconic-console-host-stage1:local
docker tag cerc/laconic-registry-cli:local cerc/laconic-registry-cli-stage1:local
2024-08-09 10:18:11 +00:00
```
2024-10-22 09:31:13 +00:00
* Same as that for [laconic-console ](#laconic-console )
2024-08-09 10:18:11 +00:00
### Deployment
* Create a spec file for the deployment:
```bash
cd /srv/console
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy init --output laconic-console-testnet2-spec.yml
2024-08-09 10:18:11 +00:00
```
* Edit network in the spec file to map container ports to host ports:
```bash
network:
ports:
2024-08-19 10:12:29 +00:00
console:
2024-10-22 09:31:13 +00:00
- '127.0.0.1:4002:80'
2024-08-09 10:18:11 +00:00
```
* Create a deployment from the spec file:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy create --spec-file laconic-console-testnet2-spec.yml --deployment-dir laconic-console-testnet2-deployment
2024-08-09 10:18:11 +00:00
```
* Update the configuration:
```bash
2024-10-22 09:31:13 +00:00
cat < < EOF > laconic-console-testnet2-deployment/config.env
2024-08-09 10:18:11 +00:00
# Laconicd (hosted) GQL endpoint
2024-10-23 07:25:32 +00:00
LACONIC_HOSTED_ENDPOINT=https://laconicd-sapo.laconic.com
2024-08-09 10:18:11 +00:00
EOF
```
### Start
* Start the deployment:
```bash
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir laconic-console-testnet2-deployment start
2024-08-09 10:18:11 +00:00
```
* Check status:
```bash
# List down the container
docker ps -a | grep console
# Follow logs for console container
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir laconic-console-testnet2-deployment logs console -f
2024-08-09 10:18:11 +00:00
```
2024-10-23 07:25:32 +00:00
* The laconic console can now be viewed at < https: // console-sapo . laconic . com >
2024-08-09 10:18:11 +00:00
< / details >
2024-10-30 10:16:28 +00:00
< details open >
2024-10-22 09:31:13 +00:00
< summary > Fixturenet Eth< / summary >
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
## Fixturenet Eth
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / fixturenet-eth-stacks >
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Target dir: `/srv/fixturenet-eth/fixturenet-eth-deployment`
2024-10-30 10:16:28 +00:00
* Cleanup an existing deployment if required:
```bash
2024-10-22 09:31:13 +00:00
cd /srv/fixturenet-eth
2024-10-30 10:16:28 +00:00
# Stop the deployment
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir fixturenet-eth-deployment stop --delete-volumes
2024-10-30 10:16:28 +00:00
# Remove the deployment dir
2024-10-22 09:31:13 +00:00
sudo rm -rf fixturenet-eth-deployment
2024-10-30 10:16:28 +00:00
```
### Setup
2024-10-22 09:31:13 +00:00
* Create a `fixturenet-eth` dir if not present already and cd into it
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
mkdir /srv/fixturenet-eth
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
cd /srv/fixturenet-eth
```
* Clone the stack repo:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/fixturenet-eth-stacks --pull
2024-10-30 10:16:28 +00:00
```
* Clone required repositories:
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-eth setup-repositories --pull
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove all repositories from that stack and re-run the command
# The repositories are located in $HOME/cerc by default
2024-10-30 10:16:28 +00:00
```
* Build the container images:
```bash
2024-10-22 09:31:13 +00:00
# Remove any older foundry image with `latest` tag
docker rmi ghcr.io/foundry-rs/foundry:latest
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-eth build-containers --force-rebuild
# If errors are thrown during build, old images used by this stack would have to be deleted
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* NOTE: this will take >10 mins depending on the specs of your machine, and **requires** 16GB of memory or greater.
* Remove any dangling Docker images (to clear up space):
```bash
docker image prune
```
* Create spec files for deployments, which will map the stack's ports and volumes to the host:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
laconic-so --stack ~/cerc/fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-eth deploy init --output fixturenet-eth-spec.yml
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* Configure ports:
* `fixturenet-eth-spec.yml`
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
```yml
...
network:
ports:
fixturenet-eth-bootnode-geth:
- '9898:9898'
- '30303'
fixturenet-eth-geth-1:
- '7545:8545'
- '7546:8546'
- '40000'
- '6060'
fixturenet-eth-lighthouse-1:
- '8001'
...
```
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Create deployments:
Once you've made any needed changes to the spec files, create deployments from them:
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so --stack ~/cerc/fixturenet-eth-stacks/stack-orchestrator/stacks/fixturenet-eth deploy create --spec-file fixturenet-eth-spec.yml --deployment-dir fixturenet-eth-deployment
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
### Run
* Start `fixturenet-eth-deployment` deployment:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir fixturenet-eth-deployment start
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
< / details >
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
< details open >
< summary > Nitro Contracts Deployment< / summary >
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
## Nitro Contracts Deployment
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / nitro-stack / src / branch / main / stack-orchestrator / stacks / nitro-contracts >
* Source repo: < https: // github . com / cerc-io / go-nitro >
* Target dir: `/srv/bridge/nitro-contracts-deployment`
* Cleanup an existing deployment if required:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd /srv/bridge
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Stop the deployment
laconic-so deployment --dir nitro-contracts-deployment stop --delete-volumes
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Remove the deployment dir
sudo rm -rf nitro-contracts-deployment
```
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
### Setup
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Switch to `testnet-ops/nitro-contracts-setup` directory on your local machine:
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
```bash
cd testnet-ops/nitro-contracts-setup
```
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Copy the `contract-vars-example.yml` vars file:
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
```bash
cp contract-vars.example.yml contract-vars.yml
```
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Edit [`contract-vars.yml` ](./contract-vars.yml ) and fill in the following values:
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
```bash
# RPC endpoint
geth_url: "https://fixturenet-eth.laconic.com"
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Chain ID (Fixturenet-eth: 1212)
geth_chain_id: "1212"
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Private key for a funded L1 account, to be used for contract deployment on L1
# Required since this private key will be utilized by both L1 and L2 nodes of the bridge
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
geth_deployer_pk: "888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218"
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Custom token to be deployed
token_name: "TestToken"
token_symbol: "TST"
initial_token_supply: "129600"
```
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Edit the `setup-vars.yml` to update the target directory:
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
```bash
...
nitro_directory: /srv/bridge
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Will create deployment at /srv/bridge/nitro-contracts-deployment
```
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
### Run
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Deploy nitro contracts on remote host by executing `deploy-contracts.yml` Ansible playbook on your local machine:
* Create a new `hosts.ini` file:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
cp ../hosts.example.ini hosts.ini
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* Edit the [`hosts.ini` ](./hosts.ini ) file to run the playbook on a remote machine:
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
```ini
[deployment_host]
< host_name > ansible_host=< target_ip > ansible_user=< ssh_user > ansible_ssh_common_args='-o ForwardAgent=yes'
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* Replace `<deployment_host>` with `nitro_host`
* Replace `<host_name>` with the alias of your choice
* Replace `<target_ip>` with the IP address or hostname of the target machine
* Replace `<ssh_user>` with the SSH username (e.g., dev, ubuntu)
* Verify that you are able to connect to the host using the following command:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
ansible all -m ping -i hosts.ini -k
# Expected output:
# < host_name > | SUCCESS => {
# "ansible_facts": {
# "discovered_interpreter_python": "/usr/bin/python3.10"
# },
# "changed": false,
# "ping": "pong"
# }
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* Execute the `deploy-contracts.yml` Ansible playbook for remote deployment:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
LANG=en_US.utf8 ansible-playbook -i hosts.ini deploy-contracts.yml --extra-vars='{ "target_host": "nitro_host"}' --user $USER -kK
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* Check logs for deployment on the remote machine:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd /srv/bridge
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Check the nitro contract deployments
laconic-so deployment --dir nitro-contracts-deployment logs nitro-contracts -f
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* To deploy a new token and transfer it to another account, refer to this [doc ](./nitro-token-ops.md )
2024-10-30 10:16:28 +00:00
< / details >
< details open >
2024-10-22 09:31:13 +00:00
< summary > Nitro Bridge< / summary >
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
## Nitro Bridge
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Stack: < https: // git . vdb . to / cerc-io / nitro-stack / src / branch / main / stack-orchestrator / stacks / bridge >
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Source repo: < https: // github . com / cerc-io / go-nitro >
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Target dir: `/srv/bridge/bridge-deployment`
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
* Cleanup an existing deployment if required:
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
```bash
cd /srv/bridge
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Stop the deployment
laconic-so deployment --dir bridge-deployment stop --delete-volumes
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Remove the deployment dir
sudo rm -rf bridge-deployment
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
### Setup
* Execute the following command on deployment machine to get the deployed Nitro contract addresses along with the asset address:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd /srv/bridge
laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "cat /app/deployment/nitro-addresses.json"
# Expected output:
# {
# "1212": [
# {
# "name": "geth",
# "chainId": "1212",
# "contracts": {
# "ConsensusApp": {
# "address": "0xC98aD0B41B9224dad0605be32A9241dB9c67E2e8"
# },
# "NitroAdjudicator": {
# "address": "0x7C22fdA703Cdf09eB8D3B5Adc81F723526713D0e"
# },
# "VirtualPaymentApp": {
# "address": "0x778e4e6297E8BF04C67a20Ec989618d72eB4a19E"
# },
# "TestToken": {
# "address": "0x02ebfB2706527C7310F2a7d9098b2BC61014C5F2"
# }
# }
# }
# ]
# }
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* Switch to `testnet-ops/nitro-bridge-setup` directory on your local machine:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd testnet-ops/nitro-bridge-setup
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* Create the required vars file:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
cp bridge-vars.example.yml bridge-vars.yml
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* Edit `bridge-vars.yml` with required values:
2024-10-30 10:16:28 +00:00
```bash
2024-10-22 09:31:13 +00:00
# WS endpoint
nitro_chain_url: "wss://fixturenet-eth.laconic.com"
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Private key for bridge Nitro address
nitro_sc_pk: ""
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Private key should correspond to a funded account on L1 and this account must own the Nitro contracts
# It also needs to hold L1 tokens to fund Nitro channels
nitro_chain_pk: "888814df89c4358d7ddb3fa4b0213e7331239a80e1f013eaa7b2deca2a41a218"
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
# Deployed Nitro contract addresses
na_address: ""
vpa_address: ""
ca_address: ""
2024-10-30 10:16:28 +00:00
```
2024-10-22 09:31:13 +00:00
* Edit the `setup-vars.yml` to update the target directory:
2024-10-30 10:16:28 +00:00
2024-10-22 09:31:13 +00:00
```bash
...
nitro_directory: /srv/bridge
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
# Will create deployment at /srv/bridge/bridge-deployment
```
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
### Run
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
* Start the bridge on remote host by executing `run-nitro-bridge.yml` Ansible playbook on your local machine:
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
* Create a new `hosts.ini` file:
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
```bash
cp ../hosts.example.ini hosts.ini
```
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
* Edit the [`hosts.ini` ](./hosts.ini ) file to run the playbook on a remote machine:
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
```ini
[deployment_host]
< host_name > ansible_host=< target_ip > ansible_user=< ssh_user > ansible_ssh_common_args='-o ForwardAgent=yes'
```
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
* Replace `<deployment_host>` with `nitro_host`
* Replace `<host_name>` with the alias of your choice
* Replace `<target_ip>` with the IP address or hostname of the target machine
* Replace `<ssh_user>` with the SSH username (e.g., dev, ubuntu)
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
* Verify that you are able to connect to the host using the following command:
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
```bash
ansible all -m ping -i hosts.ini -k
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
# Expected output:
# < host_name > | SUCCESS => {
# "ansible_facts": {
# "discovered_interpreter_python": "/usr/bin/python3.10"
# },
# "changed": false,
# "ping": "pong"
# }
```
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
* Execute the `run-nitro-bridge.yml` Ansible playbook for remote deployment:
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
```bash
LANG=en_US.utf8 ansible-playbook -i hosts.ini run-nitro-bridge.yml --extra-vars='{ "target_host": "nitro_host"}' --user $USER -kK
```
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
* Check logs for deployments on the remote machine:
2024-10-17 11:05:58 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd /srv/bridge
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
# Check bridge logs, ensure that the node is running
laconic-so deployment --dir bridge-deployment logs nitro-bridge -f
2024-10-17 11:05:58 +00:00
```
2024-10-22 09:31:13 +00:00
* Create Nitro node config for users:
2024-10-17 11:05:58 +00:00
```bash
2024-10-22 09:31:13 +00:00
cd /srv/bridge
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
# Create required variables
GETH_CHAIN_ID="1212"
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
export NA_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.NitroAdjudicator.address' /app/deployment/nitro-addresses.json")
export CA_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.ConsensusApp.address' /app/deployment/nitro-addresses.json")
export VPA_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.VirtualPaymentApp.address' /app/deployment/nitro-addresses.json")
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
export BRIDGE_NITRO_ADDRESS=$(laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-node-info -p 4005 -h nitro-bridge" | jq -r '.SCAddress')
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
export BRIDGE_PEER_ID=$(laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-node-info -p 4005 -h nitro-bridge" | jq -r '.MessageServicePeerId')
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
export L1_BRIDGE_MULTIADDR="/dns4/bridge.laconic.com/tcp/3005/p2p/$BRIDGE_PEER_ID"
export L2_BRIDGE_MULTIADDR="/dns4/bridge.laconic.com/tcp/3006/p2p/$BRIDGE_PEER_ID"
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
# Create the required config files
cat < < EOF > nitro-node-config.yml
nitro_chain_url: "wss://fixturenet-eth.laconic.com"
na_address: "$NA_ADDRESS"
ca_address: "$CA_ADDRESS"
vpa_address: "$VPA_ADDRESS"
bridge_nitro_address: "$BRIDGE_NITRO_ADDRESS"
nitro_l1_bridge_multiaddr: "$L1_BRIDGE_MULTIADDR"
nitro_l2_bridge_multiaddr: "$L2_BRIDGE_MULTIADDR"
EOF
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq --arg chainId \"$GETH_CHAIN_ID\" '{
(\$chainId): [
{
\"name\": .[\$chainId][0].name,
\"chainId\": .[\$chainId][0].chainId,
\"contracts\": (
.[\$chainId][0].contracts
| to_entries
| map(select(.key | in({\"ConsensusApp\":1, \"NitroAdjudicator\":1, \"VirtualPaymentApp\":1}) | not))
| from_entries
)
}
]
}' /app/deployment/nitro-addresses.json" > assets.json
2024-10-17 11:05:58 +00:00
```
2024-10-22 09:31:13 +00:00
* The required config files should be generated at `/srv/bridge/nitro-node-config.yml` and `/srv/bridge/assets.json`
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
* Check in the generated files at locations `ops/stage2/nitro-node-config.yml` and `ops/stage2/assets.json` within this repository respectively
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
* List down L2 channels created by the bridge:
2024-10-17 11:05:58 +00:00
2024-10-22 09:31:13 +00:00
```bash
laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-all-l2-channels -p 4005 -h nitro-bridge"
```
2024-10-17 11:05:58 +00:00
< / details >
2024-08-09 10:18:11 +00:00
## Domains / Port Mappings
```bash
2024-09-12 13:31:17 +00:00
# Machine 1
2024-10-23 07:25:32 +00:00
# LORO testnet
https://laconicd.laconic.com -> 26657
https://laconicd.laconic.com/api -> 9473/api
https://laconicd.laconic.com/console -> 9473/console
https://laconicd.laconic.com/graphql -> 9473/graphql
https://faucet.laconic.com -> 4000
https://loro-signup.laconic.com -> 3000
https://wallet.laconic.com -> 5000
https://loro-console.laconic.com -> 4001
Open p2p ports:
26656
# SAPO testnet
https://laconicd-sapo.laconic.com -> 36657
https://laconicd-sapo.laconic.com/api -> 3473/api
https://laconicd-sapo.laconic.com/console -> 3473/console
https://laconicd-sapo.laconic.com/graphql -> 3473/graphql
https://console-sapo.laconic.com -> 4002
Open p2p ports:
36656
2024-10-22 08:01:41 +00:00
2024-09-12 13:31:17 +00:00
# Machine 2
2024-10-21 11:07:01 +00:00
https://sepolia.laconic.com -> 8545
wss://sepolia.laconic.com -> 8546
https://fixturenet-eth.laconic.com -> 7545
wss://fixturenet-eth.laconic.com -> 7546
2024-09-12 13:31:17 +00:00
bridge.laconic.com
Open ports:
3005 (L1 side)
3006 (L2 side)
2024-08-09 10:18:11 +00:00
```