/ compute

coral.miner

the distributed compute node — evolving candidates, propagating results peer-to-peer, and contributing to the network's collective intelligence. run one on any machine.

scroll

/ 9 submodules

/ network

network layer

the network layer manages every aspect of peer-to-peer communication. on startup it opens a websocket server on PORT (default 9000) and an http api server on PORT+1 (default 9001). it registers with the cloudflare worker via POST /register and receives the initial peer list. peers are dialled directly via websocket — the worker is never in the message path after bootstrap. once connected, the HELLO handshake exchanges wallet addresses and current epoch numbers. each new connection triggers PEER_LIST gossip so the mesh self-expands beyond the initial bootstrap set. keepalive ping/pong runs every 15 seconds per connection; three missed pings marks a peer stale. the reconnect loop retries stale peers on exponential backoff. configurable via: PORT, MAX_PEERS, PEER_DIAL_INTERVAL_MS.