Dynamically set AppIds
AppIds are used to lookup the actual contract addresses of each app. Because of different registry names (open.aragonpm.eth vs. aragonpm.eth) we have to use different ids in the local dev chain and in the testnet/mainnet. To allow this we need to set the appids dynamically. There is an open aragon issue to solve this and also allow to use open.aragonpm.eth in the devchain by default. https://github.com/aragon/aragen/issues/10
This commit is contained in:
8
scripts/helpers/file_inject.js
Normal file
8
scripts/helpers/file_inject.js
Normal file
@@ -0,0 +1,8 @@
|
||||
// help, give me a better name
|
||||
|
||||
const fs = require('fs');
|
||||
module.exports = function (file, networkId, data) {
|
||||
let content = JSON.parse(fs.readFileSync(file));
|
||||
content[networkId] = data;
|
||||
fs.writeFileSync(file, JSON.stringify(content));
|
||||
}
|
||||
11
scripts/helpers/networkid.js
Normal file
11
scripts/helpers/networkid.js
Normal file
@@ -0,0 +1,11 @@
|
||||
module.exports = function(web3) {
|
||||
return new Promise((resolve, reject) => {
|
||||
web3.version.getNetwork((err, network) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
} else {
|
||||
resolve(network);
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user