Skip to content

Using gossip_store in tests #243

Description

@gijswijs

I am trying to lift gossip messages out of gossip_store using the pyln-testing library.

This is my initial setup

# Create two nodes
opts = [{}, {}]
alice, bob = node_factory.get_nodes(2, opts=opts)

# Open Channel
alice.openchannel(bob, capacity=10**6)

# Now wait for gossip to settle and alice to learn the topology
wait_for(lambda: len(alice.rpc.listchannels()['channels']) == 2)

I then open the gossip_store with open('{}regtest/gossip_store'.format(alice.daemon.lightning_dir), 'rb') as f: and parse it similar to what the Historian plugin does with gossipd.py

But it never yields anything it can parse. It always just returns:

Exception parsing gossip message: No parser registered for type 4104
Exception parsing gossip message: No parser registered for type 4102
Exception parsing gossip message: No parser registered for type 4102

It does work if I run the plugin registered with a node, but with the pyln-testing library I can't seem to get it to work.
My development process would be much quicker if I can test it with pyln-testing instead of stopping and starting a plugin over and over again with a running node after each change in my code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions