Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/config/src/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
}
],
"contracts": {
"Marketplace": "0xa072C42CB167d68D4c1cA15d0e4d0bd93E74A80f",
"Token": "0x73Be21733CC5D08e1a14Ea9a399fb27DB3BEf8fF",
"Mediator": "0xedD2aa644a6843F2e5133Fe3d6BD3F4080d97D9F",
"AMB": "0xaFA0dc5Ad21796C9106a36D68f69aAD69994BB64",
Expand Down
2 changes: 1 addition & 1 deletion packages/docker-dev-chain-init/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ WORKDIR /
RUN node --version
RUN npm --version
COPY ./ ./
RUN npm i
RUN npm ci
ENV DEBUG=*
RUN npm run build -w=docker-dev-chain-init
CMD npm run preload -w=docker-dev-chain-init && ./packages/docker-dev-chain-init/bridge/deploy_bridge_and_du2.sh
Expand Down
29 changes: 25 additions & 4 deletions packages/docker-dev-chain-init/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const chainlinkNodeAddress = '0x7b5F1610920d5BAf00D684929272213BaF962eFe'
const chainlinkJobId = 'c99333d032ed4cb8967b956c7f0329b5'
let nodeRegistryAddress = ''
let streamRegistryAddress = ''
let streamRegistryFromOwner

async function getProducts() {
// return await (await fetch(`${streamrUrl}/api/v1/products?publicAccess=true`)).json()
Expand Down Expand Up @@ -258,14 +259,15 @@ async function deployStreamRegistries() {
kind: 'uups'
})
const streamRegistry = await streamRegistryFactoryTx.deployed()
streamRegistryFromOwner = streamRegistry
streamRegistryAddress = streamRegistry.address
log(`Streamregistry deployed at ${streamRegistry.address}`)

log(`setting Streamregistry address in ENSCache`)
const setStreamRegTx = await ensCache.setStreamRegistry(streamRegistry.address)
await setStreamRegTx.wait()
log(`setting enscache address as trusted role in streamregistry`)

const ensa = ensCache.address
const role = await streamRegistry.TRUSTED_ROLE()
log(`granting role ${role} ensaddress ${ensa}`)
Expand All @@ -283,6 +285,7 @@ async function deployStreamRegistries() {
await tx1.wait()
const tx2 = await streamRegistry2.setPublicPermission(storageNodeAssignmentsStreamId, MaxUint256, MaxUint256, { gasLimit: 5999990 })
await tx2.wait()

}

async function smartContractInitialization() {
Expand Down Expand Up @@ -526,6 +529,24 @@ async function smartContractInitialization() {
}

await deployStreamStorageRegistry(sidechainWallet)

const newWallet = new ethers.Wallet(privKeyStreamRegistry, new ethers.providers.JsonRpcProvider(sidechainURL))
const marketDeployer3 = await ethers.getContractFactory(Marketplace2Json.abi, Marketplace2Json.bytecode, newWallet)
const marketDeployTx3 = await marketDeployer3.deploy(
sidechainDataCoin,
sidechainWallet.address,
'0x0000000000000000000000000000000000000000'
)
const market2 = await marketDeployTx3.deployed()
log(`Marketplace2 deployed on sidechain at ${market2.address}`)

const watcherDevopsKey = '0x628acb12df34bb30a0b2f95ec2e6a743b386c5d4f63aa9f338bec6f613160e78'
const watcherWallet = new ethers.Wallet(watcherDevopsKey)
const role = await streamRegistryFromOwner.TRUSTED_ROLE()
log(`granting role ${role} to devops ${watcherWallet.address}`)
const grantRoleTx2 = await streamRegistryFromOwner.grantRole(role, watcherWallet.address)
await grantRoleTx2.wait()

//put additions here

//all TXs should now be confirmed:
Expand All @@ -544,12 +565,12 @@ async function smartContractInitialization() {
if (p.pricePerSecond == 0) {
continue
}
console.log(`create ${p.id}`)
log(`create ${p.id}`)
const tx = await market.createProduct(`0x${p.id}`, p.name, wallet.address, p.pricePerSecond,
p.priceCurrency == "DATA" ? 0 : 1, p.minimumSubscriptionInSeconds)
//await tx.wait(1)
if (p.state == "NOT_DEPLOYED") {
console.log(`delete ${p.id}`)
log(`delete ${p.id}`)
await tx.wait(1)
await market.deleteProduct(`0x${p.id}`)
//await tx2.wait(1)
Expand Down
Loading