naivechain

a simple Blockchain inspired by https://github.com/lhartikk/naivechain written in Go
Install
$ go install github.com/m0t0k1ch1/naivechain@latest
Run
$ naivechain [-api HTTP_SERVER_ADDRESS_FOR_API] [-p2p WEBSOCKET_SERVER_ADDRESS_FOR_P2P] [-origin P2P_ORIGIN]
Example
$ naivechain -api :3001 -p2p :6001
HTTP API
Get chain
$ curl http://127.0.0.1:3001/blocks
Mine block
$ curl http://127.0.0.1:3001/mineBlock -d '{"data":"some data to include in the block"}'
Add peer
$ curl http://127.0.0.1:3001/addPeer -d '{"peer":"ws://127.0.0.1:6002"}'
Get connected peers
$ curl http://127.0.0.1:3001/peers