(node)
| 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 |
no test coverage detected