def start(self): logger.info('Initializing BigchainDB...') delete_reverter = BlockDeleteRevert(self.q_revert_delete) # 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() # initialize the processes p_map_bigchain = mp.Process(name='bigchain_mapper', target=self.map_bigchain) p_block_delete_revert = mp.Process(name='block_delete_revert', target=delete_reverter.start) p_voter = Voter(self.q_new_block) # start the processes logger.info('starting bigchain mapper') p_map_bigchain.start() logger.info('starting block') block.start() p_block_delete_revert.start() logger.info('starting voter') p_voter.start() election.start() logger.info('starting election') # start message p_voter.initialized.wait() logger.info(BANNER.format(bigchaindb.config['server']['bind']))
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 start(self): logger.info('Initializing BigchainDB...') delete_reverter = BlockDeleteRevert(self.q_revert_delete) # 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() # initialize the processes p_map_bigchain = mp.Process(name='bigchain_mapper', target=self.map_bigchain) p_block_delete_revert = mp.Process(name='block_delete_revert', target=delete_reverter.start) p_voter = Voter(self.q_new_block) # start the processes logger.info('starting bigchain mapper') p_map_bigchain.start() logger.info('starting block') block.start() p_block_delete_revert.start() logger.info('starting voter') p_voter.start() election.start() logger.info('starting election') # start message p_voter.initialized.wait() 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...') # start the processes logger.info('Starting block') block.start() logger.info('Starting voter') vote.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 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 {}...'.format(app_setup_name)) logger.info('dianxin test =====================================') logger.info( 'dianxin test22222222222 =====================================') need_split_backlog = bigchaindb.config['argument_config']['split_backlog'] if need_split_backlog: logger.info("NEED SIGNLE NODE BACKLOG T") else: logger.info("NEED SIGNLE NODE BACKLOG F") need_localdb = bigchaindb.config['need_local'] if bigchaindb.config['api_need_permission']: logger.info("LOCAL LEVEL T") else: logger.info("LOCAL LEVEL F") # start the processes logger.info('Starting block') block.start() logger.info('Starting voter') vote.start() logger.info('Starting stale transaction monitor') #todo open it #stale.start() monitor.start() logger.info('Starting election') election.start() if need_localdb: # must start the localdb pipeline after origin pipeline # local_block pipeline store the cluster changefeed for table bigchain logger.info('Starting localblock') local_block.start() # local_block pipeline store the cluster changefeed for table votes logger.info('Starting localvoter') local_vote.start()
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: `block.election` 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 :) election.start() mock_start.assert_called_with()