Simple blockchain server implemented in Haskell
creates a peer-to-peer network that synchronizes the blockchain.
stack build
stack exec hschain httpPort p2pPort [optional seed]
- set up two connected nodes.
hschain 7000 7001
# seed for bootstrapping a connection in a p2p network.
hschain 8000 8001 localhost:7001
- mine block
# add a new block to the blockchain via a POST request
curl -H "Content-Type: application/json" -X POST http://localhost:7000/block -d "{\"block\" : \"some data\"}"
# check the blcokchain via a GET request
curl -X GET http://localhost:7000/chain