Skip to content

Commit

Permalink
Refactoring following 0.3 LNP/BP libraries epic refactoring & upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Jan 22, 2021
1 parent c6020b1 commit 772cc15
Show file tree
Hide file tree
Showing 34 changed files with 300 additions and 582 deletions.
63 changes: 50 additions & 13 deletions Cargo.lock

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

30 changes: 19 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ build = "build.rs"
exclude = [".github", "/test", "Dockerfile"]

[lib]
name = "lnp"
name = "lnp_node"

[[bin]]
name = "lnpd"
Expand Down Expand Up @@ -42,17 +42,20 @@ required-features = ["cli"]
amplify = "3"
amplify_derive = "2.4.2"
lnpbp = "0.3"
descriptor-wallet = "0.3"
slip132 = "0.3.0-rc.1"
rgb_node = { version = "0.3.0-beta.1", path = "../../lnpbp/rgb-node", optional = true, default-features = false, features = ["client", "fungibles"] }
internet2 = { version = "0.3.4", default-features = false, features = ["derive", "descriptor-wallet", "bitcoin-ext"] }
microservices = { version = "0.3.2", default-features = false }
descriptor-wallet = { version = "0.3.3", features = ["keygen"] }
slip132 = "0.3"
lnp-core = "0.3"
rgb-core = { version = "0.3", optional = true }
rgb_node = { version = "0.3.0-rc.1", path = "../../lnpbp/rgb-node", optional = true, default-features = false, features = ["client", "fungibles"] }
internet2 = { version = "0.3.7", default-features = false, features = ["derive", "descriptor-wallet", "bitcoin-ext", "lnpbp"] }
microservices = { version = "0.3.7", default-features = false, features = ["peer"] }
# Bitcoin
bitcoin = "0.26"
electrum-client = { version = "0.5.0-beta.1", optional = true, git = "https://github.com/LNP-BP/rust-electrum-client", branch = "bitcoin-0.26" }
# Rust language
lazy_static = "1.4"
chrono = "0.4"
nix = { version = "0.19", optional = true }
# Serialization & parsing
serde_crate = { package = "serde", version = "1", features = ["derive"], optional = true }
serde_with = { version = "1.5", optional = true }
Expand All @@ -70,13 +73,18 @@ configure_me = { version = "0.4", optional = true }
dotenv = { version = "0.15", optional = true }
colored = { version = "2", optional = true }
shellexpand = { version = "2", optional = true }
# IPC
zmq = "0.9"

[build-dependencies]
amplify = "3"
amplify_derive = "2.4.2"
lnpbp = "0.3"
internet2 = { version = "0.3.4", default-features = false, features = ["derive", "descriptor-wallet"] }
microservices = { version = "0.3.2", default-features = false }
bitcoin = "0.26"
lnp-core = "0.3"
rgb-core = { version = "0.3", optional = true }
internet2 = { version = "0.3.7", default-features = false, features = ["derive", "descriptor-wallet", "bitcoin-ext", "lnpbp"] }
microservices = { version = "0.3.7", default-features = false, features = ["peer"] }
lazy_static = "1.4"
clap = "3.0.0-beta.2"
clap_generate = "3.0.0-beta.2"
Expand All @@ -95,7 +103,7 @@ default = ["server", "cli", "rgb"]
all = ["server", "cli", "rgb", "serde", "tor", "vendored_openssl"]

# Server is a standalone application that runs daemon
server = ["node", "shell", "microservices/server"]
server = ["node", "shell", "microservices/server", "nix"]
# Command-line application feature
cli = ["shell", "client", "serde", "microservices/cli"]

Expand Down Expand Up @@ -124,11 +132,11 @@ shell = [
_config = ["serde_yaml", "toml"]
_rpc = []

rgb = ["rgb_node"]
rgb = ["lnp-core/rgb", "rgb-core", "rgb_node", "internet2/rgb"]
serde = ["serde_crate", "serde_with", "serde_yaml", "serde_json", "toml",
"chrono/serde", "bitcoin/use-serde", "slip132/serde",
"amplify/serde", "internet2/serde", "microservices/serde",
"lnpbp/serde", "descriptor-wallet/serde", "rgb_node/serde" ]
"lnpbp/serde", "descriptor-wallet/serde", "rgb_node/serde", "rgb-core/serde", "lnp-core/serde" ]
tor = ["microservices/tor", "internet2/tor", "rgb_node/tor"]
vendored_openssl = ["microservices/vendored_openssl", "internet2/vendored_openssl", "rgb_node/vendored_openssl"]

