mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 01:51:23 +00:00
* Rename Transport::RawConn to Output * Remove AsyncRead + AsyncWrite bound on Transport::Output * UpgradedNode now always implements Transport * Add and tweak modifiers for Transport and ConnectionUpgrade * Secio upgrade now returns the pubkey in its output * Add upgrade::apply * Add Transport::and_then * Rework the swarm * Rustfmt * Fix concerns
Examples
Running one of the examples:
cargo run --example <name-of-the-example>
The follow examples exist:
echo-dialer
will attempt to connect to/ip4/127.0.0.1/tcp/10333
, negotiate the/echo/1.0.0
protocol, then send the"hello world"
message. Compatible with theecho-server
example.echo-server
will listen on/ip4/0.0.0.0/tcp/10333
, negotiate the/echo/1.0.0
protocol with each incoming connection, then send back any entering message. Compatible with theecho-dialer
example.ping-client
will try to connect to/ip4/127.0.0.1/tcp/4001
, which is the default address of your local IPFS node if you're running one. It will then open a substream and ping the node.
How the keys were generated
The keys used in the examples were generated like this:
openssl genrsa -out private.pem 2048
openssl rsa -in private.pem -outform DER -pubout -out public.der
openssl pkcs8 -in private.pem -topk8 -nocrypt -out private.pk8
rm private.pem # optional