mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
24 lines
715 B
TypeScript
24 lines
715 B
TypeScript
import DDO from "../ddo/DDO"
|
|
import {Account, Asset, Logger, Ocean} from "../squid"
|
|
|
|
(async () => {
|
|
const ocean: Ocean = await Ocean.getInstance({
|
|
nodeUri: "http://localhost:8545",
|
|
aquariusUri: "http://localhost:5000",
|
|
parityUri: "http://localhost:9545",
|
|
secretStoreUri: "https://secret-store.dev-ocean.com",
|
|
threshold: 2,
|
|
password: "unittest",
|
|
address: "0xed243adfb84a6626eba46178ccb567481c6e655d",
|
|
})
|
|
|
|
const publisher: Account = (await ocean.getAccounts())[0]
|
|
const asset: Asset = new Asset(
|
|
"Fancy Car Data",
|
|
"nice data", 100,
|
|
publisher)
|
|
|
|
const ddo: DDO = await ocean.register(asset)
|
|
Logger.log(ddo.id)
|
|
})()
|