Skip to content

Commit

Permalink
add options to lnd client for max message length
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreRochard committed Jan 12, 2019
1 parent 6d7e0f7 commit a8e15a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
18 changes: 14 additions & 4 deletions node_launcher/node_set/lnd_client/lnd_client.py
Expand Up @@ -31,6 +31,11 @@ def __init__(self, lnd: Lnd = None, lnddir: str = None,
self._lnd_client = None
self._wallet_unlocker = None

self.grpc_options = [
('grpc.max_receive_message_length', 33554432),
('grpc.max_send_message_length', 33554432),
]

def reset(self):
self._lnd_client = None
self._wallet_unlocker = None
Expand All @@ -46,8 +51,11 @@ def lnd_client(self):
self.get_cert_credentials(),
auth_credentials)

grpc_channel = grpc.secure_channel(f'{self.grpc_host}:{self.grpc_port}',
credentials)
grpc_channel = grpc.secure_channel(
f'{self.grpc_host}:{self.grpc_port}',
credentials,
options=self.grpc_options
)
self._lnd_client = lnrpc.LightningStub(grpc_channel)
return self._lnd_client

Expand All @@ -56,8 +64,10 @@ def wallet_unlocker(self):
if self._wallet_unlocker is not None:
return self._wallet_unlocker

grpc_channel = grpc.secure_channel(f'{self.grpc_host}:{self.grpc_port}',
credentials=self.get_cert_credentials())
grpc_channel = grpc.secure_channel(
f'{self.grpc_host}:{self.grpc_port}',
credentials=self.get_cert_credentials()
)
self._wallet_unlocker = lnrpc.WalletUnlockerStub(grpc_channel)
return self._wallet_unlocker

Expand Down
2 changes: 1 addition & 1 deletion tools/channel_balancer.py
Expand Up @@ -317,8 +317,8 @@ def get_google_sheet_data(self):

if __name__ == '__main__':
channel_balancer = ChannelBalancer()
channel_balancer.reconnect()
channel_balancer.get_channels()
# channel_balancer.reconnect()
channel_balancer.get_google_sheet_data()

# response = lnd_client.open_channel(
Expand Down

0 comments on commit a8e15a0

Please sign in to comment.