Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dpino's full-sized avatar
🏠
Working from home

Diego Pino dpino

🏠
Working from home
View GitHub Profile
@dpino
dpino / snakecoin-server-full-code.py
Last active January 4, 2019 03:19 — forked from aunyks/snakecoin-server-full-code.py
The code in this gist isn't as succinct as I'd like it to be. Please bare with me and ask plenty of questions that you may have about it.
#!/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.