Skip to content

orderbook_watcher.config

orderbook_watcher.config

Configuration management using unified JoinMarket settings.

Classes

Functions

get_directory_nodes(directory_nodes: str) -> list[tuple[str, int]]

Parse directory nodes string into list of (host, port) tuples.

Source code in orderbook_watcher/src/orderbook_watcher/config.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
def get_directory_nodes(directory_nodes: str) -> list[tuple[str, int]]:
    """Parse directory nodes string into list of (host, port) tuples."""
    if not directory_nodes:
        return []
    nodes = []
    for node in directory_nodes.split(","):
        node = node.strip()
        if not node:
            continue
        if ":" in node:
            host, port_str = node.rsplit(":", 1)
            nodes.append((host, int(port_str)))
        else:
            nodes.append((node, 5222))
    return nodes

get_orderbook_watcher_settings() -> OrderbookWatcherSettings

Get orderbook watcher settings from unified config.

Source code in orderbook_watcher/src/orderbook_watcher/config.py
 8
 9
10
11
def get_orderbook_watcher_settings() -> OrderbookWatcherSettings:
    """Get orderbook watcher settings from unified config."""
    settings = get_settings()
    return settings.orderbook_watcher