Skip to content

Commit

Permalink
florestad: Add lib.rs
Browse files Browse the repository at this point in the history
This commit introduces a lib.rs for florestad. With this change, other softwares
can spawn a florestad process and run on the background.
  • Loading branch information
Davidson-Souza committed Apr 10, 2024
1 parent ea3bb38 commit 509bf0d
Show file tree
Hide file tree
Showing 5 changed files with 544 additions and 416 deletions.
4 changes: 2 additions & 2 deletions crates/floresta-wire/src/p2p_wire/running_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ where
Ok(())
}

pub async fn run(mut self, kill_signal: &Arc<RwLock<bool>>) {
pub async fn run(mut self, kill_signal: Arc<RwLock<bool>>) {
try_and_log!(self.init_peers().await);

// Use this node state to Initial Block download
let mut ibd = UtreexoNode(self.0, ChainSelector::default());
try_and_log!(UtreexoNode::<ChainSelector, Chain>::run(&mut ibd, kill_signal).await);
try_and_log!(UtreexoNode::<ChainSelector, Chain>::run(&mut ibd, &kill_signal).await);

// Then take the final state and run the node
self = UtreexoNode(ibd.0, self.1);
Expand Down
Loading

0 comments on commit 509bf0d

Please sign in to comment.