From a83fecbe98977b9b92267a764fa2a6ca954043a2 Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 27 Jul 2015 11:24:53 -0400 Subject: [PATCH] CLI flag to enable Whisper --- eth/main.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/eth/main.cpp b/eth/main.cpp index 379e61f81..830a79163 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -204,6 +204,10 @@ void help() << " -v,--verbosity <0 - 9> Set the log verbosity from 0 to 9 (default: 8)." << endl << " -V,--version Show the version and exit." << endl << " -h,--help Show this help message and exit." << endl + << endl + << "Experimental / Proof of Concept:" << endl + << " --shh Enable Whisper" << endl + << endl ; exit(0); } @@ -1138,6 +1142,9 @@ int main(int argc, char** argv) /// Wallet password stuff string masterPassword; + + /// Whisper + bool useWhisper = false; string configFile = getDataDir() + "/config.rlp"; bytes b = contents(configFile); @@ -1484,6 +1491,8 @@ int main(int argc, char** argv) } } #endif + else if (arg == "--shh") + useWhisper = true; else if (arg == "-h" || arg == "--help") help(); else if (arg == "-V" || arg == "--version") @@ -1564,11 +1573,12 @@ int main(int argc, char** argv) netPrefs.pin = pinning || !privateChain.empty(); auto nodesState = contents((dbPath.size() ? dbPath : getDataDir()) + "/network.rlp"); + auto caps = useWhisper ? set{"eth", "shh"} : set{"eth"}; dev::WebThreeDirect web3( WebThreeDirect::composeClientVersion("++eth", clientName), dbPath, withExisting, - nodeMode == NodeMode::Full ? set{"eth"/*, "shh"*/} : set(), + nodeMode == NodeMode::Full ? caps : set(), netPrefs, &nodesState); web3.ethereum()->setMineOnBadChain(mineOnWrongChain);