This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Source https://gist.github.com/aunyks/47d157f8bc7d1829a729c2a6a919c173 | |
# Modifications: | |
# - Can pass port number as command line argument. | |
# - Added GET method /add_peer. | |
# - On retrieving blockchain, call consensus to synchronize with other peers. | |
# - On updating the current blockchain from a peers' blockchain, convert list | |
# of JSON blocks to native Block objects. |