Skip to content

Commit

Permalink
refactor: move from multithread to local pool
Browse files Browse the repository at this point in the history
  • Loading branch information
lgalabru committed Jul 22, 2023
1 parent c9c43ae commit 57a46ec
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 165 deletions.
47 changes: 22 additions & 25 deletions Cargo.lock

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

4 changes: 3 additions & 1 deletion components/hord-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ redis = "0.21.5"
serde-redis = "0.12.0"
hex = "0.4.3"
rand = "0.8.5"
chainhook-sdk = { version = "=0.7.7", default-features = false, features = ["zeromq"] }
# chainhook-sdk = { version = "=0.7.7", default-features = false, features = ["zeromq"] }
chainhook-sdk = { version = "=0.7.7", path = "../../../chainhook/components/chainhook-sdk", default-features = false, features = ["zeromq"] }
hiro-system-kit = "0.1.0"
clap = { version = "3.2.23", features = ["derive"], optional = true }
clap_generate = { version = "3.0.3", optional = true }
Expand All @@ -40,6 +41,7 @@ anyhow = { version = "1.0.56", features = ["backtrace"] }
schemars = { version = "0.8.10", git = "https://github.com/hirosystems/schemars.git", branch = "feat-chainhook-fixes" }
pprof = { version = "0.12", features = ["flamegraph"] }
progressing = '3'
futures = "0.3.28"

[dependencies.rocksdb]
version = "0.20.1"
Expand Down
14 changes: 1 addition & 13 deletions components/hord-cli/src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,22 +728,10 @@ async fn handle_command(opts: Opts, ctx: &Context) -> Result<(), String> {
let mut hord_config = config.get_hord_config();
hord_config.network_thread_max = cmd.network_threads;

let bitcoin_config = BitcoinConfig {
username: config.network.bitcoind_rpc_username.clone(),
password: config.network.bitcoind_rpc_password.clone(),
rpc_url: config.network.bitcoind_rpc_url.clone(),
network: config.network.bitcoin_network.clone(),
bitcoin_block_signaling: config.network.bitcoin_block_signaling.clone(),
};
let blocks_db =
open_readwrite_hord_db_conn_rocks_db(&config.expected_cache_path(), &ctx)?;

rebuild_rocks_db(
&bitcoin_config,
&blocks_db,
&config,
cmd.start_block,
cmd.end_block,
&config.get_hord_config(),
&ctx,
)
.await?
Expand Down

0 comments on commit 57a46ec

Please sign in to comment.