var shh = web3.shh; var appName = "My silly app!"; var myName = "Gav Would"; var myIdentity = shh.newIdentity(); shh.post({ "from": myIdentity, "topics": [ web3.fromAscii(appName) ], "payload": [ web3.fromAscii(myName), web3.fromAscii("What is your name?") ], "ttl": 100, "priority": 1000 }); var replyWatch = shh.watch({ "topics": [ web3.fromAscii(appName), myIdentity ], "to": myIdentity }); // could be "topic": [ web3.fromAscii(appName), null ] if we wanted to filter all such // messages for this app, but we'd be unable to read the contents. replyWatch.arrived(function(m) { // new message m console.log("Reply from " + web3.toAscii(m.payload) + " whose address is " + m.from); });
0.4.18