MCPcopy Create free account
hub / github.com/ElementsProject/lightning / connect

Function connect

tests/test_cln_rs.py:250–268  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

248 wait_for_grpc_start(l1)
249
250 def connect(node):
251 p = Path(node.daemon.lightning_dir) / TEST_NETWORK
252 cert, key, ca = [f.read_bytes() for f in [
253 p / 'client.pem',
254 p / 'client-key.pem',
255 p / "ca.pem"]]
256
257 creds = grpc.ssl_channel_credentials(
258 root_certificates=ca,
259 private_key=key,
260 certificate_chain=cert,
261 )
262
263 channel = grpc.secure_channel(
264 f"localhost:{node.grpc_port}",
265 creds,
266 options=(('grpc.ssl_target_name_override', 'cln'),)
267 )
268 return clnpb.NodeStub(channel)
269
270 stub = connect(l1)
271 # This should work, it's the correct node

Callers 3

test_grpc_wrong_authFunction · 0.70
rpc_openFunction · 0.50
mainFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected