mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
integrate barge
This commit is contained in:
parent
a770b45c95
commit
a786c83373
@ -18,11 +18,17 @@ before_install:
|
|||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- ganache-cli > ganache-cli.log &
|
- ganache-cli > ganache-cli.log &
|
||||||
|
- git clone https://github.com/oceanprotocol/barge
|
||||||
|
- cd barge
|
||||||
|
- git checkout origin/v3
|
||||||
|
- bash -x start_ocean.sh --no-commons --no-dashboard 2>&1 > start_ocean.log &
|
||||||
|
- cd ..
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- npm run lint
|
- npm run lint
|
||||||
- npm run build
|
- npm run build
|
||||||
- npm run test:cover
|
- npm run test:cover
|
||||||
|
- npm run test:integration
|
||||||
|
|
||||||
notifications:
|
notifications:
|
||||||
email: false
|
email: false
|
@ -3,7 +3,7 @@ import { Authentication } from './interfaces/Authentication'
|
|||||||
import { Proof } from './interfaces/Proof'
|
import { Proof } from './interfaces/Proof'
|
||||||
import { PublicKey } from './interfaces/PublicKey'
|
import { PublicKey } from './interfaces/PublicKey'
|
||||||
import { Service, ServiceType } from './interfaces/Service'
|
import { Service, ServiceType } from './interfaces/Service'
|
||||||
import Web3Provider from '../datatokens/Web3Provider'
|
import Web3Provider from '../datatokens/Web3Provider'
|
||||||
/**
|
/**
|
||||||
* DID Descriptor Object.
|
* DID Descriptor Object.
|
||||||
* Contains all the data related to an asset.
|
* Contains all the data related to an asset.
|
||||||
@ -106,8 +106,7 @@ export class DDO {
|
|||||||
this.id
|
this.id
|
||||||
]
|
]
|
||||||
|
|
||||||
return Web3Provider
|
return Web3Provider.getWeb3()
|
||||||
.getWeb3()
|
|
||||||
.utils.sha3(values.join(''))
|
.utils.sha3(values.join(''))
|
||||||
.replace(/^0x([a-f0-9]{64})(:!.+)?$/i, '0x$1')
|
.replace(/^0x([a-f0-9]{64})(:!.+)?$/i, '0x$1')
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@ import { DataTokens } from '../../src/datatokens/Datatokens'
|
|||||||
import { Ocean } from '../../src/ocean/Ocean'
|
import { Ocean } from '../../src/ocean/Ocean'
|
||||||
import config from './config'
|
import config from './config'
|
||||||
|
|
||||||
// import Accounts from "../../src/ocean/Account"
|
// import Accounts from "../../src/ocean/Account"
|
||||||
|
|
||||||
const Web3 = require('web3')
|
const Web3 = require('web3')
|
||||||
const web3 = new Web3('http://127.0.0.1:8545')
|
const web3 = new Web3('http://127.0.0.1:8545')
|
||||||
@ -50,11 +50,10 @@ describe('Marketplace flow', () => {
|
|||||||
marketplace = (await ocean.accounts.list())[3]
|
marketplace = (await ocean.accounts.list())[3]
|
||||||
|
|
||||||
await contracts.deployContracts(owner.getId())
|
await contracts.deployContracts(owner.getId())
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Alice publishes a datatoken contract', async () => {
|
it('Alice publishes a datatoken contract', async () => {
|
||||||
datatoken = new DataTokens(
|
datatoken = new DataTokens(
|
||||||
contracts.factoryAddress,
|
contracts.factoryAddress,
|
||||||
factory.abi,
|
factory.abi,
|
||||||
datatokensTemplate.abi,
|
datatokensTemplate.abi,
|
||||||
@ -69,29 +68,26 @@ describe('Marketplace flow', () => {
|
|||||||
main: {
|
main: {
|
||||||
type: 'dataset',
|
type: 'dataset',
|
||||||
name: 'test-dataset',
|
name: 'test-dataset',
|
||||||
dateCreated:
|
dateCreated: new Date(Date.now()).toISOString().split('.')[0] + 'Z', // remove milliseconds
|
||||||
new Date(Date.now())
|
|
||||||
.toISOString()
|
|
||||||
.split('.')[0] + 'Z', // remove milliseconds
|
|
||||||
author: 'oceanprotocol-team',
|
author: 'oceanprotocol-team',
|
||||||
license: 'MIT',
|
license: 'MIT',
|
||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
url: 'https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt',
|
url:
|
||||||
|
'https://raw.githubusercontent.com/tbertinmahieux/MSongsDB/master/Tasks_Demos/CoverSongs/shs_dataset_test.txt',
|
||||||
checksum: 'efb2c764274b745f5fc37f97c6b0e761',
|
checksum: 'efb2c764274b745f5fc37f97c6b0e761',
|
||||||
contentLength: '4535431',
|
contentLength: '4535431',
|
||||||
contentType: 'text/csv',
|
contentType: 'text/csv',
|
||||||
encoding: 'UTF-8',
|
encoding: 'UTF-8',
|
||||||
compression: 'zip'
|
compression: 'zip'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
it('Alice publishes a dataset', async () => {
|
it('Alice publishes a dataset', async () => {
|
||||||
ddo = await ocean.assets.create(asset, alice, [], tokenAddress)
|
ddo = await ocean.assets.create(asset, alice, [], tokenAddress)
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// it('Alice mints 100 tokens', async () => {
|
// it('Alice mints 100 tokens', async () => {
|
||||||
|
@ -11,10 +11,8 @@ describe('Rinkeby test', () => {
|
|||||||
// let contracts
|
// let contracts
|
||||||
// let datatoken
|
// let datatoken
|
||||||
// let tokenAddress
|
// let tokenAddress
|
||||||
|
|
||||||
// const tokenAmount = 100
|
// const tokenAmount = 100
|
||||||
// const blob = 'http://localhost:8030/api/v1/provider/services'
|
// const blob = 'http://localhost:8030/api/v1/provider/services'
|
||||||
|
|
||||||
// describe('#test', () => {
|
// describe('#test', () => {
|
||||||
// it('Initialize Ocean contracts v3', async () => {
|
// it('Initialize Ocean contracts v3', async () => {
|
||||||
// contracts = new TestContractHandler(
|
// contracts = new TestContractHandler(
|
||||||
@ -24,14 +22,11 @@ describe('Rinkeby test', () => {
|
|||||||
// factory.bytecode,
|
// factory.bytecode,
|
||||||
// web3
|
// web3
|
||||||
// )
|
// )
|
||||||
|
|
||||||
// const privateKey = 'PRIVATE_KEY'
|
// const privateKey = 'PRIVATE_KEY'
|
||||||
// account = web3.eth.accounts.privateKeyToAccount('0x' + privateKey)
|
// account = web3.eth.accounts.privateKeyToAccount('0x' + privateKey)
|
||||||
// web3.eth.accounts.wallet.add(account)
|
// web3.eth.accounts.wallet.add(account)
|
||||||
|
|
||||||
// await contracts.deployContracts(account.address)
|
// await contracts.deployContracts(account.address)
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// it('Publish a dataset', async () => {
|
// it('Publish a dataset', async () => {
|
||||||
// datatoken = new DataTokens(
|
// datatoken = new DataTokens(
|
||||||
// contracts.factoryAddress,
|
// contracts.factoryAddress,
|
||||||
@ -39,10 +34,8 @@ describe('Rinkeby test', () => {
|
|||||||
// datatokensTemplate.abi,
|
// datatokensTemplate.abi,
|
||||||
// web3
|
// web3
|
||||||
// )
|
// )
|
||||||
|
|
||||||
// tokenAddress = await datatoken.create(blob, account.address)
|
// tokenAddress = await datatoken.create(blob, account.address)
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// it('Mint 100 tokens', async () => {
|
// it('Mint 100 tokens', async () => {
|
||||||
// await datatoken.mint(tokenAddress, account.address, tokenAmount)
|
// await datatoken.mint(tokenAddress, account.address, tokenAmount)
|
||||||
// })
|
// })
|
||||||
|
@ -16,11 +16,9 @@ describe('Simple flow', () => {
|
|||||||
// let datatoken
|
// let datatoken
|
||||||
// let tokenAddress
|
// let tokenAddress
|
||||||
// let transactionId
|
// let transactionId
|
||||||
|
|
||||||
// const tokenAmount = 100
|
// const tokenAmount = 100
|
||||||
// const transferAmount = 1
|
// const transferAmount = 1
|
||||||
// const blob = 'http://localhost:8030/api/v1/provider/services'
|
// const blob = 'http://localhost:8030/api/v1/provider/services'
|
||||||
|
|
||||||
// describe('#test', () => {
|
// describe('#test', () => {
|
||||||
// it('Initialize Ocean contracts v3', async () => {
|
// it('Initialize Ocean contracts v3', async () => {
|
||||||
// contracts = new TestContractHandler(
|
// contracts = new TestContractHandler(
|
||||||
@ -36,7 +34,6 @@ describe('Simple flow', () => {
|
|||||||
// bob = contracts.accounts[2]
|
// bob = contracts.accounts[2]
|
||||||
// await contracts.deployContracts(owner)
|
// await contracts.deployContracts(owner)
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// it('Alice publishes a dataset', async () => {
|
// it('Alice publishes a dataset', async () => {
|
||||||
// // Alice creates a Datatoken
|
// // Alice creates a Datatoken
|
||||||
// datatoken = new DataTokens(
|
// datatoken = new DataTokens(
|
||||||
@ -47,16 +44,13 @@ describe('Simple flow', () => {
|
|||||||
// )
|
// )
|
||||||
// tokenAddress = await datatoken.create(blob, alice)
|
// tokenAddress = await datatoken.create(blob, alice)
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// it('Alice mints 100 tokens', async () => {
|
// it('Alice mints 100 tokens', async () => {
|
||||||
// await datatoken.mint(tokenAddress, alice, tokenAmount)
|
// await datatoken.mint(tokenAddress, alice, tokenAmount)
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// it('Alice transfers 1 token to Bob', async () => {
|
// it('Alice transfers 1 token to Bob', async () => {
|
||||||
// const ts = await datatoken.transfer(tokenAddress, bob, transferAmount, alice)
|
// const ts = await datatoken.transfer(tokenAddress, bob, transferAmount, alice)
|
||||||
// transactionId = ts.transactionHash
|
// transactionId = ts.transactionHash
|
||||||
// })
|
// })
|
||||||
|
|
||||||
// it('Bob consumes dataset', async () => {
|
// it('Bob consumes dataset', async () => {
|
||||||
// const config = new Config()
|
// const config = new Config()
|
||||||
// const ocean = await Ocean.getInstance(config)
|
// const ocean = await Ocean.getInstance(config)
|
||||||
|
@ -15,4 +15,4 @@ export default {
|
|||||||
secretStoreUri: 'http://localhost:12001',
|
secretStoreUri: 'http://localhost:12001',
|
||||||
verbose: LogLevel.Error,
|
verbose: LogLevel.Error,
|
||||||
web3Provider: web3
|
web3Provider: web3
|
||||||
} as Config
|
} as Config
|
||||||
|
Loading…
x
Reference in New Issue
Block a user