Drips Event Processor is a custom, read-only backend service for Drips. It ingests low-level Drips protocol Ethereum events and related IPFS documents in real-time, and produces a database of higher-level entities for the Drips App (such as "Drip Lists" and "Projects"). This database is then read by the Drips GraphQL API in order to provide a single, convenient and fast endpoint for querying decentralized data within the Drips Network without complicated client-side logic.
As a "read-only" service, Drips Event Processor and Drips GraphQL API together merely act as a query API layer for on-chain activity, meaning that Ethereum and IPFS remain the source of truth for all activity on Drips. In practice, this means that anyone is able to run an instance of this service and reach the exact same state as Drips' production instance once all past events have been ingested.
Drips Event Processor & GraphQL API together are comparable in functionality and scope to the Drips Subgraph, but add the flexibility of computing and exposing higher-level abstracted entities (such as Projects
and Drip Lists
). The canonical state of these entities is derived from low-level generics within the Drips Protocol, in combination with metadata stored on IPFS.
Run:
docker-compose up
This will spin up:
-
Postgres: the database for the application.
-
pgAdmin: the GUI for managing the PostgreSQL database.
-
Redis: the database for storing (bee)queue jobs.
To monitorBeeQueue
navigate to http://localhost:3000/arena
after launching the app.
Docker is configured to preserve the state of the database and Redis in-between runs. If you want to start fresh, you'll need to delete the respective volumes with Docker.
After you have ensured that the Docker containers are up and running, to connect to pgAdmin:
- Open your browser and go to http://localhost:5050/.
- Check out the
docker-compose.yml
file for thePGADMIN_DEFAULT_EMAIL
andPGADMIN_DEFAULT_PASSWORD
values. Use these to log into pgAdmin. - Check out the
servers.json
file for theName
andPassword
values. Use thePassword
value to connect to theName
Postgres server, if prompted.
First, populate .env
according to .env.template
.
To launch the application, run:
npm install
Then, ensure you run the development environment, assuming you don't intend to connect to external Postgres and Redis instances.
Lastly, run
npm run start:local
to start the server.
This command:
- Establishes a connection to
dripsdb
. - Synchronizes the state of the database.
- Ingests events up to the current block into the database.
- Registers event listeners for tracking incoming events.
- Continues appending new data to the database.