#distributed #blockchain #p2p #libp2p #peer-to-peer

chamomile

Another P2P Library. Support IoT devices.

15 releases (6 breaking)

Uses new Rust 2021

0.8.0 Feb 12, 2022
0.7.1 Dec 20, 2021
0.6.6 Dec 4, 2021
0.6.5 Oct 23, 2021
0.1.0 Jun 11, 2020

#1669 in Network programming

Download history 20/week @ 2022-04-24 47/week @ 2022-05-01 98/week @ 2022-05-08 261/week @ 2022-05-15 65/week @ 2022-05-22 110/week @ 2022-05-29 81/week @ 2022-06-05 3/week @ 2022-06-12 12/week @ 2022-06-19 4/week @ 2022-06-26 34/week @ 2022-07-03 39/week @ 2022-07-10 21/week @ 2022-07-17 34/week @ 2022-07-24 24/week @ 2022-07-31 12/week @ 2022-08-07

91 downloads per month
Used in 2 crates (via tdn)

MIT/Apache

180KB
4K SLoC

crate doc

Chamomile

Build a robust stable connection on p2p network

features

  • Support build a robust stable connection between two peers on the p2p network.
  • Support permissionless network.
  • Support permissioned network (distributed network).
  • DHT-based & Relay connection.
  • Diff transports: QUIC(default) / TCP / UDP-Based Special Protocol.
  • Multiple transports connecting at same runtime.

Simple test.

  • A: cargo run --example permissionless 127.0.0.1:8000
  • B: cargo run --example permissionless 127.0.0.1:8001 127.0.0.1:8000
  • C: cargo run --example permissionless 127.0.0.1:8002 127.0.0.1:8000

If not support 127.0.0.1 binding, you can change to 0.0.0.0 and try again.

Relay test.

  • A: cargo run --example relay 192.168.xx.xx:8000
    • this ip is your LAN address, it will do relay work.
  • B: cargo run --example relay 127.0.0.1:8001 192.168.xx.xx:8000
    • start waiting stable connected by relay.
  • C: cargo run --example relay 127.0.0.1:8002 192.168.xx.xx:8000 XX..
    • XX.. is above's B network peer id will connected it.
    • And if change B and C 127.0.0.1 to 0.0.0.0, they will automatically connect after the handshake is successful, no longer need relay.

Design point

  • Mobile phones, IoT devices, PC and servers are first-class citizens
  • Ability to adapt to the transmission and penetration of complex network environments
  • Support for springboard function, virtual connection with other nodes, build virtual DHT
  • Encrypted transmission and secure DHT protection
  • It can support all interconnections and single-center connections under the LAN, and can also support DHT in the public network environment
  • Automatically switch the connection according to the number of connections and the network environment
  • If Alice use QUIC, Bob use TCP, they can still connect and communicate with each other.

For more information, please visit:

License

This project is licensed under either of

at your option.

Dependencies

~17–25MB
~508K SLoC