Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Examples

Running one of the examples:

```sh
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 the `echo-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 the `echo-dialer`
example.

## How the keys were generated

The keys used in the examples were generated like this:

```sh
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
```
1 change: 0 additions & 1 deletion example/examples/test-public-key.pem

This file was deleted.