From 6f808cfeb06e252f4673491bade8181b525b4e58 Mon Sep 17 00:00:00 2001 From: VoR0220 Date: Mon, 14 Sep 2015 19:58:52 -0500 Subject: [PATCH] ability to create multiple contracts with a single password for testing purposes --- boilerplate/config/blockchain.yml | 4 +--- lib/blockchain.js | 11 +++++++---- lib/config/blockchain.js | 3 +-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/boilerplate/config/blockchain.yml b/boilerplate/config/blockchain.yml index 49fb0add4..eec7cb53e 100644 --- a/boilerplate/config/blockchain.yml +++ b/boilerplate/config/blockchain.yml @@ -7,20 +7,19 @@ development: datadir: /tmp/embark chains: config/chains/development.json mine_when_needed: true - max_peers: 0 gas_limit: 500000 gas_price: 10000000000000 console: false account: init: true password: config/password + num: 1 staging: rpc_host: localhost rpc_port: 8101 rpc_whitelist: "*" datadir: default network_id: 0 - max_peers: 4 console: true account: init: false @@ -31,7 +30,6 @@ production: rpc_whitelist: "*" datadir: default network_id: 1 - max_peers: 4 console: true account: init: false diff --git a/lib/blockchain.js b/lib/blockchain.js index 9ab37a5c9..0915c2a8b 100644 --- a/lib/blockchain.js +++ b/lib/blockchain.js @@ -105,12 +105,15 @@ Blockchain.prototype.get_address = function() { console.log("=== already initialized"); address = result.output.match(/{(\w+)}/)[1]; } else { - console.log("running: " + this.init_command()); - result = exec(this.init_command()); - address = result.output.match(/{(\w+)}/)[1]; + console.log("running: " + this.init_command() + " " + this.account.num + " time(s)"); + result = ''; + for (var i = 0; i < this.account.num; i++){ + result = exec(this.init_command()) + '\n'; + address = result.output.match(/{(\w+)}/)[1]; //TODO: Write a proper reg expression to match multiple lines of output...not my forte + } } } - + if (this.account.num > 1) return exec(this.list_command()); return address; } diff --git a/lib/config/blockchain.js b/lib/config/blockchain.js index d0dcdd50f..70f2fd50c 100644 --- a/lib/config/blockchain.js +++ b/lib/config/blockchain.js @@ -41,7 +41,6 @@ BlockchainConfig.prototype.config = function(env) { genesisBlock: config.genesis_block, datadir: config.datadir, chains: config.chains, - deployTimeout: config.deploy_timeout || 20, networkId: networkId, maxPeers: 4, port: config.port || "30303", @@ -54,4 +53,4 @@ BlockchainConfig.prototype.config = function(env) { return config; }; -module.exports = BlockchainConfig; +module.exports = BlockchainConfig; \ No newline at end of file