Just a code from the tutorial: Learn Blockchains by Building One
- In order to start the app, run:
pipenv run python api.py --port 5000
- If everything is working fine, you should have a server listening on
5000
port
Examples provided by calling API using previously mentioned HTTPie tool
http GET :5000/mine
http POST :5000/transactions/new sender="someone_rich" recipient="happy_receiver" amount=5
http GET :5000/chain
echo '{"nodes": ["http://127.0.0.1:5001"]}' | http POST :5000/nodes/register
http :5000/nodes/resolve