Skip to content

Commit

Permalink
Merge branch 'main' into feature/identify
Browse files Browse the repository at this point in the history
  • Loading branch information
erwin-kok committed Sep 4, 2023
2 parents 9f0ba49 + 5502951 commit c95c5f2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ to each other. For this to work a few challenges have to be solved:

- How to distribute content? In a client/server setup, this is almost trivial. If node A wants to send something to node B it ’tags’ the message with an ‘address’ or ‘phone-number’ and sends it to the server. Since the server knows B it forwards this message directly to B. In a P2P connection, however, all nodes are interconnected via a mesh and perhaps A does not have a direct connection to B but has an indirect connection via some intermediate nodes C, D and E. If A wants to send something to B it has to send it to C. C has to send it to D and so on until it reaches B. It has to find a ‘route’ through all the nodes from A to B. And, for efficiency reasons, C should not forward the message to all its peers, because this will lead to congestion; all messages are send to each and every node. Ideally, C should send the message only to a node that is the most optimal node in the route to B (This is not always achievable). **In libp2p this is solved using different pubsub mechanisms**.

There already exists some P2P network protocols, but they lacked standardization. Libp2p standardizes they way nodes
There already exists some P2P network protocols, but they lacked standardization. Libp2p standardizes the way nodes
communicate to each other and has a solution for the above-mentioned issues (and more).

See for an in-depth description of libp2p, please see: https://libp2p.io/
Expand Down Expand Up @@ -85,7 +85,7 @@ See for an in-depth description of libp2p, please see: https://libp2p.io/
- [X] Identify
- [X] Ping
- [ ] DHT/Kademlia (planned)
- [ ] pubsub (planned)
- [ ] GossipSub (planned)

- Peer discovery
- [ ] mDNS (planned)
Expand Down Expand Up @@ -162,7 +162,7 @@ To call a peer and open a new stream, use the following code:
val stream = host.newStream(aPeerId, ProtocolId.of("/chat/1.0.0"))
.getOrElse {
logger.error { "Could not open chat stream with peer: ${errorMessage(it)}" }
return@runBlocking
return
}
chatHandler(stream)
```
Expand All @@ -173,13 +173,13 @@ returns if it succeeds it progresses to the chatHandler.
See also the example application in `examples/chat`.

To use this sample application, start the application. It will create a new random LocalIdentity (key-pair) and logs the
adres on which it listens on the output:
address on which it listens on the output:

```shell
[main] o.e.l.a.ApplicationKt$main$1: Local addresses the Host listens on: /ip4/0.0.0.0/tcp/10333/p2p/12D3KooWDfaEJxpmjbFLb9wUakCd6Lo6LRntaV3drb4EaYZRtYuY
```

In the libp2p-Go repository you can find `chat` in the examples directory. Then you can connect to the running instance
In the libp2p-Go repository you can find `chat` in the `examples` directory. Then you can connect to the running instance
by using:

```shell
Expand All @@ -194,8 +194,8 @@ If you want to contact me, please write an e-mail to: "erwin (DOT) kok (AT) prot

## Acknowledgements

This work is largely based on the awesome libp2p-go implementation. This work would not have been possible without their
effort. Please consider giving kudos to the libp2p-go authors.
This work is largely based on the awesome [go-libp2p](https://github.com/libp2p/go-libp2p) implementation. This work would not have been possible without their
effort. Please consider giving kudos to the go-libp2p authors.
(See also [`ACKNOWLEDGEMENTS`](ACKNOWLEDGEMENTS.md))

## License
Expand Down

0 comments on commit c95c5f2

Please sign in to comment.