Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #14 from vianetwork/bitcoin-lib-fixes
Browse files Browse the repository at this point in the history
fix: bitcoin lib final fixes
  • Loading branch information
irnb authored Aug 22, 2024
2 parents ee98b2c + bb8c3b2 commit 0b4eea4
Show file tree
Hide file tree
Showing 20 changed files with 1,384 additions and 777 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions core/lib/via_btc_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,18 @@ serde_json.workspace = true
inquire = "0.7.5"
anyhow.workspace = true
serde.workspace = true
tracing.workspace = true
tracing-subscriber = { workspace = true, optional = true }

[dev-dependencies]
mockall = "0.13.0"

[features]
regtest = []
regtest = ["tracing-subscriber"]

[[example]]
name = "bitcoin_client_example"
path = "examples/bitcoin_client_example.rs"
name = "indexer"
path = "examples/indexer_init_example.rs"
required-features = ["regtest"]

[[example]]
Expand Down
101 changes: 0 additions & 101 deletions core/lib/via_btc_client/examples/bitcoin_client_example.rs

This file was deleted.

22 changes: 22 additions & 0 deletions core/lib/via_btc_client/examples/indexer_init_example.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use anyhow::Result;
use tracing_subscriber;
use via_btc_client::{indexer::BitcoinInscriptionIndexer, regtest::BitcoinRegtest, types::Network};

#[tokio::main]
async fn main() -> Result<()> {
tracing_subscriber::fmt()
.with_max_level(tracing::Level::DEBUG)
.init();

tracing::info!("starting Bitcoin client example");
let context = BitcoinRegtest::new()?;
let miner = context.get_miner_address()?;
tracing::info!("miner address: {}", miner);
let indexer =
BitcoinInscriptionIndexer::new(&context.get_url(), Network::Regtest, vec![]).await;

if let Err(e) = indexer {
tracing::error!("Failed to create indexer: {:?}", e);
}
Ok(())
}
Loading

0 comments on commit 0b4eea4

Please sign in to comment.