basic interface modeled on go repo

This commit is contained in:
Alex Haynes 2019-02-10 18:15:15 -05:00
parent 4e0fbf0470
commit 0d05c1cd1b
3 changed files with 30 additions and 0 deletions

View 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
"""

View 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
"""