コード例 #1
0
ファイル: routes.py プロジェクト: vasuvius/dartcoin
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);
コード例 #2
0
ファイル: routes.py プロジェクト: codacy-badger/GymCoin
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
コード例 #3
0
ファイル: routes.py プロジェクト: xscuvalar/GymCoin
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
コード例 #4
0
ファイル: routes.py プロジェクト: codacy-badger/GymCoin
def blockchain():
    # print(type(blockchainObj.chain));
    blockchainObj.resolveConflicts()
    return render_template("blockchain.html",
                           title="Blockchain",
                           blockchain=blockchainObj)
コード例 #5
0
ファイル: routes.py プロジェクト: codacy-badger/GymCoin
def home():
    blockchainObj.resolveConflicts()
    return render_template("blockchain.html",
                           title="Blockchain",
                           blockchain=blockchainObj)
コード例 #6
0
ファイル: routes.py プロジェクト: vasuvius/dartcoin
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);