Expand Down
4 changes: 2 additions & 2 deletions src/bin/channeld.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ extern crate log;
use clap::Clap;
use std::convert::TryInto;

use lnp::channeld::{self, Opts};
use lnp::{Config, LogStyle};
use lnp_node::channeld::{self, Opts};
use lnp_node::{Config, LogStyle};

fn main() {
println!("channeld: lightning channel microservice");
Expand Down
4 changes: 2 additions & 2 deletions src/bin/gossipd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ extern crate log;

use clap::Clap;

use lnp::gossipd::{self, Opts};
use lnp::Config;
use lnp_node::gossipd::{self, Opts};
use lnp_node::Config;

fn main() {
println!("gossipd: lightning peer network gossip daemon");
Expand Down
8 changes: 4 additions & 4 deletions src/bin/lnp-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ extern crate log;

use clap::Clap;

use lnp::cli::Opts;
use lnp::rpc::Client;
use lnp::{Config, LogStyle};
use lnpbp_services::shell::Exec;
use lnp_node::cli::Opts;
use lnp_node::rpc::Client;
use lnp_node::{Config, LogStyle};
use microservices::shell::Exec;

fn main() {
println!("lnp-cli: command-line tool for working with LNP node");
Expand Down
4 changes: 2 additions & 2 deletions src/bin/lnpd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ extern crate log;

use clap::Clap;

use lnp::lnpd::{self, Opts};
use lnp::{Config, LogStyle};
use lnp_node::lnpd::{self, Opts};
use lnp_node::{Config, LogStyle};

fn main() {
println!("lnpd: lightning node management microservice");
Expand Down
18 changes: 9 additions & 9 deletions src/bin/peerd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,21 +93,21 @@ extern crate log;
#[macro_use]
extern crate amplify_derive;

use amplify::internet::InetSocketAddr;
use clap::Clap;
use core::convert::TryFrom;
use core::time::Duration;
use internet2::addr::InetSocketAddr;
use nix::unistd::{fork, ForkResult};
use std::convert::TryFrom;
use std::net::TcpListener;
use std::net::{IpAddr, Ipv4Addr, SocketAddr};
use std::time::Duration;

use lnp::peerd::{self, Opts};
use lnp::{Config, LogStyle};
use lnpbp::bitcoin::secp256k1::PublicKey;
use lnpbp::lnp::{
session, FramingProtocol, NodeAddr, PeerConnection, RemoteNodeAddr,
RemoteSocketAddr,
use bitcoin::secp256k1::PublicKey;
use internet2::{
session, FramingProtocol, NodeAddr, RemoteNodeAddr, RemoteSocketAddr,
};
use lnp_node::peerd::{self, Opts};
use lnp_node::{Config, LogStyle};
use microservices::peer::PeerConnection;

/*
mod internal {
Expand Down
4 changes: 2 additions & 2 deletions src/bin/routed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ extern crate log;

use clap::Clap;

use lnp::routed::{self, Opts};
use lnp::Config;
use lnp_node::routed::{self, Opts};
use lnp_node::Config;

fn main() {
println!("routed: lightning peer network routing microservice");
Expand Down
6 changes: 4 additions & 2 deletions src/channeld/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
// If not, see <https://opensource.org/licenses/MIT>.

use clap::{AppSettings, Clap, ValueHint};
use lnpbp::bitcoin::hashes::hex::FromHex;
use lnpbp::lnp::{ChannelId, PartialNodeAddr};

use bitcoin::hashes::hex::FromHex;
use internet2::PartialNodeAddr;
use lnp::ChannelId;

use crate::opts::FUNGIBLED_RPC_ENDPOINT;

Expand Down
Loading

0 comments on commit 772cc15

Please sign in to comment.