1
0
mirror of https://github.com/oceanprotocol/react-tutorial synced 2024-11-22 01:36:58 +01:00

consistency fixes

This commit is contained in:
Matthias Kretschmann 2020-03-30 12:41:13 +02:00
parent 8b724ea9e7
commit 303ed00df2
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 11 additions and 9 deletions

View File

@ -1,7 +1,7 @@
import React, { useState } from 'react'
import { asset } from './asset'
import { algoAsset, createComputeService, rawAlgoMeta } from './asset-compute'
import asset from './asset'
import { assetAlgo, createComputeService, rawAlgoMeta } from './asset-compute'
export default function Compute({ ocean, web3 }) {
const [ddoAssetId, setDdoAssetId] = useState('')
@ -45,7 +45,7 @@ export default function Compute({ ocean, web3 }) {
const accounts = await ocean.accounts.list()
console.log('Publishing algo.')
const ddoAlgorithmNew = await ocean.assets.create(algoAsset, accounts[0])
const ddoAlgorithmNew = await ocean.assets.create(assetAlgo, accounts[0])
console.log(ddoAlgorithmNew)
console.log('Algo asset successfully submitted.')
// keep track of this registered asset for consumption later on
@ -59,7 +59,7 @@ export default function Compute({ ocean, web3 }) {
async function startCompute(algorithmId, algorithmMeta) {
try {
const accounts = await ocean.accounts.list()
const ComputeOutput = {
const computeOutput = {
publishAlgorithmLog: publishLogState,
publishOutput: publishOutputState,
brizoAddress: ocean.config.brizoAddress,
@ -69,7 +69,7 @@ export default function Compute({ ocean, web3 }) {
owner: accounts[0].getId(),
secretStoreUri: ocean.config.secretStoreUri
}
console.log(ComputeOutput)
console.log(computeOutput)
// order the compute service
const agreement = await ocean.compute.order(accounts[0], ddoAssetId)
setAgreementId(agreement)
@ -79,7 +79,7 @@ export default function Compute({ ocean, web3 }) {
agreement,
algorithmId,
encodeURIComponent(JSON.stringify(algorithmMeta)),
ComputeOutput
computeOutput
)
setJobId(status.jobId)
console.log(status)

View File

@ -1,4 +1,4 @@
export const algoAsset = {
export const assetAlgo = {
main: {
name: 'My great algo',
dateCreated: '2012-02-01T10:55:11Z',

View File

@ -1,4 +1,4 @@
export const asset = {
const asset = {
main: {
name: '10 Monkey Species Small',
dateCreated: '2012-02-01T10:55:11Z',
@ -50,3 +50,5 @@ export const asset = {
inLanguage: 'en'
}
}
export default asset

View File

@ -2,7 +2,7 @@ import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import { Ocean } from '@oceanprotocol/squid'
import Web3 from 'web3'
import { asset } from './asset'
import asset from './asset'
import Compute from './Compute'
let web3