chore: improve deps management

This commit is contained in:
Ludo Galabru
2023-08-21 11:12:13 +02:00
parent 73ad612ea4
commit af8e919b49
9 changed files with 24 additions and 96 deletions

38
Cargo.lock generated
View File

@@ -458,8 +458,6 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "chainhook-sdk"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7abe64f892f4f7df13856ac4b12a1a06a122b7e9279883713871be36a451a3ab"
dependencies = [
"base58 0.2.0",
"base64 0.13.1",
@@ -478,7 +476,7 @@ dependencies = [
"rand 0.8.5",
"reqwest",
"rocket",
"schemars 0.8.11",
"schemars 0.8.12",
"serde",
"serde-hex",
"serde_derive",
@@ -492,11 +490,9 @@ dependencies = [
[[package]]
name = "chainhook-types"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8128537ccd9c8f85c77b3d9096b04462b6784b67f6c7760e8d3f56c9d4128bdd"
dependencies = [
"hex",
"schemars 0.8.11",
"schemars 0.8.12",
"serde",
"serde_derive",
"serde_json",
@@ -2474,10 +2470,7 @@ dependencies = [
"anyhow",
"atty",
"chainhook-sdk",
"clap",
"clap_generate",
"crossbeam-channel 0.5.8",
"ctrlc",
"dashmap 5.4.0",
"flate2",
"flume",
@@ -2504,7 +2497,6 @@ dependencies = [
"tar",
"threadpool",
"tokio",
"toml",
"uuid 1.3.0",
]
@@ -2512,43 +2504,17 @@ dependencies = [
name = "ordhook-cli"
version = "0.3.0"
dependencies = [
"ansi_term",
"anyhow",
"atty",
"chainhook-sdk",
"clap",
"clap_generate",
"crossbeam-channel 0.5.8",
"ctrlc",
"dashmap 5.4.0",
"flate2",
"flume",
"futures",
"futures-util",
"fxhash",
"hex",
"hiro-system-kit",
"num_cpus",
"ordhook",
"pprof",
"progressing",
"rand 0.8.5",
"redis",
"reqwest",
"rocket",
"rocket_okapi",
"rocksdb",
"rusqlite",
"schemars 0.8.12",
"serde",
"serde-redis",
"serde_derive",
"serde_json",
"tar",
"threadpool",
"tokio",
"toml",
"uuid 1.3.0",
]
[[package]]

View File

@@ -4,6 +4,9 @@ version = "0.3.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[[bin]]
name = "ordhook"
path = "src/main.rs"
[dependencies]
ordhook = { path = "../ordhook-core" }
@@ -11,46 +14,12 @@ num_cpus = "1.16.0"
serde = "1"
serde_json = "1"
serde_derive = "1"
redis = "0.21.5"
serde-redis = "0.12.0"
hex = "0.4.3"
rand = "0.8.5"
chainhook-sdk = { version = "=0.8.2", default-features = false, features = ["zeromq"] }
# chainhook-sdk = { version = "=0.8.2", path = "../../../chainhook/components/chainhook-sdk", default-features = false, features = ["zeromq"] }
reqwest = { version = "0.11", features = ["stream", "json"] }
hiro-system-kit = "0.1.0"
clap = { version = "3.2.23", features = ["derive"], optional = true }
clap_generate = { version = "3.0.3", optional = true }
toml = { version = "0.5.6", features = ["preserve_order"], optional = true }
ctrlc = { version = "3.2.2", optional = true }
reqwest = { version = "0.11", features = ["stream", "json"] }
tokio = { version = "=1.24", features = ["full"] }
futures-util = "0.3.24"
flate2 = "1.0.24"
tar = "0.4.38"
flume = "0.10.14"
ansi_term = "0.12.1"
atty = "0.2.14"
crossbeam-channel = "0.5.8"
uuid = { version = "1.3.0", features = ["v4", "fast-rng"] }
threadpool = "1.8.1"
rocket_okapi = "0.8.0-rc.3"
rocket = { version = "=0.5.0-rc.3", features = ["json"] }
dashmap = "5.4.0"
fxhash = "0.2.1"
rusqlite = { version = "0.27.0", features = ["bundled"] }
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"
default-features = false
features = ["lz4", "snappy"]
# [profile.release]
# debug = true
[features]
default = ["cli"]

View File

@@ -1,18 +1,19 @@
use crate::config::file::ConfigFile;
use crate::config::generator::generate_config;
use ordhook::scan::bitcoin::scan_bitcoin_chainstate_via_rpc_using_predicate;
use chainhook_sdk::bitcoincore_rpc::{Auth, Client, RpcApi};
use chainhook_sdk::chainhooks::types::HttpHook;
use chainhook_sdk::chainhooks::types::{
use ordhook::chainhook_sdk::bitcoincore_rpc::{Auth, Client, RpcApi};
use ordhook::chainhook_sdk::chainhooks::types::HttpHook;
use ordhook::chainhook_sdk::chainhooks::types::{
BitcoinChainhookFullSpecification, BitcoinChainhookNetworkSpecification, BitcoinPredicateType,
ChainhookFullSpecification, HookAction, OrdinalOperations,
};
use chainhook_sdk::indexer::bitcoin::{
use ordhook::chainhook_sdk::utils::BlockHeights;
use ordhook::chainhook_sdk::indexer::bitcoin::{
download_and_parse_block_with_retry, retrieve_block_hash_with_retry,
};
use chainhook_sdk::observer::BitcoinConfig;
use chainhook_sdk::types::BitcoinBlockData;
use chainhook_sdk::utils::Context;
use ordhook::chainhook_sdk::observer::BitcoinConfig;
use ordhook::chainhook_sdk::types::BitcoinBlockData;
use ordhook::chainhook_sdk::utils::Context;
use clap::{Parser, Subcommand};
use hiro_system_kit;
use ordhook::config::Config;
@@ -453,7 +454,7 @@ async fn handle_command(opts: Opts, ctx: &Context) -> Result<(), String> {
// If post-to:
// - Replay that requires connection to bitcoind
let mut block_range =
chainhook_sdk::utils::BlockHeights::BlockRange(cmd.start_block, cmd.end_block)
BlockHeights::BlockRange(cmd.start_block, cmd.end_block)
.get_sorted_entries();
if let Some(ref post_to) = cmd.post_to {

View File

@@ -1,5 +1,5 @@
use chainhook_sdk::indexer::IndexerConfig;
use chainhook_sdk::types::{
use ordhook::chainhook_sdk::indexer::IndexerConfig;
use ordhook::chainhook_sdk::types::{
BitcoinBlockSignaling, BitcoinNetwork, StacksNetwork, StacksNodeConfig,
};
use ordhook::config::{

View File

@@ -1,4 +1,4 @@
use chainhook_sdk::types::BitcoinNetwork;
use ordhook::chainhook_sdk::types::BitcoinNetwork;
pub fn generate_config(network: &BitcoinNetwork) -> String {
let network = format!("{:?}", network);

View File

@@ -1,10 +1,8 @@
#[macro_use]
extern crate hiro_system_kit;
#[macro_use]
extern crate serde_derive;
extern crate serde;
#[macro_use]
extern crate hiro_system_kit;
pub mod cli;
pub mod config;

View File

@@ -3,8 +3,6 @@ name = "ordhook"
version = "0.3.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
num_cpus = "1.16.0"
serde = "1"
@@ -17,10 +15,6 @@ rand = "0.8.5"
chainhook-sdk = { version = "=0.8.2", default-features = false, features = ["zeromq"] }
# chainhook-sdk = { version = "=0.8.2", 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 }
toml = { version = "0.5.6", features = ["preserve_order"], optional = true }
ctrlc = { version = "3.2.2", optional = true }
reqwest = { version = "0.11", features = ["stream", "json"] }
tokio = { version = "=1.24", features = ["full"] }
futures-util = "0.3.24"
@@ -52,7 +46,5 @@ features = ["lz4", "snappy"]
# debug = true
[features]
default = ["cli"]
cli = ["clap", "clap_generate", "toml", "ctrlc", "hiro-system-kit/log"]
debug = ["hiro-system-kit/debug"]
release = ["hiro-system-kit/release"]

View File

@@ -9,6 +9,8 @@ extern crate serde_derive;
extern crate serde;
pub extern crate chainhook_sdk;
pub mod config;
pub mod core;
pub mod db;

View File

@@ -16,13 +16,13 @@ RUN mkdir /out
RUN cargo build --features release --release
RUN cp target/release/ordhook-cli /out
RUN cp target/release/ordhook /out
FROM debian:bullseye-slim
RUN apt update && apt install -y ca-certificates libssl-dev
COPY --from=build /out/ordhook-cli /bin/hord
COPY --from=build /out/ordhook /bin/hord
WORKDIR /workspace