bash/deploy
bash script to deploy the demobash/bcstartn
bash script to start the demobash/bcstop
bash script to stop the demopython/blockchain.py
the blockchain class and functionspython/server.py
the flask serverinput/node_ids.csv
the input file of port number and node id
cd ~
git clone https://github.com/shawenyao/blockchain.git
sudo ~/blockchain/bash/deploy
curl https://freedns.afraid.org/dynamic/update.php?xxxxxxxxxx
- Follow the guide (https://certbot.eff.org/) to request https certificate for the domain.
- Add the following lines to
/etc/nginx/sites-available/default
:
location ~ "^/(5[\d]{3})/(.*)$" {
proxy_pass http://0.0.0.0:$1/$2$is_args$args;
}
~/blockchain/bash/bcstartn %number_of_nodes%
, where%number_of_nodes%
should be replaced by a number no bigger than the number of rows ininput/node_ids.csv
Learn Blockchains by Building One
https://hackernoon.com/learn-blockchains-by-building-one-117428612f46
Learn Blockchains using Spreadsheets
https://medium.com/@vanflymen/learn-blockchains-using-spreadsheets-b97ad92b9b4d
How do peer-to-peer programs discover each other?
https://jameshfisher.com/2017/08/11/peer-to-peer-discovery/
Nested tables from json
http://bl.ocks.org/nautat/4085017
Read lines from a file into a Bash array
https://stackoverflow.com/questions/11393817/read-lines-from-a-file-into-a-bash-array
How to split a string into an array in Bash?
https://stackoverflow.com/questions/10586153/how-to-split-a-string-into-an-array-in-bash