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']))
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()
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()
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()
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']))
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']))
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']))
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()