Documentation ¶
Index ¶
- Variables
- func CheckAuthSetsMatch(caller string, e *Elections, s *state.State)
- func MaxIdx(priority []interfaces.IHash) (idx int)
- func Order(servers []interfaces.IServer, dbheight int, minute int, serverIdx int) (priority []interfaces.IHash)
- func Run(s *state.State)
- type Elections
- func (e *Elections) AddAuditServer(server interfaces.IServer) int
- func (e *Elections) AddFederatedServer(server interfaces.IServer) int
- func (e *Elections) AddSigs(round int, sigs []interfaces.IHash)
- func (e *Elections) AuditAdapterIndex(server interfaces.IHash) int
- func (e *Elections) AuditIndex(server interfaces.IHash) int
- func (e *Elections) AuditPriority() int
- func (e *Elections) ComparisonMinute() int
- func (e *Elections) FeedBackStr(v string, fed bool, index int) string
- func (e *Elections) GetAdapter() interfaces.IElectionAdapter
- func (e *Elections) GetAudServerIndex(server interfaces.IServer) int
- func (e *Elections) GetAuditServers() []interfaces.IServer
- func (e *Elections) GetElecting() int
- func (e *Elections) GetFedID() interfaces.IHash
- func (e *Elections) GetFedServerIndex(server interfaces.IServer) int
- func (e *Elections) GetFederatedServers() []interfaces.IServer
- func (e *Elections) GetRound() []int
- func (e *Elections) GetVMIndex() int
- func (e *Elections) IsSafeToReplaceFed(chainID interfaces.IHash) bool
- func (e *Elections) LeaderIndex(server interfaces.IHash) int
- func (e *Elections) LogMessage(logName string, comment string, msg interfaces.IMsg)
- func (e *Elections) LogPrintLeaders(log string)
- func (e *Elections) LogPrintf(logName string, format string, more ...interface{})
- func (e *Elections) NewFeedback()
- func (e *Elections) Print()
- func (e *Elections) ProcessWaiting()
- func (e *Elections) RemoveAuditServer(server interfaces.IServer)
- func (e *Elections) RemoveFederatedServer(server interfaces.IServer)
- func (e *Elections) SetElections3()
- func (e *Elections) Sort(serv []interfaces.IServer) bool
- func (e *Elections) String() string
- type FaultId
Constants ¶
This section is empty.
Variables ¶
View Source
var FaultTimeout int = 60 // This value only lasts till the command line is parse which will set it.
View Source
var RoundTimeout int = 20 // This value only lasts till the command line is parse which will set it.
Functions ¶
func CheckAuthSetsMatch ¶
Check that the process list and Election Authority Sets match
func MaxIdx ¶
func MaxIdx(priority []interfaces.IHash) (idx int)
Returns the index of the maximum priority entry
func Order ¶
func Order(servers []interfaces.IServer, dbheight int, minute int, serverIdx int) (priority []interfaces.IHash)
Creates an order for all servers by using a certain hash function. The list of unordered hashes (in the same order as the slice of servers) is returned.
Types ¶
type Elections ¶
type Elections struct { FedID interfaces.IHash Name string Sync []bool // List of servers that have Synced Federated []interfaces.IServer Audit []interfaces.IServer FPriority []interfaces.IHash APriority []interfaces.IHash DBHeight int // Height of this election SigType bool // False for dbsig, true for EOM Minute int // Minute of this election (-1 for a DBSig) VMIndex int // VMIndex of this election Msgs []interfaces.IMsg // Messages we are collecting in this election. Look here for what's missing. Input interfaces.IQueue Round []int Electing int // This is the federated Server index that we are looking to replace State interfaces.IState VName string Msg interfaces.IMsg // The missing message as supplied by the volunteer Ack interfaces.IMsg // The missing ack for the message as supplied by the volunteer Sigs [][]interfaces.IHash // Signatures from the Federated Servers for a given round. Adapter interfaces.IElectionAdapter // Timeout period before we start the election Timeout time.Duration // Timeout for the next audit to volunteer RoundTimeout time.Duration FaultId atomic.AtomicInt // Incremented every time we launch a new timeout // Messages that are not valid. They can be processed when an election finishes Waiting chan interfaces.IElectionMsg // contains filtered or unexported fields }
func (*Elections) AddAuditServer ¶
func (e *Elections) AddAuditServer(server interfaces.IServer) int
func (*Elections) AddFederatedServer ¶
func (e *Elections) AddFederatedServer(server interfaces.IServer) int
func (*Elections) AddSigs ¶
func (e *Elections) AddSigs(round int, sigs []interfaces.IHash)
Add the given sig list to the list of signatures for the given round.
func (*Elections) AuditAdapterIndex ¶
func (e *Elections) AuditAdapterIndex(server interfaces.IHash) int
func (*Elections) AuditIndex ¶
func (e *Elections) AuditIndex(server interfaces.IHash) int
Returns the index of the given server. -1 if it isn't a Audit Server
func (*Elections) AuditPriority ¶
func (*Elections) ComparisonMinute ¶
func (*Elections) FeedBackStr ¶
func (*Elections) GetAdapter ¶
func (e *Elections) GetAdapter() interfaces.IElectionAdapter
func (*Elections) GetAudServerIndex ¶
func (e *Elections) GetAudServerIndex(server interfaces.IServer) int
func (*Elections) GetAuditServers ¶
func (e *Elections) GetAuditServers() []interfaces.IServer
func (*Elections) GetElecting ¶
func (*Elections) GetFedID ¶
func (e *Elections) GetFedID() interfaces.IHash
func (*Elections) GetFedServerIndex ¶
func (e *Elections) GetFedServerIndex(server interfaces.IServer) int
func (*Elections) GetFederatedServers ¶
func (e *Elections) GetFederatedServers() []interfaces.IServer
func (*Elections) GetVMIndex ¶
func (*Elections) IsSafeToReplaceFed ¶
func (e *Elections) IsSafeToReplaceFed(chainID interfaces.IHash) bool
func (*Elections) LeaderIndex ¶
func (e *Elections) LeaderIndex(server interfaces.IHash) int
Returns the index of the given server. -1 if it isn't a Federated Server
func (*Elections) LogMessage ¶
func (e *Elections) LogMessage(logName string, comment string, msg interfaces.IMsg)
func (*Elections) LogPrintLeaders ¶
func (*Elections) NewFeedback ¶
func (e *Elections) NewFeedback()
func (*Elections) ProcessWaiting ¶
func (e *Elections) ProcessWaiting()
ProcessWaiting drains all waiting messages into the input
func (*Elections) RemoveAuditServer ¶
func (e *Elections) RemoveAuditServer(server interfaces.IServer)
func (*Elections) RemoveFederatedServer ¶
func (e *Elections) RemoveFederatedServer(server interfaces.IServer)
func (*Elections) SetElections3 ¶
func (e *Elections) SetElections3()
Click to show internal directories.
Click to hide internal directories.