1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-02 00:05:35 +01:00

add final screenshot, code style fixes

This commit is contained in:
Matthias Kretschmann 2019-01-30 11:45:59 +01:00
parent f07ded1e1f
commit c73f9bce0f
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 29 additions and 21 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

View File

@ -5,7 +5,7 @@ description: Tutorial to get and use a data set in a basic React app.
## Requirements
This is a continuation of the [React App Setup](/tutorials/react-setup) and [React Publish Data-set](/tutorials/react-publish-data-set) tutorial, so make sure you have done all the steps described in there.
This is a continuation of the [React App Setup](/tutorials/react-setup/) and [React Publish Data-set](/tutorials/react-publish-data-set/) tutorial, so make sure you have done all the steps described in there.
Open `src/App.js` in your marketplace app from previous tutorials.
@ -61,6 +61,10 @@ We still need button in render function just after `<button onClick={()=>this.re
<button onClick={() => this.consumeAsset()}>Consume asset</button>
```
With all these buttons in place, you should see this:
![React App 05](images/react-app-05.png)
## Final Result
That's it. If you have no errors in your `console.log` and your asset files listed you have working marketplace.
@ -134,7 +138,7 @@ class App extends Component {
}
async retrieveAssets() {
this.dbAssets = await this.ocean.searchAssetsByText("Office Humidity")
this.dbAssets = await this.ocean.searchAssetsByText('Office Humidity')
console.log(this.dbAssets)
}
@ -149,7 +153,8 @@ class App extends Component {
const serviceAgreementSignatureResult = await this.ocean.signServiceAgreement(
consumeAsset.id,
service.serviceDefinitionId,
accounts[0])
accounts[0]
)
// run it
await this.ocean.initializeServiceAgreement(
consumeAsset.id,
@ -157,8 +162,11 @@ class App extends Component {
serviceAgreementSignatureResult.serviceAgreementId,
serviceAgreementSignatureResult.serviceAgreementSignature,
// callback to handle the files we get
(files) => { console.log('Asset files', files) },
accounts[0])
files => {
console.log('Asset files', files)
},
accounts[0]
)
}
render() {

View File

@ -5,9 +5,9 @@ description: Tutorial to add dataset publishing capabilities to a basic React ap
## Requirements
This is a continuation of the [React App Setup](/tutorials/react-setup) tutorial, so make sure you have done all the steps described in there.
This is a continuation of the [React App Setup](/tutorials/react-setup/) tutorial, so make sure you have done all the steps described in there.
Open `src/App.js` in your marketplace app from the [React App Setup](/tutorials/react-setup) tutorial.
Open `src/App.js` in your marketplace app from the [React App Setup](/tutorials/react-setup/) tutorial.
## Define Asset