-
Notifications
You must be signed in to change notification settings - Fork 71
/
Copy pathblock_crawler.php
115 lines (90 loc) · 3.21 KB
/
block_crawler.php
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php
require_once ("bc_daemon.php");
require_once ("bc_layout.php");
// If a block hash was provided the block detail is shown
if (isset ($_REQUEST["block_hash"]))
{
site_header ("Block Detail Page");
block_detail ($_REQUEST["block_hash"], TRUE);
}
// If a block height is provided the block detail is shown
elseif (isset ($_REQUEST["block_height"]))
{
site_header ("Block Detail Page");
block_detail ($_REQUEST["block_height"]);
}
// If a TXid was provided the TX Detail is shown
elseif (isset ($_REQUEST["transaction"]))
{
site_header ("Transaction Detail Page");
tx_detail ($_REQUEST["transaction"]);
}
// If there were no request parameters the menu is shown
else
{
site_header ("Block Crawler Home Page");
echo " <div id=\"node_info\">\n";
echo "\n";
$network_info = getinfo ();
echo " <div class=\"node_detail\">\n";
echo " <span class=\"node_desc\">Block Count:</span><br>\n";
echo " ".$network_info["blocks"]."\n";
echo " </div>\n";
echo "\n";
echo " <div class=\"node_detail\">\n";
echo " <span class=\"node_desc\">Difficulty:</span><br>\n";
echo " ".$network_info["difficulty"]."\n";
echo " </div>\n";
echo "\n";
echo " <div class=\"node_detail\">\n";
echo " <span class=\"node_desc\">Connections:</span><br>\n";
echo " ".$network_info["connections"]."\n";
echo " </div>\n";
echo "\n";
$net_speed = getnetworkhashps ();
if ($net_speed != "")
{
echo " <div class=\"node_detail\">\n";
echo " <span class=\"node_desc\">Network H/s:</span><br>\n";
echo " ".$net_speed."\n";
echo " </div>\n";
echo "\n";
}
echo " </div>\n";
echo "\n";
echo " <div id=\"site_menu\">\n";
echo "\n";
echo " <div class=\"menu_item\">\n";
echo " <span class=\"menu_desc\">Enter a Block Index / Height</span><br>\n";
echo " <form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
echo " <input type=\"text\" name=\"block_height\" size=\"40\">\n";
echo " <input type=\"submit\" name=\"submit\" value=\"Jump To Block\">\n";
echo " </form>\n";
echo " </div>\n";
echo "\n";
echo " <div class=\"menu_item\">\n";
echo " <span class=\"menu_desc\">Enter A Block Hash</span><br>\n";
echo " <form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
echo " <input type=\"text\" name=\"block_hash\" size=\"40\">\n";
echo " <input type=\"submit\" name=\"submit\" value=\"Jump To Block\">\n";
echo " </form>\n";
echo " </div>\n";
echo "\n";
echo " <div class=\"menu_item\">\n";
echo " <span class=\"menu_desc\">Enter A Transaction ID</span><br>\n";
echo " <form action=\"".$_SERVER["PHP_SELF"]."\" method=\"post\">\n";
echo " <input type=\"text\" name=\"transaction\" size=\"40\">\n";
echo " <input type=\"submit\" name=\"submit\" value=\"Jump To TX\">\n";
echo " </form>\n";
echo " </div>\n";
echo "\n";
echo " </div>\n";
echo "\n";
}
site_footer ();
/******************************************************************************
This script is Copyright © 2013 Jake Paysnoe.
I hereby release this script into the public domain.
Jake Paysnoe Jun 26, 2013
******************************************************************************/
?>