Anoma.Node.Transport.NetworkRegister (Anoma v0.34.0)

I am the network registry.

The single Network Registry engine instance maintains a database of NodeAdvert and TopicAdvert messages that arrive from the network on each node. For each known node and topic it spawns a Router Engine or a Pub/Sub Topic Engine instance, respectively.

https://specs.anoma.net/main/arch/node/engines/net_registry.html

Summary

Types

t()

I am the state of Anoma.Node.NetworkRegistry.

Functions

I advertise to the given remote node, using the information I have about that node in my register.

Returns a specification to start this module under a supervisor.

Given a node id, I lookup all the information I have about this node.

Process a node advertisement.

Types

t()

@type t() :: %Anoma.Node.Transport.NetworkRegister{
  node_config: map(),
  node_id: String.t(),
  nodes: node_map()
}

I am the state of Anoma.Node.NetworkRegistry.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

dump_register(node_id)

@spec dump_register(String.t()) :: any()

lookup(node_id, remote_node_id)

@spec lookup(String.t(), String.t()) :: map() | nil

Given a node id, I lookup all the information I have about this node.

node_advert(node_id, remote_node_id, advert)

@spec node_advert(String.t(), String.t(), map()) :: :ok

Process a node advertisement.

A self-signed node advertisement contains the node's cryptographic identity and transport addresses. https://specs.anoma.net/main/arch/node/engines/net_registry_messages.html#examplerequest-examplereply

start_link(args \\ [])

@spec start_link(startup_options()) :: GenServer.on_start()

susbcribe_to(node_id, remote_node_id, topic)