Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
1f74148
deps: bump next in /js-peer in the npm_and_yarn group (#255)
dependabot[bot] Mar 27, 2025
24e2960
feat: add Node.js peer (#268)
achingbrain Apr 22, 2025
b0ef55c
ci: uci/copy-templates (#271)
web3-bot May 1, 2025
a1dd5f5
feat: add a TUI interface to rust-peer (#245)
dhuseby May 2, 2025
e4666f3
feat: added basic cli py-peer
sumanjeet0012 Jul 4, 2025
c579c33
basic TUI structure created
sumanjeet0012 Jul 5, 2025
996c6b1
feat: add trio-asyncio support for better combatibility
sumanjeet0012 Jul 7, 2025
363e587
Enhance chat UI and messaging system
sumanjeet0012 Jul 7, 2025
f2b4bce
Refactored py-peer architecture: added headless service and TUI using…
sumanjeet0012 Jul 12, 2025
ce986cf
fix: update chat and peers log methods to use write_line
sumanjeet0012 Jul 12, 2025
ad9d73e
fix: adjust scrollbar size for Log widget
sumanjeet0012 Jul 12, 2025
cdd67ab
Removed unused files and refactored UI files
sumanjeet0012 Jul 12, 2025
82e7340
fix: improve logging configuration for headless and UI modes
sumanjeet0012 Jul 12, 2025
73f3530
fix: duplicate message for own peer and fix some overlapping logs on …
sumanjeet0012 Jul 12, 2025
c0764a4
refactor: reorganize imports and simplify message formatting in UI mo…
sumanjeet0012 Jul 13, 2025
df15661
Removed some log files
sumanjeet0012 Jul 13, 2025
dedf1eb
refactor: remove unused log files and streamline message handling in …
sumanjeet0012 Jul 13, 2025
2ea83f0
refactor: remove unused development dependencies and system messages
sumanjeet0012 Jul 13, 2025
0167217
docs: update README for clarity and structure, enhancing features and…
sumanjeet0012 Jul 13, 2025
d5a0ff6
docs: add screenshots and description for Textual TUI Interface in RE…
sumanjeet0012 Jul 13, 2025
81cbcb3
docs: update README to clarify multiaddr sharing in Textual UI
sumanjeet0012 Jul 13, 2025
04b7026
refactor: enhance logging in ChatRoom and HeadlessService for better …
sumanjeet0012 Aug 25, 2025
a851353
Disabled peer discovery and added more loggings in go peer to test co…
sumanjeet0012 Aug 25, 2025
7900d12
refactor: enhance logging and compatibility in Go and Python peers; u…
sumanjeet0012 Aug 25, 2025
c2a8303
removed strict validation
sumanjeet0012 Aug 26, 2025
19e8005
refactor: update message publishing to use JSON format with nickname;…
sumanjeet0012 Aug 27, 2025
d73aaee
refactor: change key pair generation from Ed25519 to RSA for identity…
sumanjeet0012 Aug 27, 2025
9687044
reverted all go peer changes
sumanjeet0012 Aug 27, 2025
ef8170b
publishing plain text not json
sumanjeet0012 Aug 27, 2025
a5bf7c2
chore: set up nim peer development branch
Aug 28, 2025
7903bba
Used bootstrap module in py peer
sumanjeet0012 Aug 31, 2025
220f953
refactor: enhance headless service with DHT support and connection ma…
sumanjeet0012 Sep 1, 2025
0254d96
fix: pin react-curse to 1.0.15 (#311)
achingbrain Sep 11, 2025
74d3fc8
feat: add deterministic seed support for peer ID generation.
sumanjeet0012 Sep 27, 2025
e1bfa08
fix: revert to Ed25519 key pair generation in GenerateIdentity function
sumanjeet0012 Sep 28, 2025
aa02c2a
removed ed25519 keys
sumanjeet0012 Sep 28, 2025
beb88cc
fix: update dependencies in pyproject.toml
sumanjeet0012 Sep 28, 2025
b468651
feat: integrate identify protocol for peer validation and caching in …
sumanjeet0012 Sep 28, 2025
e003046
feat: made identify go peer compatible and update bootstrap peers.
sumanjeet0012 Oct 1, 2025
6584c2a
feat: add detailed error logging with traceback for headless service …
sumanjeet0012 Oct 2, 2025
a14f81b
feat: enhance message validation and logging in chatroom and headless…
sumanjeet0012 Oct 2, 2025
68d8317
Update go-ci.yml (#320)
galargh Oct 2, 2025
65ae536
Remove some unnecessary files
sumanjeet0012 Oct 2, 2025
7612cbe
feat: add Kivy UI support and update dependencies for mobile-friendly…
sumanjeet0012 Oct 3, 2025
634b030
feat: add topic subscription functionality to chatroom and headless s…
sumanjeet0012 Oct 3, 2025
e2664c0
feat: implement topic-based messaging and UI updates for chat functio…
sumanjeet0012 Oct 3, 2025
a873ff4
fix: clean up .gitignore and remove unused py-libp2p subproject
sumanjeet0012 Oct 4, 2025
6e55011
feat: add peer connection functionality to headless service and Kivy UI
sumanjeet0012 Oct 4, 2025
7022351
feat: enhance connection info dialog with clickable text for Peer ID …
sumanjeet0012 Oct 4, 2025
75dc5b1
feat: add Kivy and Textual UI screenshots to README
sumanjeet0012 Oct 5, 2025
ba2dad7
fix: go tui updates (#313)
dozyio Nov 6, 2025
9fdc60e
feat: add nim peer (#1) (#308)
gmelodie Nov 7, 2025
27d3dc3
Merge branch 'nim-peer-development' into main
dozyio Nov 7, 2025
f34f66f
fix: Go headless logging (#331)
dozyio Nov 8, 2025
6b6b8c4
feat: add Go flag to specify port (#332)
dozyio Nov 8, 2025
0671a70
[go-peer]: roomName handling + used as service name for mDNS discover…
alexmylonas Nov 9, 2025
1b559ee
fix: nim build (#333)
dozyio Nov 11, 2025
9d9d7d2
chore(deps): update libp2p, rand, tokio (#307)
dhuseby Nov 13, 2025
ed3ab79
fix: remove unused py-libp2p subproject
sumanjeet0012 Dec 21, 2025
381f834
fix: update libp2p dependency to specific commit and clean up bootstr…
sumanjeet0012 Dec 22, 2025
e18a6de
Remove @libp2p/kad-dht dependency (#338)
NiKrause Feb 27, 2026
6164d97
feat: implemented file sharing using bitswap
sumanjeet0012 Feb 28, 2026
b1e3f95
fix: correct libp2p repository URL in dependencies
sumanjeet0012 Feb 28, 2026
1c29260
Added REST and WebSocket API endpoints to support peer management, me…
sumanjeet0012 Mar 3, 2026
124f804
made static peer id and port Number
sumanjeet0012 Mar 4, 2026
bfacf08
feat: added frontend for py-peer
sumanjeet0012 Mar 4, 2026
f7c2382
feat: add .gitignore and update API base URL handling in client.ts
sumanjeet0012 Mar 4, 2026
7c21d54
feat: implement RAG assistant with API endpoint and integrate vector …
sumanjeet0012 Mar 8, 2026
da6eb9f
fix: update vector store directory path
sumanjeet0012 Mar 8, 2026
403c320
fix: incorrect url for ask endpoint
sumanjeet0012 Mar 8, 2026
5a90b47
Update libp2p dependency to a new commit hash
sumanjeet0012 Mar 21, 2026
b5d54eb
Update libp2p dependency source in pyproject.toml
sumanjeet0012 Mar 21, 2026
53a76e6
fix: update import path for background_trio_service and add metadata …
sumanjeet0012 Mar 21, 2026
04b3e98
fix: add tornado dependency to pyproject.toml
sumanjeet0012 Mar 21, 2026
9c6988a
fix: update README to include Tornado API and React frontend details
sumanjeet0012 Mar 22, 2026
d7979f9
docs: enhance API reference with RAG assistant details and response s…
sumanjeet0012 Mar 22, 2026
896412a
fix: update styling and button functionality in LibP2PAssistant compo…
sumanjeet0012 Mar 22, 2026
1358337
fix: simplify seed handling in HeadlessService by directly using self…
sumanjeet0012 Apr 2, 2026
7932804
fix: add langchain-chroma to installation instructions in README
sumanjeet0012 Apr 2, 2026
d8beefa
fix: update bootstrap peers and improve logging in HeadlessService
sumanjeet0012 Apr 3, 2026
5ce7d62
docs: update README with instructions for setting up Python peer envi…
sumanjeet0012 Apr 3, 2026
121440b
Merge branch 'main' into py-peer-development
sumanjeet0012 Apr 9, 2026
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
14 changes: 14 additions & 0 deletions .github/workflows/generated-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Close Generated PRs

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

permissions:
issues: write
pull-requests: write

jobs:
stale:
uses: ipdxco/unified-github-workflows/.github/workflows/reusable-generated-pr.yml@v1
3 changes: 3 additions & 0 deletions .github/workflows/go-ci-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"skip32bit": true
}
12 changes: 6 additions & 6 deletions .github/workflows/go-ci.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: go-peer ci

on:
on:
pull_request:
paths:
- 'go-peer/**'
- "go-peer/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
go-check:
uses: libp2p/uci/.github/workflows/go-check.yml@v0.0
uses: ipdxco/unified-github-workflows/.github/workflows/go-check.yml@v0.0
with:
go-version: '1.23.x'
go-version: "1.25.x"
go-test:
uses: libp2p/uci/.github/workflows/go-test.yml@v0.0
uses: ipdxco/unified-github-workflows/.github/workflows/go-test.yml@v0.0
with:
go-versions: '["1.23.x"]'
go-versions: '["1.25.x"]'
5 changes: 3 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
name: Close and mark stale issue
name: Close Stale Issues

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

permissions:
issues: write
pull-requests: write

jobs:
stale:
uses: pl-strflt/.github/.github/workflows/reusable-stale-issue.yml@v0.3
uses: ipdxco/unified-github-workflows/.github/workflows/reusable-stale-issue.yml@v1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ yarn.lock
.DS_Store
go-peer/go-peer
**/.idea
nim-peer/nim_peer
nim-peer/local.*
76 changes: 65 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ Some of the cool and cutting-edge [transport protocols](https://connectivity.lib

## Packages

| Package | 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 | ❌ | ❌ | ✅ | ✅ | ❌ |
| [`py-peer`](./py-peer/) | Chat peer implemented in Python | ❌ | ❌ | ❌ | ✅ | ✅ |
| Package | Description | WebTransport | WebRTC | WebRTC-direct | QUIC | TCP |
| :-------------------------------- | :------------------------------ | ------------ | ------ | ------------- | ---- | --- |
| [`js-peer`](./js-peer/) | Browser Chat Peer in TypeScript | ✅ | ✅ | ✅ | ❌ | ❌ |
| [`node-js-peer`](./node-js-peer/) | Node.js Chat Peer in TypeScript | ✅ | ✅ | ✅ | ✅ | ✅ |
| [`go-peer`](./go-peer/) | Chat peer implemented in Go | ✅ | ❌ | ✅ | ✅ | ✅ |
| [`rust-peer`](./rust-peer/) | Chat peer implemented in Rust | ❌ | ❌ | ✅ | ✅ | ✅ |
| [`py-peer`](./py-peer/) | Chat peer implemented in Python | ❌ | ❌ | ❌ | ✅ | ✅ |
| [`nim-peer`](./nim-peer/) | Chat peer implemented in Nim | ❌ | ❌ | ❌ | ❌ | ✅ |

✅ - Protocol supported
❌ - Protocol not supported
Expand All @@ -42,8 +44,7 @@ There are two ways to connect to a peer:

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
## Getting started: Browser JS

### 1. Install dependencies

Expand All @@ -62,14 +63,29 @@ Start the dev server:
npm run dev
```

## Getting started: Node.js

### 1. Install dependencies

```
cd node-js-peer
npm i
```

### 2. Start the app

```
npm start
```

## Getting started: Rust

```
cd rust-peer
cargo run
```

This will automatically connect you to the bootstrap node running on [fly.io](https://fly.io).
This will automatically connect you to the bootstrap nodes running on bootstrap.libp2p.io.

To explore more advanced configurations if you e.g. want to set up our own network, try:

Expand All @@ -89,7 +105,45 @@ go run .
Make sure you have the [uv package manager](https://github.com/astral-sh/uv)
installed first. Follow the instructions on their Github to install it.

```
### 1. Create a virtual environment

Create and activate a virtual environment for the Python peer:

```bash
cd py-peer
uv run hello.py
uv venv
source .venv/bin/activate
```

### 2. Install dependencies

Install the Python peer dependencies:

```bash
uv pip install -e .
```

### 3. Start the Python peer

Start the peer:

```bash
python main.py
```

If you want a specific mode, you can pass flags such as `--ui`, `--kivy`, or `--api`. For example:

```bash
python main.py --ui

## Getting started: Nim
```
cd nim-peer
nimble build

# Wait for connections in tcp/9093
./nim_peer

# Connect to another node (e.g. in localhost tcp/9092)
./nim_peer --connect /ip4/127.0.0.1/tcp/9092/p2p/12D3KooSomePeerId
```
6 changes: 3 additions & 3 deletions go-peer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use a specific version of golang alpine for better reproducibility
FROM golang:1.23-alpine AS builder
FROM golang:1.25-alpine AS builder

WORKDIR /usr/src/app

Expand All @@ -18,11 +18,11 @@ FROM alpine:latest

# Add CA certificates for HTTPS and create non-root user
RUN apk --no-cache add ca-certificates && \
adduser -D appuser
adduser -D appuser

# Create a directory for the application and set proper permissions
RUN mkdir -p /app/data && \
chown -R appuser:appuser /app
chown -R appuser:appuser /app

# Copy the binary from builder
COPY --from=builder /usr/local/bin/universal-chat-go /usr/local/bin/universal-chat-go
Expand Down
33 changes: 17 additions & 16 deletions go-peer/chatroom.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ const ChatRoomBufSize = 128
// Topic used to broadcast browser WebRTC addresses
const PubSubDiscoveryTopic string = "universal-connectivity-browser-peer-discovery"

const ChatTopic string = "universal-connectivity"
const ChatFileTopic string = "universal-connectivity-file"

// ChatRoom represents a subscription to a single PubSub topic. Messages
// can be published to the topic with ChatRoom.Publish, and received
// messages are pushed to the Messages channel.
Expand All @@ -46,15 +43,15 @@ type ChatRoom struct {
// ChatMessage gets converted to/from JSON and sent in the body of pubsub messages.
type ChatMessage struct {
Message string
SenderID string
SenderID peer.ID
SenderNick string
}

// JoinChatRoom tries to subscribe to the PubSub topic for the room name, returning
// a ChatRoom on success.
func JoinChatRoom(ctx context.Context, h host.Host, ps *pubsub.PubSub, nickname string) (*ChatRoom, error) {
func JoinChatRoom(ctx context.Context, h host.Host, ps *pubsub.PubSub, nickname string, roomName string) (*ChatRoom, error) {
// join the pubsub chatTopic
chatTopic, err := ps.Join(ChatTopic)
chatTopic, err := ps.Join(roomName)
if err != nil {
return nil, err
}
Expand All @@ -66,7 +63,8 @@ func JoinChatRoom(ctx context.Context, h host.Host, ps *pubsub.PubSub, nickname
}

// join the pubsub fileTopic
fileTopic, err := ps.Join(ChatFileTopic)
fileTopicName := roomName + "-file"
fileTopic, err := ps.Join(fileTopicName)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -100,6 +98,7 @@ func JoinChatRoom(ctx context.Context, h host.Host, ps *pubsub.PubSub, nickname
peerDiscoveryTopic: peerDiscoveryTopic,
peerDiscoverySub: peerDiscoverySub,
nick: nickname,
roomName: roomName,
Messages: make(chan *ChatMessage, ChatRoomBufSize),
SysMessages: make(chan *ChatMessage, ChatRoomBufSize),
}
Expand All @@ -115,7 +114,7 @@ func (cr *ChatRoom) Publish(message string) error {
}

func (cr *ChatRoom) ListPeers() []peer.ID {
return cr.ps.ListPeers(ChatTopic)
return cr.ps.ListPeers(cr.roomName)
}

// readLoop pulls messages from the pubsub chat/file topic and handles them.
Expand All @@ -138,8 +137,9 @@ func (cr *ChatRoom) readChatLoop() {
}
cm := new(ChatMessage)
cm.Message = string(msg.Data)
cm.SenderID = msg.ID
cm.SenderNick = string(msg.ID[len(msg.ID)-8])
cm.SenderID = msg.GetFrom()
senderStr := cm.SenderID.String()
cm.SenderNick = senderStr[len(senderStr)-8:]
// send valid messages onto the Messages channel
cr.Messages <- cm
}
Expand Down Expand Up @@ -167,8 +167,9 @@ func (cr *ChatRoom) readFileLoop() {

cm := new(ChatMessage)
cm.Message = fmt.Sprintf("File: %s (%v bytes) from %s", string(fileID), len(fileBody), msg.GetFrom().String())
cm.SenderID = msg.ID
cm.SenderNick = string(msg.ID[len(msg.ID)-8])
cm.SenderID = msg.GetFrom()
senderStr := cm.SenderID.String()
cm.SenderNick = senderStr[len(senderStr)-8:]
// send valid messages onto the Messages channel
cr.Messages <- cm
}
Expand All @@ -183,13 +184,13 @@ func (cr *ChatRoom) requestFile(toPeer peer.ID, fileID []byte) ([]byte, error) {
defer stream.Close()

reqLen := binary.AppendUvarint([]byte{}, uint64(len(fileID)))
if _, err := stream.Write(reqLen); err != nil {
if _, err = stream.Write(reqLen); err != nil {
return nil, fmt.Errorf("failed to write fileID to the stream: %w", err)
}
if _, err := stream.Write(fileID); err != nil {
if _, err = stream.Write(fileID); err != nil {
return nil, fmt.Errorf("failed to write fileID to the stream: %w", err)
}
if err := stream.CloseWrite(); err != nil {
if err = stream.CloseWrite(); err != nil {
return nil, fmt.Errorf("failed to close write stream: %w", err)
}

Expand All @@ -207,4 +208,4 @@ func (cr *ChatRoom) requestFile(toPeer peer.ID, fileID []byte) ([]byte, error) {
}

return fileBody, nil
}
}
Loading