Architecture
High level architecture for the SC Monitor Service
The proposed solution consist on a worker that publishes events to google pubsub and a server that executes readOnly functions in the smart contract.
Http Server
The HTTP server will provide an interface with view-only functions in the smart contract. The first function to integrate will be to get balance from a Liquidity Pool
Monitor Worker
A worker will be running non-stop listening to given events from the smart contract and will publish the event to Google Pubsub.
Event Schema
An Avro schema will be generated from the code and uploaded to Google Cloud to make sure that every published event abides by the schema.
Database
The monitor worker stores the last checked block in a PostgreSQL database in order to prevent dropping events. In case of downtime, the service will restore listening from the latest block checked.
RPC Provider
The connection to the blockchain API will be done through an RPC provider such as Alchemy.
CI/CD and Deployment
This service will be deployed to the Kubernetes Cluster. The CI/CD pipeline will be handle by Github Actions. The secrets will be handled inside Github and injected in the deploy.
Monitoring
Sentry will be used to monitor the health of the service
Last updated