Skip to content
LogoLogo

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

OptionTypePurpose
nodeUristringHTTP URL, or a peerId/multiaddr to use the libp2p transport.
chainIdnumber
authNodeAuthA Signer, a JWT auth token, or a pre-computed signature.
consumerAddressstringRequired 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 ) {
    .(., .) 
  }
}

See the Ocean Node client guide.