Skip to content

Instantly share code, notes, and snippets.

View blackluv's full-sized avatar
🎯
Focusing

YummyDAO blackluv

🎯
Focusing
View GitHub Profile
## 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
@blackluv
blackluv / block.js
Created February 22, 2018 22:23 — forked from lhartikk/block.js
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();
}
}
@blackluv
blackluv / blockchain.py
Created February 22, 2018 21:12 — forked from dvf/blockchain.py
Step 12: New Endpoints for Consensus
@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)
@blackluv
blackluv / blockchain.py
Created February 22, 2018 21:10 — forked from dvf/blockchain.py
Creating a simple Blockchain in Python
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):
@blackluv
blackluv / blockchain.py
Created February 22, 2018 21:04 — forked from dvf/blockchain.py
Blockchain: Step 2
block = {
'index': 1,
'timestamp': 1506057125.900785,
'transactions': [
{
'sender': "8527147fe1f5426f9dd545de4b27ee00",
'recipient': "a77f5cdfa2934df3954a5c7c7da5df1f",
'amount': 5,
}
],