Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Whisper chat demo

Compile geth from https://github.com/bas-vk/go-ethereum/tree/whisper-api

Setup private network: genesis file: https://gist.github.com/bas-vk/bbd75fcbcdd73b64cbb864f78fe49988

geth --datadir /tmp/whisper init

Get chat.js from https://gist.github.com/bas-vk/0961a9c945b3761eee7bfc4f70db75a9

Start node:

geth --datadir /tmp/whisper --shh --preload </path/to/downloaded/chat.js> console 2>/dev/null

Add peer: admin.addPeer("enode://3b48b9200bd964fee986358edf721de0c322339b36a73016e9af4de9e3b5d6da090807596b9dfb52ee35056005211c51f3744d728edf06c4c6567a309d29c967@[85.146.5.133]:30303")

Set username (optional):

chat.setUsername("abcd")

Join chat box:

chat.join("geth")

Say something:

chat.say("my message")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.