add routing interfaces

This commit is contained in:
Christophe de Carvalho
2019-03-26 20:44:01 +01:00
parent 2d1b9a03d1
commit c5289952ee
4 changed files with 130 additions and 0 deletions

View File

@ -0,0 +1,19 @@
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.
"""
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