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

Add example crate for custom rlpx subprotocol #7130

Open
mattsse opened this issue Mar 13, 2024 · 10 comments · May be fixed by #8113
Open

Add example crate for custom rlpx subprotocol #7130

mattsse opened this issue Mar 13, 2024 · 10 comments · May be fixed by #8113
Assignees
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Mar 13, 2024

Describe the feature

Add a new example that showcases rlpx subprotocols, similar to this simple Ping/Pong protocol

/// A simple Rplx subprotocol for
mod proto {

but something more sophisticated

A protocol can be installed via:

impl NetworkProtocols for NetworkHandle {
fn add_rlpx_sub_protocol(&self, protocol: RlpxSubProtocol) {
self.send_message(NetworkHandleMessage::AddRlpxSubProtocol(protocol))
}
}

Additional context

No response

@mattsse mattsse added C-enhancement New feature or request S-needs-triage This issue needs to be labelled D-good-first-issue Nice and easy! A great choice to get started and removed S-needs-triage This issue needs to be labelled labels Mar 13, 2024
@owanikin
Copy link

Hi @mattsse can I work on this?

@mattsse
Copy link
Collaborator Author

mattsse commented Mar 14, 2024

assigned, lmk if you need pointers/ have questions

@owanikin
Copy link

Thank you! Yeah, lol I need all the pointers I can get. You can give as many as you think will be useful.

@mattsse
Copy link
Collaborator Author

mattsse commented Mar 14, 2024

we want a new example crate, similar to this setup:

fn main() {
Cli::<RethCliTxpoolExt>::parse()
.run(|builder, args| async move {
// launch the node
let NodeHandle { mut node, node_exit_future } =
builder.node(EthereumNode::default()).launch().await?;

and after launch we inject a new rlpx protocol handler via the network node.network

the rlpx can be similar to the test example, could even be something like simple string message exchange

@JackG-eth
Copy link
Contributor

Happy to take ownership of this issue

@owanikin
Copy link

owanikin commented Apr 1, 2024

@JackG-eth Please this is mine, working on it.

@onbjerg
Copy link
Member

onbjerg commented Apr 29, 2024

@owanikin Hey, what's the status of this? Feel free to open a draft PR if you need feedback/direction or you are stuck :)

@owanikin
Copy link

@onbjerg I was stuck for a while :( .Kindly give me until the end of the week to make a PR. Thank you :)

@rupam-04
Copy link
Contributor

rupam-04 commented May 2, 2024

@mattsse How will things change for the NodeHandle struct in PR #8017 as here we are working with the NetworkHandle struct? Any pointers on that?

@mattsse
Copy link
Collaborator Author

mattsse commented May 2, 2024

this shouldn't require any changes to the NodeHandle struct, instead the rlpx protocol can be installed via the NetworkHandle

@onbjerg onbjerg linked a pull request May 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Status: Todo
Development

Successfully merging a pull request may close this issue.

5 participants