OceanNodeClient
The client for a single ocean-node. One node serves metadata, provider services, the indexer and compute — replacing v1's separate Aquarius and Provider.
Usually you take the one the instance already built rather than constructing your own.
Usage
const = .()
const = await .()Constructing one directly:
const = new ({
: 'https://ocean-node.dev.pontus-x.eu',
: 32456,
:
})Options
| Option | Type | Purpose |
|---|---|---|
nodeUri | string | HTTP URL, or a peerId/multiaddr to use the libp2p transport. |
chainId | number | |
auth | NodeAuth | A Signer, a JWT auth token, or a pre-computed signature. |
consumerAddress | string | Required when auth is a JWT, which nautilus cannot decode. |
Selected methods
Metadata
resolve(did) · resolveMany(dids) · query(searchQuery) · waitForIndexer(did, txid?) ·
validateRemote(ddo)
Files and storage
getFileInfo(file, withChecksum?) · checkDidFiles(did, serviceId, withChecksum?) ·
createBucket(accessLists, label?) · uploadFile(bucketId, fileName, content) ·
getFileObject(bucketId, fileName)
Compute
getComputeEnvironments() · initializeCompute(params) · computeStart(params) ·
freeComputeStart(params) · computeStatus(jobId?, agreementId?) · getComputeJob(jobId) ·
computeStop(jobId, agreementId?) · getComputeResultUrl(jobId, index) ·
getComputeResult(jobId, index, offset?) · getComputeLogs(jobId)
Identity
initializePolicyVerification(request) · policyServerPassthrough(action)
Diagnostics
getNodeStatus() · isValidNode(uri?) · OceanNodeClient.clearValidityCache()
Errors
Every call is wrapped, so failures arrive as OceanNodeError with the operation named and the
original error on cause.
try {
await ()
} catch () {
if ( instanceof ) {
.(., .)
}
}