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

Function test_create_gossip_mesh

tests/test_misc.py:4342–4383  ·  view source on GitHub ↗

Feel free to modify this test and remove the '@pytest.mark.skip' above. Run it to get a customized gossip store. It fails on purpose, see below. This builds a small mesh l1--l2--l3 | | | l4--l5--l6 | | | l7--l8--l9

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

4340
4341@pytest.mark.skip(reason="Fails by intention for creating test gossip stores")
4342def test_create_gossip_mesh(node_factory, bitcoind):
4343 """
4344 Feel free to modify this test and remove the '@pytest.mark.skip' above.
4345 Run it to get a customized gossip store. It fails on purpose, see below.
4346
4347 This builds a small mesh
4348
4349 l1--l2--l3
4350 | | |
4351 l4--l5--l6
4352 | | |
4353 l7--l8--l9
4354 """
4355 nodes = node_factory.get_nodes(9)
4356 nodeids = [n.info['id'] for n in nodes]
4357
4358 [l1, l2, l3, l4, l5, l6, l7, l8, l9] = nodes
4359 scid12, _ = l1.fundchannel(l2, wait_for_active=False, connect=True)
4360 scid14, _ = l1.fundchannel(l4, wait_for_active=False, connect=True)
4361 scid23, _ = l2.fundchannel(l3, wait_for_active=False, connect=True)
4362 scid25, _ = l2.fundchannel(l5, wait_for_active=False, connect=True)
4363 scid36, _ = l3.fundchannel(l6, wait_for_active=False, connect=True)
4364 scid45, _ = l4.fundchannel(l5, wait_for_active=False, connect=True)
4365 scid47, _ = l4.fundchannel(l7, wait_for_active=False, connect=True)
4366 scid56, _ = l5.fundchannel(l6, wait_for_active=False, connect=True)
4367 scid58, _ = l5.fundchannel(l8, wait_for_active=False, connect=True)
4368 scid69, _ = l6.fundchannel(l9, wait_for_active=False, connect=True)
4369 scid78, _ = l7.fundchannel(l8, wait_for_active=False, connect=True)
4370 scid89, _ = l8.fundchannel(l9, wait_for_active=False, connect=True)
4371 bitcoind.generate_block(10)
4372
4373 scids = [scid12, scid14, scid23, scid25, scid36, scid45, scid47, scid56,
4374 scid58, scid69, scid78, scid89]
4375
4376 # waits for all nodes to have all scids gossip active
4377 for n in nodes:
4378 for scid in scids:
4379 n.wait_channel_active(scid)
4380
4381 print("nodeids", nodeids)
4382 print("scids", scids)
4383 assert False, "Test failed on purpose, grab the gossip store from /tmp/ltests-..."
4384
4385
4386def test_graceful_no_peers(node_factory):

Callers

nothing calls this directly

Calls 4

get_nodesMethod · 0.80
generate_blockMethod · 0.80
wait_channel_activeMethod · 0.80
fundchannelMethod · 0.45

Tested by

no test coverage detected