} // Verify that a block descriptor was provided and attempt retrieval if (isset($_REQUEST["height"]) && $_REQUEST["height"] != "") { $block = mysqli_getrow($GLOBALS["tables"]["block"], "`height` = '" . $_REQUEST["height"] . "'"); } elseif (isset($_REQUEST["hash"]) && $_REQUEST["hash"] != "") { $block = mysqli_getrow($GLOBALS["tables"]["block"], "`hash` = '" . $_REQUEST["hash"] . "'"); } else { $message = "<p> \n"; $message .= "\tYou must provide either a block hash or a block height to use this page. \n"; $message .= "</p> \n\n"; spectra_page_error("Missing Block Descriptor", $message); } // Verify that block data was retrieved if ($block["success"] < 1 || $block["data"] == "") { $message = "<p> \n"; $message .= "\tUnable To Retrieve Specified Block \n"; $message .= "</p> \n\n"; $message .= "<p> \n"; $message .= "\tPlease verify your block hash/height and try again. \n"; $message .= "</p> \n\n"; spectra_page_error("Invalid Block Descriptor", $message); } // If there were no errors render the block detail view spectra_site_head($GLOBALS["currency"]["code"] . " Block Detail"); spectra_block_detail($block["data"]); spectra_site_foot(); /****************************************************************************** Developed By Jake Paysnoe - Copyright © 2015 SPEC Development Team SPEC Block Explorer is released under the MIT Software License. For additional details please read license.txt in this package. ******************************************************************************/
<?php // Enable the spectra functionality require_once "lib/spectra_config.php"; // If there is no live node the page is a spew of errors if (!spectra_node_isalive()) { $message = "<p>"; $message .= "\tUnable to connect to the specified node."; $message .= "</p>"; spectra_page_error("No Network", $message); } spectra_site_head($GLOBALS["currency"]["code"] . " Network Status"); // Network status and description spectra_network_statistics(); // Connection list for the specified node spectra_network_nodelist(); spectra_site_foot(); /****************************************************************************** Developed By Jake Paysnoe - Copyright © 2015 SPEC Development Team SPEC Block Explorer is released under the MIT Software License. For additional details please read license.txt in this package. ******************************************************************************/ ?>
<?php // Enable the spectra functionality require_once "lib/spectra_config.php"; spectra_site_head($GLOBALS["currency"]["code"] . " Block Explorer"); spectra_front_stats(); spectra_block_browser(20); spectra_site_foot(); /****************************************************************************** Developed By Jake Paysnoe - Copyright � 2015 SPEC Development Team SPEC Block Explorer is released under the MIT Software License. For additional details please read license.txt in this package. ******************************************************************************/
<?php // Enable the spectra functionality require_once "lib/spectra_config.php"; spectra_site_head($GLOBALS["currency"]["name"] . " Address Claim Form"); echo "\t<h1> " . $GLOBALS["currency"]["name"] . " Address Claim Form </h1> \n\n"; echo "\t<div class=\"panel_wide\"> \n\n"; echo "\t\t<p> \n"; echo "\t\t\tThis wizard takes you through the process of claiming your \n"; echo "\t\t\t" . $GLOBALS["currency"]["name"] . " address in the block explorer \n"; echo "\t\t\tdatabase. \n"; echo "\t\t</p> \n\n"; echo "\t\t<p> \n"; echo "\t\t\tClaiming your address means that the name you enter will \n"; echo "\t\t\tbe shown on the balances page and other people may see \n"; echo "\t\t\twhich addresses you own. \n"; echo "\t\t</p> \n\n"; echo "\t\t<p> \n"; echo "\t\t\tThe process registers one address at a time. Since there \n"; echo "\t\t\tis no way to tell from the block chain which addresses \n"; echo "\t\t\tare associated with the same wallet, you may need to \n"; echo "\t\t\tclaim each address in your wallet if you want all of your \n"; echo "\t\t\t" . $GLOBALS["currency"]["code"] . " addresses to be announced \n"; echo "\t\t\tto others on the block explorer. \n"; echo "\t\t</p> \n\n"; if (isset($_GET["address"])) { // The address is hashed to provide a unique key $address_hash = hash_hmac("sha512", $_GET["address"], md5($_GET["address"])); echo "\t\t<h2> Generating Address / Signature Hash </h2> \n\n"; echo "\t\t\t<p> Please sign this hash using your " . $GLOBALS["currency"]["code"] . " wallet: </p> \n\n"; echo "\t\t\t<p> " . $address_hash . " </p> \n\n";
// Enable the spectra functionality require_once "lib/spectra_config.php"; // Error handling for missing address if (!isset($_REQUEST["address"]) || $_REQUEST["address"] == "") { $message = "<p> \n"; $message .= "\tYou must provde an address to use this page. \n"; $message .= "</p> \n\n"; spectra_page_error("No Address Provided", $message); } // Attempt to fetch the specified address $address = mysqli_getrow($GLOBALS["tables"]["ledger"], "`address` = '" . $_REQUEST["address"] . "'"); // Error handling for invalid or unrecognized address if ($address["success"] < 1 || $address["data"] == "") { $message = "<p> \n"; $message .= "\tInvalid or Unrecognized Address \n"; $message .= "</p> \n\n"; $message .= "<p> \n"; $message .= "\tPlease verify your address and try again. \n"; $message .= "</p> \n\n"; spectra_page_error("Invalid Address", $message); } // If there were no error the address details are rendered spectra_site_head($GLOBALS["currency"]["code"] . " Address Detail"); spectra_address_detail($address["data"]); spectra_site_foot(); /****************************************************************************** Developed By Jake Paysnoe - Copyright © 2015 SPEC Development Team SPEC Block Explorer is released under the MIT Software License. For additional details please read license.txt in this package. ******************************************************************************/
<?php // Enable the spectra functionality require_once "lib/spectra_config.php"; spectra_site_head($GLOBALS["currency"]["code"] . " API Guide"); echo "\t<h1> " . $GLOBALS["currency"]["name"] . " Explorer API </h1> \n"; echo "\t<div class=\"panel_wide\"> \n\n"; echo "\t\t<h2> About the API: </h2> \n\n"; echo "\t\t<p> \n"; echo "\t\t\tThis page provides instructions and sample output \n"; echo "\t\t\tfor working with the SPECTRA block explorer API. \n"; echo "\t\t</p> \n\n"; echo "\t\t<p> \n"; echo "\t\t\tEach API response is a JSON encoded array with \n"; echo "\t\t\tthree fields provided to enable consistent status \n"; echo "\t\t\tand error information for use in your application. \n"; echo "\t\t</p> \n\n"; echo "\t\t<h2> Sample Request And Error Output: </h2> \n\n"; echo "\t\t<p> \n"; echo "\t\t\tThe API endpoint for this SPECTRA installation can be reached at: \n"; echo "\t\t</p> \n\n"; echo "\t\t<div class=\"api_sample\"> \n"; echo "\t\t\t" . $GLOBALS["url"]["home"] . "api_fetch.php \n"; echo "\t\t</div> \n\n"; echo "\t\t<p> \n"; echo "\t\t\tThe following output is an intentionally generated \n"; echo "\t\t\terror. In case of error, the API will return a \n"; echo "\t\t\tstatus of `0` and attempt to populate the \n"; echo "\t\t\tmessage field with an informative error message. \n"; echo "\t\t</p> \n\n"; echo "\t\t<div class=\"api_sample\"> \n";
<?php // Enable the spectra functionality require_once "lib/spectra_config.php"; spectra_site_head($GLOBALS["currency"]["code"] . " Account Ledger"); // If the system is rebalancing the ledger a placeholder is displayed if (system_flag_get("balance_rebuild")) { echo "\t<div class=\"panel_wide\"> \n\n"; echo "\t\t<h2> Rebuilding Balance List </h2> \n\n"; echo "\t\t<p> \n"; echo "\t\t\tThe block explorer is currently re-calculating balances. \n"; echo "\t\t</p> \n\n"; echo "\t\t<p> \n"; echo "\t\t\tThis is normal after a block has been orphaned, and \n"; echo "\t\t\tmay be caused by other maintenance activities. \n"; echo "\t\t</p> \n\n"; echo "\t\t<p> \n"; echo "\t\t\tThe process takes a few minutes, please check back soon. \n"; echo "\t\t</p> \n\n"; echo "\t</div> \n\n"; spectra_site_foot(); } // Distribution statistics are displayed spectra_ledger_statistics(); // The full ledger browser is displayed spectra_ledger_browser(20); spectra_site_foot(); /****************************************************************************** Developed By Jake Paysnoe - Copyright © 2015 SPEC Development Team SPEC Block Explorer is released under the MIT Software License. For additional details please read license.txt in this package.
// Exit without rendering the full transaction page exit; } // Error handling for a missing txid if (!isset($_REQUEST["tx"]) || $_REQUEST["tx"] == "") { $message = "<p> \n"; $message .= "\tYou must provide a transaction ID to use this page. \n"; $message .= "</p> \n\n"; spectra_page_error("Missing Transaction ID", $message); } // Attempt to retrieve the specified transaction $tx = mysqli_getrow($GLOBALS["tables"]["tx"], "`txid` = '" . $_REQUEST["tx"] . "'"); // Error handling for unrecognized transaction if ($tx["success"] < 1 || $tx["data"] == "") { $message = "<p> \n"; $message .= "\tInvalid or Unrecognized TX ID \n"; $message .= "</p> \n\n"; $message .= "<p> \n"; $message .= "\tPlease verify your TX ID and try again. \n"; $message .= "</p> \n\n"; spectra_page_error("Invalid Transaction ID", $message); } // The rest of the code generates the normal tx detail page for the site spectra_site_head($GLOBALS["currency"]["code"] . " Transaction Detail"); spectra_tx_detail($tx["data"]); spectra_site_foot(); /****************************************************************************** Developed By Jake Paysnoe - Copyright © 2015 SPEC Development Team SPEC Block Explorer is released under the MIT Software License. For additional details please read license.txt in this package. ******************************************************************************/
<?php // Enable the spectra functionality require_once "lib/spectra_config.php"; spectra_site_head("Search Results"); echo "\t<h1> " . $GLOBALS["currency"]["name"] . " Blockchain Search </h1> \n\n"; echo "\t<div class=\"panel_wide\"> \n\n"; // Search for matching addresses spectra_search_address($_POST["searchtext"]); // Search for matcching transaction IDs spectra_search_tx($_POST["searchtext"]); // Search for matching block hashes spectra_search_block($_POST["searchtext"]); echo "\t</div> \n\n"; spectra_site_foot(); /****************************************************************************** Developed By Jake Paysnoe - Copyright © 2015 SPEC Development Team SPEC Block Explorer is released under the MIT Software License. For additional details please read license.txt in this package. ******************************************************************************/
<?php // Enable the spectra functionality require_once "lib/spectra_config.php"; // This page can provide a market panel to itself in ajax fashion if (isset($_REQUEST["mkt_index"]) && $_REQUEST["mkt_index"] != "") { // Render the market panel for the requested exchange spectra_market_panel($_REQUEST["mkt_index"]); // Exit before any page rendering exit; } // If there were no special requests the market data page is rendered spectra_site_head($GLOBALS["currency"]["code"] . " Market Browser"); echo "<h1>Market Tickers</h1> \n\n"; foreach ($GLOBALS["markets"] as $market) { spectra_ticker_panel($market); } // Force a little whitespace echo "\t<br><br> \n\n"; // Create the exchange selection menu echo "<h1>Detailed Market Information</h1> \n\n"; echo "\t<div id=\"spectra_market_menu\"> \n\n"; foreach ($GLOBALS["markets"] as $market) { echo "\t\t<a class=\"spectra_market_button\" href=\"javascript:panel_fetch('spectra_market_panel', '" . $GLOBALS["url"]["home"] . "markets.php?mkt_index=" . $market["index"] . "')\" title=\"" . $market["exch_display"] . " " . $market["mkt_display"] . " Market Detail\"> \n"; echo "\t\t\t" . $market["exch_display"] . " \n"; echo "\t\t\t<hr> \n"; echo "\t\t\t" . $market["mkt_display"] . "\n"; echo "\t\t</a> \n"; } echo "\t</div> \n\n"; // This panel will be loaded with information when a market is selected