This comprehensive guide is designed for technical personnel responsible for setting up, configuring, and maintaining a Validator Server on the Request Network infrastructure. It covers the comprehensive lifecycle of a Validator Server, from initial setup to advanced operations and troubleshooting.
The technology stack for Request Network Marketplace involves several modern and robust technologies optimized for high performance and reliability:
Configure your environment to differentiate between development, staging and production settings:
Fork the Repository
Database and API Configuration
DATABASE_URL=postgres://user:pass@host:port/database
NODE_ENV=development
Docker Compose Configuration
docker-compose.yml.Additional Configuration
ENCRYPTION_KEY=WANabc234=IV_STRING=dxabcdeLAP333123abcLg==VALIDATOR_NAME=Your Validator NameAPI_PORT=8080API_HOST=http://localhost:8080API_PREFIX=/api/v1REQUEST_NETWORK_UI_URL=http://rn-staging.taoshi.io orREQUEST_NETWORK_UI_URL=http://request.taoshi.io for productionUNKEY_VERIFY_URL=https://api.unkey.dev/v1/keys.verifyKeyVALIDATOR_NAME=
NODE_ENV=
API_PORT=
API_HOST=
API_PREFIX=
DATABASE_URL=
REQUEST_NETWORK_UI_URL=
VALIDATOR_OUTPUT_SERVER_API_URL=
TAOSHI_API_KEY=
TAOSHI_VALIDATOR_API_SECRET=
ENCRYPTION_KEY=
IV_STRING=
UNKEY_VERIFY_URL=
PAYMENT_ENROLLMENT_SECRET=
STRIPE_PUBLIC_KEY=
STRIPE_SECRET_KEY=
STRIPE_WEBHOOKS_KEY=
SENTRY_DSN=
SENTRY_AUTH_TOKEN=
Complete the registration through the Request Network Marketplace UI:
Upon completing the registration, you will receive an Api key and a secret, which are crucial for operating your Validator Server:
TAOSHI_API_KEY=api_abcdefTAOSHI_VALIDATOR_API_SECRET=abc123456These credentials allow you to authenticate incoming requests and manage interactions between your Validator Server and the Request Network Marketplace UI.
Request Network Validator Server acts as a proxy between the consumer Api and the Validator Output Server (OPS). To establish this connection:
.env file:
VALIDATOR_OUTPUT_SERVER_API_URL=https://output-server-1:8080x-taoshi-consumer-request-keyx-taoshi-validator-request-key.x-taoshi-request-key for communication between Request Network Marketplace UI and Validator Server./api/v1/user/:id/api/v1/user/:id?min=1&max=50/validator-checkpointSet up the Validator Output Server (OPS) connection:
.env file:
docker compose build --no-cache
docker compose up -d
eb init
eb create
eb open
The Validator Server can be deployed anywhere that supports Node.js, with or without Docker. At Taoshi, we deploy our own Validator Server on AWS ECS and Elastic Beanstalk. The project source code is set up with workflows for deployment to AWS ECS and/or AWS Elastic Beanstalk.
Install the EB CLI:
pip install awsebcli --upgrade --user
Configure AWS Credentials:
aws configure
Initialize Your Application:
eb init
Create an Environment and Deploy:
eb create
eb create command will handle the provisioning of AWS resources (like EC2, RDS, etc.) and deploy your application.Open Your Application:
eb open
Update Your Application:
eb deploy <environment> --profile <profile>
e.g eb deploy staging --profile taoshi
Once everything is setup, with EB, run:
pnpm deploy:staging
Which should deploy your application to AWS EB under the account that's tied the configured profile.
When currency type of "Fiat" is selected during registration, payments are are facilitated and managed through Stripe Integration.
To enable Stripe payments you will need to create a Stripe account and store the credentials in your .env file.
STRIPE_HOST=https://stripe.com <-- Needed to whitelist stripe website for webhooks.
PAYMENT_ENROLLMENT_SECRET=<random string to be used for jwt token verification>
STRIPE_PUBLIC_KEY=pk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
STRIPE_SECRET_KEY=sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
STRIPE_WEBHOOKS_KEY=<Webhooks key required for payment status updates>
stripe trigger payment_intent.succeeded --add payment_intent:metadata.activate=true
SENTRY_DSN=https://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
SENTRY_AUTH_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
taoshi