Access controllers
orbitdb-relay supports the following OrbitDB Access Controller types when opening databases:
orbitdb— the built-in OrbitDB access controller.orbitdb-deferred— a custom deferred OrbitDB ACL registered by this package (src/access/deferred-orbitdb-access-controller.ts).todo-delegation— delegated todo writes (same rules as the app; see below).
Notes:
- Existing databases are opened using the manifest's
accessController.type. - Creating a new database without explicitly passing an
AccessControllerstill defaults toorbitdb.
Why the relay needs the app's access controller
The relay verifies oplog entries as part of replication. To evaluate canAppend the same way the
browser does, it must register the same access controller the application uses. If the relay's
access-controller package version drifts from the app's, verification of a custom AC's own store
can fail — see Version compatibility.
The todo-delegation package
The delegated todo access controller lives in
@le-space/orbitdb-access-controller-delegated-todo (shared with
simple-todo) so pinning uses the same canAppend and
verifyDelegationWriterIdentity behavior as the browser. This relay depends on ^0.1.0 of
that package.
If npm install cannot resolve it yet, install from a local checkout of simple-todo:
npm install ../path/to/simple-todo/packages/orbitdb-access-controller-delegated-todo
Choosing a controller
- Use
orbitdbfor a standard shared database where the write set is the set of known identities. - Use
orbitdb-deferredwhen you need the deferred OrbitDB ACL semantics this package registers. - Use
todo-delegationwhen your app already uses the delegated-todo controller and you want the relay to enforce the identical delegation rules while it pins.
The relay does not decide the controller — the database manifest does. Your application picks the access controller when it creates the database; the relay simply opens the manifest and registers the matching controller so it can verify entries.
See also
- Identity providers — how the relay verifies the identities that
canAppendchecks. - Version compatibility — keeping the AC package in sync between app and relay.