Directory
Account-to-peer directory.
Account-to-peer directory. It answers one question — which libp2p peer holds a
given account's chat — and it is the lookup POST /chat/send
performs before delivering a message.
Registrations are signed by the account they name and scoped to the network, so only the account holder can publish one. They also expire: a node re-publishes its own registration on a timer, and an account that stops re-registering falls out of the directory and becomes unreachable for chat. Nothing here is on the ledger — this is node-local, gossiped state.
GETPOSTGET
/directoryList all registrations — Every unexpired registration this node holds, sorted by account and paginated.
/directory/registerRegister account — Publishes a signed mapping from an account to the libp2p peer that will receive chat for it, then gossips it to the rest of the network. The node verifies the signature against `account` before accepting, so an account can only be registered by its own key. A registration whose timestamp is not newer than the one already held for that account is ignored, and the call still succeeds. Registrations expire — re-register before the directory TTL elapses to stay reachable.
/directory/{account}Lookup account registration — Resolves an account to the peer its chat should be delivered to. This is the lookup `POST /chat/send` performs internally.