py-libp2p/peer/peermetadata_interface.py
ZX 8bcffb67cb WIP CI Build Errors (#76)
* ignore TODO and kademlia

* remove unnecessary pass

* fixed swarm warnings

* fixed peerdata_interface warnings

* fixed peer warnings

* fixed rest of linting errors

* trying to fix last error

* fixed dup errors
2018-11-26 18:24:29 -05:00

25 lines
633 B
Python

from abc import ABC, abstractmethod
class IPeerMetadata(ABC):
def __init__(self):
pass
@abstractmethod
def get(self, peer_id, key):
"""
:param peer_id: peer ID to lookup key for
:param key: key to look up
:return: value at key for given peer
:raise Exception: peer ID not found
"""
@abstractmethod
def put(self, peer_id, key, val):
"""
:param peer_id: peer ID to lookup key for
:param key: key to associate with peer
:param val: value to associated with key
:raise Exception: unsuccessful put
"""