In this repo I have created blockchain api. Run npm start to start node server. When server will start it will create 2 pair of publickey, private key and UTXO for each.
Api endpoints are as follows -
-
/startMining - Request object =
{method:"put",content-type:"application/json"}
-
/transaction - Request object =
{method: "post", content-type:"application/json", body: JSON.stringify({ "txo":{ "owner": "04599f1b3000720b3f41e8d566575c17f61a79680a2ce1dd56fd9847f9bf08720e0493cb4088be7308ab0242434f21811e88e2550d1ce444ef454a9c3d0c0cca16", "amount": 20 } })}
-
/stopMining - Request object =
{method:"put",content-type:"application/json"}
-
/getBalance/address - here value of address should be public key.