Beispiel #1
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
Beispiel #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
Beispiel #3
0
def full_chain():
    response = {
        "chain": blockchainObj.chainJSONencode(),
        "length": len(blockchainObj.chain),
    }
    return jsonify(response), 200
Beispiel #4
0
def full_chain():
    response = {
        'chain': blockchainObj.chainJSONencode(),
        'length': len(blockchainObj.chain),
    }
    return jsonify(response), 200