Refactor kredits related configuration in arapp.json

we use an environment specific entry for the daoAddress.
Locally we deploy our own, but for rinkeby and other public networks
we use the official entries.
To make deployments easy we store the address in the arapp.json
This commit is contained in:
bumi 2020-02-10 15:55:16 +01:00
parent 190d3b77d5
commit 3db89b0fa3
3 changed files with 24 additions and 7 deletions

View File

@ -170,8 +170,14 @@ Deploys a new KreditsKit that allows to create a new DAO
or or
$ npm run deploy:kit $ npm run deploy:kit
`ENS` address is required as environment variable. #### Kredits configuration options:
`DAO_FACTORY` can optionally be set as environment variable. (see aragon)
Configuration options can be set in an environment specific `kredits` object in the `arapp.json` or using a CLI parameter.
* daoFactory: Ethereum address of the used DAO Factory. On public networks we use [official aragon factories](https://github.com/aragon/deployments/tree/master/environments/)
* apmDomain: the ENS domain of the aragonPM (normally `open.aragonpm.eth`)
(please also see the [arapp.json related configuration options](https://hack.aragon.org/docs/cli-global-confg#the-arappjson-file))
### new-dao.js ### new-dao.js

View File

@ -41,8 +41,10 @@
"network": "rinkeby", "network": "rinkeby",
"registry": "0x98Df287B6C145399Aaa709692c8D308357bC085D", "registry": "0x98Df287B6C145399Aaa709692c8D308357bC085D",
"wsRPC": "wss://rinkeby.eth.aragon.network/ws", "wsRPC": "wss://rinkeby.eth.aragon.network/ws",
"daoFactory": "0x2298d27a9b847c681d2b2c2828ab9d79013f5f1d", "appName": "dummy.open.aragonpm.eth",
"appName": "dummy.open.aragonpm.eth" "kredits": {
"daoFactory": "0x2298d27a9b847c681d2b2c2828ab9d79013f5f1d"
}
}, },
"kovan": { "kovan": {
"network": "kovan", "network": "kovan",

View File

@ -13,9 +13,18 @@ const KreditsKit = artifacts.require('KreditsKit')
const arapp = require('../arapp.json') const arapp = require('../arapp.json')
const environment = argv['network'] || argv['environment'] || 'development' const environment = argv['network'] || argv['environment'] || 'development'
const apm = arapp.environments[environment].apm || 'open.aragonpm.eth'
const ensAddr = arapp.environments[environment].registry || process.env.ENS const kreditsArappConfig = (arapp.environments[environment].kredits || {}
const daoFactoryAddress = arapp.environments[environment].daoFactory || process.env.DAO_FACTORY
// typically we use the open.aragonpm.eth aragonpm.
const apm = kreditsArappConfig.apmDomain || argv['apmDomain'] || 'open.aragonpm.eth'
// daoFactory is environment specific.
// See https://github.com/aragon/deployments/tree/master/environments/ for the official daoFactory
// Locally we deploy our own daoFactory and no daoFactory is required (`daoFactoryAddress` is null).
const daoFactoryAddress = kreditsArappConfig.daoFactory || argv['daoFactory']
const ensAddr = arapp.environments[environment].registry || argv['ensAddress']
module.exports = async function(callback) { module.exports = async function(callback) {