Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/libp2p/universal-connectivity
Realtime decentralised chat with libp2p showing ubiquitous peer-to-peer connectivity between multiple programming languages (Go, Rust, TypeScript) and runtimes (Web, native binary) using QUIC, WebRTC and WebTransport
https://github.com/libp2p/universal-connectivity
go libp2p networking p2p peer-to-peer rust webrtc webtransport
Last synced: 1 day ago
JSON representation
Realtime decentralised chat with libp2p showing ubiquitous peer-to-peer connectivity between multiple programming languages (Go, Rust, TypeScript) and runtimes (Web, native binary) using QUIC, WebRTC and WebTransport
- Host: GitHub
- URL: https://github.com/libp2p/universal-connectivity
- Owner: libp2p
- License: other
- Created: 2023-03-06T22:54:58.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-01T09:18:43.000Z (3 months ago)
- Last Synced: 2025-01-13T14:17:06.980Z (8 days ago)
- Topics: go, libp2p, networking, p2p, peer-to-peer, rust, webrtc, webtransport
- Language: TypeScript
- Homepage: https://universal-connectivity.on.fleek.co/
- Size: 16.9 MB
- Stars: 94
- Watchers: 10
- Forks: 33
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# Universal Connectivity
Realtime highly decentralised chat app.
![libp2p topology](libp2p-hero.svg)
Showcasing [libp2p](https://libp2p.io/)'s superpowers in establishing ubiquitous peer-to-peer [connectivity](https://connectivity.libp2p.io/) in modern programming languages (Go, Rust, TypeScript) and runtimes (Web, native binary).
On top of this strong foundation, it layers a GossipSub: A Secure PubSub Protocol for Unstructured Decentralised P2P Overlays. By analogy, an event broker with distributed brokering, or a distributed PubSub protocol.
This is the gossip event protocol that powers Filecoin and Post-Merge Ethereum.
Some of the cool and cutting-edge [transport protocols](https://connectivity.libp2p.io/) used by this app are:
- WebTransport
- WebRTC
- WebRTC-direct
- QUIC
- TCP## Packages
| Packge | Description | WebTransport | WebRTC | WebRTC-direct | QUIC | TCP |
| :-------------------------- | :------------------------------ | ------------ | ------ | ------------- | ---- | --- |
| [`js-peer`](./js-peer/) | Browser Chat Peer in TypeScript | ✅ | ✅ | ✅ | ❌ | ❌ |
| [`go-peer`](./go-peer/) | Chat peer implemented in Go | ✅ | ❌ | ✅ | ✅ | ✅ |
| [`rust-peer`](./rust-peer/) | Chat peer implemented in Rust | ❌ | ❌ | ✅ | ✅ | ❌ |✅ - Protocol supported
❌ - Protocol not supported- Uses the [**GossipSub**](https://docs.libp2p.io/concepts/pubsub/overview/) PubSub protocol for decentralised messaging
## Connecting to a peer
There are two ways to connect to a peer:
- With a PeerID using peer routing (adds a step to resolve the multiaddr for the PeerID), using the IPFS/Libp2p DHT, e.g. `12D3KooWLMySi3eEWscUnKmMCYRSXL3obYJ4KNimpShJK6shUy2M`
- With a multiaddr directly (skips the peer routing step), e.g. `/ip4/127.0.0.1/udp/64434/webrtc/certhash/uEiA_tkndZQWf7jyFqgCiwH_CqsS7FTWFTb6Px8MPxxT9gQ/p2p/12D3KooWLMySi3eEWscUnKmMCYRSXL3obYJ4KNimpShJK6shUy2M`### Using a multiaddr
Load the UI, and enter the multiaddr into the UI. Ensure that it includes the peerID, e.g.`/ip4/192.168.178.21/udp/61838/quic-v1/webtransport/certhash/uEiCQCALYac4V3LJ2ourLdauXOswIXpIuJ_JNT-8Wavmxyw/certhash/uEiCdYghq5FlXGkVONQXT07CteA16BDyMPI23-0GjA9Ej_w/p2p/12D3KooWF7ovRNBKPxERf6GtUbFdiqJsQviKUb7Z8a2Uuuo6MrDX`
## Getting started: JS
### 1. Install dependencies
Run npm install:
```
cd js-peer
npm i
```### 2. Start Next.js dev server
Start the dev server:
```
npm run dev
```## Getting started: Rust
```
cd rust-peer
cargo run
```This will automatically connect you to the bootstrap node running on [fly.io](https://fly.io).
To explore more advanced configurations if you e.g. want to set up our own network, try:
```
cargo run -- --help
```## Getting started: Go
```
cd go-peer
go run .
```