A peer-to-peer agent network implementing Mycelial Economics principles for Univrs.io. Built with Rust, libp2p, and React.
Mycelial creates a decentralized network where autonomous agents:
- Discover each other via Kademlia DHT and mDNS
- Communicate through gossipsub pub/sub messaging
- Track reputation based on contributions
- Establish credit relationships for mutual resource sharing
- Orchestrate workloads across the network
- Visualize everything through a real-time dashboard
MYCELIAL SYSTEM
┌─────────────────────────────────────────────────────────────────────┐
│ │
│ ┌──────────────────────────┐ ┌──────────────────────────────┐ │
│ │ React Dashboard │ │ Orchestrator │ │
│ │ │ │ (port 9090) │ │
│ │ • Live peer graph │◄──►│ • Workload scheduling │ │
│ │ • P2P chat │ │ • Node health monitoring │ │
│ │ • Reputation tracking │ │ • Cluster resource mgmt │ │
│ │ • Workload monitoring │ │ • Event streaming │ │
│ └────────────┬─────────────┘ └──────────────────────────────┘ │
│ │ │
│ │ WebSocket + REST API │
│ ▼ │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ P2P Node (port 8080) │ │
│ │ │ │
│ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │ │
│ │ │ Gossipsub │ │ Kademlia │ │ mDNS │ │ │
│ │ │ Pub/Sub │ │ DHT │ │ Local Discovery │ │ │
│ │ └─────────────┘ └─────────────┘ └─────────────────────┘ │ │
│ │ │ │
│ │ ┌─────────────────────────────────────────────────────────┐ │ │
│ │ │ TCP + Noise + Yamux Transport │ │ │
│ │ └─────────────────────────────────────────────────────────┘ │ │
│ └──────────────────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────────────────────────────────────────────────────┐ │
│ │ Core Layer (Rust) │ │
│ │ • Ed25519 Identity & DID • Blake3 Content Hashing │ │
│ │ • SQLite Persistence • LRU Cache │ │
│ │ • CRDT Conflict Resolution • Merkle Tree Proofs │ │
│ └──────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────┘
- Peer Discovery: Automatic peer discovery via Kademlia DHT and local mDNS
- Secure Messaging: End-to-end encrypted communication with Noise protocol
- Pub/Sub Topics: Chat, reputation, credit transfers, and governance channels
- Ed25519 Identity: Cryptographic identity with DID (Decentralized Identifier) support
- Workload Management: Schedule and monitor distributed tasks across nodes
- Health Monitoring: Real-time node status (Ready/NotReady) with resource metrics
- Resource Tracking: CPU, memory, and disk allocation monitoring
- Event Streaming: WebSocket-based live updates for dashboard integration
- Network Visualization: Interactive force-directed graph of P2P connections
- Real-time Chat: Broadcast and direct messaging between peers
- Cluster Overview: Node status, resource usage, and workload metrics
- Reputation Display: Peer contribution scores and vouching relationships
- Rust 1.75+:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - Node.js 18+ and pnpm:
npm install -g pnpm
# Clone the repository
git clone https://github.com/univrs-io/mycelial-dashboard.git
cd mycelial-dashboard
# Build all Rust components
cargo build --release
# Run tests
cargo test --workspace# Terminal 1: Bootstrap node (acts as initial peer)
cargo run --release --bin mycelial-node -- \
--bootstrap --name "Bootstrap" --port 9000 --http-port 8080
# Terminal 2: Additional peer
cargo run --release --bin mycelial-node -- \
--name "Alice" --connect "/ip4/127.0.0.1/tcp/9000"
# Terminal 3: Another peer
cargo run --release --bin mycelial-node -- \
--name "Bob" --connect "/ip4/127.0.0.1/tcp/9000"cd dashboard
pnpm install
pnpm dev
# Open http://localhost:5173# For workload management and cluster monitoring
cargo run --release --bin mycelial-orchestrator -- --port 9090Environment variables for the dashboard (.env):
# P2P Network (mycelial-node)
VITE_P2P_WS_URL=ws://localhost:8080/ws
VITE_P2P_API_URL=http://localhost:8080
# Orchestrator (optional)
VITE_ORCHESTRATOR_WS_URL=ws://localhost:9090/api/v1/events
VITE_ORCHESTRATOR_API_URL=http://localhost:9090
# Development mode
VITE_USE_MOCK_DATA=false| Endpoint | Method | Description |
|---|---|---|
/ws |
WebSocket | Real-time P2P events |
/api/peers |
GET | List connected peers |
/api/info |
GET | Local node information |
/api/stats |
GET | Network statistics |
/health |
GET | Health check |
| Endpoint | Method | Description |
|---|---|---|
/api/v1/events |
WebSocket | Real-time cluster events |
/api/v1/nodes |
GET | List managed nodes |
/api/v1/workloads |
GET/POST | Workload management |
/api/v1/cluster/status |
GET | Cluster health metrics |
This system implements the foundation for Mycelial Economics:
- Contribution Scoring: Track helpful peer interactions automatically
- Reputation Propagation: Gossip reputation updates through the network
- Mutual Credit: Peer-to-peer credit relationships without central banking
- Resource Sharing: Fair allocation based on contributions
- Democratic Governance: Proposal and voting system for network policies
See the Mycelial Economics Whitepaper for the full framework.
| Component | Technology |
|---|---|
| Core | Rust 2021, serde, thiserror |
| P2P Network | libp2p 0.54 (gossipsub, kademlia, mDNS) |
| Persistence | SQLite + sqlx + LRU cache |
| HTTP Server | Axum + tokio |
| Dashboard | React 18 + Vite + TypeScript + TailwindCSS |
| Visualization | D3.js force-directed graph |
- P2P Network: Production-ready (40+ tests passing)
- Dashboard: Functional (peer graph, chat, orchestrator integration)
- Orchestrator: Beta (workload scheduling, health monitoring)
- Economics: In development (reputation, credit, governance)
- libp2p - Modular P2P networking stack
- Holochain - Agent-centric distributed applications
- hREA - Economic coordination on Holochain
MIT License - see LICENSE for details.
We welcome contributions! Please:
- Fork the repository
- Create a feature branch
- Ensure tests pass (
cargo test --workspace) - Submit a pull request
Built by Univrs.io