def start(self): log = self.app.log args = self.app.pargs abci_app = ABCIServer(app=EzoABCI()) abci_app.run()
def start(): logger.info(BANNER) from abci import ABCIServer app = ABCIServer(app=App()) app.run()
def start(): # Exchange object for event stream api logger.info('Starting BigchainDB') exchange = Exchange() # start the web api app_server = server.create_server(settings=bigchaindb.config['server'], log_config=bigchaindb.config['log'], bigchaindb_factory=BigchainDB) p_webapi = Process(name='bigchaindb_webapi', target=app_server.run, daemon=True) p_webapi.start() # start message logger.info(BANNER.format(bigchaindb.config['server']['bind'])) # start websocket server p_websocket_server = Process(name='bigchaindb_ws', target=websocket_server.start, daemon=True, args=(exchange.get_subscriber_queue( EventTypes.BLOCK_VALID), )) p_websocket_server.start() # connect to tendermint event stream p_websocket_client = Process(name='bigchaindb_ws_to_tendermint', target=event_stream.start, daemon=True, args=(exchange.get_publisher_queue(), )) p_websocket_client.start() p_exchange = Process(name='bigchaindb_exchange', target=exchange.run, daemon=True) p_exchange.start() # We need to import this after spawning the web server # because import ABCIServer will monkeypatch all sockets # for gevent. from abci import ABCIServer setproctitle.setproctitle('bigchaindb') # Start the ABCIServer app = ABCIServer(app=App()) app.run()
def start(args): # Exchange object for event stream api logger.info('Starting BigchainDB') exchange = Exchange() # start the web api app_server = server.create_server(settings=bigchaindb.config['server'], log_config=bigchaindb.config['log'], bigchaindb_factory=BigchainDB) p_webapi = Process(name='bigchaindb_webapi', target=app_server.run, daemon=True) p_webapi.start() logger.info(BANNER.format(bigchaindb.config['server']['bind'])) # start websocket server p_websocket_server = Process(name='bigchaindb_ws', target=websocket_server.start, daemon=True, args=(exchange.get_subscriber_queue( EventTypes.BLOCK_VALID), )) p_websocket_server.start() p_exchange = Process(name='bigchaindb_exchange', target=exchange.run, daemon=True) p_exchange.start() # We need to import this after spawning the web server # because import ABCIServer will monkeypatch all sockets # for gevent. from abci import ABCIServer setproctitle.setproctitle('bigchaindb') # Start the ABCIServer if args.experimental_parallel_validation: app = ABCIServer(app=ParallelValidationApp( events_queue=exchange.get_publisher_queue())) else: app = ABCIServer(app=App(events_queue=exchange.get_publisher_queue())) app.run()
def start(): # Exchange object for event stream api logger.info('Starting BigchainDB') exchange = Exchange() # start the web api app_server = server.create_server( settings=bigchaindb.config['server'], log_config=bigchaindb.config['log'], bigchaindb_factory=BigchainDB) p_webapi = Process(name='bigchaindb_webapi', target=app_server.run, daemon=True) p_webapi.start() # start message logger.info(BANNER.format(bigchaindb.config['server']['bind'])) # start websocket server p_websocket_server = Process(name='bigchaindb_ws', target=websocket_server.start, daemon=True, args=(exchange.get_subscriber_queue(EventTypes.BLOCK_VALID),)) p_websocket_server.start() # connect to tendermint event stream p_websocket_client = Process(name='bigchaindb_ws_to_tendermint', target=event_stream.start, daemon=True, args=(exchange.get_publisher_queue(),)) p_websocket_client.start() p_exchange = Process(name='bigchaindb_exchange', target=exchange.run, daemon=True) p_exchange.start() # We need to import this after spawning the web server # because import ABCIServer will monkeypatch all sockets # for gevent. from abci import ABCIServer setproctitle.setproctitle('bigchaindb') # Start the ABCIServer app = ABCIServer(app=App()) app.run()
help='Path to dataset') parser.add_argument('-device', type=str, default="CPU", help='Device') parser.add_argument('-config', type=str, default=None, help='config') args = parser.parse_args() if args.config is None: exit("No config.ini found.") con = Configer(args.config) os.environ["DATASET"] = con.trainer.get_dataset() # newsender = sender(log, url_="http://node0:26657") newsender = sender(log, url_=con.bcfl.get_sender()) # newdb = moddb("ipfs") newdb = moddb(con.bcfl.get_db()) newagg = aggregator(log, con, newdb, newsender) # newtrain = trainer(log, args.dataset, newdb, newsender, devices=args.device) newtrain = trainer(log, con, newdb, newsender) newcontroller = State_controller(log, newtrain, newagg, con.agg.get_threshold()) # Create the app # app = ABCIServer(app=SimpleBCFL(newcontroller), port=args.p) app = ABCIServer(app=SimpleBCFL(newcontroller), port=con.bcfl.get_app_port()) # Run it app.run()
def run(self): """ Run the app in the py-abci server """ server = ABCIServer(app=self) server.run()