Scenario

The Developer Platform

Build apps on top of MeshHold.

Build apps on top of MeshHold. REST API, Server-Sent Events stream, and the mesh protocols.

REST API

All endpoints live under /api/v1/. Bearer-token auth (the same token the web UI uses). Configurable bind on api.listen_addr.

Key endpoints:

  • GET /api/v1/vaults — list vaults
  • POST /api/v1/vaults — create
  • GET /api/v1/vaults/{id}/files/{path} / DELETE … — read / delete a file
  • POST /api/v1/vaults/{id}/upload/{path} — upload one
  • GET /api/v1/events/stream — global SSE for chat events

The full reference is the REST API reference.

SSE event stream

const es = new EventSource('/api/v1/events/stream?token=...');
es.addEventListener('chat_message', (e) => {
  const m = JSON.parse(e.data);
  console.log(m.room_id, m.sender_node_id, m.message_type);
});

The event says that a message arrived, not what it says: fetch the text from GET /api/v1/rooms/{room_id}/messages.

Mesh protocol IDs

Nodes talk to each other over MeshHold's own mesh layer. Every stream opens with a protocol ID, and the version is part of the ID — a node that does not serve one answers "unsupported" rather than guessing. What a node serves at this release:

Protocol Purpose
/meshhold/hello/1.0 First exchange on a connection: name, capabilities, the addresses each side listens on, and the peers the answering side knows
/meshhold/topo/2.0 Topology: each node's signed presence and record, flooded
/meshhold/beat/1.0 The idle beat: one frame per peer carrying every subsystem's digest
/meshhold/topic/1.0 The broadcast flood that carries the topics — /meshhold/chat/<room> (live messages) and /meshhold/replication/<vault> (holders' announcements, and nudges that a vault's rows moved) — each message signed by its publisher
/meshhold/punch/1.0 Coordinates a hole punch between two NAT'd nodes
/meshhold/standby/2.0 The session between a phone in standby and the node holding it
/meshhold/block/1.0 Block fetch by hash
/meshhold/block-reserve/1.0, /meshhold/block-put/1.0, /meshhold/replica-commit/1.0 Pushing a new file's blocks to a peer with free disk that holds the vault, and registering it as their holder
/meshhold/sets/1.0 The sync engine: one session per pair of nodes compares every set both hold by hash buckets — a vault's version rows, heads, holder claims, library and policy; a room's messages, receipts and message lifetime — and moves the rows that differ both ways. Nothing changed costs one root exchange
/meshhold/vault-history/1.0 A file's version rows, asked of a node that keeps the vault's whole history by a member that does not, when the file's history is opened
/meshhold/repl-notify/3.0 A replication announcement or nudge pushed straight to a member the flood does not reach
/meshhold/prepare/2.0 Asks a node to hash a file that a Listed only folder lists without hashes
/meshhold/offers/1.0 What a node has opened to the network, and handing over a key on request
/meshhold/doc/2.0 A document's collaboration state, so two editors converge — only between nodes that prove they hold the vault's key
/meshhold/filesend/1.0 One-shot, consent-gated file push between two nodes
/meshhold/share-publish/2.0, /meshhold/share-block/1.0, /meshhold/share-status/1.0, /meshhold/share-unpublish/1.0 Putting a public share link's content on a gateway node
/meshhold/meet-create/2.0, /meshhold/meet-delete/2.0 Putting a meeting on a gateway node
/meshhold/call/1.0 Call control: invite, ringing, accept, hang up
/meshhold/call-media/1.0 Call media frames, end-to-end encrypted
/meshhold/dgflow/1.0 Sets up a direct datagram flow for real-time media
/meshhold/tunnel/1.0, /meshhold/tunnel/1.1 Circuit control: hop by hop, and chained
/meshhold/tunnel-data/1.0, /meshhold/tunnel-data/2.0 Circuit data substreams
/meshhold/tunnel-carrier/1.0 A circuit's flows carried over the delivery layer
/meshhold/link-datagram/1.0 The datagram plane on a connection with no native datagrams