Elections
Table of contents
Run
Elections help factomd determine the set of servers that will belong in the Federated Server Pool. As discussed in the Factom Whitepaper, if a Federated Server faults, an Audit server will take its place. The process of elections makes this happen.
Run()
creates a new Election
and connects the ElectionQueue
from State into the Election
. It starts a nonterminating loop and calls BlockingDequeue
on the aforementioned ElectionQueue
. This will block until an election message arrives. It will be an IMsg
asserted to be an IElectionMsg
.
The Election Message
The Election message has two election-specific functions: ElectionProcess
and ElectionValidate
. Different types of elections messages
will execute different versions of those two messages.
To see an inventory of types of elections messages and their origins, see the “Election Messages” post of Who’s “Explanation of Messages (IMsg)” thread. You can see in the directory linked in the last paragraph the validation and process functions that are called.