Description
Due to the changes made in V5 which relying on redis
to store the remaining budget for a Campaign
a postgres seeding of the database is not sufficient for the sentry
application anymore.
Combined with the fact that we also have a spendable
amount for each Channel
that will be regularly update by one of the Adapter
s (Dummy
or Ethereum
) we need to develop a way to fully seed the sentry
application databases and setup the adapters prerequisites.
In this line of thought, here's what we can do to make the seeding of the development environment of sentry
usable:
-
Create a set of Campaigns (like in test_harness) that will be used to populate the database (AdUnits, Channels, etc)
Seeding was introduced in Sentry benchmark #526 -
A seeder can use a set of Deposits and
Campaign
s (and in turnChannel
s) to setup the database and adapter in the necessary state
Seeding with deposits was introduced in Sentry benchmark #526 -
Dummy adapter should be improved upon the current functionality to return a set deposit no matter how often it is called until the value is changed (set a new value through the adapter). The current setup allows only to set a specific call on the Dummy and what value it should return on that specific call only.
Dummy adapter deposit was introduced in Sentry dummy adapter deposits #520
The only outstanding tasks right now are to:
- Add the ability to populate events (and in turn analytics and accounting) in those Campaigns programmatically.
- Figure out a way to run the seeding on a
sentry
binary start Seeding sentry REST API for Ethereum and Dummy adapters #559
Seed data
We've already introduced 3 campaigns that are available when seeding the sentry application:
.../rust-validator/sentry$ cargo make run-seed
(runs the seed
binary)
Related work
-
test_harness - These capabilities are somewhat similar to what the test_harness is doing at the moment (setting Ethereum deposits, making API calls to create campaigns, events, etc.)
-
sentry REST API documentation - this setup is also related to the API documentation, since we need to be able to generate examples of the JSON responses, request queries, etc. for the sentry API endpoints.