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

Method get_nodes

contrib/pyln-testing/pyln/testing/utils.py:1424–1452  ·  view source on GitHub ↗

Start a number of nodes in parallel, each with its own options

(self, num_nodes, opts=None)

Source from the content-addressed store, hash-verified

1422 return node_id
1423
1424 def get_nodes(self, num_nodes, opts=None):
1425 """Start a number of nodes in parallel, each with its own options
1426 """
1427 if opts is None:
1428 # No opts were passed in, give some dummy opts
1429 opts = [{} for _ in range(num_nodes)]
1430 elif isinstance(opts, dict):
1431 # A single dict was passed in, so we use these opts for all nodes
1432 opts = [opts] * num_nodes
1433
1434 assert len(opts) == num_nodes
1435
1436 # Only trace one random node's plugins, to avoid OOM.
1437 if SLOW_MACHINE:
1438 valgrind_plugins = [False] * num_nodes
1439 valgrind_plugins[random.randint(0, num_nodes - 1)] = True
1440 else:
1441 valgrind_plugins = [True] * num_nodes
1442
1443 jobs = []
1444 for i in range(num_nodes):
1445 node_opts, cli_opts = self.split_options(opts[i])
1446 jobs.append(self.executor.submit(
1447 self.get_node, options=cli_opts,
1448 node_id=self.get_node_id(), **node_opts,
1449 valgrind_plugins=valgrind_plugins[i]
1450 ))
1451
1452 return [j.result() for j in jobs]
1453
1454 def get_node(self, node_id=None, options=None, dbfile=None,
1455 bkpr_dbfile=None, feerates=(15000, 11000, 7500, 3750),

Callers 15

line_graphMethod · 0.95
test_remote_addrFunction · 0.80
test_connection_movedFunction · 0.80
test_second_channelFunction · 0.80
test_channel_abandonFunction · 0.80
test_remote_disconnectFunction · 0.80
test_v2_openFunction · 0.80
test_funding_cancel_raceFunction · 0.80

Calls 2

split_optionsMethod · 0.95
get_node_idMethod · 0.95

Tested by 15

test_remote_addrFunction · 0.64
test_connection_movedFunction · 0.64
test_second_channelFunction · 0.64
test_channel_abandonFunction · 0.64
test_remote_disconnectFunction · 0.64
test_v2_openFunction · 0.64
test_funding_cancel_raceFunction · 0.64