forked from ripplerm/steem-servers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
64 lines (58 loc) · 1.8 KB
/
Copy pathindex.html
File metadata and controls
64 lines (58 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Demo</title>
<script src="steem-1.0.2-min.js"></script>
<script>
var remote = new Steem.Remote({
servers: [
'wss://steemd.steemit.com',
'wss://steemd.steemitdev.com',
'wss://steemd-int.steemit.com',
'wss://steemd.steemitstage.com',
'wss://gtg.steem.house:8090',
'wss://seed.bitcoiner.me',
'wss://steemd.minnowsupportproject.org',
'wss://steemd.privex.io',
'wss://rpc.steemliberator.com',
'wss://this.piston.rocks',
'wss://node.steem.ws',
]
});
var states = {};
function output(inp) {
document.getElementById('log').appendChild(document.createElement('pre')).innerHTML = inp;
}
function clear_log() {
document.getElementById('log').innerHTML = '';
}
window.onload = function() {
output('connecting...')
remote.connect(function() {
output('connected.')
});
remote.servers.forEach(function (s) {
states[s._url] = s._state;
s.on('state', function (state) {
states[s._url] = state;
})
s.on('properties', function (p) {
states[s._url] = [p.last_irreversible_block_num, p.head_block_number].join('/');
})
})
output(JSON.stringify(states, null, ' '));
var timer = setInterval(function () {
clear_log();
output(JSON.stringify(states, null, ' '));
}, 1000 * 3)
}
</script>
</head>
<body>
<h1>Steem Servers</h1>
server_url: last_irreversible_block / head_block <br>
=============================================================
<div id="log"> </div>
</body>
</html>