diff --git a/libp2p/discovery/advertiser_interface.py b/libp2p/discovery/advertiser_interface.py new file mode 100644 index 0000000..01e4405 --- /dev/null +++ b/libp2p/discovery/advertiser_interface.py @@ -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 + """ \ No newline at end of file diff --git a/libp2p/discovery/discoverer_interface.py b/libp2p/discovery/discoverer_interface.py new file mode 100644 index 0000000..e7d11e7 --- /dev/null +++ b/libp2p/discovery/discoverer_interface.py @@ -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 + """ diff --git a/libp2p/discovery/discovery_interface.py b/libp2p/discovery/discovery_interface.py deleted file mode 100644 index e69de29..0000000