Skip to content

Commit

Permalink
Updated deep mind and DMLOG to Firehose and FIRE
Browse files Browse the repository at this point in the history
  • Loading branch information
maoueh committed Sep 28, 2022
1 parent e511587 commit 7115c3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/cmd/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub struct Console {
/// data directory where to store latest block fully processed
#[structopt(short = "d", long, default_value = "./thegarii")]
data_directory: String,
/// reduce deep mind block output by just showing the length (not good for production!)
/// reduce Firehose logs block output by just showing the length (not good for production!)
#[structopt(short = "q", long)]
quiet: bool,
}
Expand Down
14 changes: 7 additions & 7 deletions src/polling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,16 @@ impl Polling {
.map_err(Into::into)
}

/// dm log to stdout
/// Firehose log to stdout
///
/// DMLOG BLOCK <HEIGHT> <ENCODED>
fn dm_log(&self, b: &(u64, Vec<u8>)) -> Result<()> {
/// FIRE BLOCK <HEIGHT> <ENCODED>
fn firehose_log(&self, b: &(u64, Vec<u8>)) -> Result<()> {
let height = b.0;

if self.quiet {
println!("DMLOG BLOCK {} <quiet-mode>", height);
println!("FIRE BLOCK {} <quiet-mode>", height);
} else {
println!("DMLOG BLOCK {} {}", height, hex::encode(&b.1));
println!("FIRE BLOCK {} {}", height, hex::encode(&b.1));
}

Ok(())
Expand Down Expand Up @@ -181,10 +181,10 @@ impl Polling {
while let Some(item) = tasks.next().await {
let block = item?;

self.dm_log(&block)?;
self.firehose_log(&block)?;
// # Safty
//
// only update ptr after dm_log
// only update ptr after firehose_log has been emitted
self.ptr = block.0 + 1;

self.write_ptr().await?;
Expand Down

0 comments on commit 7115c3f

Please sign in to comment.