Skip to content

Instantly share code, notes, and snippets.

View SassOnTheRoad's full-sized avatar

Sasson Mansoori SassOnTheRoad

View GitHub Profile
@SassOnTheRoad
SassOnTheRoad / snakecoin-server-full-code.py
Created February 24, 2018 19:29 — 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.
from flask import Flask
from flask import request
import json
import requests
import hashlib as hasher
import datetime as date
node = Flask(__name__)
# Define what a Snakecoin block is
class Block:
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash