def main(args=None): conf.initialize_settings() parser = argparse.ArgumentParser() parser.add_argument('--limit', type=int) parser.add_argument('--download', action='store_true', help='Set flag to also download each sd_blob and report on success') args = parser.parse_args(args) log_support.configure_console() log_support.configure_twisted() # make a fresh dir or else we will include blobs that we've # already downloaded but might not otherwise be available. db_dir = tempfile.mkdtemp() try: blob_dir = os.path.join(db_dir, 'blobfiles') os.makedirs(blob_dir) storage = Wallet.InMemoryStorage() wallet = Wallet.LBRYumWallet(storage) session = Session.Session( 0, db_dir=db_dir, lbryid=utils.generate_id(), blob_dir=blob_dir, dht_node_port=4444, known_dht_nodes=conf.settings['known_dht_nodes'], peer_port=3333, use_upnp=False, wallet=wallet ) api = analytics.Api.new_instance() run(args, session, api) reactor.run() finally: shutil.rmtree(db_dir)
def main(args=None): conf.initialize_settings() parser = argparse.ArgumentParser() parser.add_argument('--limit', type=int) parser.add_argument('--download', action='store_true', help='Set flag to also download each sd_blob and report on success') args = parser.parse_args(args) log_support.configure_console() log_support.configure_twisted() # make a fresh dir or else we will include blobs that we've # already downloaded but might not otherwise be available. db_dir = tempfile.mkdtemp() try: blob_dir = os.path.join(db_dir, 'blobfiles') os.makedirs(blob_dir) storage = Wallet.InMemoryStorage() wallet = Wallet.LBRYumWallet(storage) session = Session.Session( 0, db_dir=db_dir, lbryid=utils.generate_id(), blob_dir=blob_dir, dht_node_port=4444, known_dht_nodes=conf.settings['known_dht_nodes'], peer_port=3333, use_upnp=False, wallet=wallet ) api = analytics.Api.new_instance() run(args, session, api) reactor.run() finally: shutil.rmtree(db_dir)
def main(args=None): conf.initialize_settings() parser = argparse.ArgumentParser() parser.add_argument('peer') parser.add_argument('blob_hash') parser.add_argument('--timeout', type=int, default=30) args = parser.parse_args(args) log_support.configure_console(level='DEBUG') log_support.configure_twisted() if ":" in str(args.peer): host, port = str(args.peer).strip().split(":") else: host = args.peer port = 3333 d = download_it(Peer.Peer(host, int(port)), args.timeout, args.blob_hash) d.addErrback(log.exception) d.addBoth(lambda _: reactor.callLater(0, reactor.stop)) reactor.run()
def main(): log_support.configure_console(level='DEBUG') log_support.configure_twisted() reactor.callLater(0, connect, port=10001) log.info("Running reactor") reactor.run()
def main(): log_support.configure_console(level='DEBUG') log_support.configure_twisted() reactor.callLater(0, connect, port=10001) log.info("Running reactor") reactor.run()