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
## How to hide API keys from github ## | |
1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while | |
retaining your commits: https://help.github.com/articles/remove-sensitive-data/ | |
2. In the terminal, create a config.js file and open it up: | |
touch config.js | |
atom config.js |
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
class Block { | |
constructor(index, previousHash, timestamp, data, hash) { | |
this.index = index; | |
this.previousHash = previousHash.toString(); | |
this.timestamp = timestamp; | |
this.data = data; | |
this.hash = hash.toString(); | |
} | |
} |
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
@app.route('/nodes/register', methods=['POST']) | |
def register_nodes(): | |
values = request.get_json() | |
nodes = values.get('nodes') | |
if nodes is None: | |
return "Error: Please supply a valid list of nodes", 400 | |
for node in nodes: | |
blockchain.register_node(node) |
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
class Blockchain(object): | |
def __init__(self): | |
self.current_transactions = [] | |
self.chain = [] | |
def new_block(self): | |
# Creates a new Block in the Blockchain | |
pass | |
def new_transaction(self): |
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
block = { | |
'index': 1, | |
'timestamp': 1506057125.900785, | |
'transactions': [ | |
{ | |
'sender': "8527147fe1f5426f9dd545de4b27ee00", | |
'recipient': "a77f5cdfa2934df3954a5c7c7da5df1f", | |
'amount': 5, | |
} | |
], |