Exemple #1
0
def blockchain():
    #this is the screen that displays the blockchain!
    #print(type(blockchainObj.chain));
    blockchainObj.resolveConflicts();
    #blockchain is the blockchain object passed into the function
    print(blockchainObj);
    return render_template('blockchain.html', title = "Blockchain", blockchain = blockchainObj);
Exemple #2
0
def consensus():
    replaced = blockchainObj.resolveConflicts()

    if replaced:
        response = {
            "message": "Our chain was replaced",
            "new_chain": blockchainObj.chainJSONencode(),
        }
    else:
        response = {
            "message": "Our chain is authoritative",
            "chain": blockchainObj.chainJSONencode(),
        }

    return jsonify(response), 200
Exemple #3
0
def consensus():
    replaced = blockchainObj.resolveConflicts()

    if replaced:
        response = {
            'message': 'Our chain was replaced',
            'new_chain': blockchainObj.chainJSONencode()
        }
    else:
        response = {
            'message': 'Our chain is authoritative',
            'chain': blockchainObj.chainJSONencode()
        }

    return jsonify(response), 200
Exemple #4
0
def blockchain():
    # print(type(blockchainObj.chain));
    blockchainObj.resolveConflicts()
    return render_template("blockchain.html",
                           title="Blockchain",
                           blockchain=blockchainObj)
Exemple #5
0
def home():
    blockchainObj.resolveConflicts()
    return render_template("blockchain.html",
                           title="Blockchain",
                           blockchain=blockchainObj)
Exemple #6
0
def home():
    blockchainObj.resolveConflicts();
    #instead, render a template that explains the blockchain and what it does
    return render_template('home.html', title = "Blockchain", blockchain = blockchainObj);