-> Flask
-> Python3
-> Merkle Trees (tools)
-> HTML/CSS/Javascript/Bootstrap
-> Consensus algorithm
-> Replication
-> Proof of Work
FLASK_APP=server.py flask run --port=5001
FLASK_APP=server.py flask run --port=5002
Include all other nodes in the JSON file other than the node you're already on. Uses proof of work and forges a new block. For registering node 5002 on node 5001:
curl -i -X POST http://localhost:5001/nodes/register -d @register-node5001.json --header "Content-Type: application/json"
For registering node 5001 on node 5002:
curl -i -X POST http://localhost:5002/nodes/register -d @register-node5002.json --header "Content-Type: application/json"
curl -i -X POST http://localhost:5001/register -d @entry.json --header "Content-Type: application/json"
{
"upc": "123",
"product":"MEGNYA Leather Baby Moccasins",
"link": "https://www.amazon.com/MEGNYA-Leather-Moccasins-Toddler-ZH0003-Brown-12-5/dp/B07BBVPSPW/ref=sr_1_1_sspa?ie=UTF8&qid=1525936891&sr=8-1-spons&keywords=baby+shoes&psc=1",
"quantity": "90",
"price":"18.99",
"manufacturer": "MEGNYA"
}
To replicate all new changes (such as the ones made on 5001) on node 5002:
curl -i -X GET http://127.0.0.1:5002/nodes/resolve
To replicate all new changes (such as the ones made on 5002) on node 5001:
curl -i -X GET http://127.0.0.1:5001/nodes/resolve
Run on all nodes that have not been updated.
Checks to see that the original owner actually has the product or not. Also checks to see if a product exists with that ID.
curl -i -X GET http://127.0.0.1:5001/transfer
{
"upc": 123123,
"old_owner": "Aditi",
"new_owner": "Femi"
}
curl -i -X GET http://127.0.0.1:5001/chain
curl -i -X GET http://127.0.0.1:5001/transaction/<transaction_ID>
Returns an error statement if a product with that ID does not exist.
curl -i -X GET http://127.0.0.1:5001/product/<product_ID>