A pipeline for monitoring gSOL transactions and populating a database with its details
Some helpful docs
https://jac0xb.medium.com/writing-an-anchor-program-indexer-for-solana-using-helius-webhooks-google-cloud-functions-and-a2f1349ad0b3
https://cloud.google.com/functions/docs/quickstarts
https://docs.helius.xyz/solana-data-infrastucture/advanced-infrastructure/solana-indexing
https://www.mongodb.com/docs/atlas/api/data-api-resources/#find-multiple-documents
For detailed instructions, please refer to the documentation.
Depending on your preferred package manager, follow the instructions below to deploy your project.
Requirements: NodeJS
lts/fermium (v.14.15.0)
. If you're using nvm, runnvm use
to ensure you're using the same Node version in local and in your cloud function's runtime.
-
Go to the API dashboard, select your project and enable the following APIs (if not already enabled):
- Cloud Functions API
- Cloud Deployment Manager V2 API
- Cloud Build API
- Cloud Storage
- Cloud Logging API
-
Replace
<your-gcp-project-id>
with your project id inserverles.ts
Follow the authentication doc.
TL;DR
gcloud auth application-default login
# with npm
npm i
# or yarn
yarn
# with npm
npm run deploy
# or yarn
yarn deploy
Note - after deploying, run the following to make a cloud function public:
gcloud functions set-iam-policy --region=europe-west1 sunrise-transaction-monitor-dev-httpHello policy.json
This is currently not automated by serverless.