Examples
The guides on this site show you the calls. The examples are the same calls, wired up and runnable: a small CLI covering publishing, editing, downloading, Compute-to-Data and credential-gated access, against a real network.
They live in the nautilus repository, under
examples/.
Getting them running
git clone https://github.com/deltaDAO/nautilus.git
cd nautilus
npm install && npm run build
cd examples
npm install
cp example.env .envNode 22 or later. There is no build step for the examples themselves — tsx
runs the TypeScript directly.
Set these variables in .env:
| Variable | Value |
|---|---|
NETWORK | PONTUSXDEV, PONTUSXTEST, OASISSAPPHIRE, OPSEPOLIA (OP Sepolia), LOCAL (the local docker stack, chain 8996) or CUSTOM (any other chain, from CHAIN_ID, RPC_URL and OCEAN_NODE_URI) |
PRIVATE_KEY | The account that publishes and edits — and consumes, unless CONSUMER_PRIVATE_KEY is set |
OCEAN_NODE_URI | The ocean-node to use. Required for OPSEPOLIA and CUSTOM, and in practice everywhere (see below) |
DDO_STORE | ipfs (with IPFS_UPLOAD_URL, optionally IPFS_JWT) or s3 (with the S3_* variables) — where the encrypted DDO goes. Needed to publish or edit (an IPFS_UPLOAD_URL on its own also selects ipfs). There is no fallback to the node's own storage, which ocean-node 4.2 cannot read DDOs from. See remote stores. |
Optional:
| Variable | Value |
|---|---|
CONSUMER_PRIVATE_KEY | A second account that orders, downloads and runs compute. Its address is added to the allowlist of every allowlisted example asset. |
CONSUMER_ADDRESSES | More addresses to allowlist, comma separated — e.g. a consumer on another machine. |
PRICING_TOKEN_ADDRESS, PRICING_TOKEN_DECIMALS, PRICING_FIXED_RATE | Fixed prices in a token of your choice, on any network. OPSEPOLIA and CUSTOM have no ready-made payment token, so without these they publish for free. |
PUBLISH_LOG | A file that gets one JSON line per publish and edit — DID, NFT, datatokens, transaction and the store pointer without credentials — for cleaning up later. example.env sets published.jsonl. |
INDEXER_TIMEOUT_MS, INDEXER_INTERVAL_MS | How long publish and edit wait for the indexer (default 5 minutes, every 7 s). |
example.env documents every variable inline. Your account needs funds for gas, and for any
non-free asset it buys. Contact deltaDAO at contact@delta-dao.com for tokens and onboarding.
Plain http:// URLs are accepted only for localhost, 127.0.0.0/8, ::1 and *.localhost
(nautilus requires https:// for OCEAN_NODE_URI, S3_ENDPOINT and IPFS_UPLOAD_URL
elsewhere, and the examples have no switch to relax that). S3_NODE_ENDPOINT may be http://,
since only the node connects to it.
Then check what your ocean-node actually is, and that your DDO store works, before anything else:
npm start -- check:node
npm start -- store:check # the store's check(), what publish runs before minting; no transactionThe CLI
Every example is a named command:
npm start -- <command> [args...]
npm start -- help # every command, grouped
npm start -- <command> --help # one command's usage and what it needs, offlinehelp is generated from the command table in commands.ts, so it never drifts from what is
actually there. It marks the commands that need a DDO store (S) and the ones that act as the
consumer (C). The groups:
| Group | What it covers |
|---|---|
check: | Diagnostics. check:node is the one to run first. |
store: | store:check — the DDO store's preflight, without a transaction. |
publish: | Datasets, algorithms, SaaS offers, multi-service assets, local validation, and publish:resume to finish a publish that stopped after the mint. |
asset: | Inspecting, unlisting and revoking a published asset, and asset:indexing-state — the node's record of why it did or did not index it. |
edit: | Metadata, descriptions, a service's name, description and timeout (edit:service), its files and endpoint (edit:service-files) and allowlist (edit:service-allow), prices, trusted algorithms. |
access: | Price checks, ordering, downloading, service selection, consumer parameters. |
compute: | Environments, free and paid jobs, status, logs, results, multi-dataset jobs. |
ssi: | Credential-gated publishing and consuming with walt.id, for access and compute (ssi:publish-gated-compute, then ssi:compute). |
A first run, end to end:
npm start -- publish:access-dataset # prints a did:ope:… DID
npm start -- access:price did:ope:…
npm start -- access:download did:ope:…If a publish stops after the NFT was minted, the error prints the command to finish it on the same NFT, and the node's indexing record tells you why a change was not indexed:
npm start -- publish:resume publish:access-dataset 0xNFT… 0xDatatoken…
npm start -- asset:indexing-state 0xTxHash… # failures are filed by transactionOr chain the whole thing:
npm run scenario:e2e # publish → order → download → compute → revoke
npm start -- ssi:round-trip # the credential-gated round tripscenario:e2e revokes the assets it published at the end (revoking is one-way); set
E2E_KEEP_ASSETS=true to keep them.
Running against a local nautilus
The examples ship pointing at the nautilus in the same checkout
("@deltadao/nautilus": "file:../src"), so they exercise your working copy by default. Three
scripts control it:
npm run nautilus:which # report which is active
npm run use:local # build ../src and link it (the default)
npm run use:npm # switch to the published packageA bare use:npm reads the version from ../src/package.json and installs ^<version>, so it
tracks whatever the checkout is about to release. Pin something specific with --spec; then
nothing outside examples/ is read, so it also works in a copy of the directory:
npm run use:npm -- --spec 2.0.0-beta.0
npm run use:npm -- --spec betaSwitching rewrites package.json and package-lock.json; that churn is not meant to be
committed. And the examples need the release they were written for: they use
S3RemoteStore, completePublish, getIndexingState and the throwing waitForIndexer,
which 2.0.0-beta.0 does not have. Pin a version that does, or stay on use:local.
It is a dependency rewrite rather than npm link, deliberately: nothing is written to your
global npm prefix.
Where to look
publish:access-dataset, publish:saas, publish:multi-service
access:price, access:order, access:download
compute:envs, compute:free, compute:paid, compute:full
edit:metadata, edit:service, edit:service-files, edit:price
ssi:connect, ssi:round-trip, ssi:publish-gated-compute
The examples' own README goes further on the things that most often surprise people coming from v1: publishing needing a DDO store, what to do when a publish or an edit does not end indexed, one ocean-node replacing two URLs, and what DDO v5 did to the metadata.