Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

@enc-protocol/registry-cli — RegistrySdk

The discovery app: a public index of identities, enclaves, and nodes that lets clients resolve who/where without a central server.

Extends AppSdk. Enclave: Registry. No encryption — the registry is a public index.

Install

npm config set @enc-protocol:registry https://npm-registry.ocrybit.workers.dev/
npm install @enc-protocol/registry-cli

Construct

import { RegistrySdk } from '@enc-protocol/registry-cli'
 
const sdk = new RegistrySdk({ mode: 'cf', nodeUrl: process.env.NODE_URL, identity })
await sdk.init()

Options are the standard AppSdk constructor.

Read-only at the app level

RegistrySdk exposes no generated submit* methods — registration is written at the enclave level through the Registry enclave's customs (reg_identity, reg_enclave, reg_node), and read back through the registry's dataview snapshots. The dataview keeps one UPSERT-keyed row per entity:

view (data_type)source eventkeyed by
reg_identitiesreg_identityid_pub
reg_enclavesreg_enclaveenclave_id
reg_nodesreg_nodeseq_pub

Read them with the generic AppSdk surface, or drop to the lower-level adapter:

const identities = await sdk.query('reg_identities')
const client = sdk.raw()   // underlying AppClient for enclave-level access

For typed lookups (resolve an enclave to its hosting node, list nodes/identities), the RegistryClient in @enc-protocol/client is usually the better surface.

See also