Esempio n. 1
0
 def __init__(self, lnd_dir, server):
     os.environ['GRPC_SSL_CIPHER_SUITES'] = 'HIGH+ECDSA'
     lnd_dir = expanduser(lnd_dir)
     combined_credentials = self.get_credentials(lnd_dir)
     channel_options = [
         ('grpc.max_message_length', MESSAGE_SIZE_MB),
         ('grpc.max_receive_message_length', MESSAGE_SIZE_MB)
     ]
     grpc_channel = grpc.secure_channel(server, combined_credentials, channel_options)
     self.stub = lnrpc.LightningStub(grpc_channel)
     self.router_stub = lnrouterrpc.RouterStub(grpc_channel)
     self.graph = None
     self.info = None
     self.channels = None
Esempio n. 2
0
    def __init__(self, lnd_dir, server, network):
        os.environ["GRPC_SSL_CIPHER_SUITES"] = "HIGH+ECDSA"
        if lnd_dir == "_DEFAULT_":
            lnd_dir = "~/.lnd"
            lnd_dir2 = "~/umbrel/lnd"
            lnd_dir = expanduser(lnd_dir)
            lnd_dir2 = expanduser(lnd_dir2)
            if not os.path.isdir(lnd_dir) and os.path.isdir(lnd_dir2):
                lnd_dir = lnd_dir2
        else:
            lnd_dir = expanduser(lnd_dir)

        combined_credentials = self.get_credentials(lnd_dir, network)
        channel_options = [
            ("grpc.max_message_length", MESSAGE_SIZE_MB),
            ("grpc.max_receive_message_length", MESSAGE_SIZE_MB),
        ]
        grpc_channel = grpc.secure_channel(server, combined_credentials,
                                           channel_options)
        self.stub = lnrpc.LightningStub(grpc_channel)
        self.router_stub = lnrouterrpc.RouterStub(grpc_channel)
        self.invoices_stub = invoicesrpc.InvoicesStub(grpc_channel)