Created
July 9, 2018 11:24
-
-
Save achiko/b4b58bb1bde29ab40a3782a0d9bc5c01 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Web3 = require('web3'); | |
const web3 = new Web3('ws://localhost:8546'); | |
const shh = web3.shh; | |
// Generate Symkey From password | |
// https://github.com/ethereum/go-ethereum/wiki/Whisper-Usage#generatesymkeyfrompassword | |
shh.generateSymKeyFromPassword("hello").then((symKeyID) => { | |
console.log('This is symkey ID unique foe every run: ', symKeyID); | |
// Get symkey from local node by useing symKeyID | |
// https://github.com/ethereum/go-ethereum/wiki/Whisper-Usage#generatesymkeyfrompassword | |
shh.getSymKey(symKeyID).then((symKey) => { | |
console.log('This is identical symkey : ', symKey); | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment