init

init(url = 'https://scheduler.distributed.computer', autoUpdate = false[, bundleLocation])

Asynchronously initialize the dcp-client bundle for use by the compute API, etc.

Arguments
  • url (string|URL()) – Scheduler URL location, defaults to https://scheduler.distributed.computer

  • autoUpdate (boolean()) – AutoUpdate dcp-client bundle, defaults to true.

  • bundleLocation (string()) – Bundle location to download during auto updating.

Return type

A promise which resolves to an instance of a DCP object.

Example:

const { init } = require('dcp-client');

init().then((dcp) => {
  const compute = require('dcp/compute');
  // or
  // const { compute } = dcp;
});

Tutorials: