koi_net.interfaces.network

Classes

KoiNetworkConfig(**data)

NetworkConfigProvider(config_schema, root_dir)

NetworkInterface()

class koi_net.interfaces.network.KoiNetworkConfig(**data)[source]

Bases: BaseModel

Parameters:
  • first_contact (str | None)

  • nodes (dict[str, str])

first_contact: str | None
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

nodes: dict[str, str]
class koi_net.interfaces.network.NetworkConfigProvider(config_schema, root_dir)[source]

Bases: ConfigProvider

class koi_net.interfaces.network.NetworkInterface[source]

Bases: object

add_node(node)[source]
Parameters:

node (NodeInterface)

apply_first_contact(source, target)[source]
Parameters:
config: KoiNetworkConfig | NetworkConfigProvider
get_first_contact()[source]
load_nodes()[source]
Return type:

list[NodeInterface]

nodes: list[NodeInterface]
remove_node(node)[source]
Parameters:

node (NodeInterface)

resolve_node(name)[source]
Return type:

NodeInterface | None

Parameters:

name (str)

run()[source]
set_first_contact(fc_node)[source]
Parameters:

fc_node (NodeInterface)

start(block=True)[source]
Parameters:

block (bool)

stop(block=True)[source]
Parameters:

block (bool)

sync()[source]
unset_first_contact(fc_node)[source]
Parameters:

fc_node (NodeInterface)

wipe_cache()[source]
wipe_config()[source]
wipe_logs()[source]