twelvepool

Crates.iotwelvepool
lib.rstwelvepool
version0.5.0
sourcesrc
created_at2021-11-28 08:04:22.263089
updated_at2021-12-01 05:05:09.700446
descriptionWatch for new txs in a Terra node mempool
homepagehttps://github.com/setten-io/twelvepool
repositoryhttps://github.com/setten-io/twelvepool
max_upload_size
id488720
size52,863
Etienne Napoleone (etienne-napoleone)

documentation

https://github.com/setten-io/twelvepool/blob/main/README.md

README

twelvepool

Watch for new txs in a Terra node mempool.

Example

use twelvepool::Watcher;

#[tokio::main]
async fn main() {
    let mut receiver = Watcher::new(
        String::from("http://localhost:26657"),  // RPC address
        String::from("http://localhost:1317"),   // LCD address
        None,                                    // Optional reqwest client
        None,                                    // Optional interval duration (default to 100ms)
    )
    .run();

    loop {
        if let Some(mempool_item) = receiver.recv().await {
            if mempool_item.tx.memo == "my memo" {
                println!("tx with our memo found (tx hash {})", mempool_item.tx_hash);
            }
        }
    }
}
Commit count: 31

cargo fmt