mirror of
https://github.com/oceanprotocol/ocean-subgraph.git
synced 2024-12-02 05:57:29 +01:00
2a711626ed
* add integration tests * try actions * workflows check * workflows testing * workflow test * workflow test * workflow test * increase timeout * small fix Signed-off-by: mihaisc <mihai.scarlat@smartcontrol.ro> * workflow test * workflow test * workflow test * fix workflows * add readme * fix readme * one more test * end test Co-authored-by: mihaisc <mihai.scarlat@smartcontrol.ro>
56 lines
1.4 KiB
JavaScript
56 lines
1.4 KiB
JavaScript
/* eslint-disable no-unused-vars */
|
|
var fs = require('fs')
|
|
|
|
async function replaceContractAddresses() {
|
|
// load barge addresses first
|
|
try {
|
|
const data = JSON.parse(fs.readFileSync(process.env.ADDRESS_FILE, 'utf8'))
|
|
const {
|
|
DTFactory,
|
|
// eslint-disable-next-line no-unused-vars
|
|
BFactory,
|
|
// eslint-disable-next-line no-unused-vars
|
|
FixedRateExchange,
|
|
// eslint-disable-next-line no-unused-vars
|
|
Metadata
|
|
} = data.development
|
|
let subgraph = fs.readFileSync('subgraph.yaml', 'utf8')
|
|
if (!data) {
|
|
return false
|
|
}
|
|
// BFactory
|
|
subgraph = subgraph.replace(
|
|
/0xbe0083053744ECb871510C88dC0f6b77Da162706/g,
|
|
BFactory
|
|
)
|
|
// dt factory
|
|
subgraph = subgraph.replace(
|
|
/0x57317f97E9EA49eBd19f7c9bB7c180b8cDcbDeB9/g,
|
|
DTFactory
|
|
)
|
|
// metadata
|
|
subgraph = subgraph.replace(
|
|
/0x1a4b70d8c9DcA47cD6D0Fb3c52BB8634CA1C0Fdf/g,
|
|
Metadata
|
|
)
|
|
// fixed rate exchgage
|
|
subgraph = subgraph.replace(
|
|
/0x608d05214E42722B94a54cF6114d4840FCfF84e1/g,
|
|
FixedRateExchange
|
|
)
|
|
// network
|
|
subgraph = subgraph.replace(/network: mainnet/g, 'network: barge')
|
|
|
|
// startBlocks
|
|
subgraph = subgraph.replace(/startBlock:[ 0-9].*/g, 'startBlock: 0')
|
|
|
|
fs.writeFileSync('subgraph.barge.yaml', subgraph, 'utf8')
|
|
} catch (e) {
|
|
console.error('Failed to load address.json')
|
|
console.error(e)
|
|
process.exit(1)
|
|
}
|
|
}
|
|
|
|
replaceContractAddresses()
|