Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Writing a New Block for Cryptocurrency Blockchain

<?php
  // including basic configuration file and Data Access Object class
  include_once("./includes/config.php");
  include_once("./includes/blockchain.php");

  // initializing the class
  $Blockchain = new BLOCKCHAIN();

  // loading the full blockchain in an array and showing it as output on the webpage
  $full_chain = $Blockchain->read_all();
  echo "full blockchain loaded:<br />";
  echo '<pre>',print_r($full_chain["chain"],1),'</pre>';
  echo "<hr />";
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Writing #New #Block #Cryptocurrency #Blockchain
ADD COMMENT
Topic
Name
5+4 =