Skip to content

Commit bb24153

Browse files
authored
chore: define max circuit bytes (#19)
1 parent 45420bf commit bb24153

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ members = [".", "examples/dcutr", "examples/chat"]
33

44
[package]
55
name = "boot-node"
6-
version = "0.5.0"
6+
version = "0.5.1"
77
authors = ["Calimero Limited <info@calimero.network>"]
88
edition = "2021"
99
repository = "https://github.com/calimero-network/boot-node"

src/main.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use tracing_subscriber::EnvFilter;
1212

1313
const PROTOCOL_VERSION: &str = concat!("/", env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION"));
1414
const CALIMERO_KAD_PROTO_NAME: StreamProtocol = StreamProtocol::new("/calimero/kad/1.0.0");
15+
const MAX_RELAY_CIRCUIT_BYTES: u64 = 8 << 20; // 8 MiB
1516

1617
#[derive(NetworkBehaviour)]
1718
struct Behaviour {
@@ -95,7 +96,11 @@ async fn main() -> eyre::Result<()> {
9596
},
9697
ping: ping::Behaviour::new(ping::Config::new()),
9798
rendezvous: rendezvous::server::Behaviour::new(rendezvous::server::Config::default()),
98-
relay: relay::Behaviour::new(keypair.public().to_peer_id(), Default::default()),
99+
relay: relay::Behaviour::new(keypair.public().to_peer_id(), {
100+
let mut x = relay::Config::default();
101+
x.max_circuit_bytes = MAX_RELAY_CIRCUIT_BYTES;
102+
x
103+
}),
99104
})?
100105
.build();
101106

0 commit comments

Comments
 (0)