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 .envNext 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-envThen run migrations and seed the database:
yarn migrate:devyarn seedOnce steps above completed, run the following command to start the project in watch mode:
yarn start:devOpen 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-solTo authorize your treasury wallet (sign a message and generate a JWT token):
yarn authorize-walletJWT_ACCESS_SECRETandJWT_REFRESH_SECRETare randomly generated 42 char stringsSOLANA_CLUSTERcan be eithermainnet-beta,testnetordevnet. Rule of thumb is to usedevneton localhost development, andmainnet-betafor production applicationsAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYare 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_NAMEshould be delivered by sysadmin alongside AWS credentialsTREASURY_PRIVATE_KEYis 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_SECRETis the secret key used for AES encryption/decryption of the Treasury wallet's private key, preferably 64 byte longMAIL_SERVICEand 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_KEYcan be obtained via Helius DashboardDISCORD_WEBHOOK_URLcan be obtained on discord by creating a channel and going to "settings -> integrations"
When contributing please follow the guidelines specified in the CONTRIBUTING document