Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elenaf9/p2p-poc
Basic PoC for the implementation of a Peer-to-Peer Network using the rust-libp2p library
https://github.com/elenaf9/p2p-poc
hacktoberfest libp2p peer-to-peer
Last synced: 5 days ago
JSON representation
Basic PoC for the implementation of a Peer-to-Peer Network using the rust-libp2p library
- Host: GitHub
- URL: https://github.com/elenaf9/p2p-poc
- Owner: elenaf9
- Created: 2020-09-14T22:53:06.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-05-31T09:21:09.000Z (over 1 year ago)
- Last Synced: 2024-12-16T19:03:53.580Z (22 days ago)
- Topics: hacktoberfest, libp2p, peer-to-peer
- Language: Rust
- Homepage:
- Size: 41 KB
- Stars: 5
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# p2p-poc
Basic Mailbox that enables different peers to communicate with each other.
In order to provide a message / record for a remote peer, a local peer adds this information to a key-value-store mailbox that runs on a server. The mailbox publishes this record in their kademlia DHT, from which the remote peer can then read the value if they know the key.**This was only the PoC to start digging into the concepts and protocols of libp2p. Any further development and the library-version of this exists within [elenaf9/p2p](https://github.com/elenaf9/p2p)**.
## Getting started
` cargo run`
optional arguments:
- `--port ` to set a port that this peer listens to within the same network, default is 16384
- `--mailbox ` to connect to a mailbox, the arguments should be entered within string quotes.## command line interface
All values shoul be entered within typical string-quotes, apart from the timeout_sec, which is a numeric value without quotes.
- `LIST`: list all the entries within the kademlia bucket of the peer
- `PING ` Ping a remote peer in order to test the connection. This only works with peers that has been discovered and are listed in the kademlia bucket
- `GET ` Get the stored key-value pair for this key from either the own kademlia store or from the mailbox. Keys have to be alphanumeric.
- `PUT ` Add a record to the mailbox, key should be alphanumeric, values may contain any chars apart from '"'. The optional timeout_sec should be a numeric value and it describes the duration that this record is available on the mailbox. If no timeout is given, it will be the default value of 90000sec/15min.## libp2p protocols
- libp2p-noise for authentication
- libp2p-kademlia DHT for peer discovery and publishing / reading records
- libp2p-mdns for peer discovery within a local network
- implementation of the libp2p-request-response protocol for custom Request/Response Messages