A distributed peer-to-peer rendering farm and data processing engine built with Rust (WASM), WebRTC, and FastAPI. This project turns every browser tab into a compute node, forming a decentralized supercomputer.
- P2P Communication: Direct browser-to-browser data transfer via WebRTC (DataChannels), bypassing server bottlenecks.
- High-Performance Kernels: Image processing (Sobel, Inversion) and Mandelbrot fractals powered by Rust compiled to WebAssembly.
- Custom Logic Injection: Requesters can deploy custom JavaScript logic across the grid with near-native performance.
- Security Sandboxing: Worker nodes execute custom code in a secured environment with restricted API access (No fetch/XHR).
- Result Verification: Built-in redundancy system that cross-verifies results from multiple workers for data integrity.
- Backend: Python (FastAPI, WebSockets for signaling)
- High-Perf: Rust (WebAssembly / wasm-bindgen)
- Networking: WebRTC (Peer-to-Peer), WebSockets
- Frontend: Vanilla JS, HTML5 Canvas, CSS3
- Rust &
wasm-pack - Python 3.8+
cd rust_worker
wasm-pack build --target webpip install fastapi uvicorn requestspython main.pyor
python3 main.py- Open http://localhost:8000 to see the Global Dashboard.
- Open /worker in multiple tabs (or different devices) to provide compute power.
- Open /requester to start a rendering or data analysis job.
- Transferable Objects: Used for zero-copy memory transfer between Workers and the main thread, ensuring 60fps performance even during heavy computation.
- API Lockdown: In the compute worker, global APIs like fetch and WebSocket are disabled to prevent data exfiltration by malicious job requesters.
- JIT-Optimized Loops: Custom logic is wrapped in a pre-compiled function scope to allow the V8 engine to optimize execution paths.
MIT