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)
| 132 | |
| 133 | |
| 134 | def 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 | |
| 154 | def test_list_methods(node_factory): |
no test coverage detected