mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
add port argument in connect, add getpeer method for test convenience
This commit is contained in:
parent
67dbe71dfa
commit
bdcf38442b
@ -214,12 +214,13 @@ class LightningRpc(UnixDomainSocketRpc):
|
||||
"""
|
||||
return self._call("listpayments")
|
||||
|
||||
def connect(self, peer_id, host=None):
|
||||
def connect(self, peer_id, host=None, port=None):
|
||||
"""
|
||||
Connect to {peer_id} at {host} (which can end in ':port' if not default)
|
||||
Connect to {peer_id} at {host} and {port}
|
||||
"""
|
||||
args = [peer_id]
|
||||
host is not None and args.append(host)
|
||||
host and args.append(host)
|
||||
port and args.append(port)
|
||||
return self._call("connect", args=args)
|
||||
|
||||
def listpeers(self, peer_id=None, logs=None):
|
||||
@ -230,6 +231,15 @@ class LightningRpc(UnixDomainSocketRpc):
|
||||
logs is not None and args.append(logs)
|
||||
return self._call("listpeers", args=args)
|
||||
|
||||
def getpeer(self, peer_id, logs=None):
|
||||
"""
|
||||
Show peer with {peer_id}, if {level} is set, include {log}s
|
||||
"""
|
||||
args = [peer_id]
|
||||
logs is not None and args.append(logs)
|
||||
res = self.listpeers(peer_id, logs)
|
||||
return res.get('peers') and res['peers'][0]
|
||||
|
||||
def fundchannel(self, peer_id, satoshi):
|
||||
"""
|
||||
Fund channel with {id} using {satoshi} satoshis"
|
||||
|
Loading…
Reference in New Issue
Block a user