Skip to content

koshieguchi/blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Set up

In order to run this app, execute the following commands

$ python3 blockchain.py 5000
$ python3 blockchain.py 5001

Basic Commands

# register the node
$ curl -X POST -H "Content-Type: application/json" -d '{
    "nodes": ["http://localhost:5001"]
}' "http://localhost:5000/nodes/register"

# mine blockchain
$ curl "http://localhost:5001/mine"

# add transactions
$ curl -X POST -H "Content-Type: application/json" -d '{
 "sender": "d4ee26eee15148ee92c6cd394edd974e",
 "recipient": "someone-other-address",
 "amount": 5
}' "http://localhost:5000/transactions/new"

# resolve conflicts among nodes
$ curl "http://localhost:5000/nodes/resolve"

# check the current node in the designated node
$ curl "http://localhost:5001/chain"

About

A brief experiment of bitcoin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages