Ejemplo n.º 1
0
 def __init__(self, tx_queue):
     self.callbacks = defaultdict(list)
     self.lnwatcher = None
     self.interface = None
     user_config = {}
     user_dir = tempfile.mkdtemp(prefix="electrum-lnpeer-test-")
     self.config = simple_config.SimpleConfig(user_config, read_user_dir_function=lambda: user_dir)
     self.asyncio_loop = asyncio.get_event_loop()
     self.channel_db = ChannelDB(self)
     self.path_finder = LNPathFinder(self.channel_db)
     self.tx_queue = tx_queue
Ejemplo n.º 2
0
 def start(self):
     self.logger.info("start")
     user_config = {
         "auto_connect": False,
         "oneserver": True,
         "server": "localhost:" + str(self.electrumx.tcp_port) + ":t",
         "request_initial_sync": False,
         "lightning_listen": "127.0.0.1:" + str(self.port),
     }
     config = simple_config.SimpleConfig(
         user_config, read_user_dir_function=lambda: self.directory)
     constants.set_regtest()
     self.actual = Daemon(config)
     assert self.actual.network.asyncio_loop.is_running()
     wallet_path = self.actual.cmd_runner.create(segwit=True)['path']
     storage = WalletStorage(wallet_path)
     wallet = Wallet(storage)
     wallet.start_network(self.actual.network)
     self.actual.add_wallet(wallet)