serai/coordinator/src/main.rs

34 lines
621 B
Rust
Raw Normal View History

2023-04-15 21:38:47 +00:00
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_mut)]
use serai_db::Db;
use serai_client::Serai;
mod transaction;
2023-04-15 21:38:47 +00:00
mod substrate;
#[cfg(test)]
mod tests;
2023-04-15 21:38:47 +00:00
async fn run<D: Db>(db: D, serai: Serai) {
let mut last_substrate_block = 0; // TODO: Load from DB
loop {
match substrate::handle_new_blocks(&serai, &mut last_substrate_block).await {
Ok(()) => {}
Err(e) => log::error!("couldn't communicate with serai node: {e}"),
}
// Handle all messages from tributaries
// Handle all messages from processors
}
}
2023-04-11 13:21:35 +00:00
#[tokio::main]
2023-04-15 21:38:47 +00:00
async fn main() {
// Open the database
}