diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-06-24 01:19:33 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-06-24 01:19:33 +0800 |
commit | 72e2613a9fe3205fa5a67b72b832e03b2357ee88 (patch) | |
tree | bbc987510d279d9e174ff8f684158d668131661e /cmd/mist/assets/examples/whisper.html | |
parent | 5daf8729be88eca87b302ebf7a46fc69cad0f6d0 (diff) | |
parent | 67e6f74e9af00ff011a6a02f18644804eb18cdaa (diff) | |
download | go-tangerine-0.9.32.tar go-tangerine-0.9.32.tar.gz go-tangerine-0.9.32.tar.bz2 go-tangerine-0.9.32.tar.lz go-tangerine-0.9.32.tar.xz go-tangerine-0.9.32.tar.zst go-tangerine-0.9.32.zip |
Merge branch 'release/0.9.32'v0.9.32
Diffstat (limited to 'cmd/mist/assets/examples/whisper.html')
-rw-r--r-- | cmd/mist/assets/examples/whisper.html | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/cmd/mist/assets/examples/whisper.html b/cmd/mist/assets/examples/whisper.html deleted file mode 100644 index ad568f783..000000000 --- a/cmd/mist/assets/examples/whisper.html +++ /dev/null @@ -1,70 +0,0 @@ -<!doctype> -<html> -<title>Whisper test</title> -<head> -<script type="text/javascript" src="../ext/bignumber.min.js"></script> -<script type="text/javascript" src="../ext/ethereum.js/dist/ethereum.js"></script> -</head> -<body> - -<h1>Whisper test</h1> - -<button onclick="test()">Send</button> -<button onclick="test2()">Private send</button> - -<table width="100%" id="table"> - <tr> - <td>Count</td> - <td id="count"></td> - </tr> - - <tr> - <td>ID</td> - <td id="id"></td> - </tr> - - <tr> - <td>Has identity</td> - <td id="known"></td> - </tr> -</table> -</body> - -<script type="text/javascript"> - var web3 = require('web3'); - web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8080')); - - var shh = web3.shh; - - var id = shh.newIdentity(); - document.querySelector("#id").innerHTML = id; - document.querySelector("#known").innerHTML = shh.haveIdentity(id); - - var watch = shh.watch({topics: ["test"]}) - watch.arrived(function(message) { - document.querySelector("#table").innerHTML += "<tr><td colspan='2'>"+JSON.stringify(message)+"</td></tr>"; - }); - - var selfWatch = shh.watch({to: id, topics: ["test"]}) - selfWatch.arrived(function(message) { - document.querySelector("#table").innerHTML += "<tr><td>To me</td><td>"+JSON.stringify(message)+"</td></tr>"; - }); - - function test() { - shh.post({topics: ["test"], payload: web3.fromAscii("test it")}); - count(); - } - - function test2() { - shh.post({to: id, topics: ["test"], payload: web3.fromAscii("Private")}); - count(); - } - - function count() { - document.querySelector("#count").innerHTML = watch.messages().length; - } -</script> - -</html> - - |