deploy tx

Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
Cyrill Leutwiler
2025-03-25 17:54:40 +01:00
parent a835754d41
commit 34b8879b15
7 changed files with 141 additions and 18 deletions
+1
View File
@@ -5,6 +5,7 @@ use revive_dt_config::Arguments;
use revive_dt_node_interaction::EthereumNode;
pub mod geth;
pub mod pool;
/// The default genesis configuration.
pub const GENESIS_JSON: &str = include_str!("../../../genesis.json");
+38
View File
@@ -0,0 +1,38 @@
use std::sync::{
LazyLock, Mutex,
mpsc::{Receiver, Sender},
};
pub trait NodePool<T: Node> {
fn access() -> &'static LazyLock<Mutex<Vec<T>>>;
}
use revive_dt_config::Arguments;
use crate::Node;
//static POOL: LazyLock<Mutex<Pool<T>>> = LazyLock::new(Default::default);
pub struct Handle<T> {
node: T,
notifier: Sender<()>,
}
pub struct Pool<T> {
request: Receiver<()>,
nodes: usize,
handles: Vec<T>,
}
impl<T> Pool<T>
where
T: Node,
{
pub fn spawn() {}
}
// spawner: loops on a queue
pub fn get_handle<T: Node + NodePool<T>>(config: &Arguments) -> Receiver<T> {
todo!()
}