forked from LBRYCommunity/lbry-sdk
minor
This commit is contained in:
parent
e1c33dccab
commit
336a0f6ae1
4 changed files with 16 additions and 1 deletions
|
@ -380,6 +380,10 @@ def support_filter_kwargs(
|
||||||
|
|
||||||
|
|
||||||
class API:
|
class API:
|
||||||
|
"""
|
||||||
|
The high-level interface for the Service (either wallet server or client)
|
||||||
|
This is hte "public" api, for CLI and stuff.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, service: Service):
|
def __init__(self, service: Service):
|
||||||
self.service = service
|
self.service = service
|
||||||
|
|
|
@ -19,6 +19,11 @@ class BlockEvent(NamedTuple):
|
||||||
|
|
||||||
|
|
||||||
class Sync:
|
class Sync:
|
||||||
|
"""
|
||||||
|
Maintains local state in sync with some upstream source of truth.
|
||||||
|
Client stays synced with wallet server
|
||||||
|
Server stays synced with lbrycrd
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, ledger: Ledger, db: Database):
|
def __init__(self, ledger: Ledger, db: Database):
|
||||||
self.ledger = ledger
|
self.ledger = ledger
|
||||||
|
@ -50,6 +55,7 @@ class Sync:
|
||||||
class Service:
|
class Service:
|
||||||
"""
|
"""
|
||||||
Base class for light client and full node LBRY service implementations.
|
Base class for light client and full node LBRY service implementations.
|
||||||
|
This is the programmatic api (as compared to API)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
sync: Sync
|
sync: Sync
|
||||||
|
|
|
@ -68,7 +68,10 @@ class WebSocketManager(WebSocketResponse):
|
||||||
|
|
||||||
|
|
||||||
class Daemon:
|
class Daemon:
|
||||||
|
"""
|
||||||
|
Mostly connects API to aiohttp stuff.
|
||||||
|
Handles starting and stopping API
|
||||||
|
"""
|
||||||
def __init__(self, service: Service, console: Console):
|
def __init__(self, service: Service, console: Console):
|
||||||
self.service = service
|
self.service = service
|
||||||
self.conf = service.conf
|
self.conf = service.conf
|
||||||
|
|
|
@ -12,6 +12,8 @@ log = logging.getLogger(__name__)
|
||||||
|
|
||||||
class LightClient(Service):
|
class LightClient(Service):
|
||||||
|
|
||||||
|
sync: SPVSync
|
||||||
|
|
||||||
def __init__(self, ledger: Ledger):
|
def __init__(self, ledger: Ledger):
|
||||||
super().__init__(ledger)
|
super().__init__(ledger)
|
||||||
self.client = Client(Config().api_connection_url)
|
self.client = Client(Config().api_connection_url)
|
||||||
|
|
Loading…
Reference in a new issue