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

Function connect

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

Source from the content-addressed store, hash-verified

412 wait_for_grpc_start(l1)
413
414 def connect(node):
415 p = Path(node.daemon.lightning_dir) / TEST_NETWORK
416 cert, key, ca = [f.read_bytes() for f in [
417 p / 'client.pem',
418 p / 'client-key.pem',
419 p / "ca.pem"]]
420
421 creds = grpc.ssl_channel_credentials(
422 root_certificates=ca,
423 private_key=key,
424 certificate_chain=cert,
425 )
426
427 channel = grpc.secure_channel(
428 f"localhost:{node.grpc_port}",
429 creds,
430 options=(('grpc.ssl_target_name_override', 'cln'),)
431 )
432 return clnpb.NodeStub(channel)
433
434 stub = connect(l1)
435 # 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