Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

kauri-learn-to-build-a-blockchain Part1: Blocks & Consensus

Source code for Kauri series of articles on Creating a Blockchain | Blocks & Consensus

Installation

  1. Install Node & NPM
  2. Clone this respo
  3. Run npm install

Run

Start a node

node src/server.js port=<port>

Mine a block

curl -X POST "localhost:<port>/mine" -H 'Content-Type: application/json' -d'
{
    "data": "Mine a block on node 1"
}
'

Add peer to node

curl -X POST "localhost:<port>/peers/add"  -H 'Content-Type: application/json' -d'
{
    "peers":  ["http://<host>:<port>"]
}
'

Contributing

Contributions are welcome! Please feel free to submit a PR and/or a Kauri article