Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Read the index and hashid of the last block in the blockchain

<?php 
// reading last block's hash id
  $previous_hashid = $Blockchain->get_previous_hashid($full_chain["chain"]);
  echo "reading last block's hash id:<br />";
  echo $previous_hashid;
  echo "<hr />";

  // reading last block's index to calculate next index
  $previous_index = $Blockchain->get_previous_index($full_chain["chain"]);
  $next_index = $previous_index+1;
  echo "reading last block's index to calculate next index:<br />";
  echo "Last: " .$previous_index. " | Next: ".$next_index;
  echo "<hr />";
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Read #index #hashid #block #blockchain
ADD COMMENT
Topic
Name
9+4 =