I am struggling to get a simple whisper (shh) example running. I am using the following versions: geth 1.9.24-stable-cc05b050 web3 6.14.5
I am running geth with the following command:
geth --shh --rpc
And I start coding with the following linex:
var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
var shh = web3.shh;
(async function main() {
var keyPair = await shh.newKeyPair();
})();
Then I get the following error:
Error: Returned error: the method shh_newKeyPair does not exist/is not available
I guess that the shh command is not supported by the node (geth).
Can anyone instruct how to get a simple message passing example using Whisper running with the versions above? Thanks for the support.
geth --shh --http --http.api shh
. The old parametersrpc
rpcapi
were deprecated, geth.ethereum.org/docs/interface/command-line-options.