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

Function connect

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

Source from the content-addressed store, hash-verified

191 wait_for_grpc_start(l1)
192
193 def connect(node):
194 p = Path(node.daemon.lightning_dir) / TEST_NETWORK
195 cert, key, ca = [f.open('rb').read() for f in [
196 p / 'client.pem',
197 p / 'client-key.pem',
198 p / "ca.pem"]]
199
200 creds = grpc.ssl_channel_credentials(
201 root_certificates=ca,
202 private_key=key,
203 certificate_chain=cert,
204 )
205
206 channel = grpc.secure_channel(
207 f"localhost:{grpc_port}",
208 creds,
209 options=(('grpc.ssl_target_name_override', 'cln'),)
210 )
211 return nodegrpc.NodeStub(channel)
212
213 stub = connect(l1)
214 # This should work, it's the correct node

Callers 3

test_grpc_wrong_authFunction · 0.70
handle_initFunction · 0.50
mainFunction · 0.50

Calls 2

openMethod · 0.80
readMethod · 0.45

Tested by

no test coverage detected