Ricochet-Exchange / ricochet-keeper

Keeper for Ricochet Protocol, implemented with Apache Airflow
5 stars 10 forks source link

Keep on multiple networks #48

Open mikeghen opened 2 years ago

mikeghen commented 2 years ago

We need to be able to keep on multiple networks. Superfluid is deployed on Gnosis Chain and Avalanche. Getting REX setup on these networks will increase volume.

As a first step, the existing DAGs should be changed so that if there's multiple networks, then there will be multiple DAGs.

A single DAG script usually creates 1 dag, the pattern is 1 file 1 dag. However, we can use a single file to make multiple DAGs.

One solution is to add a variable networks = ['polygon', 'gnosis', 'avalanche'] and then at the top of the DAG files use:

for network in Variables.networks:
   dag = DAG("ricochet_distribute_{network}", ...)

A single DAG file will then make multiple DAGs:

ricochet_distribute_polygon
ricochet_distribute_gnsois
ricochet_distribute_avalanche