Let's start by creating a new simple example for understanding the cycle:
useMayoz\Blockchain\Blockchain;
useMayoz\Blockchain\Transaction;
// create main blockchain instance$blockchain = newBlockchain;
// add new transactions to pending chain$blockchain->transaction(newTransaction('foo', 'bar', 10));
$blockchain->transaction(newTransaction('foo', 'baz', 20));
// mine the pending chain$block = $blockchain->mine('miner-address');
var_dump($block->hash);
// add new transactions to new pending chain$blockchain->transaction(newTransaction('baz', 'bar', 15));
// and mine it$block = $blockchain->mine('miner-address');
var_dump($block->hash);For more information about Blockchain, please watch this video.
You will need an install of Composer before continuing.
First, install the dependencies:
$ composer installThen run PHPUnit:
$ vendor/bin/phpunitThe MIT License (MIT). Please see License File for more information.