コード例 #1
0
ファイル: processes.py プロジェクト: CsterKuroi/Simplechaindb
def start():
    logger.info('Initializing BigchainDB...')

    # init localdb with localdb utils
    logger.info('start localdb pipeline...')
    leveldb.init()
    local_block.start()
    local_vote.start()

    # start the processes
    logger.info('Starting block')
    block.start()

    logger.info('Starting voter')
    vote.start()

    logger.info('Starting stale transaction monitor')
    stale.start()

    logger.info('Starting election')
    election.start()

    # start the web api
    app_server = server.create_server(bigchaindb.config['server'])
    p_webapi = mp.Process(name='webapi', target=app_server.run)
    p_webapi.start()

    # start message
    logger.info(BANNER.format(bigchaindb.config['server']['bind']))
コード例 #2
0
def processes(genesis_block):
    block_maker = block.start()
    voter = vote.start()
    election_runner = election.start()
    stale_monitor = stale.start()
    yield
    block_maker.terminate()
    voter.terminate()
    election_runner.terminate()
    stale_monitor.terminate()
コード例 #3
0
def start():
    logger.info('Initializing BigchainDB...')

    # Create a Exchange object.
    # The events queue needs to be initialized once and shared between
    # processes. This seems the best way to do it
    # At this point only the election processs and the event consumer require
    # this queue.
    exchange = Exchange()

    # start the processes
    logger.info('Starting block')
    block.start()

    logger.info('Starting voter')
    vote.start()

    logger.info('Starting stale transaction monitor')
    stale.start()

    logger.info('Starting election')
    election.start(events_queue=exchange.get_publisher_queue())

    # start the web api
    app_server = server.create_server(settings=bigchaindb.config['server'],
                                      log_config=bigchaindb.config['log'])
    p_webapi = mp.Process(name='webapi', target=app_server.run)
    p_webapi.start()

    logger.info('WebSocket server started')
    p_websocket_server = mp.Process(name='ws',
                                    target=websocket_server.start,
                                    args=(exchange.get_subscriber_queue(
                                        EventTypes.BLOCK_VALID), ))
    p_websocket_server.start()

    # start message
    logger.info(BANNER.format(bigchaindb.config['server']['bind']))

    start_events_plugins(exchange)

    exchange.run()
コード例 #4
0
ファイル: processes.py プロジェクト: cgwyx/bigchaindb
def start():
    logger.info('Initializing BigchainDB...')

    # Create a Exchange object.
    # The events queue needs to be initialized once and shared between
    # processes. This seems the best way to do it
    # At this point only the election processs and the event consumer require
    # this queue.
    exchange = Exchange()

    # start the processes
    logger.info('Starting block')
    block.start()

    logger.info('Starting voter')
    vote.start()

    logger.info('Starting stale transaction monitor')
    stale.start()

    logger.info('Starting election')
    election.start(events_queue=exchange.get_publisher_queue())

    # start the web api
    app_server = server.create_server(settings=bigchaindb.config['server'],
                                      log_config=bigchaindb.config['log'])
    p_webapi = mp.Process(name='webapi', target=app_server.run)
    p_webapi.start()

    logger.info('WebSocket server started')
    p_websocket_server = mp.Process(name='ws',
                                    target=websocket_server.start,
                                    args=(exchange.get_subscriber_queue(EventTypes.BLOCK_VALID),))
    p_websocket_server.start()

    # start message
    logger.info(BANNER.format(bigchaindb.config['server']['bind']))

    start_events_plugins(exchange)

    exchange.run()
コード例 #5
0
ファイル: processes.py プロジェクト: CsterKuroi/Charitychain
def start():
    logger.info('Initializing BigchainDB...')

    # start the processes
    logger.info('Starting block')
    block.start()

    logger.info('Starting voter')
    vote.start()

    logger.info('Starting stale transaction monitor')
    stale.start()

    logger.info('Starting election')
    election.start()

    # start the web api
    app_server = server.create_server(bigchaindb.config['server'])
    p_webapi = mp.Process(name='webapi', target=app_server.run)
    p_webapi.start()

    # start message
    logger.info(BANNER.format(bigchaindb.config['server']['bind']))
コード例 #6
0
def start():
    logger.info('Initializing BigchainDB...')

    # Create the events queue
    # The events queue needs to be initialized once and shared between
    # processes. This seems the best way to do it
    # At this point only the election processs and the event consumer require
    # this queue.
    events_queue = setup_events_queue()

    # start the processes
    logger.info('Starting block')
    block.start()

    logger.info('Starting voter')
    vote.start()

    logger.info('Starting stale transaction monitor')
    stale.start()

    logger.info('Starting election')
    election.start(events_queue=events_queue)

    # start the web api
    app_server = server.create_server(bigchaindb.config['server'])
    p_webapi = mp.Process(name='webapi', target=app_server.run)
    p_webapi.start()

    logger.info('Events api started')
    p_websocket_server = mp.Process(name='ws',
                                    target=events_api.start,
                                    args=(events_queue, ))
    p_websocket_server.start()

    # start message
    logger.info(BANNER.format(bigchaindb.config['server']['bind']))
コード例 #7
0
ファイル: processes.py プロジェクト: rhsimplex/bigchaindb
def start():
    logger.info('Initializing BigchainDB...')

    # Create the events queue
    # The events queue needs to be initialized once and shared between
    # processes. This seems the best way to do it
    # At this point only the election processs and the event consumer require
    # this queue.
    events_queue = setup_events_queue()

    # start the processes
    logger.info('Starting block')
    block.start()

    logger.info('Starting voter')
    vote.start()

    logger.info('Starting stale transaction monitor')
    stale.start()

    logger.info('Starting election')
    election.start(events_queue=events_queue)

    # start the web api
    app_server = server.create_server(bigchaindb.config['server'])
    p_webapi = mp.Process(name='webapi', target=app_server.run)
    p_webapi.start()

    logger.info('WebSocket server started')
    p_websocket_server = mp.Process(name='ws',
                                    target=websocket_server.start,
                                    args=(events_queue,))
    p_websocket_server.start()

    # start message
    logger.info(BANNER.format(bigchaindb.config['server']['bind']))
コード例 #8
0
def test_start(mock_start):
    # TODO: `sta,e.start` is just a wrapper around `block.create_pipeline`,
    #       that is tested by `test_full_pipeline`.
    #       If anyone has better ideas on how to test this, please do a PR :)
    stale.start()
    mock_start.assert_called_with()