From 7cf8c61be0cae4b729915e704bc859c1a77a5de5 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 20 Nov 2019 11:45:16 +0100 Subject: [PATCH 1/2] package updates --- package.json | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index c14ef8e..abcf17c 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,11 @@ "version": "1.0.0", "description": "React + squid.js interacting in the most minimal way with Ocean Protocol.", "dependencies": { - "@oceanprotocol/keeper-contracts": "0.11.1", - "@oceanprotocol/squid": "0.7.2", - "react": "^16.9.0", - "react-dom": "^16.9.0", - "react-scripts": "^3.1.1", - "web3": "^1.2.1" + "@oceanprotocol/squid": "^1.0.0-beta.6", + "react": "^16.12.0", + "react-dom": "^16.12.0", + "react-scripts": "^3.2.0", + "web3": "^1.2.4" }, "scripts": { "start": "react-scripts start", From 14df1d877be48deda15afa12bf3c4efbafffcd4b Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Wed, 20 Nov 2019 11:50:17 +0100 Subject: [PATCH 2/2] DDO schema updates --- src/asset.js | 19 ++++++++----------- src/index.js | 6 +++--- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/src/asset.js b/src/asset.js index 093f779..decff76 100644 --- a/src/asset.js +++ b/src/asset.js @@ -1,8 +1,9 @@ const asset = { - base: { + main: { name: '10 Monkey Species Small', dateCreated: '2012-02-01T10:55:11Z', author: 'Mario', + type: 'dataset', license: 'CC0: Public Domain', price: '0', files: [ @@ -11,7 +12,7 @@ const asset = { contentType: 'application/zip', checksum: '2bf9d229d110d1976cdf85e9f3256c7f', checksumType: 'MD5', - contentLength: 12057507, + contentLength: '12057507', compression: 'zip', encoding: 'UTF-8', url: @@ -22,19 +23,15 @@ const asset = { contentType: 'text/txt', checksum: '354d19c0733c47ef3a6cce5b633116b0', checksumType: 'MD5', - contentLength: 928, + contentLength: '928', url: - 'https://s3.amazonaws.com/datacommons-seeding-us-east/10_Monkey_Species_Small/assets/monkey_labels.txt', - resourceId: 'test' - }, - { - index: 2 + 'https://s3.amazonaws.com/datacommons-seeding-us-east/10_Monkey_Species_Small/assets/monkey_labels.txt' } - ], - checksum: '', + ] + }, + additionalInformation: { categories: ['image'], tags: ['image data', 'classification', 'animals'], - type: 'dataset', description: 'EXAMPLE ONLY ', copyrightHolder: 'Unknown', workExample: 'image path, id, label', diff --git a/src/index.js b/src/index.js index 4a3dae7..b8fadac 100644 --- a/src/index.js +++ b/src/index.js @@ -73,18 +73,18 @@ class App extends Component { // get first asset from search results const consumeAsset = this.state.results[0] // get service we want to execute - const service = consumeAsset.findServiceByType('Access') + const service = consumeAsset.findServiceByType('access') // order service agreement const agreement = await this.state.ocean.assets.order( consumeAsset.id, - service.serviceDefinitionId, + service.index, accounts[0] ) // consume it await this.state.ocean.assets.consume( agreement, consumeAsset.id, - service.serviceDefinitionId, + service.index, accounts[0], '', 0