mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
added logger param when instantiating datatoken (#562)
This commit is contained in:
parent
215f0eaaa3
commit
ea2fe529af
@ -12,9 +12,9 @@
|
||||
|
||||
With ocean.js, you can:
|
||||
|
||||
- **Publish** data services: downloadable files or compute-to-data.
|
||||
Ocean creates a new [ERC20](https://github.com/ethereum/EIPs/blob/7f4f0377730f5fc266824084188cc17cf246932e/EIPS/eip-20.md)
|
||||
datatoken for each dataset / data service.
|
||||
- **Publish** data services: downloadable files or compute-to-data.
|
||||
Ocean creates a new [ERC20](https://github.com/ethereum/EIPs/blob/7f4f0377730f5fc266824084188cc17cf246932e/EIPS/eip-20.md)
|
||||
datatoken for each dataset / data service.
|
||||
- **Mint** datatokens for the service
|
||||
- **Sell** datatokens via an OCEAN-datatoken Balancer pool (for auto price discovery), or for a fixed price
|
||||
- **Stake** OCEAN on datatoken pools
|
||||
@ -49,7 +49,7 @@ npm install @oceanprotocol/lib
|
||||
## 🏄 Quickstart
|
||||
|
||||
```ts
|
||||
import { Ocean, Config, ConfigHelper } from '@oceanprotocol/lib'
|
||||
import { Ocean, Config, ConfigHelper, Logger } from '@oceanprotocol/lib'
|
||||
|
||||
const defaultConfig: Config = new ConfigHelper().getConfig(
|
||||
'rinkeby',
|
||||
|
@ -37,6 +37,7 @@ export PROVIDER_VERSION=latest
|
||||
import { TestContractHandler } from '../TestContractHandler'
|
||||
import { DataTokens } from '../../src/datatokens/Datatokens'
|
||||
import { Ocean } from '../../src/ocean/Ocean'
|
||||
import { LoggerInstance } from '../../src/utils'
|
||||
const Web3 = require('web3')
|
||||
const web3 = new Web3('http://127.0.0.1:8545')
|
||||
const factory = require('@oceanprotocol/contracts/artifacts/DTFactory.json')
|
||||
@ -54,11 +55,12 @@ const config = {
|
||||
const ocean = await Ocean.getInstance(config)
|
||||
const alice = (await ocean.accounts.list())[0]
|
||||
|
||||
datatoken = new DataTokens(
|
||||
const datatoken = new DataTokens(
|
||||
config.factoryAddress,
|
||||
factory.abi,
|
||||
datatokensTemplate.abi,
|
||||
web3
|
||||
web3,
|
||||
LoggerInstance
|
||||
)
|
||||
const data = { t: 1, url: ocean.config.metadataCacheUri }
|
||||
const blob = JSON.stringify(data)
|
||||
|
@ -35,7 +35,8 @@ const datatoken = new DataTokens(
|
||||
contracts.factoryAddress,
|
||||
factoryABI,
|
||||
datatokensABI,
|
||||
web3
|
||||
web3,
|
||||
Logger
|
||||
)
|
||||
// deploy datatoken
|
||||
const tokenAddress = await datatoken.create(blob, alice)
|
||||
|
Loading…
x
Reference in New Issue
Block a user