Add steps to setup onboarding app and wallet deployments

This commit is contained in:
Prathamesh Musale 2024-08-09 12:24:27 +05:30
parent b5556fddd5
commit 0aa5e4203f

View File

@ -359,7 +359,7 @@
# List down the container
docker ps -a | grep console
# Follow logs for laconicd container, check that new blocks are getting created
# Follow logs for console container
laconic-so deployment --dir laconic-console-deployment logs console -f
```
@ -372,27 +372,25 @@
## testnet-onboarding-app
* Stack: <https://git.vdb.to/cerc-io/testnet-laconicd-stack/src/branch/main/stack-orchestrator/stacks/laconic-console>
* Stack: <https://git.vdb.to/cerc-io/testnet-onboarding-app-stack/src/branch/main/stack-orchestrator/stacks/onboarding-app>
* Source repos:
* <git.vdb.to/cerc-io/laconic-registry-cli>
* <git.vdb.to/cerc-io/laconic-console>
* Source repo: <git.vdb.to/cerc-io/testnet-onboarding-app>
* Target dir: `/srv/console/laconic-console-deployment`
* Target dir: `/srv/app/onboarding-app-deployment`
* Cleanup an existing deployment if required:
```bash
cd /srv/console
cd /srv/app
# Stop the deployment
laconic-so deployment --dir laconic-console-deployment stop --delete-volumes
laconic-so deployment --dir onboarding-app-deployment
# Remove the deployment dir
sudo rm -rf laconic-console-deployment
sudo rm -rf onboarding-app-deployment
# Remove the existing spec file
rm laconic-console-spec.yml
rm onboarding-app-spec.yml
```
### Setup
@ -400,25 +398,25 @@
* Clone the stack repo:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-laconicd-stack --pull
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-onboarding-app-stack --pull
# This should clone the testnet-laconicd-stack repo at `/home/dev/cerc/testnet-laconicd-stack`
# This should clone the testnet-onboarding-app-stack repo at `/home/dev/cerc/testnet-onboarding-app-stack`
```
* Clone required repositories:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console setup-repositories --pull
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app setup-repositories --pull
# This should clone the laconic-registry-cli repo at `/home/dev/cerc/laconic-registry-cli`, laconic-console repo at `/home/dev/cerc/laconic-console`
# This should clone the testnet-onboarding-app repo at `/home/dev/cerc/testnet-onboarding-app`
```
* Build the container images:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console build-containers --force-rebuild
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app build-containers --force-rebuild
# This should create the Docker images: "cerc/laconic-registry-cli", "cerc/webapp-base", "cerc/laconic-console-host"
# This should create the Docker image "cerc/testnet-onboarding-app" locally
```
### Deployment
@ -426,9 +424,9 @@
* Create a spec file for the deployment:
```bash
cd /srv/console
cd /srv/app
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy init --output laconic-console-spec.yml
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app deploy init --output onboarding-app-spec.yml
```
* Edit network in the spec file to map container ports to host ports:
@ -436,22 +434,28 @@
```bash
network:
ports:
laconic-console:
- '127.0.0.1:4001:80'
testnet-onboarding-app:
- '127.0.0.1:3000:80'
```
* Create a deployment from the spec file:
```bash
laconic-so --stack ~/cerc/testnet-laconicd-stack/stack-orchestrator/stacks/laconic-console deploy create --spec-file laconic-console-spec.yml --deployment-dir laconic-console-deployment
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
```
* Update the configuration:
```bash
cat <<EOF > laconic-console-deployment/config.env
# Laconicd (hosted) GQL endpoint
LACONIC_HOSTED_ENDPOINT=https://laconicd.laconic.com
WALLET_CONNECT_ID=63...
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"
EOF
```
@ -460,28 +464,120 @@
* Start the deployment:
```bash
laconic-so deployment --dir laconic-console-deployment start
laconic-so deployment --dir onboarding-app-deployment start
```
* Check status:
```bash
# List down the container
docker ps -a | grep console
docker ps -a | grep testnet-onboarding-app
# Follow logs for laconicd container, check that new blocks are getting created
laconic-so deployment --dir laconic-console-deployment logs console -f
# 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
```
* The laconic console can now be viewed at <https://loro-console.laconic.com>
* The onboarding app can now be viewed at <https://loro-signup.laconic.com>
</details>
<details open>
<summary>laconic-console</summary>
<summary>laconic-wallet-web</summary>
## laconic-wallet-web
* Stack: <https://git.vdb.to/cerc-io/laconic-wallet-web/src/branch/main/stack/stack-orchestrator/stack/laconic-wallet-web>
* Source repo: <git.vdb.to/cerc-io/laconic-wallet-web>
* Target dir: `/srv/wallet/laconic-wallet-web-deployment`
* Cleanup an existing deployment if required:
```bash
cd /srv/wallet
# Stop the deployment
laconic-so deployment --dir laconic-wallet-web-deployment
# Remove the deployment dir
sudo rm -rf laconic-wallet-web-deployment
# Remove the existing spec file
rm laconic-wallet-web-spec.yml
```
### Setup
* Clone the stack repo:
```bash
laconic-so fetch-stack git.vdb.to/cerc-io/laconic-wallet-web --pull
# This should clone the laconic-wallet-web repo at `/home/dev/cerc/laconic-wallet-web`
```
* Build the container images:
```bash
laconic-so --stack ~/cerc/laconic-wallet-web/stack/stack-orchestrator/stack/laconic-wallet-web build-containers --force-rebuild
# This should create the Docker image "cerc/laconic-wallet-web" locally
```
### Deployment
* Create a spec file for the deployment:
```bash
cd /srv/wallet
laconic-so --stack ~/cerc/laconic-wallet-web/stack/stack-orchestrator/stack/laconic-wallet-web deploy init --output laconic-wallet-web-spec.yml
```
* Edit network in the spec file to map container ports to host ports:
```bash
network:
ports:
laconic-wallet-web:
- '127.0.0.1:5000:80'
```
* Create a deployment from the spec file:
```bash
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
```
* Update the configuration:
```bash
cat <<EOF > laconic-wallet-web-deployment/config.env
WALLET_CONNECT_ID=63...
EOF
```
### Start
* Start the deployment:
```bash
laconic-so deployment --dir laconic-wallet-web-deployment start
```
* Check status:
```bash
# List down the container
docker ps -a | grep laconic-wallet-web
# 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 wallet web app can now be viewed at <https://wallet.laconic.com>
</details>
<details open>