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

Function start_node_with_clnrest

tests/test_clnrest.py:134–151  ·  view source on GitHub ↗

Start a node with the clnrest plugin, whose options are the default options. Return: - the node, - the base url and - the certificate authority path used for the self-signed certificates.

(node_factory, plugin=None)

Source from the content-addressed store, hash-verified

132
133
134def start_node_with_clnrest(node_factory, plugin=None):
135 """Start a node with the clnrest plugin, whose options are the default options.
136 Return:
137 - the node,
138 - the base url and
139 - the certificate authority path used for the self-signed certificates."""
140 rest_port = str(node_factory.get_unused_port())
141 rest_certs = node_factory.directory + '/clnrest-certs'
142 options = {'clnrest-port': rest_port, 'clnrest-certs': rest_certs}
143 if plugin is not None:
144 options['plugin'] = plugin
145 l1 = node_factory.get_node(options=options)
146 base_url = 'https://127.0.0.1:' + rest_port
147 # This might happen really early!
148 l1.daemon.logsearch_start = 0
149 l1.daemon.wait_for_log(r'plugin-clnrest: REST server running at ' + base_url)
150 ca_cert = Path(rest_certs) / 'ca.pem'
151 return l1, base_url, ca_cert
152
153
154def test_list_methods(node_factory):

Callers 15

test_list_methodsFunction · 0.85
test_unknown_methodFunction · 0.85
test_rpc_methodFunction · 0.85
test_large_responseFunction · 0.85
test_websocket_no_runeFunction · 0.85
test_http_headersFunction · 0.85

Calls 3

get_unused_portMethod · 0.80
wait_for_logMethod · 0.80
get_nodeMethod · 0.45

Tested by

no test coverage detected