diff --git a/Cargo.lock b/Cargo.lock index bcc45f3..05fa9f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "amplify" -version = "3.12.0" +version = "3.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47cfa6a69eeb140125a63e4f5ae1156a530f8744ea1d35aa1b8b5613e4d8b41d" +checksum = "e45c604e86700ffea68a7d90c3ffb1508dad1120902f31dbb08afc942cf8acf3" dependencies = [ "amplify_derive", "amplify_num", @@ -201,9 +201,9 @@ dependencies = [ [[package]] name = "bitcoin_scripts" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8ef0ceaddc4fc71a8c6c923201abbf269f36ae7d7e50ee2d93fd4c32537e113" +checksum = "dcfdf7d9a0b3af94a35b92daa2e3f1c5b02b7293b5938a4cd4cc426852e52249" dependencies = [ "amplify", "bitcoin 0.28.1", @@ -907,9 +907,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" [[package]] name = "heck" @@ -959,9 +959,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "1.8.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" +checksum = "6c6392766afd7964e2531940894cffe4bd8d7d17dbc3c1c4857040fd4b33bdb3" dependencies = [ "autocfg 1.1.0", "hashbrown", @@ -1170,23 +1170,24 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lnp-cli" -version = "0.8.0" +version = "0.8.0-alpha.1" dependencies = [ "amplify", "clap", + "clap_complete", + "configure_me_codegen", "internet2", "lightning-invoice", "lnp-core", "lnp_rpc", "log", "microservices", - "zmq2", ] [[package]] name = "lnp-core" -version = "0.8.0" -source = "git+https://github.com/LNP-WG/lnp-core#85fc6546f34dc05a41e3bc93baaf62e6729f19ce" +version = "0.8.0-alpha.1" +source = "git+https://github.com/LNP-WG/lnp-core#1c952b5919a6294be4317f78eeb78a465ed258fb" dependencies = [ "amplify", "bitcoin 0.28.1", @@ -1203,8 +1204,8 @@ dependencies = [ [[package]] name = "lnp2p" -version = "0.8.0" -source = "git+https://github.com/LNP-WG/lnp-core#85fc6546f34dc05a41e3bc93baaf62e6729f19ce" +version = "0.8.0-alpha.1" +source = "git+https://github.com/LNP-WG/lnp-core#1c952b5919a6294be4317f78eeb78a465ed258fb" dependencies = [ "amplify", "bitcoin 0.28.1", @@ -1225,7 +1226,7 @@ dependencies = [ [[package]] name = "lnp_node" -version = "0.8.0" +version = "0.8.0-alpha.1" dependencies = [ "amplify", "bitcoin 0.28.1", @@ -1258,7 +1259,7 @@ dependencies = [ [[package]] name = "lnp_rpc" -version = "0.8.0" +version = "0.8.0-alpha.1" dependencies = [ "amplify", "bitcoin 0.28.1", @@ -1546,9 +1547,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" dependencies = [ "unicode-ident", ] @@ -1579,9 +1580,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" dependencies = [ "proc-macro2", ] @@ -2173,9 +2174,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strict_encoding" -version = "1.8.8" +version = "1.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1bbb5109701ede3df3e20b82a134d601036f02b8b2f259965266a6a784cc749" +checksum = "796bf3e8abb485e9194d03dfc534221e382f8cf058f417bbd66d5f4dd3b8a0cc" dependencies = [ "amplify", "bitcoin 0.28.1", @@ -2231,9 +2232,9 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.96" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index b314ed0..449255a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,11 +5,12 @@ members = [".", "rpc", "cli"] [package] name = "lnp_node" description = "LNP node" -version = "0.8.0" +version = "0.8.0-alpha.1" authors = ["Dr. Maxim Orlovsky "] license = "MIT" keywords = ["bitcoin", "bifi", "lightning-network", "smart-contracts", "lnp"] -edition = "2018" +edition = "2021" +rust-version = "1.59.0" readme = "README.md" build = "build.rs" exclude = [".github", "Dockerfile", ".dockerignore", "contrib", "doc"] @@ -47,8 +48,8 @@ amplify = "3.12.0" strict_encoding = { version = "1.8.1", features = ["miniscript"] } descriptor-wallet = { version = "0.7.1", features = ["keygen", "miniscript", "electrum"] } lnpbp = "0.7.0" -lnp-core = { version = "0.8.0", git = "https://github.com/LNP-WG/lnp-core" } -lnp_rpc = { version = "0.8.0", path = "./rpc" } +lnp-core = { version = "0.8.0-alpha.1", git = "https://github.com/LNP-WG/lnp-core" } +lnp_rpc = { version = "0.8.0-alpha.1", path = "./rpc" } internet2 = { version = "0.8.0-beta.1", features = ["keygen"] } microservices = { version = "0.8.0-rc.4", default-features = false, features = ["node", "peer"] } # Bitcoin @@ -79,8 +80,8 @@ amplify = "3.12.0" lnpbp = "0.7.0" bitcoin = "0.28.1" lightning-invoice = "0.14.0" -lnp-core = { version = "0.8.0", git = "https://github.com/LNP-WG/lnp-core" } -lnp_rpc = { version = "0.8.0", path = "./rpc" } +lnp-core = { version = "0.8.0-alpha.1", git = "https://github.com/LNP-WG/lnp-core" } +lnp_rpc = { version = "0.8.0-alpha.1", path = "./rpc" } internet2 = "0.8.0-beta.1" microservices = { version = "0.8.0-rc.2", default-features = false, features = ["peer"] } clap = { version = "~3.1.18", features = ["env"] } diff --git a/build.rs b/build.rs index ad00081..9d6a53d 100644 --- a/build.rs +++ b/build.rs @@ -15,6 +15,8 @@ #[macro_use] extern crate clap; +use std::fs; + use clap::IntoApp; use clap_complete::generate_to; use clap_complete::shells::*; @@ -45,6 +47,7 @@ pub mod routed { fn main() -> Result<(), configure_me_codegen::Error> { let outdir = "./shell"; + fs::create_dir_all(outdir).expect("failed to create shell dir"); for app in [ lnpd::Opts::command(), peerd::Opts::command(), @@ -61,5 +64,6 @@ fn main() -> Result<(), configure_me_codegen::Error> { generate_to(Zsh, app, &name, &outdir)?; } - configure_me_codegen::build_script_auto() + // configure_me_codegen::build_script_auto() + Ok(()) } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 0fd60ba..402db43 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,13 +1,15 @@ [package] name = "lnp-cli" description = "LNP node command-line interface" -version = "0.8.0" +version = "0.8.0-alpha.1" authors = ["Dr. Maxim Orlovsky "] license = "MIT" keywords = ["bitcoin", "node", "lightning-network", "smart-contracts", "lnp"] -edition = "2018" +categories = ["network-programming", "command-line-utilities"] +edition = "2021" +rust-version = "1.59.0" readme = "../README.md" -exclude = [] +build = "build.rs" [[bin]] path = "src/main.rs" @@ -15,14 +17,23 @@ name = "lnp-cli" [dependencies] amplify = "3.12.0" -lnp-core = { version = "0.8.0", git = "https://github.com/LNP-WG/lnp-core", default-features = false } -lnp_rpc = { version = "0.8.0", path = "../rpc" } +lnp-core = { version = "0.8.0-alpha.1", git = "https://github.com/LNP-WG/lnp-core", default-features = false } +lnp_rpc = { version = "0.8.0-alpha.1", path = "../rpc" } lightning-invoice = { version = "0.14.0", optional = true } internet2 = "0.8.0-beta.1" microservices = { version = "0.8.0-rc.2", default-features = false, features = ["cli"] } clap = { version = "~3.1.18", features = ["derive", "env"] } log = "0.4.14" -zmq = { package = "zmq2", version = "0.5.0" } + +[build-dependencies] +amplify = "3.12.0" +clap = { version = "~3.1.18", features = ["derive", "env"] } +clap_complete = "~3.1.4" +lightning-invoice = "0.14.0" +internet2 = "0.8.0-beta.1" +lnp-core = { version = "0.8.0-alpha.1", git = "https://github.com/LNP-WG/lnp-core", default-features = false } +lnp_rpc = { version = "0.8.0-alpha.1", path = "../rpc" } +configure_me_codegen = "0.4" [features] default = ["bolt", "bifrost"] diff --git a/cli/build.rs b/cli/build.rs new file mode 100644 index 0000000..f5f5134 --- /dev/null +++ b/cli/build.rs @@ -0,0 +1,43 @@ +// LNP Node: node running lightning network protocol and generalized lightning +// channels. +// Written in 2020-2022 by +// Dr. Maxim Orlovsky +// +// To the extent possible under law, the author(s) have dedicated all +// copyright and related and neighboring rights to this software to +// the public domain worldwide. This software is distributed without +// any warranty. +// +// You should have received a copy of the MIT License +// along with this software. +// If not, see . + +#[macro_use] +extern crate clap; +#[macro_use] +extern crate amplify; + +use std::fs; + +use clap::IntoApp; +use clap_complete::generate_to; +use clap_complete::shells::*; + +pub mod cli { + include!("src/opts.rs"); +} + +fn main() -> Result<(), configure_me_codegen::Error> { + let outdir = "../shell"; + + fs::create_dir_all(outdir).expect("failed to create shell dir"); + for app in [cli::Opts::command()].iter_mut() { + let name = app.get_name().to_string(); + generate_to(Bash, app, &name, &outdir)?; + generate_to(PowerShell, app, &name, &outdir)?; + generate_to(Zsh, app, &name, &outdir)?; + } + + // configure_me_codegen::build_script_auto() + Ok(()) +} diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index d7f1e42..1607ec1 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -1,11 +1,13 @@ [package] name = "lnp_rpc" description = "LNP node RPC API" -version = "0.8.0" +version = "0.8.0-alpha.1" authors = ["Dr. Maxim Orlovsky "] license = "MIT" keywords = ["bitcoin", "node", "lightning-network", "smart-contracts", "rpc"] -edition = "2018" +categories = ["network-programming"] +edition = "2021" +rust-version = "1.59.0" readme = "../README.md" [lib] @@ -14,7 +16,7 @@ name = "lnp_rpc" [dependencies] amplify = "3.12.0" strict_encoding = "1.8.1" -lnp-core = { version = "0.8.0", git = "https://github.com/LNP-WG/lnp-core", default-features = false } +lnp-core = { version = "0.8.0-alpha.1", git = "https://github.com/LNP-WG/lnp-core", default-features = false } lnpbp = "0.7.0" bitcoin = { version = "0.28.1", features = ["rand"] } lightning-invoice = { version = "0.14.0", optional = true } diff --git a/shell/_lnp-cli b/shell/_lnp-cli index 259351a..30fbf7e 100644 --- a/shell/_lnp-cli +++ b/shell/_lnp-cli @@ -38,8 +38,6 @@ _arguments "${_arguments_options[@]}" \ '--ip=[IPv4 or IPv6 address to bind to]:IP_ADDR: ' \ '-p+[Port to use; defaults to the native LN port]:PORT: ' \ '--port=[Port to use; defaults to the native LN port]:PORT: ' \ -'-o+[Use overlay protocol (http, websocket etc)]:OVERLAY: ' \ -'--overlay=[Use overlay protocol (http, websocket etc)]:OVERLAY: ' \ '-c+[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \ '--connect=[ZMQ socket for connecting daemon RPC interface]:CONNECT: ' \ '-h[Print help information]' \ diff --git a/shell/_lnp-cli.ps1 b/shell/_lnp-cli.ps1 index 01454e9..01acf62 100644 --- a/shell/_lnp-cli.ps1 +++ b/shell/_lnp-cli.ps1 @@ -47,8 +47,6 @@ Register-ArgumentCompleter -Native -CommandName 'lnp-cli' -ScriptBlock { [CompletionResult]::new('--ip', 'ip', [CompletionResultType]::ParameterName, 'IPv4 or IPv6 address to bind to') [CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Port to use; defaults to the native LN port') [CompletionResult]::new('--port', 'port', [CompletionResultType]::ParameterName, 'Port to use; defaults to the native LN port') - [CompletionResult]::new('-o', 'o', [CompletionResultType]::ParameterName, 'Use overlay protocol (http, websocket etc)') - [CompletionResult]::new('--overlay', 'overlay', [CompletionResultType]::ParameterName, 'Use overlay protocol (http, websocket etc)') [CompletionResult]::new('-c', 'c', [CompletionResultType]::ParameterName, 'ZMQ socket for connecting daemon RPC interface') [CompletionResult]::new('--connect', 'connect', [CompletionResultType]::ParameterName, 'ZMQ socket for connecting daemon RPC interface') [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print help information') diff --git a/shell/lnp-cli.bash b/shell/lnp-cli.bash index b3d9024..c1bafa5 100644 --- a/shell/lnp-cli.bash +++ b/shell/lnp-cli.bash @@ -206,7 +206,7 @@ _lnp-cli() { return 0 ;; lnp__cli__listen) - opts="-i -p -o -h -c -v --ip --port --overlay --help --connect --verbose" + opts="-i -p -h -c -v --ip --port --help --connect --verbose" if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 @@ -228,14 +228,6 @@ _lnp-cli() { COMPREPLY=($(compgen -f "${cur}")) return 0 ;; - --overlay) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; - -o) - COMPREPLY=($(compgen -f "${cur}")) - return 0 - ;; --connect) COMPREPLY=($(compgen -f "${cur}")) return 0