Skip to content

Commit

Permalink
Merge pull request #28 from SpectrumXYZ/jr-multi-machine
Browse files Browse the repository at this point in the history
Add multi-machine example
  • Loading branch information
DieracDelta authored Feb 22, 2022
2 parents d05c2f2 + aa1015f commit ece345b
Show file tree
Hide file tree
Showing 17 changed files with 978 additions and 86 deletions.
13 changes: 11 additions & 2 deletions libp2p-networking/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 libp2p-networking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ color-eyre = "0.6.0"
crossterm = { version = "0.23.0", features = ["event-stream"] }
flume = "0.10.11"
futures = "0.3.21"
libp2p = "0.42.2"
libp2p = { version = "0.42.2", features = ["serde"] }
parking_lot = "0.12.0"
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.79"
snafu = "0.7.0"
structopt = "0.3.26"
tracing = "0.1.31"
Expand Down
11 changes: 2 additions & 9 deletions libp2p-networking/examples/clichat.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use libp2p::{Multiaddr, PeerId};
use libp2p::Multiaddr;
use networking_demo::message::Message;
use networking_demo::ui::{run_app, TableApp};

Expand Down Expand Up @@ -28,9 +28,6 @@ struct CliOpt {
#[structopt(long = "port", short = "p")]
port: Option<u16>,

#[structopt()]
first_dial_peer_id: Option<PeerId>,

#[structopt()]
first_dial_addr: Option<Multiaddr>,
}
Expand All @@ -52,11 +49,7 @@ async fn main() -> Result<()> {
let port = CliOpt::from_args().port.unwrap_or(0u16);
let known_peer = CliOpt::from_args().first_dial_addr;
let peer_list = if let Some(p) = known_peer {
if let Some(pid) = CliOpt::from_args().first_dial_peer_id {
vec![(pid, p)]
} else {
Vec::new()
}
vec![(None, p)]
} else {
Vec::new()
};
Expand Down
Loading

0 comments on commit ece345b

Please sign in to comment.