orbitdb-relay-pinner
v0.1.7
Published
OrbitDB relay + pinning/sync service for Helia/libp2p stacks.
Maintainers
Readme
orbitdb-relay-pinner
OrbitDB relay + pinning/sync service used by our apps and tests.
AI Agents
See AGENTS.md for an architecture and feature guide (entrypoints, data flow, env vars, and extension points).
Docs
- Relay media pinning flow:
docs/relay-media-pinning.md
CLI
Install:
npm i orbitdb-relay-pinnerRun:
orbitdb-relay-pinnerTest mode (deterministic peer id via TEST_PRIVATE_KEY or RELAY_PRIV_KEY):
orbitdb-relay-pinner --testSupported Access Controllers
orbitdb-relay-pinner supports the following Access Controller types when opening OrbitDB databases:
orbitdb(built-in OrbitDB access controller)todo-delegation(custom delegated todo controller registered by this package)
Notes:
- Existing databases are opened using the manifest
accessController.type. - Creating a new database without explicitly passing an
AccessControllerstill defaults toorbitdb.
Environment Variables (common)
RELAY_TCP_PORT,RELAY_WS_PORT,RELAY_WEBRTC_PORTRELAY_DISABLE_WEBRTC=trueto disable UDP/webrtc-directlistener in constrained environmentsMETRICS_PORT=0to bind metrics on an ephemeral port (avoidEADDRINUSE)DATASTORE_PATHorRELAY_DATASTORE_PATHto control where LevelDB data is storedPUBSUB_TOPICSto override pubsub peer discovery topics (default:todo._peer-discovery._p2p._pubsub)TEST_PRIVATE_KEY/RELAY_PRIV_KEYfor--testruns (optional)
Development
npm i
npm run build
node dist/cli.js --testDocker Compose Example
See docker-compose.example.yml for a minimal deployment example with:
- persistent datastore volume (PeerId/key survives restarts)
- relay + metrics ports exposed (
9091/tcp,9092/tcp,9093/udp,9090/tcp) - WebRTC enabled and AutoTLS left enabled by default
