Skip to content

Simple example with stream between two peers #2396

Closed Answered by thomaseizinger
alexander-camuto asked this question in Q&A
Discussion options

You must be logged in to vote

rust-libp2p's design is centered around the idea of modelling each protocol as a pluggable component.

There is a hierachy of NetworkBehaviour > ProtocolsHandler > InboundUpgrade/OutboundUpgrade.

The upgrade traits define how to go from bytes to higher-level messages on a protocol stream.

The ProtocolsHandler is responsible for connection-level state management with one peer (per protocol).

The NetworkBehaviour is responsible for managing state across multiple peers AND connections per protocol.

To achieve what you want is unfortunately not as light-weight as in Go or JS because there is currently no way of not using these abstractions.

However, whilst it might not be as appealing for prot…

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@alexander-camuto
Comment options

@thomaseizinger
Comment options

Answer selected by alexander-camuto
Comment options

You must be logged in to vote
5 replies
@thomaseizinger
Comment options

@alexander-camuto
Comment options

@thomaseizinger
Comment options

@alexander-camuto
Comment options

@thomaseizinger
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants