Skip to content

Commit

Permalink
Add custom network support
Browse files Browse the repository at this point in the history
  • Loading branch information
Raskolnikofff committed Apr 22, 2021
1 parent fafc0bb commit d634715
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
17 changes: 15 additions & 2 deletions shared/truffle.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
const config = require('@aragon/os/truffle-config')

const HDWalletProvider = require('truffle-hdwallet-provider');
const gasLimit = 7e6 - 1

config.networks.rpc.gas = gasLimit
config.networks.devnet.gas = gasLimit
config.networks.rinkeby.gas = gasLimit
@@ -8,4 +8,17 @@ config.networks.rinkeby.gas = gasLimit
config.networks.ropsten.gas = gasLimit
config.networks.kovan.gas = gasLimit

config.networks.devnet = {
provider: function() {
return new HDWalletProvider(
process.env.MNEMONIC,
process.env.WEB3_URL,
process.env.ADDRESS_NUMBER,
)
},
network_id: process.env.CHAIN_ID,
gas: 8e6,
gasPrice: 1e9,
}

module.exports = config
7 changes: 4 additions & 3 deletions templates/company/arapp.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"environments": {
"default": {
"appName": "company-template.aragonpm.eth",
"network": "rpc",
"registry": "0x5f6f7e8cc7346a11ca2def8f827b7a0b612c56a1"
"network": "devnet",
"registry": "0x13199fa47e33332669776cbd1aee101cc2acfa25",
"wsRPC": "ws://135.181.123.210:8545"
},
"mainnet": {
"appName": "company-template.aragonpm.eth",
Expand Down Expand Up @@ -32,4 +33,4 @@
},
"roles": [],
"path": "contracts/CompanyTemplate.sol"
}
}
8 changes: 8 additions & 0 deletions templates/company/scripts/changeNetwork.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var fs = require('fs');

var arapp=JSON.parse(fs.readFileSync("arapp.json"))

arapp["environments"]["default"]["registry"] = process.env.APPLICATION_COMPANY_ADDRESS
arapp["environments"]["default"]["wsRPC"] = process.env.WEB3_WS_URL

fs.writeFileSync("./arapp.json",JSON.stringify(arapp,0,2))

0 comments on commit d634715

Please sign in to comment.