This file contains hidden or 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
| # Go parameters | |
| GOCMD=go | |
| GOBUILD=$(GOCMD) build | |
| GOCLEAN=$(GOCMD) clean | |
| GOTEST=$(GOCMD) test | |
| GOGET=$(GOCMD) get | |
| BINARY_NAME=mybinary | |
| BINARY_UNIX=$(BINARY_NAME)_unix |
Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third party interference.
This is a step-by-step guide, how to setup private Ethereum network.
We’ll set up a network and create two simple JSON-RPC clients in order to communicate with our Ethereum nodes.
This file contains hidden or 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
| # Overlay 2 histograms to compare them | |
| def overlaid_histogram(data1, data2, n_bins = 0, data1_name="", data1_color="#539caf", data2_name="", data2_color="#7663b0", x_label="", y_label="", title=""): | |
| # Set the bounds for the bins so that the two distributions are fairly compared | |
| max_nbins = 10 | |
| data_range = [min(min(data1), min(data2)), max(max(data1), max(data2))] | |
| binwidth = (data_range[1] - data_range[0]) / max_nbins | |
| if n_bins == 0 | |
| bins = np.arange(data_range[0], data_range[1] + binwidth, binwidth) |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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: |