From 4609a21643e6a4e313297662c245a611ae70c24f Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Sun, 9 Aug 2015 16:41:42 -0400 Subject: [PATCH] add support to enable whisper --- lib/blockchain.js | 8 ++++++++ lib/config/blockchain.js | 1 + 2 files changed, 9 insertions(+) diff --git a/lib/blockchain.js b/lib/blockchain.js index 5d6a91d00..4afd8d4d9 100644 --- a/lib/blockchain.js +++ b/lib/blockchain.js @@ -9,6 +9,7 @@ Blockchain.prototype.generate_basic_command = function() { var address = config.account.address; var cmd = "geth "; + var rpc_api = ['eth', 'web3']; if (config.datadir !== "default") { cmd += "--datadir=\"" + config.datadir + "\" "; @@ -31,6 +32,13 @@ Blockchain.prototype.generate_basic_command = function() { cmd += "--genesis=\"" + config.genesisBlock + "\" "; } + if (config.whisper) { + cmd += "--shh "; + rpc_api.push('shh') + } + + cmd += '--rpcapi "' + rpc_api.join(',') + '" '; + //TODO: this should be configurable cmd += "--maxpeers " + config.maxPeers + " "; diff --git a/lib/config/blockchain.js b/lib/config/blockchain.js index 935ba130b..368fa493f 100644 --- a/lib/config/blockchain.js +++ b/lib/config/blockchain.js @@ -45,6 +45,7 @@ BlockchainConfig.prototype.config = function(env) { port: config.port || "30303", console_toggle: config.console || false, mine_when_needed: config.mine_when_needed || false, + whisper: config.whisper || false, account: config.account }