This repository has been archived by the owner on Jul 3, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from xn3cr0nx/feat/state-of-the-art
Refactor project to the "state of the art"
- Loading branch information
Showing
37 changed files
with
828 additions
and
599 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,30 +5,48 @@ version = "0.1.0" | |
authors = ["Dr. Maxim Orlovsky <[email protected]>"] | ||
keywords = ["bitcoin", "node"] | ||
license = "MIT" | ||
edition = "2018" | ||
edition = "2021" | ||
readme = "README.md" | ||
|
||
[lib] | ||
name = "bp_node" | ||
|
||
[[bin]] | ||
name = "queryd" | ||
path = "src/bin/queryd.rs" | ||
|
||
[[bin]] | ||
name = "bp-cli" | ||
path = "src/bin/bp-cli.rs" | ||
|
||
[[bin]] | ||
name = "bp-indexer" | ||
path = "src/bin/bp-indexer.rs" | ||
|
||
[dependencies] | ||
dotenv = "~0.15" | ||
clap = "=3.0.0-beta.1" | ||
clap = "=3.0.0-beta.5" | ||
chrono = "~0.4" | ||
derive_wrapper = "~0.1" | ||
async-trait = "~0.1" | ||
log = { version = "~0.4", features = ["max_level_trace", "release_max_level_debug"] } | ||
env_logger = "~0.7" | ||
diesel = { version = "~1.4", features = ["postgres", "uuid", "numeric", "chrono"] } | ||
tokio = { version = "~0.2", features = ["full"] } | ||
futures = "~0.3" | ||
zmq = "~0.9" | ||
tiny_http = "~0.6" | ||
prometheus = "~0.8" | ||
amplify = "~3.9.1" | ||
bp-core = "0.5.0-rc.1" | ||
microservices = { version = "0.5.0-beta.1", default-features = false, features = ["peer"] } | ||
internet2 = "0.5.0-alpha.2" | ||
bitcoin = "0.27.1" | ||
bitcoin_hashes = "0.10.0" | ||
miniscript = "6.0.1" | ||
|
||
[dependencies.lnpbp] | ||
git = "https://github.com/lnp-bp/rust-lnpbp" | ||
tag = "v0.1.0-alpha.3" | ||
features = ["tor", "tokio", "log", "daemons", "serde"] | ||
branch = "master" | ||
|
||
# lnpbp requires custom version of bitcoin, so to maintain type compatibility | ||
# we have to use library through lnpbp::bitcoin handle and not via direct | ||
# dependency | ||
#bitcoin = "~0.23" | ||
[patch.crates-io] | ||
# Remove this once https://github.com/jean-airoldie/zeromq-src-rs/pull/15 got merged | ||
zeromq-src = { git = "https://github.com/LNP-BP/zeromq-src-rs", branch = "fix/cmake" } | ||
bp-core = { git = "https://github.com/xn3cr0nx/bp-core", branch = "pub-short-id" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,52 +11,61 @@ | |
// along with this software. | ||
// If not, see <https://opensource.org/licenses/MIT>. | ||
|
||
|
||
use clap::Clap; | ||
use clap::Parser; | ||
|
||
use crate::msgbus::constants::*; | ||
|
||
|
||
#[derive(Clap, Clone, Debug, Display)] | ||
#[derive(Parser, Clone, Debug, Display)] | ||
#[display_from(Debug)] | ||
#[clap( | ||
name = "bp-cli", | ||
version = "0.0.1", | ||
author = "Dr Maxim Orlovsky <[email protected]>", | ||
about = "BP node command-line interface; part of Bitcoin protocol node" | ||
about = "BP node command-line interface; part of Bitcoin protocol node" | ||
)] | ||
pub struct Opts { | ||
/// Path and name of the configuration file | ||
#[clap(global = true, short = "c", long = "config", default_value = "./cli.toml")] | ||
#[clap( | ||
global = true, | ||
short = 'c', | ||
long = "config", | ||
default_value = "./cli.toml" | ||
)] | ||
pub config: String, | ||
|
||
/// Sets verbosity level; can be used multiple times to increase verbosity | ||
#[clap(global = true, short = "v", long = "verbose", min_values = 0, max_values = 4, parse(from_occurrences))] | ||
#[clap( | ||
global = true, | ||
short = 'v', | ||
long = "verbose", | ||
min_values = 0, | ||
max_values = 4, | ||
parse(from_occurrences) | ||
)] | ||
pub verbose: u8, | ||
|
||
/// IPC connection string for queryd daemon API | ||
#[clap(global = true, short = "w", long = "queryd-api", default_value = MSGBUS_PEER_API_ADDR, env="BP_CLI_QUERYD_API_ADDR")] | ||
#[clap(global = true, short = 'w', long = "queryd-api", default_value = MSGBUS_PEER_API_ADDR, env="BP_CLI_QUERYD_API_ADDR")] | ||
pub queryd_api_socket_str: String, | ||
|
||
/// IPC connection string for queryd daemon push notifications on perr status updates | ||
#[clap(global = true, short = "W", long = "queryd-push", default_value = MSGBUS_PEER_PUSH_ADDR, env="BP_CLI_QUERYD_PUSH_ADDR")] | ||
#[clap(global = true, short = 'W', long = "queryd-push", default_value = MSGBUS_PEER_PUSH_ADDR, env="BP_CLI_QUERYD_PUSH_ADDR")] | ||
pub queryd_push_socket_str: String, | ||
|
||
#[clap(subcommand)] | ||
pub command: Command | ||
pub command: Command, | ||
} | ||
|
||
#[derive(Clap, Clone, Debug, Display)] | ||
#[derive(Parser, Clone, Debug, Display)] | ||
#[display_from(Debug)] | ||
pub enum Command { | ||
/// Sends command to a wired daemon to connect to the new peer | ||
Query { | ||
/// Query to run against Bitcoin blockchain & transaction index | ||
query: String | ||
query: String, | ||
}, | ||
} | ||
|
||
|
||
// We need config structure since not all of the parameters can be specified | ||
// via environment and command-line arguments. Thus we need a config file and | ||
// default set of configuration | ||
|
@@ -85,7 +94,7 @@ impl Default for Config { | |
Self { | ||
verbose: 0, | ||
msgbus_peer_api_addr: MSGBUS_PEER_API_ADDR.to_string(), | ||
msgbus_peer_sub_addr: MSGBUS_PEER_PUSH_ADDR.to_string() | ||
msgbus_peer_sub_addr: MSGBUS_PEER_PUSH_ADDR.to_string(), | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.