Add instructions for multisig app usage #21
38
README.md
38
README.md
@ -19,3 +19,41 @@
|
|||||||
- **Run A Validator Node:** Follow steps in [run-validator.md](docs/run-validator.md) to run a mainnet validator node
|
- **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
|
- **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
|
||||||
|
|
||||||
|
## Multisig App
|
||||||
|
|
||||||
|
- Usage guide is available at [multisig-usage.md](./playbooks/cosmos-multisig-app/multisig-usage.md)
|
||||||
|
|
||||||
|
## Configure Wallet for Mainnet
|
||||||
|
|
||||||
|
- To use <https://deploy.laconic.com>, you need to add `laconic-mainnet` network in your wallet
|
||||||
|
|
||||||
|
- Go to <https://wallet.laconic.com>
|
||||||
|
|
||||||
|
- If the wallet has not been initialized, click on `Create Wallet` and create a new wallet
|
||||||
|
|
||||||
|
- Click on `Add Network` and filling in required details:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Set network type
|
||||||
|
Network Type: COSMOS
|
||||||
|
|
||||||
|
# Chain ID of the network
|
||||||
|
Chain ID: laconic-mainnet
|
||||||
|
|
||||||
|
# Name of the network
|
||||||
|
Network Name: Laconic Mainnet
|
||||||
|
|
||||||
|
# RPC endpoint of the mainnet node
|
||||||
|
New RPC URL: https://laconicd-mainnet.laconic.com
|
||||||
|
|
||||||
|
# Coin type
|
||||||
|
Coin Type: 118
|
||||||
|
|
||||||
|
# Address prefix
|
||||||
|
Address Prefix: laconic
|
||||||
|
|
||||||
|
# Native denom and gas price
|
||||||
|
Native denom: alnt
|
||||||
|
Gas Price: 0.001alnt
|
||||||
|
```
|
||||||
|
@ -19,6 +19,11 @@
|
|||||||
"coinDenom": "ALNT",
|
"coinDenom": "ALNT",
|
||||||
"coinMinimalDenom": "alnt",
|
"coinMinimalDenom": "alnt",
|
||||||
"coinDecimals": 0
|
"coinDecimals": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"coinDenom": "ALPS",
|
||||||
|
"coinMinimalDenom": "alps",
|
||||||
|
"coinDecimals": 0
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"feeCurrencies": [
|
"feeCurrencies": [
|
||||||
@ -39,7 +44,6 @@
|
|||||||
"coinDecimals": 0
|
"coinDecimals": 0
|
||||||
},
|
},
|
||||||
"features": [
|
"features": [
|
||||||
"stargate",
|
"stargate"
|
||||||
"ibc-transfer"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -15,4 +15,7 @@ Open port for TMKMS:
|
|||||||
|
|
||||||
# Console app deployment already exists, point new domain to following port
|
# Console app deployment already exists, point new domain to following port
|
||||||
https://console-mainnet.laconic.com -> 4001
|
https://console-mainnet.laconic.com -> 4001
|
||||||
|
|
||||||
|
# Cosmos Multisig App
|
||||||
|
https://multisig.laconic.com -> 7000
|
||||||
```
|
```
|
||||||
|
@ -91,6 +91,11 @@
|
|||||||
|
|
||||||
- Copy over the `priv_validator_key.json` located at `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json` to the machine where the TMKMS service is to be setup (machine 4)
|
- Copy over the `priv_validator_key.json` located at `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json` to the machine where the TMKMS service is to be setup (machine 4)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Example command to transfer file from machine 2 to machine 4 (run on machine 2)
|
||||||
|
scp -C $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json <user>@<machine-ip-address>:<absolute-path-to-desired-destination-directory>
|
||||||
|
```
|
||||||
|
|
||||||
## Setup TMKMS
|
## Setup TMKMS
|
||||||
|
|
||||||
- For integrating TMKMS with laconicd, follow steps below in the machine where the TMKMS service is to be setup (machine 4)
|
- For integrating TMKMS with laconicd, follow steps below in the machine where the TMKMS service is to be setup (machine 4)
|
||||||
@ -112,10 +117,16 @@
|
|||||||
|
|
||||||
- Run the following steps in machine where the testnet node is already running (machine 1)
|
- Run the following steps in machine where the testnet node is already running (machine 1)
|
||||||
|
|
||||||
|
- Export the testnet deployment directory as environment variable:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export TESTNET_DEPLOYMENT_DIR=<absolute/path/to/testnet/deployment>
|
||||||
|
```
|
||||||
|
|
||||||
- Get your private key from testnet deployment:
|
- Get your private key from testnet deployment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so deployment --dir <testnet-deployment-dir> exec laconicd "laconicd keys export <key-name> --unarmored-hex --unsafe --keyring-backend test"
|
laconic-so deployment --dir $TESTNET_DEPLOYMENT_DIR exec laconicd "laconicd keys export <key-name> --unarmored-hex --unsafe --keyring-backend test"
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: Store this key securely as it is needed in later steps
|
NOTE: Store this key securely as it is needed in later steps
|
||||||
@ -123,31 +134,29 @@
|
|||||||
- Stop the node for SAPO testnet:
|
- Stop the node for SAPO testnet:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so deployment --dir <testnet-deployment-dir> stop
|
laconic-so deployment --dir $TESTNET_DEPLOYMENT_DIR stop
|
||||||
```
|
```
|
||||||
|
|
||||||
- Run script to export state from testnet chain:
|
- Run script to export state from testnet chain:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
~/cerc/laconicd-stack/scripts/export-testnet-state.sh <absolute-path-to-testnet-deployment>
|
~/cerc/laconicd-stack/scripts/export-testnet-state.sh $TESTNET_DEPLOYMENT_DIR
|
||||||
```
|
```
|
||||||
|
|
||||||
- The compressed zst file will be generated at `<absolute-path-to-testnet-deployment>/export/testnet-state.zst`
|
- The compressed zst file will be generated at `$TESTNET_DEPLOYMENT_DIR/export/testnet-state.zst`
|
||||||
|
|
||||||
## Generate mainnet genesis file
|
## Generate mainnet genesis file
|
||||||
|
|
||||||
- Run the following steps in machine where [the genesis file is to be generated (machine 3)](#build-laconicd-to-generate-genesis-file)
|
- Run the following steps in machine where [the genesis file is to be generated (machine 3)](#build-laconicd-to-generate-genesis-file)
|
||||||
|
|
||||||
- Copy over compressed `testnet-state.zst` file to target machine
|
|
||||||
|
|
||||||
- Set envs:
|
- Set envs:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Path where exported testnet state JSON file will be created
|
# File path where exported testnet state JSON file will be created
|
||||||
export EXPORTED_STATE_PATH=<absolute-path-to-be-exported-testnet-state-json>
|
export EXPORTED_STATE_PATH=<absolute/path/to/testnet-state.json>
|
||||||
|
|
||||||
# Path where LPS distribution JSON file will be created
|
# File path where LPS distribution JSON file will be created
|
||||||
export LPS_DISTRIBUTION_PATH=<absolute-path-to-be-generated-distribution-json>
|
export LPS_DISTRIBUTION_PATH=<absolute/path/to/distribution.json>
|
||||||
|
|
||||||
export EARLY_SUPPORTS_ACC_ADDR=<account-address-controlled-by-laconic-foundation>
|
export EARLY_SUPPORTS_ACC_ADDR=<account-address-controlled-by-laconic-foundation>
|
||||||
|
|
||||||
@ -155,13 +164,20 @@
|
|||||||
export DATA_DIRECTORY=
|
export DATA_DIRECTORY=
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Copy over the compressed `testnet-state.zst` file:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Example command to transfer file from machine 1 to machine 3
|
||||||
|
scp -C <user>@<machine-ip-address>:<absolute-path-to-testnet-deployment>/export/testnet-state.zst <absolute-path-to-compressed-file>
|
||||||
|
```
|
||||||
|
|
||||||
- Extract the testnet-state JSON file:
|
- Extract the testnet-state JSON file:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
zstd -dc <path-to-compressed-file>/testnet-state.zst > $EXPORTED_STATE_PATH
|
zstd -dc <absolute-path-to-compressed-file>/testnet-state.zst > $EXPORTED_STATE_PATH
|
||||||
|
|
||||||
# Remove zst folder
|
# Remove zst folder
|
||||||
rm -rf <path-to-compressed-file>/testnet-state.zst
|
rm -rf <absolute-path-to-compressed-file>/testnet-state.zst
|
||||||
```
|
```
|
||||||
|
|
||||||
- Generate LPS lockup distribution JSON file
|
- Generate LPS lockup distribution JSON file
|
||||||
@ -291,6 +307,8 @@
|
|||||||
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR logs laconicd -f
|
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR logs laconicd -f
|
||||||
```
|
```
|
||||||
|
|
||||||
|
NOTE: The node takes a long time to start generating blocks `~30 seconds`
|
||||||
|
|
||||||
- Verify that validator and TMKMS pubkeys match:
|
- Verify that validator and TMKMS pubkeys match:
|
||||||
|
|
||||||
- Get validator pubkey on chain
|
- Get validator pubkey on chain
|
||||||
@ -371,6 +389,54 @@
|
|||||||
|
|
||||||
- Update `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/config.env` with required values
|
- Update `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/config.env` with required values
|
||||||
|
|
||||||
|
- Start the node deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR start
|
||||||
|
```
|
||||||
|
|
||||||
|
## Rebuild Images
|
||||||
|
|
||||||
|
- Follow these steps to rebuild the images for TMKMS and node in case of any code changes
|
||||||
|
|
||||||
|
### TMKMS
|
||||||
|
|
||||||
|
- Run these steps in the machine where the TMKMS service is setup (machine 4)
|
||||||
|
|
||||||
|
- Stop the TMKMS deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir $DATA_DIRECTORY/tmkms-deployment stop
|
||||||
|
```
|
||||||
|
|
||||||
|
- Run ansible playbook to rebuild the TMKMS image:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
BUILD_ONLY=true ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/setup-tmkms.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
- Start the TMKMS deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/run-tmkms.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Node
|
||||||
|
|
||||||
|
- Run these steps in the machine where the mainnet node is setup (machine 2)
|
||||||
|
|
||||||
|
- Stop the node deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR stop
|
||||||
|
```
|
||||||
|
|
||||||
|
- Run ansible playbook to rebuild the node image:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
BUILD_ONLY=true ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/first-validator/setup-first-validator.yml
|
||||||
|
```
|
||||||
|
|
||||||
- Start the node deployment:
|
- Start the node deployment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -102,7 +102,12 @@
|
|||||||
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/setup-validator.yml
|
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/setup-validator.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
- Copy over the `priv_validator_key.json` located at `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json` to the machine from where the TMKMS service is to be setup (machine 4)
|
- Copy over the `priv_validator_key.json` located at `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json` to the machine where the TMKMS service is to be setup (machine 4)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Example command to transfer file from machine 2 to machine 4 (run on machine 2)
|
||||||
|
scp -C $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/data/laconicd-data/config/priv_validator_key.json <user>@<machine-ip-address>:<absolute-path-to-desired-destination-directory>
|
||||||
|
```
|
||||||
|
|
||||||
## Setup TMKMS
|
## Setup TMKMS
|
||||||
|
|
||||||
@ -189,7 +194,7 @@
|
|||||||
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR logs laconicd -f
|
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR logs laconicd -f
|
||||||
```
|
```
|
||||||
|
|
||||||
NOTE: The node takes a long time to start syncing blocks `~40 seconds`.
|
NOTE: The node takes a long time to start syncing blocks `~30 seconds`
|
||||||
|
|
||||||
- Get the public key of your node:
|
- Get the public key of your node:
|
||||||
|
|
||||||
@ -215,6 +220,7 @@
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Set the public IP address of the machine where your node is running
|
# Set the public IP address of the machine where your node is running
|
||||||
|
# NOTE: An https URL can also be used
|
||||||
node_url: "tcp://NODE_PUBLIC_IP_ADDRESS:26657"
|
node_url: "tcp://NODE_PUBLIC_IP_ADDRESS:26657"
|
||||||
|
|
||||||
# Make sure to wrap it with single quotes ('')
|
# Make sure to wrap it with single quotes ('')
|
||||||
@ -288,6 +294,54 @@
|
|||||||
|
|
||||||
- Update `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/config.env` with required values
|
- Update `$DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR/config.env` with required values
|
||||||
|
|
||||||
|
- Start the node deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR start
|
||||||
|
```
|
||||||
|
|
||||||
|
## Rebuild Images
|
||||||
|
|
||||||
|
- Follow these steps to rebuild the images for TMKMS and node in case of any code changes
|
||||||
|
|
||||||
|
### TMKMS
|
||||||
|
|
||||||
|
- Run these steps in the machine where the TMKMS service is setup (machine 4)
|
||||||
|
|
||||||
|
- Stop the TMKMS deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir $DATA_DIRECTORY/tmkms-deployment stop
|
||||||
|
```
|
||||||
|
|
||||||
|
- Run ansible playbook to rebuild the TMKMS image:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
BUILD_ONLY=true ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/setup-tmkms.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
- Start the TMKMS deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/tmkms/run-tmkms.yml
|
||||||
|
```
|
||||||
|
|
||||||
|
### Node
|
||||||
|
|
||||||
|
- Run these steps in the machine where the mainnet node is setup (machine 2)
|
||||||
|
|
||||||
|
- Stop the node deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir $DATA_DIRECTORY/$MAINNET_DEPLOYMENT_DIR stop
|
||||||
|
```
|
||||||
|
|
||||||
|
- Run ansible playbook to rebuild the node image:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
BUILD_ONLY=true ansible-playbook -i localhost, -c local ~/cerc/laconicd-stack/playbooks/validator/setup-validator.yml
|
||||||
|
```
|
||||||
|
|
||||||
- Start the node deployment:
|
- Start the node deployment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
@ -39,9 +39,6 @@ Instructions to reset / update the deployments
|
|||||||
```bash
|
```bash
|
||||||
# URL for the deploy app so that wallet can work with it
|
# URL for the deploy app so that wallet can work with it
|
||||||
CERC_ALLOWED_URLS=https://deploy.laconic.com,https://store.laconic.com
|
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:
|
* Restart the deployment:
|
||||||
@ -57,46 +54,39 @@ Instructions to reset / update the deployments
|
|||||||
|
|
||||||
* The web wallet can now be viewed at <https://wallet.laconic.com>
|
* 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
|
## laconic-console
|
||||||
|
|
||||||
* Deployment dir: `/srv/console/laconic-console-deployment`
|
* Deployment dir: `/srv/console/laconic-console-testnet2-deployment`
|
||||||
|
|
||||||
* If code has changed, fetch and build with updated source code:
|
* Set deployment directory in a variable:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# testnet-onboarding-app source
|
CONSOLE_DEPLOYMENT=/srv/console/laconic-console-testnet2-deployment
|
||||||
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`:
|
* Update the configuration:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nano $CONSOLE_DEPLOYMENT/config.env
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Laconicd (hosted) GQL endpoint
|
# Laconicd (hosted) GQL endpoint
|
||||||
LACONIC_HOSTED_ENDPOINT=https://laconicd-mainnet.laconic.com/graphql
|
LACONIC_HOSTED_ENDPOINT=https://laconicd-mainnet.laconic.com
|
||||||
|
|
||||||
|
# laconicd chain id
|
||||||
|
CERC_LACONICD_CHAIN_ID=laconic-mainnet
|
||||||
```
|
```
|
||||||
|
|
||||||
* Restart the deployment:
|
* Restart the deployment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so deployment --dir laconic-console-deployment stop
|
laconic-so deployment --dir $CONSOLE_DEPLOYMENT stop
|
||||||
|
|
||||||
laconic-so deployment --dir laconic-console-deployment start
|
laconic-so deployment --dir $CONSOLE_DEPLOYMENT start
|
||||||
|
|
||||||
# Follow logs for console container
|
# Follow logs for console container
|
||||||
laconic-so deployment --dir laconic-console-deployment logs console -f
|
laconic-so deployment --dir $CONSOLE_DEPLOYMENT logs console -f
|
||||||
```
|
```
|
||||||
|
|
||||||
* The laconic console can now be viewed at <https://console-mainnet.laconic.com>
|
* The laconic console can now be viewed at <https://console-mainnet.laconic.com>
|
||||||
@ -126,6 +116,21 @@ Instructions to reset / update the deployments
|
|||||||
CERC_LACONICD_CHAIN_ID=laconic-mainnet
|
CERC_LACONICD_CHAIN_ID=laconic-mainnet
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* Update the code for shopify app in [theme/sections/main-product.liquid](https://git.vdb.to/cerc-io/shopify/pulls/13/files#diff-971bd0e0a616c3feaecf3205ac98a23296a5a0d7) to use the correct chain ID
|
||||||
|
|
||||||
|
```bash
|
||||||
|
...
|
||||||
|
<script>
|
||||||
|
// Function to send a message to the iframe to get or create wallet account
|
||||||
|
function requestWalletAddress(iframe) {
|
||||||
|
const message = {
|
||||||
|
type: 'REQUEST_CREATE_OR_GET_ACCOUNTS',
|
||||||
|
# Replace `laconic-testnet-2` with `laconic-mainnet`
|
||||||
|
chainId: 'laconic-testnet-2',
|
||||||
|
};
|
||||||
|
...
|
||||||
|
```
|
||||||
|
|
||||||
* Restart the deployment:
|
* Restart the deployment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -138,51 +143,28 @@ Instructions to reset / update the deployments
|
|||||||
|
|
||||||
## Webapp Deployer
|
## Webapp Deployer
|
||||||
|
|
||||||
* Fetch latest stack repos:
|
* Deployment dir: `/srv/service-provider/webapp-deployer` and `/srv/service-provider/webapp-ui`
|
||||||
|
|
||||||
|
* Set deployment directory in a variable:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# In directory where webapp-deployer deployment was created
|
SP_DEPLOYMENT=/srv/service-provider/webapp-deployer
|
||||||
laconic-so --stack webapp-deployer-backend setup-repositories --pull
|
SP_UI_DEPLOYMENT=/srv/service-provider/webapp-ui
|
||||||
|
|
||||||
# Confirm latest commit hash in the ~/cerc/webapp-deployment-status-api repo
|
|
||||||
```
|
```
|
||||||
|
|
||||||
* Rebuild container images if there are any changes:
|
* Stop the deployments:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so --stack webapp-deployer-backend build-containers --force-rebuild
|
laconic-so deployment --dir $SP_DEPLOYMENT stop
|
||||||
|
laconic-so deployment --dir $SP_UI_DEPLOYMENT stop
|
||||||
```
|
```
|
||||||
|
|
||||||
* Push stack images to the container registry:
|
* Update the laconic registry config with new endpoints:
|
||||||
|
|
||||||
* Login to the container registry:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Set required variables
|
nano $SP_DEPLOYMENT/data/config/laconic.yml
|
||||||
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
|
```bash
|
||||||
services:
|
services:
|
||||||
registry:
|
registry:
|
||||||
@ -201,7 +183,7 @@ Instructions to reset / update the deployments
|
|||||||
* Start the webapp deployer:
|
* Start the webapp deployer:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so deployment --dir webapp-deployer start
|
laconic-so deployment --dir $SP_DEPLOYMENT start
|
||||||
```
|
```
|
||||||
|
|
||||||
* Get the webapp-deployer pod id:
|
* Get the webapp-deployer pod id:
|
||||||
@ -242,7 +224,11 @@ Instructions to reset / update the deployments
|
|||||||
kubectl logs -f $POD_ID -c cerc-webapp-auction-handler
|
kubectl logs -f $POD_ID -c cerc-webapp-auction-handler
|
||||||
```
|
```
|
||||||
|
|
||||||
* Update deployer UI config (`webapp-ui/config.env`):
|
* Update deployer UI config:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nano $SP_UI_DEPLOYMENT/config.env
|
||||||
|
```
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# URL of the laconic console
|
# URL of the laconic console
|
||||||
@ -252,19 +238,25 @@ Instructions to reset / update the deployments
|
|||||||
* Start the webapp UI:
|
* Start the webapp UI:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so deployment --dir webapp-ui start
|
laconic-so deployment --dir $SP_UI_DEPLOYMENT start
|
||||||
```
|
```
|
||||||
|
|
||||||
* Check logs
|
* Check logs
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so deployment --dir webapp-ui logs webapp
|
laconic-so deployment --dir $SP_UI_DEPLOYMENT logs webapp
|
||||||
```
|
```
|
||||||
|
|
||||||
## Deploy Backend
|
## Deploy Backend
|
||||||
|
|
||||||
* Deployment dir: `/srv/deploy-backend/laconic-backend-deployment`
|
* Deployment dir: `/srv/deploy-backend/laconic-backend-deployment`
|
||||||
|
|
||||||
|
* Stop the deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir laconic-backend-deployment stop
|
||||||
|
```
|
||||||
|
|
||||||
* If code has changed, fetch and build with updated source code:
|
* If code has changed, fetch and build with updated source code:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -312,11 +304,15 @@ Instructions to reset / update the deployments
|
|||||||
* Restart the deployment:
|
* Restart the deployment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so deployment --dir laconic-backend-deployment stop
|
|
||||||
|
|
||||||
laconic-so deployment --dir laconic-backend-deployment start
|
laconic-so deployment --dir laconic-backend-deployment start
|
||||||
```
|
```
|
||||||
|
|
||||||
|
* Check logs:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir laconic-backend-deployment logs snowballtools-base-backend
|
||||||
|
```
|
||||||
|
|
||||||
## Deploy Frontend
|
## Deploy Frontend
|
||||||
|
|
||||||
* Source repo: <https://git.vdb.to/cerc-io/snowballtools-base>
|
* Source repo: <https://git.vdb.to/cerc-io/snowballtools-base>
|
||||||
@ -377,6 +373,12 @@ Instructions to reset / update the deployments
|
|||||||
|
|
||||||
Note: The `userKey` account should own the authority `laconic-deploy`
|
Note: The `userKey` account should own the authority `laconic-deploy`
|
||||||
|
|
||||||
|
* Update the `deploy-frontend.sh` script to use mainnet chain id:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sed -i 's/laconic-testnet-2/laconic-mainnet/g' ./deploy-frontend.sh
|
||||||
|
```
|
||||||
|
|
||||||
### Run
|
### Run
|
||||||
|
|
||||||
* Run frontend deployment script:
|
* Run frontend deployment script:
|
||||||
@ -388,3 +390,5 @@ Instructions to reset / update the deployments
|
|||||||
Follow deployment logs on the deployer UI
|
Follow deployment logs on the deployer UI
|
||||||
|
|
||||||
* On a successful deployment, the frontend can be viewed at <https://deploy.laconic.com>
|
* On a successful deployment, the frontend can be viewed at <https://deploy.laconic.com>
|
||||||
|
|
||||||
|
* **NOTE**: Update the CI and deployment scripts in deployer app once mainnet is launched ([PR](https://git.vdb.to/cerc-io/snowballtools-base/pulls/58))
|
||||||
|
@ -153,7 +153,7 @@ A Laconic mainnet node (see [run-validator.md](./run-validator.md))
|
|||||||
kubectl logs -f $POD_ID -c cerc-webapp-auction-handler
|
kubectl logs -f $POD_ID -c cerc-webapp-auction-handler
|
||||||
```
|
```
|
||||||
|
|
||||||
* Update deployer UI config (`webapp-ui/config.env`):
|
* Update deployer UI config (`webapp-ui/config.env`) if required:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# URL of the webapp deployer backend API
|
# URL of the webapp deployer backend API
|
||||||
@ -161,7 +161,7 @@ A Laconic mainnet node (see [run-validator.md](./run-validator.md))
|
|||||||
LACONIC_HOSTED_CONFIG_app_api_url=
|
LACONIC_HOSTED_CONFIG_app_api_url=
|
||||||
|
|
||||||
# URL of the laconic console
|
# URL of the laconic console
|
||||||
# eg: https://console-mainnet.laconic.com
|
# eg: https://console-mainnet.laconic.com/console?...
|
||||||
LACONIC_HOSTED_CONFIG_app_console_link=
|
LACONIC_HOSTED_CONFIG_app_console_link=
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -8,87 +8,133 @@ This playbook sets up the Cosmos Multisig application for managing multisig wall
|
|||||||
- [ansible](../README.md#ansible-installation)
|
- [ansible](../README.md#ansible-installation)
|
||||||
- If running playbook to setup deployment on remote machine, the following need to be installed in remote:
|
- If running playbook to setup deployment on remote machine, the following need to be installed in remote:
|
||||||
- [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install)
|
- [laconic-so](https://github.com/cerc-io/stack-orchestrator/?tab=readme-ov-file#install)
|
||||||
- [yq](https://github.com/mikefarah/yq?tab=readme-ov-file#wget)
|
- Check [domain port mappings](./domain-port-mappings.md) to ensure that required domain is pointing to correct port
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
* Fetch the stack:
|
- Fetch the stack:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
laconic-so fetch-stack git.vdb.to/cerc-io/laconicd-stack --git-ssh --pull
|
||||||
```
|
```
|
||||||
|
|
||||||
* Copy the example variables file:
|
- Copy the example variables file:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cp ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.yml
|
cp ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.example.yml ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
* Update `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.yml` with your node configuration:
|
- Update `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.yml` with your node configuration:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# TODO: Update with example domains mapped to ports
|
|
||||||
next_public_node_addresses: '["https://laconicd-mainnet.laconic.com"]'
|
next_public_node_addresses: '["https://laconicd-mainnet.laconic.com"]'
|
||||||
node_rest_endpoint: "https://api.laconicd-mainnet.laconic.com"
|
node_rest_endpoint: "https://api.laconicd-mainnet.laconic.com"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Setup Steps
|
## Setup Steps
|
||||||
|
|
||||||
* Set common environment variables:
|
- Set common environment variables:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Parent directory where the deployment directory will live
|
# Parent directory where the deployment directory will live
|
||||||
export DATA_DIRECTORY=<path/to/deployments/directory>
|
export DATA_DIRECTORY=<absolute/path/to/deployments/directory>
|
||||||
|
|
||||||
export MULTISIG_DEPLOYMENT_DIR=cosmos-multisig-deployment
|
export MULTISIG_DEPLOYMENT_DIR=cosmos-multisig-deployment
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Copy the inventory file:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cp ~/cerc/laconicd-stack/playbooks/hosts.ini.example ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini
|
||||||
|
```
|
||||||
|
|
||||||
### Local Setup
|
### Local Setup
|
||||||
|
|
||||||
* Setup and start the multisig app:
|
- Setup and start the multisig app:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible-playbook -v -i hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit local
|
ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit local
|
||||||
```
|
```
|
||||||
|
|
||||||
* Access the app at <http://localhost:7000/laconic>
|
- Access the app at <https://multisig.laconic.com/laconic-mainnet>
|
||||||
|
|
||||||
### Remote Setup
|
### Remote Setup
|
||||||
|
|
||||||
* Create and configure hosts.ini:
|
- Create and configure hosts.ini:
|
||||||
* Copy the example file:
|
|
||||||
```bash
|
- Edit `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini` and update the remote host details:
|
||||||
cp ~/cerc/laconicd-stack/playbooks/hosts.ini.example ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini
|
|
||||||
```
|
|
||||||
* Edit `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini` and update the remote host details:
|
|
||||||
```ini
|
```ini
|
||||||
[remote]
|
[remote]
|
||||||
# Replace with your actual remote host details
|
# Replace with your actual remote host details
|
||||||
remote_host ansible_host=your.remote.host ansible_user=your_remote_user ansible_ssh_common_args='-o ForwardAgent=yes'
|
remote_host ansible_host=your.remote.host ansible_user=your_remote_user ansible_ssh_common_args='-o ForwardAgent=yes'
|
||||||
```
|
```
|
||||||
* Verify SSH connection using Ansible ping:
|
|
||||||
|
- Verify SSH connection using Ansible ping:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible all -m ping -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini --limit remote_host
|
ansible all -m ping -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini --limit remote_host
|
||||||
```
|
```
|
||||||
|
|
||||||
* Run the playbook targeting the remote host:
|
- Run the playbook targeting the remote host:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit remote_host
|
ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit remote_host
|
||||||
```
|
```
|
||||||
|
|
||||||
* Access the app at <http://your.remote.host:7000/laconic>
|
- Access the app at <https://multisig.laconic.com/laconic-mainnet>
|
||||||
|
|
||||||
## Check Status
|
## Check Status
|
||||||
|
|
||||||
* Check app logs:
|
- Check app logs:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR logs -f cosmos-multisig-ui
|
laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR logs -f cosmos-multisig-ui
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Update
|
||||||
|
|
||||||
|
- Set environment variables for the deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Parent directory where the deployment directory will live
|
||||||
|
export DATA_DIRECTORY=<absolute/path/to/deployments/directory>
|
||||||
|
|
||||||
|
export MULTISIG_DEPLOYMENT_DIR=cosmos-multisig-deployment
|
||||||
|
```
|
||||||
|
|
||||||
|
- Stop the deployment:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR stop
|
||||||
|
```
|
||||||
|
|
||||||
|
- Update `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-vars.yml` with required values
|
||||||
|
|
||||||
|
- Run ansible playbook to deploy again:
|
||||||
|
|
||||||
|
- For local host
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit local
|
||||||
|
```
|
||||||
|
|
||||||
|
- For remote host (check that remote is configured properly in `~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini`)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ansible-playbook -v -i ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/hosts.ini ~/cerc/laconicd-stack/playbooks/cosmos-multisig-app/cosmos-multisig-app-start.yml --limit remote_host
|
||||||
|
```
|
||||||
|
|
||||||
## Clean up
|
## Clean up
|
||||||
|
|
||||||
- To stop the deployment:
|
- To stop the deployment:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR stop
|
laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR stop
|
||||||
```
|
```
|
||||||
|
|
||||||
- To stop and delete all data:
|
- To stop and delete all data:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR stop --delete-volumes
|
laconic-so deployment --dir $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR stop --delete-volumes
|
||||||
sudo rm -rf $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR
|
sudo rm -rf $DATA_DIRECTORY/$MULTISIG_DEPLOYMENT_DIR
|
||||||
|
@ -29,7 +29,7 @@ next_public_display_denom: "ALNT"
|
|||||||
next_public_display_denom_exponent: 0
|
next_public_display_denom_exponent: 0
|
||||||
|
|
||||||
# JSON array of asset definitions, including denom units, base, name, display, and symbol
|
# JSON array of asset definitions, including denom units, base, name, display, and symbol
|
||||||
next_public_assets: '[{"denom_units":[{"denom":"alnt","exponent":0}],"base":"alnt","name":"Laconic Token","display":"ALNT","symbol":"alnt"}]'
|
next_public_assets: '[{"denom_units":[{"denom":"alnt","exponent":0}],"base":"alnt","name":"Laconic Token","display":"ALNT","symbol":"alnt"},{"denom_units":[{"denom":"alps","exponent":0}],"base":"alps","name":"Laconic Prepaid Service","display":"ALPS","symbol":"alps"}]'
|
||||||
|
|
||||||
# Default gas price for transactions
|
# Default gas price for transactions
|
||||||
next_public_gas_price: "0.001alnt"
|
next_public_gas_price: "0.001alnt"
|
||||||
|
61
playbooks/cosmos-multisig-app/multisig-usage.md
Normal file
61
playbooks/cosmos-multisig-app/multisig-usage.md
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
# Multisig Usage
|
||||||
|
|
||||||
|
## Create a Multisig
|
||||||
|
|
||||||
|
- On opening the app, a prompt will be shown to add Laconic Mainnet network to you Keplr wallet. Click on `Approve`
|
||||||
|
|
||||||
|
- Go to home and click on `I don't have a multisig`
|
||||||
|
|
||||||
|
- Add the addresses of accounts which have performed at least one tx on chain
|
||||||
|
|
||||||
|
- Set the threshold as required (if threshold is set to N out of N members then all the validators have to sign the tx)
|
||||||
|
|
||||||
|
- Click on `Submit` and `Create multisig`
|
||||||
|
|
||||||
|
## Import Accounts in Keplr
|
||||||
|
|
||||||
|
- Add the accounts in Keplr wallet for signing the transaction
|
||||||
|
|
||||||
|
- Open Keplr wallet and click on the user icon in the top right corner
|
||||||
|
|
||||||
|
- Click on `Add wallet`, then select `Import an existing wallet` and go to `Use recovery phrase or private key`
|
||||||
|
|
||||||
|
- Select the `Private key` tab and then paste the private key of the account and click on import
|
||||||
|
|
||||||
|
- Set a name for the wallet (used when connecting wallet to app for signing transaction) and click on next
|
||||||
|
|
||||||
|
- Search for `Laconic Mainnet` and select it, then click on `Save`
|
||||||
|
|
||||||
|
- Other accounts can be added in a similar manner
|
||||||
|
|
||||||
|
- Send funds to the generated multisig address using Keplr
|
||||||
|
|
||||||
|
- Open Keplr wallet and select the account from which you wish to transfer the funds to the multisig address
|
||||||
|
|
||||||
|
- Search for `Laconic Mainnet`, choose the token you wish to send and select the network
|
||||||
|
|
||||||
|
- Select `Send` and paste the multisig address and set desired amount
|
||||||
|
|
||||||
|
- Click on `Next` and approve the transaction
|
||||||
|
|
||||||
|
## Send Transaction From Multisig Address
|
||||||
|
|
||||||
|
- In the multisig app, Go to `home`, paste your multisig address and click on `Use this multisig`
|
||||||
|
|
||||||
|
- You will see the multisig members and holdings for the address
|
||||||
|
|
||||||
|
- Click on `Create new transaction` and then click on `Bank Send` under `Add New Msg`
|
||||||
|
|
||||||
|
- Enter the recipient address, amount to be transfered and memo (optional)
|
||||||
|
|
||||||
|
- You can either select `alnt` or `alps` as denom
|
||||||
|
|
||||||
|
- Click on create transaction
|
||||||
|
|
||||||
|
- Under Choose wallet to sign, click on `Connect Keplr`
|
||||||
|
|
||||||
|
- After connecting the wallet, click on `Sign transaction` and approve the transaction
|
||||||
|
|
||||||
|
- Repeat the above steps for other members of the multisig to sign the transaction
|
||||||
|
|
||||||
|
- Once the transaction is signed by required number of validators (as set in the threshold), click on `Broadcast Transaction`
|
@ -9,6 +9,7 @@
|
|||||||
spec_file: "{{data_directory}}/laconicd-spec.yml"
|
spec_file: "{{data_directory}}/laconicd-spec.yml"
|
||||||
spec_template: "./templates/specs/spec-template.yml.j2"
|
spec_template: "./templates/specs/spec-template.yml.j2"
|
||||||
build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}"
|
build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}"
|
||||||
|
BUILD_ONLY: "{{ lookup('env', 'BUILD_ONLY') | default(false) | bool }}"
|
||||||
tasks:
|
tasks:
|
||||||
- name: Include setup tasks
|
- name: Include setup tasks
|
||||||
ansible.builtin.import_tasks: ../setup.yml
|
ansible.builtin.import_tasks: ../setup.yml
|
||||||
@ -18,7 +19,7 @@
|
|||||||
msg: >-
|
msg: >-
|
||||||
Required environment variables are not set.
|
Required environment variables are not set.
|
||||||
Please export both DATA_DIRECTORY and MAINNET_DEPLOYMENT_DIR before running the playbook.
|
Please export both DATA_DIRECTORY and MAINNET_DEPLOYMENT_DIR before running the playbook.
|
||||||
when: lookup('env', 'DATA_DIRECTORY') == '' or lookup('env', 'MAINNET_DEPLOYMENT_DIR') == ''
|
when: not BUILD_ONLY and (lookup('env', 'DATA_DIRECTORY') == '' or lookup('env', 'MAINNET_DEPLOYMENT_DIR') == '')
|
||||||
|
|
||||||
- name: Setup required repositories
|
- name: Setup required repositories
|
||||||
shell: >
|
shell: >
|
||||||
@ -30,18 +31,22 @@
|
|||||||
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers {{ build_args }}
|
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers {{ build_args }}
|
||||||
|
|
||||||
- name: Create deployment spec file
|
- name: Create deployment spec file
|
||||||
|
when: not BUILD_ONLY
|
||||||
shell: |
|
shell: |
|
||||||
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy init --output {{ spec_file }}
|
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy init --output {{ spec_file }}
|
||||||
|
|
||||||
- name: Replace network section in spec_file
|
- name: Replace network section in spec_file
|
||||||
|
when: not BUILD_ONLY
|
||||||
shell: >
|
shell: >
|
||||||
{{ yq_path }} eval '(.network) = load("{{ spec_template }}").network' -i {{ spec_file }}
|
{{ yq_path }} eval '(.network) = load("{{ spec_template }}").network' -i {{ spec_file }}
|
||||||
|
|
||||||
- name: Create deployment from spec file
|
- name: Create deployment from spec file
|
||||||
|
when: not BUILD_ONLY
|
||||||
shell: |
|
shell: |
|
||||||
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy create --spec-file {{ spec_file }} --deployment-dir {{data_directory}}/{{ mainnet_deployment_dir }}
|
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy create --spec-file {{ spec_file }} --deployment-dir {{data_directory}}/{{ mainnet_deployment_dir }}
|
||||||
|
|
||||||
- name: Create config.env
|
- name: Create config.env
|
||||||
|
when: not BUILD_ONLY
|
||||||
copy:
|
copy:
|
||||||
dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/config.env"
|
dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/config.env"
|
||||||
content: |
|
content: |
|
||||||
@ -53,6 +58,7 @@
|
|||||||
mode: '0777'
|
mode: '0777'
|
||||||
|
|
||||||
- name: Initialize laconicd node
|
- name: Initialize laconicd node
|
||||||
|
when: not BUILD_ONLY
|
||||||
shell: |
|
shell: |
|
||||||
docker run -i \
|
docker run -i \
|
||||||
-v {{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data:/root/.laconicd \
|
-v {{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data:/root/.laconicd \
|
||||||
@ -62,6 +68,7 @@
|
|||||||
cerc/laconicd:local bash -c "/scripts/setup-laconicd.sh"
|
cerc/laconicd:local bash -c "/scripts/setup-laconicd.sh"
|
||||||
|
|
||||||
- name: Ensure tmp directory exists inside laconicd-data
|
- name: Ensure tmp directory exists inside laconicd-data
|
||||||
|
when: not BUILD_ONLY
|
||||||
file:
|
file:
|
||||||
path: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp"
|
path: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp"
|
||||||
state: directory
|
state: directory
|
||||||
|
@ -6,13 +6,14 @@
|
|||||||
tmkms_deployment_dir: "{{ lookup('env', 'TMKMS_DEPLOYMENT_DIR') | default('tmkms-deployment', true) }}"
|
tmkms_deployment_dir: "{{ lookup('env', 'TMKMS_DEPLOYMENT_DIR') | default('tmkms-deployment', true) }}"
|
||||||
tmkms_spec_file: "{{data_directory}}/tmkms-spec.yml"
|
tmkms_spec_file: "{{data_directory}}/tmkms-spec.yml"
|
||||||
build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}"
|
build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}"
|
||||||
|
BUILD_ONLY: "{{ lookup('env', 'BUILD_ONLY') | default(false) | bool }}"
|
||||||
tasks:
|
tasks:
|
||||||
- name: Fail if DATA_DIRECTORY env var is not set
|
- name: Fail if DATA_DIRECTORY env var is not set
|
||||||
fail:
|
fail:
|
||||||
msg: >-
|
msg: >-
|
||||||
Required environment variable DATA_DIRECTORY is not set.
|
Required environment variable DATA_DIRECTORY is not set.
|
||||||
Please export DATA_DIRECTORY before running the playbook.
|
Please export DATA_DIRECTORY before running the playbook.
|
||||||
when: lookup('env', 'DATA_DIRECTORY') == ''
|
when: not BUILD_ONLY and lookup('env', 'DATA_DIRECTORY') == ''
|
||||||
|
|
||||||
- name: Fetch tmkms stack
|
- name: Fetch tmkms stack
|
||||||
shell: |
|
shell: |
|
||||||
@ -23,9 +24,11 @@
|
|||||||
laconic-so --stack ~/cerc/tmkms-stack/stack-orchestrator/stacks/tmkms build-containers {{ build_args }}
|
laconic-so --stack ~/cerc/tmkms-stack/stack-orchestrator/stacks/tmkms build-containers {{ build_args }}
|
||||||
|
|
||||||
- name: Create tmkms deployment spec file
|
- name: Create tmkms deployment spec file
|
||||||
|
when: not BUILD_ONLY
|
||||||
shell: |
|
shell: |
|
||||||
laconic-so --stack ~/cerc/tmkms-stack/stack-orchestrator/stacks/tmkms deploy init --output {{ tmkms_spec_file }}
|
laconic-so --stack ~/cerc/tmkms-stack/stack-orchestrator/stacks/tmkms deploy init --output {{ tmkms_spec_file }}
|
||||||
|
|
||||||
- name: Create tmkms deployment from spec file
|
- name: Create tmkms deployment from spec file
|
||||||
|
when: not BUILD_ONLY
|
||||||
shell: |
|
shell: |
|
||||||
laconic-so --stack ~/cerc/tmkms-stack/stack-orchestrator/stacks/tmkms deploy create --spec-file {{ tmkms_spec_file }} --deployment-dir {{data_directory}}/{{ tmkms_deployment_dir }}
|
laconic-so --stack ~/cerc/tmkms-stack/stack-orchestrator/stacks/tmkms deploy create --spec-file {{ tmkms_spec_file }} --deployment-dir {{data_directory}}/{{ tmkms_deployment_dir }}
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
spec_file: "{{data_directory}}/laconicd-validator-spec.yml"
|
spec_file: "{{data_directory}}/laconicd-validator-spec.yml"
|
||||||
spec_template: "./templates/specs/spec-template.yml.j2"
|
spec_template: "./templates/specs/spec-template.yml.j2"
|
||||||
build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}"
|
build_args: "{{ '--force-rebuild' if (lookup('env', 'FORCE_REBUILD') | default(omit, true)) not in [ 'false', 'False', '0' ] else '' }}"
|
||||||
|
BUILD_ONLY: "{{ lookup('env', 'BUILD_ONLY') | default(false) | bool }}"
|
||||||
tasks:
|
tasks:
|
||||||
- name: Include setup tasks
|
- name: Include setup tasks
|
||||||
ansible.builtin.import_tasks: ../setup.yml
|
ansible.builtin.import_tasks: ../setup.yml
|
||||||
@ -18,14 +19,14 @@
|
|||||||
msg: >-
|
msg: >-
|
||||||
Required environment variables are not set.
|
Required environment variables are not set.
|
||||||
Please export both DATA_DIRECTORY and MAINNET_DEPLOYMENT_DIR before running the playbook.
|
Please export both DATA_DIRECTORY and MAINNET_DEPLOYMENT_DIR before running the playbook.
|
||||||
when: lookup('env', 'DATA_DIRECTORY') == '' or lookup('env', 'MAINNET_DEPLOYMENT_DIR') == ''
|
when: not BUILD_ONLY and (lookup('env', 'DATA_DIRECTORY') == '' or lookup('env', 'MAINNET_DEPLOYMENT_DIR') == '')
|
||||||
|
|
||||||
- name: Fail if required key files are not defined
|
- name: Fail if required key files are not defined
|
||||||
fail:
|
fail:
|
||||||
msg: >-
|
msg: >-
|
||||||
Required key files are not defined.
|
Required key files are not defined.
|
||||||
Please set genesis_file and staking_amount_file in validator-vars.yml.
|
Please set genesis_file and staking_amount_file in validator-vars.yml.
|
||||||
when: not genesis_file or not staking_amount_file
|
when: not BUILD_ONLY and (not genesis_file or not staking_amount_file)
|
||||||
|
|
||||||
- name: Setup required repositories
|
- name: Setup required repositories
|
||||||
shell: >
|
shell: >
|
||||||
@ -37,18 +38,22 @@
|
|||||||
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers {{ build_args }}
|
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd build-containers {{ build_args }}
|
||||||
|
|
||||||
- name: Create deployment spec file
|
- name: Create deployment spec file
|
||||||
|
when: not BUILD_ONLY
|
||||||
shell: |
|
shell: |
|
||||||
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy init --output {{ spec_file }}
|
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy init --output {{ spec_file }}
|
||||||
|
|
||||||
- name: Replace network section in spec_file
|
- name: Replace network section in spec_file
|
||||||
|
when: not BUILD_ONLY
|
||||||
shell: >
|
shell: >
|
||||||
{{ yq_path }} eval '(.network) = load("{{ spec_template }}").network' -i {{ spec_file }}
|
{{ yq_path }} eval '(.network) = load("{{ spec_template }}").network' -i {{ spec_file }}
|
||||||
|
|
||||||
- name: Create deployment from spec file
|
- name: Create deployment from spec file
|
||||||
|
when: not BUILD_ONLY
|
||||||
shell: |
|
shell: |
|
||||||
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy create --spec-file {{ spec_file }} --deployment-dir {{data_directory}}/{{ mainnet_deployment_dir }}
|
laconic-so --stack ~/cerc/laconicd-stack/stack-orchestrator/stacks/mainnet-laconicd deploy create --spec-file {{ spec_file }} --deployment-dir {{data_directory}}/{{ mainnet_deployment_dir }}
|
||||||
|
|
||||||
- name: Create config.env
|
- name: Create config.env
|
||||||
|
when: not BUILD_ONLY
|
||||||
copy:
|
copy:
|
||||||
dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/config.env"
|
dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/config.env"
|
||||||
content: |
|
content: |
|
||||||
@ -61,18 +66,21 @@
|
|||||||
mode: '0777'
|
mode: '0777'
|
||||||
|
|
||||||
- name: Ensure tmp directory exists inside laconicd-data
|
- name: Ensure tmp directory exists inside laconicd-data
|
||||||
|
when: not BUILD_ONLY
|
||||||
file:
|
file:
|
||||||
path: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp"
|
path: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp"
|
||||||
state: directory
|
state: directory
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Copy genesis file to laconicd-data tmp directory
|
- name: Copy genesis file to laconicd-data tmp directory
|
||||||
|
when: not BUILD_ONLY
|
||||||
copy:
|
copy:
|
||||||
src: "{{ genesis_file }}"
|
src: "{{ genesis_file }}"
|
||||||
dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp/genesis.json"
|
dest: "{{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data/tmp/genesis.json"
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
|
|
||||||
- name: Initialize laconicd node
|
- name: Initialize laconicd node
|
||||||
|
when: not BUILD_ONLY
|
||||||
shell: |
|
shell: |
|
||||||
docker run -i \
|
docker run -i \
|
||||||
-v {{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data:/root/.laconicd \
|
-v {{data_directory}}/{{ mainnet_deployment_dir }}/data/laconicd-data:/root/.laconicd \
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
# The URL of the laconicd node's RPC endpoint (e.g., "tcp://NODE_PUBLIC_IP_ADDRESS:26657")
|
# The URL of the laconicd node's RPC endpoint (e.g., "tcp://NODE_PUBLIC_IP_ADDRESS:26657" or "https://<your-node-url>")
|
||||||
node_url: ""
|
node_url: ""
|
||||||
|
|
||||||
# The public key of the validator node. This is required for creating the validator on chain
|
# The public key of the validator node. This is required for creating the validator on chain
|
||||||
|
Loading…
Reference in New Issue
Block a user