getJobInfo

Compute.getJobInfo(jobID)

Returns information for the job with the provided ID. It will use wallet.getId() to retrieve the auth keystore.

Arguments
  • jobID (string()) – The job ID

Returns

Promise.<object> – status object describing a given job

Example:

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

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

  const job = compute.for(
    1,
    5,
    1,
    async (sliceIndex, data) => {
      progress();
      return sliceIndex ** 2 + Math.sqrt(data);
    },
    [100],
  );

  job.on('accepted', async () => {
    const jobInfo = await compute.getJobInfo(job.id);
    console.log(jobInfo);
  });

  const results = await job.exec();
});