Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Networking simplification #2264

Merged
merged 20 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ std = [
"async-std",
"futures/thread-pool",
"parking_lot",
"pin-project",
"schnorrkel/getrandom", # TODO: necessary for signing; clarify in docs and in source code
"soketto",
"wasmtime",
Expand Down Expand Up @@ -66,7 +67,6 @@ num-bigint = { version = "0.4.3", default-features = false }
num-rational = { version = "0.4.0", default-features = false, features = ["num-bigint"] }
num-traits = { version = "0.2.15", default-features = false }
pbkdf2 = { version = "0.11.0", default-features = false }
pin-project = "1.0.8"
prost = { version = "0.10.3", default-features = false, features = ["prost-derive"] }
rand = { version = "0.8.5", default-features = false, features = ["std", "std_rng"] } # TODO: rand is used in hack-y ways at the moment ; these features should be removed
rand_chacha = { version = "0.3.1", default-features = false }
Expand All @@ -90,6 +90,7 @@ sqlite = { version = "0.26.0", optional = true, default-features = false, featur
# Add here the crates that cannot function without the help of the operating system or environment.
async-std = { version = "1.11.0", optional = true }
parking_lot = { version = "0.12.0", optional = true }
pin-project = { version = "1.0.8", optional = true }
soketto = { version = "0.7.1", optional = true }

# BELOW: DEPENDENCIES TO REMOVE
Expand Down
1 change: 1 addition & 0 deletions bin/full-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ctrlc = "3.2.2"
derive_more = "0.99.17"
directories = "4.0.1"
either = { version = "1.6.1", default-features = false }
event-listener = { version = "2.5.2" }
fnv = { version = "1.0.7", default-features = false }
futures = { version = "0.3.21", default-features = false, features = ["std", "thread-pool"] }
futures-timer = "3.0"
Expand Down
12 changes: 0 additions & 12 deletions bin/full-node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,11 @@ use std::{net::SocketAddr, path::PathBuf};
pub enum CliOptions {
/// Connects to the chain and synchronizes the local database with the network.
Run(CliOptionsRun),
/// Connects to an IP address and prints some information about the node.
NodeInfo(CliOptionsNodeInfo),
/// Computes the 64 bits BLAKE2 hash of a string payload and prints the hexadecimal-encoded hash.
#[structopt(name = "blake2-64bits-hash")]
Blake264BitsHash(CliOptionsBlake264Hash),
}

#[derive(Debug, clap::StructOpt)]
pub struct CliOptionsNodeInfo {
/// IP address to connect to (format: `<ip>:<port>`).
// Note: we accept a String rather than a SocketAddr in order to allow for DNS addresses.
pub address: String,
/// Ed25519 private key of network identity (as a seed phrase).
#[structopt(long, parse(try_from_str = decode_ed25519_private_key))]
pub libp2p_key: Option<[u8; 32]>,
}

#[derive(Debug, clap::StructOpt)]
pub struct CliOptionsRun {
/// Chain to connect to ("Polkadot", "Kusama", "Westend", or a file path).
Expand Down
2 changes: 0 additions & 2 deletions bin/full-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#![deny(unused_crate_dependencies)]

mod cli;
mod node_info;
mod run;

fn main() {
Expand All @@ -30,7 +29,6 @@ fn main() {
async fn async_main() {
match <cli::CliOptions as clap::Parser>::parse() {
cli::CliOptions::Run(r) => run::run(r).await,
cli::CliOptions::NodeInfo(opt) => node_info::run(opt).await,
cli::CliOptions::Blake264BitsHash(opt) => {
let hash = blake2_rfc::blake2b::blake2b(8, &[], opt.payload.as_bytes());
println!("0x{}", hex::encode(hash));
Expand Down
174 changes: 0 additions & 174 deletions bin/full-node/src/node_info.rs

This file was deleted.

Loading