Network provides access to a test gossip network of nodes.
NewNetwork creates nodeCount gossip nodes.
CreateNode creates a simulation node and starts an RPC server for it.
GetNodeFromID returns the simulation node associated with provided node ID, or nil if there is no such node.
RunUntilFullyConnected blocks until the gossip network has received gossip from every other node in the network. It returns the gossip cycle at which the network became fully connected.
SimulateNetwork runs until the simCallback returns false.
At each cycle, every node gossips a key equal to its address (unique) with the cycle as the value. The received cycle value can be used to determine the aging of information between any two nodes in the network.
At each cycle of the simulation, node 0 gossips the sentinel.
The simulation callback receives the cycle and the network as arguments.
StartNode initializes a gossip instance for the simulation node and starts it.
Stop stops all servers and gossip nodes.
Node represents a node used in a Network. It includes information about the node's gossip instance, network address, and underlying server.