Skip to content

Commit

Permalink
fix(autonat): update examples (libp2p#3310)
Browse files Browse the repository at this point in the history
Fix AutoNAT examples that became outdated due to libp2p#2959 and libp2p#2618.
  • Loading branch information
elenaf9 committed Jan 10, 2023
1 parent f770e2a commit a731f8e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Cargo.toml
Expand Up @@ -41,3 +41,11 @@ libp2p-yamux = { path = "../../muxers/yamux" }
all-features = true
rustdoc-args = ["--cfg", "docsrs"]
rustc-args = ["--cfg", "docsrs"]

[[example]]
name = "client"
path = "examples/autonat_client.rs"

[[example]]
name = "server"
path = "examples/autonat_server.rs"
1 change: 1 addition & 0 deletions examples/autonat_client.rs
Expand Up @@ -116,6 +116,7 @@ impl Behaviour {
refresh_interval: Duration::from_secs(30),
boot_delay: Duration::from_secs(5),
throttle_server_period: Duration::ZERO,
only_global_ips: false,
..Default::default()
},
),
Expand Down
5 changes: 4 additions & 1 deletion examples/autonat_server.rs
Expand Up @@ -95,7 +95,10 @@ impl Behaviour {
)),
auto_nat: autonat::Behaviour::new(
local_public_key.to_peer_id(),
autonat::Config::default(),
autonat::Config {
only_global_ips: false,
..Default::default()
},
),
}
}
Expand Down

0 comments on commit a731f8e

Please sign in to comment.