Skip to content

pitsolu/blockly

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blockly

This is just a simple blockchain with basic functionality.

Installation

Ensure you have php7 and php-apcu extension for cache installed.

git clone https://github.com/samweru/blockly
cd blockly
composer update

Install python httpie which is a commandline http client.

pip install httpie

Getting Started

  1. Run nodes in separate terminals as ports in php in-built server 8080,8081,8082
php -S localhost:{port} index.php
  1. Add transactions to a node
http POST localhost:8080/add/trx sender="sam" recipient="max" amount="100"
  1. View chain
http GET localhost:8080/chain
  1. Mine chain
http GET localhost:8080/mine
  1. Register nodes in different node
http GET localhost:8081/register/nodes <<<"{'nodes':['localhost:8080','localhost:8082']}"
  1. View registered node
http GET localhost:8081/nodes
  1. View chain on node 8081 first then do consensus
http GET localhost:8081/consensus
  1. View chain on node 8081 again.

About

How blockchain works.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 86.4%
  • HTML 13.3%
  • Other 0.3%