100 blocks
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
// ---
|
||||
// --- La config globale
|
||||
// ---
|
||||
require_once '../global/inc/config.php';
|
||||
|
||||
// ---
|
||||
// --- External dependances
|
||||
// ---
|
||||
require TOPISTO_PATH.'/ressources/vendor/autoload.php';
|
||||
|
||||
// ---
|
||||
// --- Internal dependances
|
||||
// ---
|
||||
require_once APP_PATH.'/blockchain/inc/block.php';
|
||||
|
||||
// ---
|
||||
// --- Par défaut on cherche le dernier block
|
||||
// --- Le cas échéant, on cherche block passé en argument
|
||||
// ---
|
||||
$block_hash = 'LAST';
|
||||
if (isset($argv[1])) $block_hash = $argv[1];
|
||||
|
||||
$the_block = blockchain::getBlockWithHash($block_hash);
|
||||
if ($the_block === FALSE) die();
|
||||
|
||||
echo $the_block->height.' '.$the_block->time.' '.$the_block->n_tx.' '.$the_block->nonce.' '.$the_block->prev_block.PHP_EOL;
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user