Add setup for testnet onboarding app and API stacks

This commit is contained in:
Prathamesh Musale 2024-07-29 17:36:30 +05:30
parent 0f9e0c2bb8
commit 76b98af374

View File

@ -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 <<EOF > onboarding-app-deployment/config.env
WALLET_CONNECT_ID=$WALLET_CONNECT_ID
EOF
cat <<EOF > onboarding-api-deployment/config.env
SUMSUB_APP_TOKEN=$SUMSUB_APP_TOKEN
SUMSUB_SECRET_KEY=$SUMSUB_SECRET_KEY
EOF
```
### Stack Orchestrator