NestJS backend for dReader dapp on Solana
Note generate a new Helius API key via Helius Dashboard
To test webhooks we recommend creating a reverse proxy to your local machine on which your localhost webserver is running. We suggest using ngrok, which you can set up by following these instructions
Note ask DevOps engineer to generate new IAM user credentials for you
Warning make sure your node version matches the one specified in
.nvmrc
Install dependencies and copy the .env.example
content into .env
:
yarn add & cp .env.example .env
Next run the command for generating env variables and replace placeholder values from .env
as per instructions in the terminal. Fill in any remaining variables by following notes from the .env section:
yarn generate-env
Then run migrations and seed the database:
yarn migrate:dev
yarn seed
Once steps above completed, run the following command to start the project in watch mode:
yarn start:dev
Open http://localhost:3005 with your browser to see the result. API documentation is available on the /api route
For airdropping Sol to a specified wallet use the following command
yarn airdrop-sol
To authorize your treasury wallet (sign a message and generate a JWT token):
yarn authorize-wallet
JWT_ACCESS_SECRET
andJWT_REFRESH_SECRET
are randomly generated 42 char stringsSOLANA_CLUSTER
can be eithermainnet-beta
,testnet
ordevnet
. Rule of thumb is to usedevnet
on localhost development, andmainnet-beta
for production applicationsAWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
are necessary for app to work as intended since app relies on AWS S3 for file storage. These credentials can be obtained upon IAM user creation (contact sysadmin to create IAM user for you)AWS_BUCKET_NAME
should be delivered by sysadmin alongside AWS credentialsTREASURY_PRIVATE_KEY
is the AES encrypted private key of a wallet used as a Treasury. All royalties will be collected there and all our payments will be done with it.TREASURY_SECRET
is the secret key used for AES encryption/decryption of the Treasury wallet's private key, preferably 64 byte longMAIL_SERVICE
and other mail related variables are unnecessary unless working on email-related features. Make sure to download NodemailerApp for local development. For production setup follow the nodemailer-gmail-smtp guideHELIUS_API_KEY
can be obtained via Helius DashboardDARKBLOCK_API_KEY
can be obtained via Darkblock DocsDISCORD_WEBHOOK_URL
can be obtained on discord by creating a channel and going to "settings -> integrations"
When contributing please follow the guidelines specified in the CONTRIBUTING document