Files
frid/README.md
T

80 lines
2.9 KiB
Markdown
Raw Normal View History

2026-07-26 03:48:30 +03:00
# frid
2026-07-10 12:45:47 +03:00
2026-07-26 03:48:30 +03:00
Frid is the decentralized networking core behind Furumi. It provides reusable
Rust libraries for building equal-peer applications with no application
server, central peer registry, or privileged node.
2026-07-10 12:45:47 +03:00
2026-07-26 03:48:30 +03:00
The workspace has two layers:
2026-07-10 12:45:47 +03:00
2026-07-26 03:48:30 +03:00
- [`federation-net`](crates/federation-net) establishes authenticated,
NAT-traversing P2P connections over iroh, isolates independent networks and
message schemas, and optionally discovers peers through the BitTorrent
Mainline DHT.
- [`music-dht`](crates/music-dht) builds a Kademlia-style distributed music
directory on top of that transport, including catalog discovery, content-id
lookup, direct byte streams, and shared Furumi wire types.
2026-07-10 12:45:47 +03:00
2026-07-26 03:48:30 +03:00
Each participant is a client, router, and storage peer. Automatic rendezvous
has no Frid-operated bootstrap service, while self-contained peer tickets
remain available for explicit or isolated connections.
2026-07-10 12:45:47 +03:00
2026-07-26 03:48:30 +03:00
## Design principles
2026-07-10 12:45:47 +03:00
2026-07-26 03:48:30 +03:00
- **Equal peers.** No node receives a permanent coordinator or server role.
- **Application-owned protocols.** The transport moves typed messages and
byte streams without owning domain state.
- **Bounded inputs.** Frames, tickets, routing tables, requests, and record
batches have explicit limits.
- **Offline-tolerant discovery.** Records are replicated, refreshed by their
owners, expired by TTL, and removed through revisioned tombstones.
- **Protocol isolation.** Network IDs, schema IDs, versions, and ALPNs prevent
unrelated or incompatible applications from being merged accidentally.
- **Local persistence.** Identity, routing knowledge, owned records, and
replicas survive restarts in application-controlled storage.
2026-07-10 12:45:47 +03:00
2026-07-26 03:48:30 +03:00
See [ARCHITECTURE.md](ARCHITECTURE.md) for the protocol layers, trust model,
failure handling, and compatibility rules.
2026-07-10 12:45:47 +03:00
2026-07-26 03:48:30 +03:00
## Workspace
2026-07-10 12:45:47 +03:00
```text
2026-07-26 03:48:30 +03:00
crates/
federation-net/ generic iroh transport and rendezvous
music-dht/ distributed music catalog and content discovery
2026-07-10 12:45:47 +03:00
```
2026-07-26 03:48:30 +03:00
## Using the libraries
Until crates are published to a registry, depend on the repository directly:
```toml
[dependencies]
federation-net = { git = "https://gt.hexor.cy/ab/frid.git" }
music-dht = { git = "https://gt.hexor.cy/ab/frid.git" }
```
Start with the crate documentation:
- [`federation-net` guide](crates/federation-net/README.md)
- [`music-dht` guide](crates/music-dht/README.md)
## Development
2026-07-26 03:51:15 +03:00
Frid uses Rust edition 2024 and requires Rust 1.97 or newer.
2026-07-10 12:45:47 +03:00
```bash
2026-07-26 03:48:30 +03:00
cargo fmt --all -- --check
cargo check --workspace --all-targets --all-features
2026-07-10 12:45:47 +03:00
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace
```
2026-07-26 03:48:30 +03:00
The integration tests open real local sockets and establish iroh connections.
Some rendezvous tests also use public discovery infrastructure, so a restricted
sandbox may need explicit network permission.
## License
Frid is released under the
[Do What The Fuck You Want To Public License, Version 2](LICENSE).