This worker server constantly checks for transactions on specific addresses on the Cardano blockchain, and stores them in a MongoDB database for later processing. The worker will check transactions for each address defined in a monitoring object (models/BlockachinMonitoring.js
) and stores a corresponding transaction object (models/BlockachinTransaction.js
) with a matching project key. The system will prioritize queries based on the recent activity on the address.
This server is also capable of processing transactions for a custodial CNFT staking system, the logic of which can be found in the stakingRewards.js
file. The corresponding claim sessions (models/StakeClaim.js
) are created by the Cardano Staking API server. This worker will process the incoming transactions and call the Cardano Node API to send back the tokens.
The server requires a connection to a server running Cardano Node and DB Sync with PostgREST to query DB Sync data and Cardano Node API to submit transactions.
DATABASE_URL
- MongoDB Connection StringCARDANO_API_SECRET
- Shared secret with the Cardano Node APICARDANO_API_URL
- URL of the Cardano Node APICARDANO_DB_URL
- URL of the PostgREST API server
Run the worker with node index.js