Esempio n. 1
0
def run_upsert_validator(args):
    """Store validators which should be synced with Tendermint"""

    b = bigchaindb.BigchainDB()
    public_key = public_key_from_base64(args.public_key)
    validator = {
        'pub_key': {
            'type': 'ed25519',
            'data': public_key
        },
        'power': args.power
    }
    validator_update = {
        'validator': validator,
        'update_id': VALIDATOR_UPDATE_ID
    }
    try:
        query.store_validator_update(b.connection, validator_update)
    except MultipleValidatorOperationError:
        logger.error('A validator update is pending to be applied. '
                     'Please re-try after the current update has '
                     'been processed.')
Esempio n. 2
0
def _run_init():
    bdb = bigchaindb.BigchainDB()

    schema.init_database(connection=bdb.connection)