2019-02-14 15:56:55 +01:00
|
|
|
import { Ocean } from '@oceanprotocol/squid'
|
2019-01-23 12:15:16 +01:00
|
|
|
|
|
|
|
import {
|
2019-01-23 14:43:41 +01:00
|
|
|
address,
|
2019-01-23 12:15:16 +01:00
|
|
|
aquariusHost,
|
|
|
|
aquariusPort,
|
2019-01-23 14:43:41 +01:00
|
|
|
aquariusScheme,
|
2019-01-23 12:15:16 +01:00
|
|
|
brizoHost,
|
|
|
|
brizoPort,
|
2019-01-23 14:43:41 +01:00
|
|
|
brizoScheme,
|
|
|
|
nodeHost,
|
|
|
|
nodePort,
|
|
|
|
nodeScheme,
|
2019-01-23 12:15:16 +01:00
|
|
|
parityHost,
|
|
|
|
parityPort,
|
2019-01-23 14:43:41 +01:00
|
|
|
parityScheme,
|
|
|
|
password,
|
2019-01-23 12:15:16 +01:00
|
|
|
secretStoreHost,
|
|
|
|
secretStorePort,
|
2019-01-23 14:43:41 +01:00
|
|
|
secretStoreScheme,
|
2019-01-23 12:15:16 +01:00
|
|
|
threshold,
|
|
|
|
verbose
|
2019-01-23 17:39:34 +01:00
|
|
|
} from './config'
|
2019-01-23 12:15:16 +01:00
|
|
|
|
|
|
|
export async function provideOcean() {
|
|
|
|
const nodeUri = `${nodeScheme}://${nodeHost}:${nodePort}`
|
|
|
|
const aquariusUri = `${aquariusScheme}://${aquariusHost}:${aquariusPort}`
|
|
|
|
const brizoUri = `${brizoScheme}://${brizoHost}:${brizoPort}`
|
|
|
|
const parityUri = `${parityScheme}://${parityHost}:${parityPort}`
|
|
|
|
const secretStoreUri = `${secretStoreScheme}://${secretStoreHost}:${secretStorePort}`
|
|
|
|
|
|
|
|
const config = {
|
|
|
|
nodeUri,
|
|
|
|
aquariusUri,
|
|
|
|
brizoUri,
|
|
|
|
parityUri,
|
|
|
|
secretStoreUri,
|
|
|
|
threshold,
|
|
|
|
password,
|
|
|
|
address,
|
|
|
|
verbose
|
|
|
|
}
|
|
|
|
|
|
|
|
const ocean = await Ocean.getInstance(config)
|
|
|
|
|
|
|
|
return { ocean }
|
|
|
|
}
|