| .. | ||
| README.md | ||
| stack.yml | ||
onboarding-api
Instructions for running the testnet-onboarding-api using laconic-so
Setup
-
Clone the stack repo:
laconic-so fetch-stack git.vdb.to/cerc-io/testnet-onboarding-app-stack -
Setup required repositories:
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-api setup-repositories -
Build the container image:
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-api build-containersThis should create the
cerc/testnet-onboarding-apiimage locally
Create a deployment
-
Create a spec file for the deployment:
laconic-so --stack ~/cerc/testnet-onboarding-app-stack/stack-orchestrator/stacks/onboarding-api deploy init --output onboarding-api-spec.yml -
Edit
networkin the spec file to map container ports to host ports as required:network: ports: testnet-onboarding-api: - '3000:3000' -
Create a deployment from the spec file:
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
Configuration
-
Inside the
onboarding-api-deploymentdeployment directory, openconfig.envfile and set following env variables:# Your sumsub application token SUMSUB_APP_TOKEN= # Your sumsub secret key SUMSUB_SECRET_KEY= # Optional # KYC level of access token being generated (default: basic-kyc-level) KYC_LEVEL= # TTL for the generated access token in seconds (default: 600) TTL_IN_SECS=
Start the deployment
laconic-so deployment --dir onboarding-api-deployment start
Check status
-
To list down and monitor the running container:
# With status docker ps # Check logs for the server laconic-so deployment --dir onboarding-api-deployment logs -f testnet-onboarding-api
Run
-
Generate an access token for a user:
curl -X POST http://localhost:3000/generate-token \ -H "Content-Type: application/json" \ -d '{"userId": "JamesBond007"}' # Expected output: # {"token":"generated-access-token"}
Clean up
-
Stop the deployment:
laconic-so deployment --dir onboarding-api-deployment stop