A basic implementation of blockchain in go.
$ cd cmd
$ go build -o gochain
You can start as many nodes as you want with the following command
./gochain -port=<port-number>
GET 127.0.0.1:8000/chain
GET 127.0.0.1:8000/mine
-
POST 127.0.0.1:8000/transactions/new
-
Body: A transaction to be added
{ "sender": "sender-address-te33412uywq89234g", "recipient": "recipient-address-j3h45jk23hjk543gf", "amount": 1000 }
Currently you must add each new node to each running node.
-
POST 127.0.0.1:8000/nodes/register
-
Body: A list of nodes to add
{ "nodes": ["http://127.0.0.1:8001", <more-nodes>] }
GET 127.0.0.1:8000/nodes/resolve