nodes

The field nodes contains a list of nodes for the scenario. Each node must be given a unique name and can be configured to have a baker and accuser associated.

Info

Mitten will automatically start (and stop, after execution) the network with all the bakers and accusers.

Each node is a value of the type node:

#![allow(unused)]
fn main() {
type node = {
  name : name;
  baking : bool;
  accusing : bool;
  drift : drift;
}
}

Nodes (with their respective baker and accuser) can be made to have a clock drift for simulation purposes. This is useful for instance to test how the network behaves, in particular how the consensus evolves in the presence of nodes which do not have the same clock (which happens in practice).

#![allow(unused)]
fn main() {
type drift = {
  add : float option;
  mul : float option;
}
}

The time for a node with a clock drift is an affine function of the real time (the one on the machine which runs ) :

For instance, a node whose drift is set to

#![allow(unused)]
fn main() {
{ add = Some (- 1.0); mul = Some 1.01 }
}

will have a clock which is initially 1 second early, but whose time passes 1% slower (i.e. the node will "loose" one second every hundred seconds).

Tip

A drift of nodrift = { add = None; mul = None } is functionally equivalent to { add = Some 0.0; mul = Some 1.0 } but the system calls will not be intercepted by libfaketime.

Info

To simulate clock drifts, you need to have libfaketime installed on your system.