mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2026-02-12 16:10:57 +00:00
refactored routedhost into router passed to swarm
This commit is contained in:
21
libp2p/routing/kademlia/kademlia_content_router.py
Normal file
21
libp2p/routing/kademlia/kademlia_content_router.py
Normal file
@ -0,0 +1,21 @@
|
||||
from libp2p.routing.interfaces import IContentRouting
|
||||
|
||||
|
||||
class KadmeliaContentRouter(IContentRouting):
|
||||
|
||||
def provide(self, cid, announce=True):
|
||||
"""
|
||||
Provide adds the given cid to the content routing system. If announce is True,
|
||||
it also announces it, otherwise it is just kept in the local
|
||||
accounting of which objects are being provided.
|
||||
"""
|
||||
# the DHT finds the closest peers to `key` using the `FIND_NODE` RPC
|
||||
# then sends a `ADD_PROVIDER` RPC with its own `PeerInfo` to each of these peers.
|
||||
pass
|
||||
|
||||
def find_provider_iter(self, cid, count):
|
||||
"""
|
||||
Search for peers who are able to provide a given key
|
||||
returns an iterator of peer.PeerInfo
|
||||
"""
|
||||
pass
|
||||
Reference in New Issue
Block a user