From 3db89b0fa3ff720229f9a793c34ba6646d619fe3 Mon Sep 17 00:00:00 2001 From: Michael Bumann Date: Mon, 10 Feb 2020 15:55:16 +0100 Subject: [PATCH] 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 --- README.md | 10 ++++++++-- arapp.json | 6 ++++-- scripts/deploy-kit.js | 15 ++++++++++++--- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6f51f85..73fd7af 100644 --- a/README.md +++ b/README.md @@ -170,8 +170,14 @@ Deploys a new KreditsKit that allows to create a new DAO or $ npm run deploy:kit -`ENS` address is required as environment variable. -`DAO_FACTORY` can optionally be set as environment variable. (see aragon) +#### Kredits configuration options: + +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 diff --git a/arapp.json b/arapp.json index f04de8e..8fb23eb 100644 --- a/arapp.json +++ b/arapp.json @@ -41,8 +41,10 @@ "network": "rinkeby", "registry": "0x98Df287B6C145399Aaa709692c8D308357bC085D", "wsRPC": "wss://rinkeby.eth.aragon.network/ws", - "daoFactory": "0x2298d27a9b847c681d2b2c2828ab9d79013f5f1d", - "appName": "dummy.open.aragonpm.eth" + "appName": "dummy.open.aragonpm.eth", + "kredits": { + "daoFactory": "0x2298d27a9b847c681d2b2c2828ab9d79013f5f1d" + } }, "kovan": { "network": "kovan", diff --git a/scripts/deploy-kit.js b/scripts/deploy-kit.js index bff6c68..b3d20b0 100644 --- a/scripts/deploy-kit.js +++ b/scripts/deploy-kit.js @@ -13,9 +13,18 @@ const KreditsKit = artifacts.require('KreditsKit') const arapp = require('../arapp.json') 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 daoFactoryAddress = arapp.environments[environment].daoFactory || process.env.DAO_FACTORY + +const kreditsArappConfig = (arapp.environments[environment].kredits || {} + +// 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) {