ddht
ddht copied to clipboard
Add support for stream find nodes to Alexandria client / network
What was wrong?
Support for stream_find_nodes
was recently added to v5_1
network & client. This api should be implemented for the Alexandria client and network.
How can it be fixed?
From https://github.com/ethereum/ddht/pull/263#discussion_r539430526
Think it's going to be a little complicated to do it cleanly because we can expose a common subscribe(...) API but they use different message types for their FindNodes messages which makes a common implementation a bit more complex but doable.
First step is going to be proxying the subscription API so that it can be accessed directly from NetworkAPI.subscribe(...) (which under the hood simply proxies to the dispatcher).
Next you'll have to adjust this function to take the type of the FindNodesMessage.
And then you'll still have to deal with the fact that the messages are shaped differently and so you won't be able to access their payloads the same way... icky.