From 76b98af3747688a2c5f1fdad1ad3fa71b5274eb7 Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Mon, 29 Jul 2024 17:36:30 +0530 Subject: [PATCH] Add setup for testnet onboarding app and API stacks --- testnet-onboarding-demo.md | 78 ++++++++++++++++++++++++++++++-------- 1 file changed, 62 insertions(+), 16 deletions(-) diff --git a/testnet-onboarding-demo.md b/testnet-onboarding-demo.md index 3df3da6..0628c84 100644 --- a/testnet-onboarding-demo.md +++ b/testnet-onboarding-demo.md @@ -107,44 +107,90 @@ WALLET_CONNECT_ID=39bc93c... ``` -### Testnet Onboarding App +### Testnet Onboarding App and Onboarding API stacks -- Clone the repository +- Clone the stack repo: ```bash - git clone git@git.vdb.to:cerc-io/testnet-onboarding-app.git + laconic-so fetch-stack git.vdb.to/cerc-io/testnet-onboarding-app-stack ``` -- Enter the project directory +- Setup required repositories: ```bash - cd testnet-onboarding-app + laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app setup-repositories --pull + laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-api setup-repositories --pull ``` -- Setup .env - - Copy and update `.env` +- Build the container image: + + ```bash + laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app build-containers --force-rebuild + laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-api build-containers --force-rebuild + ``` + +- Create spec files for deployments, which will map the stack's ports to the host: + + ```bash + laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-app deploy init --output onboarding-app-spec.yml + laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-api deploy init --output onboarding-api-spec.yml + ``` + +- Configure ports: + + - `onboarding-app-spec.yml`: ```bash - cp .env.example .env + network: + ports: + testnet-onboarding-app: + - '3000:80' ``` - - In the `.env` file, add the WalletConnect project ID used in your [laconic-wallet](https://git.vdb.to/cerc-io/laconic-wallet) setup. + - `onboarding-api-spec.yml`: ```bash - WALLET_CONNECT_PROJECT_ID=39bc93c... + network: + ports: + testnet-onboarding-api: + - '3001:3000' ``` -- Install dependencies +- Create deployments: ```bash - yarn + 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 + + laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-api deploy create --spec-file onboarding-api-spec.yml --deployment-dir onboarding-api-deployment ``` -- Exit project repo +- Env configuration: - ```bash - cd ../ - ``` + - Set the required variables: + + ```bash + # WalletConnect project ID + export WALLET_CONNECT_ID= + + # Your sumsub application token + export SUMSUB_APP_TOKEN= + + # Your sumsub secret key + export SUMSUB_SECRET_KEY= + ``` + + - Set the env config for app and apk deployments: + + ```bash + cat < onboarding-app-deployment/config.env + WALLET_CONNECT_ID=$WALLET_CONNECT_ID + EOF + + cat < onboarding-api-deployment/config.env + SUMSUB_APP_TOKEN=$SUMSUB_APP_TOKEN + SUMSUB_SECRET_KEY=$SUMSUB_SECRET_KEY + EOF + ``` ### Stack Orchestrator