2015-01-29 21:39:26 +02:00
|
|
|
|
|
|
|
<!doctype>
|
|
|
|
<html>
|
|
|
|
<head>
|
2015-02-14 01:25:47 +02:00
|
|
|
<meta name="badge" content="10">
|
2015-01-29 21:39:26 +02:00
|
|
|
<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>Info</h1>
|
|
|
|
|
|
|
|
<table width="100%">
|
|
|
|
<tr>
|
|
|
|
<td>Block number</td>
|
|
|
|
<td id="number"></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Peer count</td>
|
|
|
|
<td id="peer_count"></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Default block</td>
|
|
|
|
<td id="default_block"></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Accounts</td>
|
|
|
|
<td id="accounts"></td>
|
|
|
|
</tr>
|
|
|
|
|
2015-02-05 01:05:47 +02:00
|
|
|
<tr>
|
|
|
|
<td>Balance</td>
|
|
|
|
<td id="balance"></td>
|
|
|
|
|
2015-01-29 21:39:26 +02:00
|
|
|
<tr>
|
|
|
|
<td>Gas price</td>
|
|
|
|
<td id="gas_price"></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Mining</td>
|
|
|
|
<td id="mining"></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Listening</td>
|
|
|
|
<td id="listening"></td>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
<tr>
|
|
|
|
<td>Coinbase</td>
|
|
|
|
<td id="coinbase"></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
var web3 = require('web3');
|
|
|
|
var eth = web3.eth;
|
|
|
|
|
2015-02-14 01:25:47 +02:00
|
|
|
web3.setProvider(new web3.providers.HttpSyncProvider('http://localhost:8545'));
|
2015-01-29 21:39:26 +02:00
|
|
|
|
|
|
|
document.querySelector("#number").innerHTML = eth.number;
|
|
|
|
document.querySelector("#coinbase").innerHTML = eth.coinbase
|
|
|
|
document.querySelector("#peer_count").innerHTML = eth.peerCount;
|
|
|
|
document.querySelector("#default_block").innerHTML = eth.defaultBlock;
|
|
|
|
document.querySelector("#accounts").innerHTML = eth.accounts;
|
2015-02-05 01:05:47 +02:00
|
|
|
document.querySelector("#balance").innerHTML = web3.toEth(eth.balanceAt(eth.accounts[0]));
|
2015-01-29 21:39:26 +02:00
|
|
|
document.querySelector("#gas_price").innerHTML = eth.gasPrice;
|
|
|
|
document.querySelector("#mining").innerHTML = eth.mining;
|
|
|
|
document.querySelector("#listening").innerHTML = eth.listening;
|
2015-02-17 23:20:47 +02:00
|
|
|
eth.watch('chain').changed(function() {
|
|
|
|
document.querySelector("#number").innerHTML = eth.number;
|
|
|
|
});
|
|
|
|
|
2015-01-29 21:39:26 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
</html>
|
|
|
|
|