Ejemplo n.º 1
0
def run_start(args):
    """Start the processes to run the node"""
    logger.info('BigchainDB Version {}'.format(bigchaindb.__version__))

    bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)

    if args.allow_temp_keypair:
        if not (bigchaindb.config['keypair']['private']
                or bigchaindb.config['keypair']['public']):

            private_key, public_key = crypto.generate_key_pair()
            bigchaindb.config['keypair']['private'] = private_key
            bigchaindb.config['keypair']['public'] = public_key
        else:
            logger.warning('Keypair found, no need to create one on the fly.')

    if args.start_rethinkdb:
        try:
            proc = utils.start_rethinkdb()
        except StartupError as e:
            sys.exit('Error starting RethinkDB, reason is: {}'.format(e))
        logger.info('RethinkDB started with PID %s' % proc.pid)

    try:
        db.init()
    except DatabaseAlreadyExists:
        pass
    except KeypairNotFoundException:
        sys.exit("Can't start BigchainDB, no keypair found. "
                 'Did you run `bigchaindb configure`?')

    logger.info('Starting BigchainDB main process with public key %s',
                bigchaindb.config['keypair']['public'])
    processes.start()
Ejemplo n.º 2
0
def run_start(args):
    """Start the processes to run the node"""
    logger.info('BigchainDB Version {}'.format(bigchaindb.__version__))

    bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)

    if args.allow_temp_keypair:
        if not (bigchaindb.config['keypair']['private'] or
                bigchaindb.config['keypair']['public']):

            private_key, public_key = crypto.generate_key_pair()
            bigchaindb.config['keypair']['private'] = private_key
            bigchaindb.config['keypair']['public'] = public_key
        else:
            logger.warning('Keypair found, no need to create one on the fly.')

    if args.start_rethinkdb:
        try:
            proc = utils.start_rethinkdb()
        except StartupError as e:
            sys.exit('Error starting RethinkDB, reason is: {}'.format(e))
        logger.info('RethinkDB started with PID %s' % proc.pid)

    try:
        db.init()
    except DatabaseAlreadyExists:
        pass
    except KeypairNotFoundException:
        sys.exit("Can't start BigchainDB, no keypair found. "
                 'Did you run `bigchaindb configure`?')

    logger.info('Starting BigchainDB main process with public key %s',
                bigchaindb.config['keypair']['public'])
    processes.start()
Ejemplo n.º 3
0
def run_init(args):
    """Initialize the database"""
    bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
    # TODO Provide mechanism to:
    # 1. prompt the user to inquire whether they wish to drop the db
    # 2. force the init, (e.g., via -f flag)
    try:
        db.init()
    except DatabaseAlreadyExists:
        print('The database already exists.', file=sys.stderr)
        print('If you wish to re-initialize it, first drop it.', file=sys.stderr)
Ejemplo n.º 4
0
def run_start(args):
    """Start the processes to run the node"""
    run_configure(args, skip_if_exists=True)
    bigchaindb.config_utils.file_config(args.config)
    try:
        db.init()
    except DatabaseAlreadyExists:
        pass
    processes = Processes()
    logger.info('Start bigchaindb main process')
    processes.start()
Ejemplo n.º 5
0
def run_init(args):
    """Initialize the database"""
    bigchaindb.config_utils.file_config(args.config)
    # TODO Provide mechanism to:
    # 1. prompt the user to inquire whether they wish to drop the db
    # 2. force the init, (e.g., via -f flag)
    try:
        db.init()
    except DatabaseAlreadyExists:
        print('The database already exists.')
        print('If you wish to re-initialize it, first drop it.')
Ejemplo n.º 6
0
def run_start(args):
    """Start the processes to run the node"""
    run_configure(args, skip_if_exists=True)
    bigchaindb.config_utils.file_config(args.config)
    try:
        db.init()
    except db.DatabaseAlreadyExistsException:
        pass
    p = Processes()
    logger.info('Start bigchaindb main process')
    p.start()
Ejemplo n.º 7
0
def run_start(args):
    """Start the processes to run the node"""
    # run_configure(args, skip_if_exists=True)
    bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
    try:
        db.init()
    except DatabaseAlreadyExists:
        pass
    except KeypairNotFoundException:
        sys.exit('Cannot start BigchainDB, no keypair found. Did you run `bigchaindb configure`?')

    processes = Processes()
    logger.info('Start bigchaindb main process')
    processes.start()
Ejemplo n.º 8
0
def run_start(args):
    """Start the processes to run the node"""
    # run_configure(args, skip_if_exists=True)
    bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)
    try:
        db.init()
    except DatabaseAlreadyExists:
        pass
    except KeypairNotFoundException:
        sys.exit(
            'Cannot start BigchainDB, no keypair found. Did you run `bigchaindb configure`?'
        )

    processes = Processes()
    logger.info('Start bigchaindb main process')
    processes.start()
Ejemplo n.º 9
0
def run_start(args):
    """Start the processes to run the node"""
    bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)

    if args.start_rethinkdb:
        try:
            proc = utils.start_rethinkdb()
        except StartupError as e:
            sys.exit('Error starting RethinkDB, reason is: {}'.format(e))
        logger.info('RethinkDB started with PID %s' % proc.pid)

    try:
        db.init()
    except DatabaseAlreadyExists:
        pass
    except KeypairNotFoundException:
        sys.exit("Can't start BigchainDB, no keypair found. "
                 'Did you run `bigchaindb configure`?')

    processes = Processes()
    logger.info('Starting BigchainDB main process')
    processes.start()
Ejemplo n.º 10
0
def run_start(args):
    """Start the processes to run the node"""
    logger.info('BigchainDB Version {}'.format(bigchaindb.__version__))
    bigchaindb.config_utils.autoconfigure(filename=args.config, force=True)

    if args.start_rethinkdb:
        try:
            proc = utils.start_rethinkdb()
        except StartupError as e:
            sys.exit('Error starting RethinkDB, reason is: {}'.format(e))
        logger.info('RethinkDB started with PID %s' % proc.pid)

    try:
        db.init()
    except DatabaseAlreadyExists:
        pass
    except KeypairNotFoundException:
        sys.exit("Can't start BigchainDB, no keypair found. "
                 'Did you run `bigchaindb configure`?')

    logger.info('Starting BigchainDB main process')
    processes.start()
Ejemplo n.º 11
0
def run_init(args):
    """Initialize the database"""
    bigchaindb.config_utils.file_config(args.config)
    db.init()
Ejemplo n.º 12
0
def run_init(args):
    """Initialize the database"""
    bigchaindb.config_utils.file_config(args.config)
    db.init()