Skip to content

feat: add base p2p node with relay client #97

Merged
varex83 merged 15 commits into
mainfrom
bohdan/p2p-create-node
Jan 8, 2026
Merged

feat: add base p2p node with relay client #97
varex83 merged 15 commits into
mainfrom
bohdan/p2p-create-node

Conversation

@varex83
Copy link
Copy Markdown
Collaborator

@varex83 varex83 commented Dec 22, 2025

No description provided.

@varex83 varex83 requested a review from emlautarom1 December 22, 2025 13:13
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Dec 22, 2025

Coverage (base → head): 60.78% → 59.91% ⬇️ 0.87 pp
Only posts when PR coverage is lower than the base branch's latest push (or freshly computed base).

println!("Relay told us our observed address: {}", observed_addr);
learned_observed_addr = true;
}
event => panic!("{event:?}"),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During testing, if you run this client, shut it down, and then start again with the same relay we can end up in a panic due to recieving an NewExternalAddrOfPeer message.

Not a blocker since it's testing code but it's worth keeping track of this.

Comment thread crates/charon-p2p/src/behaviours/mod.rs
@@ -0,0 +1,9 @@
//! Behaviours.
#![allow(missing_docs)] // we need to allow missing docs for the derive macro
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: In general we can write is as follows:

Suggested change
#![allow(missing_docs)] // we need to allow missing docs for the derive macro
#![allow(missing_docs, reason = "required for the derive macro")]

Self {
relay: relay_client,
identify: identify::Behaviour::new(identify::Config::new(
"/pluto/1.0.0-alpha".into(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original Go implementation uses "" as the protocol version (ends up being the default).

What actually gets configured is the UserAgent which is set to obolnetwork-charon/<current version>, ex. obolnetwork-charon/v1.7.0-rc. We should set the User agent to something like pluto/v1.0.0-alpha.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vise.workspace = true
tokio.workspace = true
rand.workspace = true
tempfile.workspace = true
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can move this to a dev-dependency since it's only used in tests.

@varex83
Copy link
Copy Markdown
Collaborator Author

varex83 commented Jan 8, 2026

Fixes will be applied in a separate PR (#110)

@varex83 varex83 merged commit 176fb8f into main Jan 8, 2026
7 checks passed
@varex83 varex83 deleted the bohdan/p2p-create-node branch January 8, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants