Skip to content

dodopontocom/mini-blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

73 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mini-blockchain

A blockchain in python for study purpose

dependencies
$ pip3 install -r requirements.txt
$ sudo apt-get install jq curl
(also install python3xxx)

environment variable dependencies
export (blockchain/env-vars-template.sh) appending to your ~/.bashrc
edit the values accordingly

run blockchain (if you change port number here, dont forget to also change in nodes.json file for the localhost server, default is 5000)
$ cd mini-blockchain/blockchain
$ PORT=5000 ./miniapi.py ${PORT}

then sending several requests to the blockchain (in another terminal window)
$ PORT=5000 curl -s http://127.0.0.1:${PORT}/mint_block | jq
$ PORT=5000 curl -s http://127.0.0.1:${PORT}/get_chain | jq
$ PORT=5000 curl -s http://127.0.0.1:${PORT}/is_valid | jq

FLASK_ENV=development ./miniapi.py 5000

http://127.0.0.1:{PORT}/
view

About

A blockchain in python for study purpose

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published