Add instructions to update deployments (#18)

Part of https://www.notion.so/Create-stacks-for-mainnet-1f2a6b22d4728034be4be2c51decf94e

Co-authored-by: Shreerang Kale <shreerangkale@gmail.com>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Reviewed-on: #18
Co-authored-by: shreerang <shreerang@noreply.git.vdb.to>
Co-committed-by: shreerang <shreerang@noreply.git.vdb.to>
This commit is contained in:
shreerang 2025-06-13 14:10:07 +00:00 committed by nabarun
parent a3738cb036
commit de553ebcd3
5 changed files with 599 additions and 3 deletions

View File

@ -4,10 +4,18 @@
- It allows you to export SAPO testnet state and start mainnet nodes - It allows you to export SAPO testnet state and start mainnet nodes
## Mainnet OPS
- To launch Laconic mainnet, follow these steps: - To launch Laconic mainnet, follow these steps:
- **Run the First Validator Node:** Begin by setting up and running the initial validator node as detailed in [run-first-validator.md](docs/run-first-validator.md) - **Run the First Validator Node:** Begin by setting up and running the initial validator node as detailed in [run-first-validator.md](docs/run-first-validator.md)
- **Deploy Cosmos Multisig App:** Integrate and run the Cosmos Multisig app using the playbook available at [cosmos-multisig-app playbook](./playbooks/cosmos-multisig-app/README.md) - **Deploy Cosmos Multisig App:** Integrate and run the Cosmos Multisig app using the playbook available at [cosmos-multisig-app playbook](./playbooks/cosmos-multisig-app/README.md)
- **Run Subsequent Validator Nodes:** Run subsequent validator nodes by following the instructions in [run-validator.md](docs/run-validator.md) - To migrate existing deployments from SAPO testnet to mainnet, refer to [update-deployments.md](docs/update-deployments.md)
## Join Mainnet
- **Run A Validator Node:** Follow steps in [run-validator.md](docs/run-validator.md) to run a mainnet validator node
- **Update Service Provider:** Follow steps in [update-service-provider.md](docs/update-service-provider.md) to migrate your service provider from SAPO testnet to mainnet

View File

@ -0,0 +1,18 @@
# Domains / Port Mappings
```bash
# Machine running the mainnet node should have following domain port mappings
https://laconicd-mainnet.laconic.com -> 26657
https://laconicd-mainnet.laconic.com/api -> 9473/api
https://laconicd-mainnet.laconic.com/console -> 9473/console
https://laconicd-mainnet.laconic.com/graphql -> 9473/graphql
Open p2p port:
26656
Open port for TMKMS:
26659
# Console app deployment already exists, point new domain to following port
https://console-mainnet.laconic.com -> 4001
```

View File

@ -8,6 +8,8 @@
- Machine 2: Where the mainnet first validator node is to be setup - Machine 2: Where the mainnet first validator node is to be setup
- Check [domain port mappings](./domain-port-mappings.md) to ensure that required domains are pointing to correct ports
- Machine 3: Where the genesis file is to be generated - Machine 3: Where the genesis file is to be generated
- Install `zstd` using `sudo apt install zstd` - Install `zstd` using `sudo apt install zstd`
@ -220,7 +222,7 @@
priv_validator_key_file_path: "</path/to/priv_validator_key.json>" priv_validator_key_file_path: "</path/to/priv_validator_key.json>"
# Set the IP address of the machine where the laconicd node is setup # Set the IP address of the machine where the laconicd node is setup
node_ip: "<NODE_PUBLIC_IP_ADDRESS>" node_ip: "laconicd-mainnet.laconic.com"
# Set the port of the laconicd node # Set the port of the laconicd node
node_port: "26659" node_port: "26659"
@ -378,7 +380,7 @@
- Get your node's address by running following command in the machine where the mainnet node is running (machine 2): - Get your node's address by running following command in the machine where the mainnet node is running (machine 2):
```bash ```bash
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'echo $(laconicd cometbft show-node-id)@YOUR_PUBLIC_IP_ADDRESS:26656' laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR exec laconicd 'echo $(laconicd cometbft show-node-id)@laconicd-mainnet.laconic.com:26656'
``` ```
- Add your node's address to [node-addresses.yml](./node-addresses.yml) - Add your node's address to [node-addresses.yml](./node-addresses.yml)

390
docs/update-deployments.md Normal file
View File

@ -0,0 +1,390 @@
# Update Deployments
Instructions to reset / update the deployments
## Login
* Log in as `dev` user on the deployments VM
* All the deployments are placed in the `/srv` directory:
```bash
cd /srv
```
## laconic-wallet-web
* Deployment dir: `/srv/wallet/laconic-wallet-web-deployment`
* If code has changed, fetch and build with updated source code:
```bash
# testnet-onboarding-app source
cd ~/cerc/laconic-wallet-web
# Pull latest changes
git pull
# Checkout to the latest tag (https://git.vdb.to/LaconicNetwork/laconic-wallet-web/tags)
git checkout <tag>
# Rebuild the containers
cd /srv/wallet
laconic-so --stack ~/cerc/laconic-wallet-web/stack/stack-orchestrator/stack/laconic-wallet-web build-containers --force-rebuild
```
* Update the configuration `laconic-wallet-web-deployment/config.env`:
```bash
# URL for the deploy app so that wallet can work with it
CERC_ALLOWED_URLS=https://deploy.laconic.com,https://store.laconic.com
# RPC URL for the mainnet node
CERC_LACONICD_RPC_URL="https://laconicd-mainnet.laconic.com"
```
* Restart the deployment:
```bash
laconic-so deployment --dir laconic-wallet-web-deployment stop
laconic-so deployment --dir laconic-wallet-web-deployment start
# 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
```
* The web wallet can now be viewed at <https://wallet.laconic.com>
* Add `laconic-mainnet` network by clicking on `Add Network` and filling in required details
## laconic-console
* Deployment dir: `/srv/console/laconic-console-deployment`
* If code has changed, fetch and build with updated source code:
```bash
# testnet-onboarding-app source
cd ~/cerc/laconic-console
# Pull latest changes
git pull
# Checkout to the latest tag (https://git.vdb.to/cerc-io/laconic-console/tags)
git checkout <tag>
# Rebuild the containers
cd /srv/console
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers --force-rebuild
```
* Update the configuration, if required in `laconic-console-deployment/config.env`:
```bash
# Laconicd (hosted) GQL endpoint
LACONIC_HOSTED_ENDPOINT=https://laconicd-mainnet.laconic.com/graphql
```
* Restart the deployment:
```bash
laconic-so deployment --dir laconic-console-deployment stop
laconic-so deployment --dir laconic-console-deployment start
# Follow logs for console container
laconic-so deployment --dir laconic-console-deployment logs console -f
```
* The laconic console can now be viewed at <https://console-mainnet.laconic.com>
---
## Laconic Shopify
* Deployment dir: `/srv/shopify/laconic-shopify-deployment`
* If code has changed, fetch and build with updated source code:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify setup-repositories --git-ssh --pull
# rebuild containers
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-shopify build-containers --force-rebuild
```
* Update the configuration if required in `laconic-shopify-deployment/config.env`:
```bash
# laconicd RPC endpoint
CERC_LACONICD_RPC_ENDPOINT=https://laconicd-mainnet.laconic.com
# laconicd chain id
CERC_LACONICD_CHAIN_ID=laconic-mainnet
```
* Restart the deployment:
```bash
cd /srv/shopify
laconic-so deployment --dir laconic-shopify-deployment stop
laconic-so deployment --dir laconic-shopify-deployment start
```
## Webapp Deployer
* Fetch latest stack repos:
```bash
# In directory where webapp-deployer deployment was created
laconic-so --stack webapp-deployer-backend setup-repositories --pull
# Confirm latest commit hash in the ~/cerc/webapp-deployment-status-api repo
```
* Rebuild container images if there are any changes:
```bash
laconic-so --stack webapp-deployer-backend build-containers --force-rebuild
```
* Push stack images to the container registry:
* Login to the container registry:
```bash
# Set required variables
CONTAINER_REGISTRY_URL=container-registry.apps.vaasl.io
# For credentials: "cat /srv/service-provider/webapp-deployer/config.env | grep IMAGE_REGISTRY"
CONTAINER_REGISTRY_USERNAME=
CONTAINER_REGISTRY_PASSWORD=
# login to container registry
docker login $CONTAINER_REGISTRY_URL --username $CONTAINER_REGISTRY_USERNAME --password $CONTAINER_REGISTRY_PASSWORD
# WARNING! Using --password via the CLI is insecure. Use --password-stdin.
# WARNING! Your password will be stored unencrypted in /home/dev2/.docker/config.json.
# Configure a credential helper to remove this warning. See
# https://docs.docker.com/engine/reference/commandline/login/#credential-stores
# Login Succeeded
```
* Push images:
```bash
laconic-so deployment --dir webapp-deployer push-images
```
* Update deployer laconic registry config (`webapp-deployer/data/config/laconic.yml`) with new endpoints:
```bash
services:
registry:
rpcEndpoint: "https://laconicd-mainnet.laconic.com"
gqlEndpoint: "https://laconicd-mainnet.laconic.com/api"
userKey: "<userKey>"
bondId: "<bondId>"
chainId: laconic-mainnet
gasPrice: 0.001alnt
```
Note: Existing `userKey` and `bondId` can be used since they are carried over from SAPO testnet to mainnet
* Update any deployer config (`webapp-deployer/config.env`) if required
* Start the webapp deployer:
```bash
laconic-so deployment --dir webapp-deployer start
```
* Get the webapp-deployer pod id:
```bash
laconic-so deployment --dir webapp-deployer ps
# Expected output
# Running containers:
# id: default/laconic-096fed46af974a47-deployment-644db859c7-snbq6, name: laconic-096fed46af974a47-deployment-644db859c7-snbq6, ports: 10.42.2.11:9555->9555
# Set pod id
export POD_ID=
# Example:
# export POD_ID=laconic-096fed46af974a47-deployment-644db859c7-snbq6
```
* Copy over GPG keys files to the webapp-deployer container:
```bash
kubie ctx default
# Copy the GPG key files to the pod
kubectl cp <path-to-your-gpg-private-key> $POD_ID:/app
kubectl cp <path-to-your-gpg-public-key> $POD_ID:/app
# Required everytime you stop and start the deployer
```
* Check logs:
```bash
# Deployer
kubectl logs -f $POD_ID
# Deployer auction handler
kubectl logs -f $POD_ID -c cerc-webapp-auction-handler
```
* Update deployer UI config (`webapp-ui/config.env`):
```bash
# URL of the laconic console
LACONIC_HOSTED_CONFIG_app_console_link=https://console-mainnet.laconic.com
```
* Start the webapp UI:
```bash
laconic-so deployment --dir webapp-ui start
```
* Check logs
```bash
laconic-so deployment --dir webapp-ui logs webapp
```
## Deploy Backend
* Deployment dir: `/srv/deploy-backend/laconic-backend-deployment`
* If code has changed, fetch and build with updated source code:
```bash
laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend setup-repositories --git-ssh --pull
# rebuild containers
laconic-so --stack ~/cerc/snowballtools-base-api-stack/stack-orchestrator/stacks/snowballtools-base-backend build-containers --force-rebuild
```
* Push updated images to the container registry:
```bash
cd /srv/deploy-backend
# login to container registry
CONTAINER_REGISTRY_URL=container-registry.apps.vaasl.io
# For credentials: "cat /srv/service-provider/webapp-deployer/config.env | grep IMAGE_REGISTRY"
CONTAINER_REGISTRY_USERNAME=
CONTAINER_REGISTRY_PASSWORD=
docker login $CONTAINER_REGISTRY_URL --username $CONTAINER_REGISTRY_USERNAME --password $CONTAINER_REGISTRY_PASSWORD
# Push backend images
laconic-so deployment --dir laconic-backend-deployment push-images
```
* Update the configuration if required in `laconic-backend-deployment/configmaps/config/prod.toml`:
```toml
...
[registryConfig]
fetchDeploymentRecordDelay = 5000
checkAuctionStatusDelay = 5000
restEndpoint = "https://laconicd-mainnet.laconic.com"
gqlEndpoint = "https://laconicd-mainnet.laconic.com/api"
chainId = "laconic-mainnet"
privateKey = "<private-key>"
bondId = "<bond-id>"
authority = "laconic-deploy"
[registryConfig.fee]
gasPrice = "0.001alnt"
...
```
* Restart the deployment:
```bash
laconic-so deployment --dir laconic-backend-deployment stop
laconic-so deployment --dir laconic-backend-deployment start
```
## 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=laconic-deploy
```
Note: The bond id should be set to the `laconic-deploy` 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-mainnet.laconic.com
gqlEndpoint: https://laconicd-mainnet.laconic.com/api
userKey: <user-pk>
bondId: <bond-id>
chainId: laconic-mainnet
gasPrice: 0.001alnt
EOF
```
Note: The `userKey` account should own the authority `laconic-deploy`
### Run
* Run frontend deployment script:
```bash
./deploy-frontend.sh
```
Follow deployment logs on the deployer UI
* On a successful deployment, the frontend can be viewed at <https://deploy.laconic.com>

View File

@ -0,0 +1,178 @@
# Update Service Provider
## Prerequisites
A Laconic mainnet node (see [run-validator.md](./run-validator.md))
## Stop services
* Stop laconic-console deployment:
```bash
# In directory where laconic-console deployment was created
laconic-so deployment --dir laconic-console-deployment stop
```
* Stop webapp deployer:
```bash
# In directory where webapp-deployer deployment was created
laconic-so deployment --dir webapp-deployer stop
laconic-so deployment --dir webapp-ui stop
```
## Update laconic console
* Update the console config (`laconic-console-deployment/config.env`) if required:
```bash
# CLI configuration
# laconicd RPC endpoint (can be pointed to your node)
CERC_LACONICD_RPC_ENDPOINT=https://laconicd-mainnet.laconic.com
# laconicd GQL endpoint (can be pointed to your node)
CERC_LACONICD_GQL_ENDPOINT=https://laconicd-mainnet.laconic.com/api
CERC_LACONICD_CHAIN_ID=laconic-mainnet
# Console configuration
# Laconicd (hosted) GQL endpoint (can be pointed to your node)
LACONIC_HOSTED_ENDPOINT=https://laconicd-mainnet.laconic.com
```
* Update any other config values as required
* Start the deployment:
```bash
laconic-so deployment --dir laconic-console-deployment start
```
* Use the cli service for any registry CLI operations:
```bash
# Example
laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry status"
```
## Check authority and deployer record
* The state has been carried over from SAPO testnet to the mainnet, if you had authority and records on the SAPO testnet, they should be present on mainnet as well
* Check authority:
```bash
# In directory where laconic-console deployment was created
AUTHORITY=<your-authority>
laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry authority whois $AUTHORITY"
```
* Check deployer record:
```bash
PAYMENT_ADDRESS=<your-deployers-payment-address>
laconic-so deployment --dir laconic-console-deployment exec cli "laconic registry record list --all --type WebappDeployer --paymentAddress $PAYMENT_ADDRESS"
```
## Update webapp deployer
* Update deployer laconic registry config (`webapp-deployer/data/config/laconic.yml`) with new endpoints:
```bash
services:
registry:
rpcEndpoint: "<your-mainnet-rpc-endpoint>" # Eg. https://laconicd-mainnet.laconic.com
gqlEndpoint: "<your-mainnet-gql-endpoint>" # Eg. https://laconicd-mainnet.laconic.com/api
userKey: "<userKey>"
bondId: "<bondId"
chainId: laconic-mainnet
gasPrice: 0.001alnt
```
Note: Existing `userKey` and `bondId` can be used since they are carried over from SAPO testnet to mainnet
* Update deployer config (`webapp-deployer/config.env`) if required:
```bash
# Update the deployer LRN if it has changed
export LRN=
# Min payment to require for performing deployments
export MIN_REQUIRED_PAYMENT=9500
# Handle deployment auction requests
export HANDLE_AUCTION_REQUESTS=true
# Amount that the deployer will bid on deployment auctions
export AUCTION_BID_AMOUNT=9500
```
* Start the webapp deployer:
```bash
laconic-so deployment --dir webapp-deployer start
```
* Get the webapp-deployer pod id:
```bash
laconic-so deployment --dir webapp-deployer ps
# Expected output
# Running containers:
# id: default/laconic-096fed46af974a47-deployment-644db859c7-snbq6, name: laconic-096fed46af974a47-deployment-644db859c7-snbq6, ports: 10.42.2.11:9555->9555
# Set pod id
export POD_ID=
# Example:
# export POD_ID=laconic-096fed46af974a47-deployment-644db859c7-snbq6
```
* Copy over GPG keys files to the webapp-deployer container:
```bash
kubie ctx default
# Copy the GPG key files to the pod
kubectl cp <path-to-your-gpg-private-key> $POD_ID:/app
kubectl cp <path-to-your-gpg-public-key> $POD_ID:/app
# Required everytime you stop and start the deployer
```
* Check logs:
```bash
# Deployer
kubectl logs -f $POD_ID
# Deployer auction handler
kubectl logs -f $POD_ID -c cerc-webapp-auction-handler
```
* Update deployer UI config (`webapp-ui/config.env`):
```bash
# URL of the webapp deployer backend API
# eg: https://webapp-deployer-api.pwa.laconic.com
LACONIC_HOSTED_CONFIG_app_api_url=
# URL of the laconic console
# eg: https://console-mainnet.laconic.com
LACONIC_HOSTED_CONFIG_app_console_link=
```
* Start the webapp UI:
```bash
laconic-so deployment --dir webapp-ui start
```
* Check logs
```bash
laconic-so deployment --dir webapp-ui logs webapp
```