From 9d582082f05cab961915aef04e74f8e32fd7ba9c Mon Sep 17 00:00:00 2001 From: paulo-ocean Date: Fri, 21 Jun 2024 15:20:41 +0100 Subject: [PATCH 1/4] wip: update to support agreementId --- docs/classes/Provider.md | 6 +++--- package-lock.json | 4 ++-- package.json | 2 +- src/services/Provider.ts | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/classes/Provider.md b/docs/classes/Provider.md index e3e92d81..9c937bfc 100644 --- a/docs/classes/Provider.md +++ b/docs/classes/Provider.md @@ -128,9 +128,9 @@ ___ ### computeStatus -▸ **computeStatus**(`providerUri`, `consumerAddress`, `jobId?`, `did?`, `signal?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> +▸ **computeStatus**(`providerUri`, `consumerAddress`, `jobId?`, `agreementId?`, `signal?`): `Promise`<[`ComputeJob`](../interfaces/ComputeJob.md) \| [`ComputeJob`](../interfaces/ComputeJob.md)[]\> -Get compute status for a specific jobId/documentId/owner. +Get compute status for a specific jobId/agreementId/owner. #### Parameters @@ -139,7 +139,7 @@ Get compute status for a specific jobId/documentId/owner. | `providerUri` | `string` | The URI of the provider we want to query | | `consumerAddress` | `string` | The consumer ethereum address | | `jobId?` | `string` | The ID of a compute job. | -| `did?` | `string` | The ID of the asset | +| `agreementId?` | `string` | The ID of service agreement | | `signal?` | `AbortSignal` | abort signal | #### Returns diff --git a/package-lock.json b/package-lock.json index 87b25d16..ffb382ce 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@oceanprotocol/lib", - "version": "3.3.1", + "version": "3.3.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@oceanprotocol/lib", - "version": "3.3.1", + "version": "3.3.2", "license": "Apache-2.0", "dependencies": { "@oceanprotocol/contracts": "^2.0.3", diff --git a/package.json b/package.json index 0870c151..447b59c1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@oceanprotocol/lib", "source": "./src/index.ts", - "version": "3.3.1", + "version": "3.3.2", "description": "JavaScript client library for Ocean Protocol", "main": "./dist/lib.js", "umd:main": "dist/lib.umd.js", diff --git a/src/services/Provider.ts b/src/services/Provider.ts index 27cb40aa..3d5435f0 100644 --- a/src/services/Provider.ts +++ b/src/services/Provider.ts @@ -685,7 +685,7 @@ export class Provider { * @param {string} providerUri The URI of the provider we want to query * @param {string} consumerAddress The consumer ethereum address * @param {string} jobId The ID of a compute job. - * @param {string} did The ID of the asset + * @param {string} agreementId The ID of the service agreement (tx id) * @param {AbortSignal} signal abort signal * @return {Promise} */ @@ -693,7 +693,7 @@ export class Provider { providerUri: string, consumerAddress: string, jobId?: string, - did?: string, + agreementId?: string, signal?: AbortSignal ): Promise { const providerEndpoints = await this.getEndpoints(providerUri) @@ -706,7 +706,7 @@ export class Provider { : null let url = `?consumerAddress=${consumerAddress}` - url += (did && `&documentId=${this.noZeroX(did)}`) || '' + url += (agreementId && `&agreementId=${this.noZeroX(agreementId)}`) || '' url += (jobId && `&jobId=${jobId}`) || '' if (!computeStatusUrl) return null From 1dcafcff6cd51b1d3f0ec4a7ce882ad727a2267b Mon Sep 17 00:00:00 2001 From: paulo-ocean Date: Tue, 25 Jun 2024 09:19:41 +0100 Subject: [PATCH 2/4] wip: debug agreemenet id --- ComputeExamples.md | 2 +- test/integration/ComputeExamples.test.ts | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ComputeExamples.md b/ComputeExamples.md index 487ffffd..250c169d 100644 --- a/ComputeExamples.md +++ b/ComputeExamples.md @@ -672,7 +672,7 @@ You can also add various delays so you see the various states of the compute job providerUrl, await consumerAccount.getAddress(), computeJobId, - DATASET_DDO.id + agreementId ) ``` -Let's save the compute job it, we re going to use later +Let's save the compute job id, we re going to use later +We can also save the agreementId. Its another optional field that we can later use to retrieve the job status ```Typescript computeJobId = computeJobs[0].jobId + agreementId = computeJobs[0].agreementId ``` diff --git a/test/integration/ComputeExamples.test.ts b/test/integration/ComputeExamples.test.ts index 877a9392..209ada3e 100644 --- a/test/integration/ComputeExamples.test.ts +++ b/test/integration/ComputeExamples.test.ts @@ -655,8 +655,6 @@ describe('Compute-to-data example tests', async () => { algo ) - console.log('COMPUTE JOBS', computeJobs) - /// ``` ///