basic interface modeled on go repo
This commit is contained in:
parent
4e0fbf0470
commit
0d05c1cd1b
14
libp2p/discovery/advertiser_interface.py
Normal file
14
libp2p/discovery/advertiser_interface.py
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
|
class IDiscoverer(ABC):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def advertise(self, service):
|
||||||
|
"""
|
||||||
|
Advertise providing a specific service to the network
|
||||||
|
:param service: service that you provide
|
||||||
|
:raise Exception: network error
|
||||||
|
"""
|
16
libp2p/discovery/discoverer_interface.py
Normal file
16
libp2p/discovery/discoverer_interface.py
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
|
|
||||||
|
|
||||||
|
class IDiscoverer(ABC):
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
@abstractmethod
|
||||||
|
def find_peers(self, service):
|
||||||
|
"""
|
||||||
|
Find peers on the networking providing a particular service
|
||||||
|
:param service: service that peers must provide
|
||||||
|
:return: peerstore containing found peers on the network
|
||||||
|
:raise Exception: network error
|
||||||
|
"""
|
Loading…
Reference in New Issue
Block a user