Example #1
0
def main():
    parser = get_argument_parser()
    args = parser.parse_args()
    coin_class = get_coin_class(args.spvserver)
    logging.basicConfig(level=logging.INFO)
    logging.info('torba.server starting')
    try:
        server = Server(Env(coin_class))
        server.run()
    except Exception:
        traceback.print_exc()
        logging.critical('torba.server terminated abnormally')
    else:
        logging.info('torba.server terminated normally')
Example #2
0
File: node.py Project: shyba/torba
 async def start(self):
     self.data_path = tempfile.mkdtemp()
     conf = {
         'DB_DIRECTORY': self.data_path,
         'DAEMON_URL': 'http://*****:*****@localhost:50001/',
         'REORG_LIMIT': '100',
         'TCP_PORT': '1984'
     }
     os.environ.update(conf)
     self.server = Server(Env(self.coin_class))
     self.server.bp.prefetcher.polling_delay = 0.5
     await self.server.start()
Example #3
0
 async def start(self, blockchain_node: 'BlockchainNode'):
     self.data_path = tempfile.mkdtemp()
     conf = {
         'DB_DIRECTORY': self.data_path,
         'DAEMON_URL': blockchain_node.rpc_url,
         'REORG_LIMIT': '100',
         'HOST': self.hostname,
         'TCP_PORT': str(self.port)
     }
     # TODO: don't use os.environ
     os.environ.update(conf)
     self.server = Server(Env(self.coin_class))
     self.server.mempool.refresh_secs = self.server.bp.prefetcher.polling_delay = 0.5
     await self.server.start()
Example #4
0
 async def start(self, blockchain_node: 'BlockchainNode'):
     self.data_path = tempfile.mkdtemp()
     conf = {
         'DB_DIRECTORY': self.data_path,
         'DAEMON_URL': blockchain_node.rpc_url,
         'REORG_LIMIT': '100',
         'HOST': self.hostname,
         'TCP_PORT': str(self.port),
         'SESSION_TIMEOUT': str(self.session_timeout),
         'MAX_QUERY_WORKERS': '0',
         'INDIVIDUAL_TAG_INDEXES': '',
     }
     # TODO: don't use os.environ
     os.environ.update(conf)
     self.server = Server(Env(self.coin_class))
     self.server.mempool.refresh_secs = self.server.bp.prefetcher.polling_delay = 0.5
     await self.server.start()