messages

package
v6.2.2-rc3+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2019 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AckBalanceHash = true
View Source
var (
	TestRegex *regexp.Regexp
)

Functions

func CheckChainID

func CheckChainID(state interfaces.IState, ExternalIDs [][]byte, msg *RevealEntryMsg) bool

Checks to make sure these External IDs actually produce a ChainID that machtes the Chain ID in the CommitChainMsg

func CheckFileName

func CheckFileName(name string) bool

Check a filename and see if logging is on for that filename If it never ben see then check with the regex. If it has been seen then just look it up in the map assumes traceMutex is locked already

func Cleanup

func Cleanup()

unused -- of.File is written by direct calls to write and not buffered and the os closes the files on exit.

func LogMessage

func LogMessage(name string, note string, msg interfaces.IMsg)

func LogParcel

func LogParcel(name string, note string, msg string)

stringify it in the caller to avoid having to deal with the import loop

func LogPrintf

func LogPrintf(name string, format string, more ...interface{})

func LookupName

func LookupName(s string) string

Look up the hex string in the map of names...

func NewAddServerByHashMsg

func NewAddServerByHashMsg(state interfaces.IState, serverType int, newServerHash interfaces.IHash) interfaces.IMsg

func NewAddServerMsg

func NewAddServerMsg(state interfaces.IState, serverType int) interfaces.IMsg

func NewChangeServerKeyMsg

func NewChangeServerKeyMsg(state interfaces.IState, identityChain interfaces.IHash, adminChange byte, keyPriority byte, keyType byte, key interfaces.IHash) interfaces.IMsg

func NewDBStateMissing

func NewDBStateMissing(state interfaces.IState, dbheightStart uint32, dbheightEnd uint32) interfaces.IMsg

func NewDataResponse

func NewDataResponse(state interfaces.IState, dataObject interfaces.BinaryMarshallable,
	dataType int,
	dataHash interfaces.IHash) interfaces.IMsg

func NewEnd

func NewEnd(inLen int, start uint32, end uint32) (s uint32, e uint32)

func NewMissingData

func NewMissingData(state interfaces.IState, requestHash interfaces.IHash) interfaces.IMsg

func NewMissingMsgResponse

func NewMissingMsgResponse(state interfaces.IState, msgResponse interfaces.IMsg, ackResponse interfaces.IMsg) interfaces.IMsg

func NewRemoveServerMsg

func NewRemoveServerMsg(state interfaces.IState, chainId interfaces.IHash, serverType int) interfaces.IMsg

func StateLogMessage

func StateLogMessage(FactomNodeName string, DBHeight int, CurrentMinute int, logName string, comment string, msg interfaces.IMsg)

Log a message with a state timestamp

func StateLogPrintf

func StateLogPrintf(FactomNodeName string, DBHeight int, CurrentMinute int, logName string, format string, more ...interface{})

Log a printf with a state timestamp

Types

type Ack

type Ack struct {
	msgbase.MessageBase
	Timestamp   interfaces.Timestamp // Timestamp of Ack by Leader
	Salt        [8]byte              // Eight bytes of the salt
	SaltNumber  uint32               // Secret Number used to detect multiple servers with the same ID
	MessageHash interfaces.IHash     // Hash of message acknowledged
	DBHeight    uint32               // Directory Block Height that owns this ack
	Height      uint32               // Height of this ack in this process list
	SerialHash  interfaces.IHash     // Serial hash including previous ack

	DataAreaSize uint64 // Size of the Data Area
	DataArea     []byte // Data Area

	Signature interfaces.IFullSignature

	Response    bool // A response to a missing data request
	BalanceHash interfaces.IHash
	// contains filtered or unexported fields
}

General acknowledge message

func (*Ack) ComputeVMIndex

func (m *Ack) ComputeVMIndex(state interfaces.IState)

Returns true if this is a message for this server to execute as a leader.

func (*Ack) FollowerExecute

func (m *Ack) FollowerExecute(state interfaces.IState)

func (*Ack) GetHash

func (m *Ack) GetHash() (rval interfaces.IHash)

We have to return the hash of the underlying message.

func (*Ack) GetMsgHash

func (m *Ack) GetMsgHash() (rval interfaces.IHash)

func (*Ack) GetRepeatHash

func (m *Ack) GetRepeatHash() (rval interfaces.IHash)

func (*Ack) GetSignature

func (m *Ack) GetSignature() interfaces.IFullSignature

func (*Ack) GetTimestamp

func (m *Ack) GetTimestamp() interfaces.Timestamp

func (*Ack) IsSameAs

func (a *Ack) IsSameAs(b *Ack) bool

func (*Ack) JSONByte

func (e *Ack) JSONByte() ([]byte, error)

func (*Ack) JSONString

func (e *Ack) JSONString() (string, error)

func (*Ack) LeaderExecute

func (m *Ack) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message Leader, follower, do the same thing.

func (*Ack) LogFields

func (m *Ack) LogFields() log.Fields

func (*Ack) MarshalBinary

func (m *Ack) MarshalBinary() (data []byte, err error)

func (*Ack) MarshalForSignature

func (m *Ack) MarshalForSignature() (rval []byte, err error)

func (*Ack) Process

func (e *Ack) Process(dbheight uint32, state interfaces.IState) bool

Acknowledgements do not go into the process list.

func (*Ack) Sign

func (m *Ack) Sign(key interfaces.Signer) error

func (*Ack) String

func (m *Ack) String() string

func (*Ack) Type

func (m *Ack) Type() byte

func (*Ack) UnmarshalBinary

func (m *Ack) UnmarshalBinary(data []byte) error

func (*Ack) UnmarshalBinaryData

func (m *Ack) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*Ack) Validate

func (m *Ack) Validate(s interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

func (*Ack) VerifySignature

func (m *Ack) VerifySignature() (bool, error)

type AddServerMsg

type AddServerMsg struct {
	msgbase.MessageBase
	Timestamp     interfaces.Timestamp // Message Timestamp
	ServerChainID interfaces.IHash     // ChainID of new server
	ServerType    int                  // 0 = Federated, 1 = Audit

	Signature interfaces.IFullSignature
}

func (*AddServerMsg) ComputeVMIndex

func (m *AddServerMsg) ComputeVMIndex(state interfaces.IState)

Returns true if this is a message for this server to execute as a leader.

func (*AddServerMsg) FollowerExecute

func (m *AddServerMsg) FollowerExecute(state interfaces.IState)

func (*AddServerMsg) GetHash

func (m *AddServerMsg) GetHash() (rval interfaces.IHash)

func (*AddServerMsg) GetMsgHash

func (m *AddServerMsg) GetMsgHash() (rval interfaces.IHash)

func (*AddServerMsg) GetRepeatHash

func (m *AddServerMsg) GetRepeatHash() (rval interfaces.IHash)

func (*AddServerMsg) GetSignature

func (m *AddServerMsg) GetSignature() interfaces.IFullSignature

func (*AddServerMsg) GetTimestamp

func (m *AddServerMsg) GetTimestamp() interfaces.Timestamp

func (*AddServerMsg) IsSameAs

func (m *AddServerMsg) IsSameAs(b *AddServerMsg) bool

func (*AddServerMsg) JSONByte

func (e *AddServerMsg) JSONByte() ([]byte, error)

func (*AddServerMsg) JSONString

func (e *AddServerMsg) JSONString() (string, error)

func (*AddServerMsg) LeaderExecute

func (m *AddServerMsg) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*AddServerMsg) LogFields

func (m *AddServerMsg) LogFields() log.Fields

func (*AddServerMsg) MarshalBinary

func (m *AddServerMsg) MarshalBinary() (rval []byte, err error)

func (*AddServerMsg) MarshalForSignature

func (m *AddServerMsg) MarshalForSignature() (rval []byte, err error)

func (*AddServerMsg) Process

func (e *AddServerMsg) Process(dbheight uint32, state interfaces.IState) bool

Acknowledgements do not go into the process list.

func (*AddServerMsg) Sign

func (m *AddServerMsg) Sign(key interfaces.Signer) error

func (*AddServerMsg) String

func (m *AddServerMsg) String() string

func (*AddServerMsg) Type

func (m *AddServerMsg) Type() byte

func (*AddServerMsg) UnmarshalBinary

func (m *AddServerMsg) UnmarshalBinary(data []byte) error

func (*AddServerMsg) UnmarshalBinaryData

func (m *AddServerMsg) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*AddServerMsg) Validate

func (m *AddServerMsg) Validate(state interfaces.IState) int

func (*AddServerMsg) VerifySignature

func (m *AddServerMsg) VerifySignature() (bool, error)

type Bounce

type Bounce struct {
	msgbase.MessageBase
	Name      string
	Number    int32
	Timestamp interfaces.Timestamp
	Stamps    []interfaces.Timestamp
	Data      []byte
	// contains filtered or unexported fields
}

func (*Bounce) AddData

func (m *Bounce) AddData(dataSize int)

func (*Bounce) ComputeVMIndex

func (m *Bounce) ComputeVMIndex(state interfaces.IState)

Returns true if this is a message for this server to execute as a leader.

func (*Bounce) FollowerExecute

func (m *Bounce) FollowerExecute(state interfaces.IState)

func (*Bounce) GetHash

func (m *Bounce) GetHash() (rval interfaces.IHash)

We have to return the hash of the underlying message.

func (*Bounce) GetMsgHash

func (m *Bounce) GetMsgHash() (rval interfaces.IHash)

func (*Bounce) GetRepeatHash

func (m *Bounce) GetRepeatHash() (rval interfaces.IHash)

func (*Bounce) GetSignature

func (m *Bounce) GetSignature() interfaces.IFullSignature

func (*Bounce) GetTimestamp

func (m *Bounce) GetTimestamp() interfaces.Timestamp

func (*Bounce) IsSameAs

func (a *Bounce) IsSameAs(b *Bounce) bool

func (*Bounce) JSONByte

func (e *Bounce) JSONByte() ([]byte, error)

func (*Bounce) JSONString

func (e *Bounce) JSONString() (string, error)

func (*Bounce) LeaderExecute

func (m *Bounce) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message Leader, follower, do the same thing.

func (*Bounce) LogFields

func (m *Bounce) LogFields() log.Fields

func (*Bounce) MarshalBinary

func (m *Bounce) MarshalBinary() (data []byte, err error)

func (*Bounce) MarshalForSignature

func (m *Bounce) MarshalForSignature() (rval []byte, err error)

func (*Bounce) Process

func (e *Bounce) Process(dbheight uint32, state interfaces.IState) bool

Acknowledgements do not go into the process list.

func (*Bounce) Processed

func (e *Bounce) Processed() bool

func (*Bounce) SetValid

func (m *Bounce) SetValid(v int)

func (*Bounce) Sign

func (m *Bounce) Sign(key interfaces.Signer) error

func (*Bounce) SizeOf

func (m *Bounce) SizeOf() int

func (*Bounce) String

func (m *Bounce) String() string

func (*Bounce) Type

func (m *Bounce) Type() byte

func (*Bounce) UnmarshalBinary

func (m *Bounce) UnmarshalBinary(data []byte) error

func (*Bounce) UnmarshalBinaryData

func (m *Bounce) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*Bounce) Validate

func (m *Bounce) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

func (*Bounce) VerifySignature

func (m *Bounce) VerifySignature() (bool, error)

type BounceReply

type BounceReply struct {
	msgbase.MessageBase
	Name      string
	Number    int32
	Timestamp interfaces.Timestamp
	Stamps    []interfaces.Timestamp
	// contains filtered or unexported fields
}

func (*BounceReply) ComputeVMIndex

func (m *BounceReply) ComputeVMIndex(state interfaces.IState)

Returns true if this is a message for this server to execute as a leader.

func (*BounceReply) FollowerExecute

func (m *BounceReply) FollowerExecute(state interfaces.IState)

func (*BounceReply) GetHash

func (m *BounceReply) GetHash() (rval interfaces.IHash)

We have to return the hash of the underlying message.

func (*BounceReply) GetMsgHash

func (m *BounceReply) GetMsgHash() (rval interfaces.IHash)

func (*BounceReply) GetRepeatHash

func (m *BounceReply) GetRepeatHash() (rval interfaces.IHash)

func (*BounceReply) GetSignature

func (m *BounceReply) GetSignature() interfaces.IFullSignature

func (*BounceReply) GetTimestamp

func (m *BounceReply) GetTimestamp() interfaces.Timestamp

func (*BounceReply) IsSameAs

func (a *BounceReply) IsSameAs(b *BounceReply) bool

func (*BounceReply) JSONByte

func (e *BounceReply) JSONByte() ([]byte, error)

func (*BounceReply) JSONString

func (e *BounceReply) JSONString() (string, error)

func (*BounceReply) LeaderExecute

func (m *BounceReply) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message Leader, follower, do the same thing.

func (*BounceReply) LogFields

func (m *BounceReply) LogFields() log.Fields

func (*BounceReply) MarshalBinary

func (m *BounceReply) MarshalBinary() (data []byte, err error)

func (*BounceReply) MarshalForSignature

func (m *BounceReply) MarshalForSignature() (rval []byte, err error)

func (*BounceReply) Process

func (e *BounceReply) Process(dbheight uint32, state interfaces.IState) bool

Acknowledgements do not go into the process list.

func (*BounceReply) Sign

func (m *BounceReply) Sign(key interfaces.Signer) error

func (*BounceReply) SizeOf

func (m *BounceReply) SizeOf() int

func (*BounceReply) String

func (m *BounceReply) String() string

func (*BounceReply) Type

func (m *BounceReply) Type() byte

func (*BounceReply) UnmarshalBinary

func (m *BounceReply) UnmarshalBinary(data []byte) error

func (*BounceReply) UnmarshalBinaryData

func (m *BounceReply) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*BounceReply) Validate

func (m *BounceReply) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

func (*BounceReply) VerifySignature

func (m *BounceReply) VerifySignature() (bool, error)

type ChangeServerKeyMsg

type ChangeServerKeyMsg struct {
	msgbase.MessageBase
	Timestamp        interfaces.Timestamp // Message Timestamp
	IdentityChainID  interfaces.IHash     // ChainID of new server
	AdminBlockChange byte
	KeyType          byte
	KeyPriority      byte
	Key              interfaces.IHash

	Signature interfaces.IFullSignature
}

func (*ChangeServerKeyMsg) ComputeVMIndex

func (m *ChangeServerKeyMsg) ComputeVMIndex(state interfaces.IState)

Returns true if this is a message for this server to execute as a leader.

func (*ChangeServerKeyMsg) FollowerExecute

func (m *ChangeServerKeyMsg) FollowerExecute(state interfaces.IState)

func (*ChangeServerKeyMsg) GetHash

func (m *ChangeServerKeyMsg) GetHash() (rval interfaces.IHash)

func (*ChangeServerKeyMsg) GetMsgHash

func (m *ChangeServerKeyMsg) GetMsgHash() (rval interfaces.IHash)

func (*ChangeServerKeyMsg) GetRepeatHash

func (m *ChangeServerKeyMsg) GetRepeatHash() (rval interfaces.IHash)

func (*ChangeServerKeyMsg) GetSignature

func (m *ChangeServerKeyMsg) GetSignature() interfaces.IFullSignature

func (*ChangeServerKeyMsg) GetTimestamp

func (m *ChangeServerKeyMsg) GetTimestamp() interfaces.Timestamp

func (*ChangeServerKeyMsg) IsSameAs

func (m *ChangeServerKeyMsg) IsSameAs(b *ChangeServerKeyMsg) bool

func (*ChangeServerKeyMsg) JSONByte

func (e *ChangeServerKeyMsg) JSONByte() ([]byte, error)

func (*ChangeServerKeyMsg) JSONString

func (e *ChangeServerKeyMsg) JSONString() (string, error)

func (*ChangeServerKeyMsg) LeaderExecute

func (m *ChangeServerKeyMsg) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*ChangeServerKeyMsg) LogFields

func (m *ChangeServerKeyMsg) LogFields() log.Fields

func (*ChangeServerKeyMsg) MarshalBinary

func (m *ChangeServerKeyMsg) MarshalBinary() (rval []byte, err error)

func (*ChangeServerKeyMsg) MarshalForSignature

func (m *ChangeServerKeyMsg) MarshalForSignature() (rval []byte, err error)

func (*ChangeServerKeyMsg) Process

func (e *ChangeServerKeyMsg) Process(dbheight uint32, state interfaces.IState) bool

Acknowledgements do not go into the process list.

func (*ChangeServerKeyMsg) Sign

func (*ChangeServerKeyMsg) String

func (m *ChangeServerKeyMsg) String() string

func (*ChangeServerKeyMsg) Type

func (m *ChangeServerKeyMsg) Type() byte

func (*ChangeServerKeyMsg) UnmarshalBinary

func (m *ChangeServerKeyMsg) UnmarshalBinary(data []byte) error

func (*ChangeServerKeyMsg) UnmarshalBinaryData

func (m *ChangeServerKeyMsg) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*ChangeServerKeyMsg) Validate

func (m *ChangeServerKeyMsg) Validate(state interfaces.IState) int

func (*ChangeServerKeyMsg) VerifySignature

func (m *ChangeServerKeyMsg) VerifySignature() (bool, error)

type CommitChainMsg

type CommitChainMsg struct {
	msgbase.MessageBase
	CommitChain *entryCreditBlock.CommitChain

	Signature interfaces.IFullSignature
	// contains filtered or unexported fields
}

A placeholder structure for messages

func (*CommitChainMsg) ComputeVMIndex

func (m *CommitChainMsg) ComputeVMIndex(state interfaces.IState)

func (*CommitChainMsg) FollowerExecute

func (m *CommitChainMsg) FollowerExecute(state interfaces.IState)

func (*CommitChainMsg) GetCount

func (m *CommitChainMsg) GetCount() int

func (*CommitChainMsg) GetHash

func (m *CommitChainMsg) GetHash() (rval interfaces.IHash)

func (*CommitChainMsg) GetMsgHash

func (m *CommitChainMsg) GetMsgHash() (rval interfaces.IHash)

func (*CommitChainMsg) GetRepeatHash

func (m *CommitChainMsg) GetRepeatHash() (rval interfaces.IHash)

func (*CommitChainMsg) GetSignature

func (m *CommitChainMsg) GetSignature() interfaces.IFullSignature

func (*CommitChainMsg) GetTimestamp

func (m *CommitChainMsg) GetTimestamp() interfaces.Timestamp

func (*CommitChainMsg) IncCount

func (m *CommitChainMsg) IncCount()

func (*CommitChainMsg) IsSameAs

func (a *CommitChainMsg) IsSameAs(b *CommitChainMsg) bool

func (*CommitChainMsg) JSONByte

func (e *CommitChainMsg) JSONByte() ([]byte, error)

func (*CommitChainMsg) JSONString

func (e *CommitChainMsg) JSONString() (string, error)

func (*CommitChainMsg) LeaderExecute

func (m *CommitChainMsg) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*CommitChainMsg) LogFields

func (m *CommitChainMsg) LogFields() log.Fields

func (*CommitChainMsg) MarshalBinary

func (m *CommitChainMsg) MarshalBinary() (data []byte, err error)

func (*CommitChainMsg) MarshalForSignature

func (m *CommitChainMsg) MarshalForSignature() (data []byte, err error)

func (*CommitChainMsg) Process

func (m *CommitChainMsg) Process(dbheight uint32, state interfaces.IState) bool

func (*CommitChainMsg) SetCount

func (m *CommitChainMsg) SetCount(cnt int)

func (*CommitChainMsg) Sign

func (m *CommitChainMsg) Sign(key interfaces.Signer) error

func (*CommitChainMsg) String

func (m *CommitChainMsg) String() string

func (*CommitChainMsg) Type

func (m *CommitChainMsg) Type() byte

func (*CommitChainMsg) UnmarshalBinary

func (m *CommitChainMsg) UnmarshalBinary(data []byte) error

func (*CommitChainMsg) UnmarshalBinaryData

func (m *CommitChainMsg) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*CommitChainMsg) Validate

func (m *CommitChainMsg) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

func (*CommitChainMsg) VerifySignature

func (m *CommitChainMsg) VerifySignature() (bool, error)

type CommitEntryMsg

type CommitEntryMsg struct {
	msgbase.MessageBase

	CommitEntry *entryCreditBlock.CommitEntry

	Signature interfaces.IFullSignature
	// contains filtered or unexported fields
}

A placeholder structure for messages

func NewCommitEntryMsg

func NewCommitEntryMsg() *CommitEntryMsg

func (*CommitEntryMsg) ComputeVMIndex

func (m *CommitEntryMsg) ComputeVMIndex(state interfaces.IState)

func (*CommitEntryMsg) FollowerExecute

func (m *CommitEntryMsg) FollowerExecute(state interfaces.IState)

func (*CommitEntryMsg) GetCount

func (m *CommitEntryMsg) GetCount() int

func (*CommitEntryMsg) GetHash

func (m *CommitEntryMsg) GetHash() (rval interfaces.IHash)

func (*CommitEntryMsg) GetMsgHash

func (m *CommitEntryMsg) GetMsgHash() (rval interfaces.IHash)

func (*CommitEntryMsg) GetRepeatHash

func (m *CommitEntryMsg) GetRepeatHash() (rval interfaces.IHash)

func (*CommitEntryMsg) GetSignature

func (m *CommitEntryMsg) GetSignature() interfaces.IFullSignature

func (*CommitEntryMsg) GetTimestamp

func (m *CommitEntryMsg) GetTimestamp() interfaces.Timestamp

func (*CommitEntryMsg) IncCount

func (m *CommitEntryMsg) IncCount()

func (*CommitEntryMsg) IsSameAs

func (a *CommitEntryMsg) IsSameAs(b *CommitEntryMsg) bool

func (*CommitEntryMsg) JSONByte

func (e *CommitEntryMsg) JSONByte() ([]byte, error)

func (*CommitEntryMsg) JSONString

func (e *CommitEntryMsg) JSONString() (string, error)

func (*CommitEntryMsg) LeaderExecute

func (m *CommitEntryMsg) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*CommitEntryMsg) LogFields

func (m *CommitEntryMsg) LogFields() log.Fields

func (*CommitEntryMsg) MarshalBinary

func (m *CommitEntryMsg) MarshalBinary() (data []byte, err error)

func (*CommitEntryMsg) MarshalForSignature

func (m *CommitEntryMsg) MarshalForSignature() (data []byte, err error)

func (*CommitEntryMsg) Process

func (m *CommitEntryMsg) Process(dbheight uint32, state interfaces.IState) bool

func (*CommitEntryMsg) SetCount

func (m *CommitEntryMsg) SetCount(cnt int)

func (*CommitEntryMsg) Sign

func (m *CommitEntryMsg) Sign(key interfaces.Signer) error

func (*CommitEntryMsg) String

func (m *CommitEntryMsg) String() string

func (*CommitEntryMsg) Type

func (m *CommitEntryMsg) Type() byte

func (*CommitEntryMsg) UnmarshalBinary

func (m *CommitEntryMsg) UnmarshalBinary(data []byte) error

func (*CommitEntryMsg) UnmarshalBinaryData

func (m *CommitEntryMsg) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*CommitEntryMsg) Validate

func (m *CommitEntryMsg) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

func (*CommitEntryMsg) VerifySignature

func (m *CommitEntryMsg) VerifySignature() (bool, error)

type DBStateMissing

type DBStateMissing struct {
	msgbase.MessageBase
	Timestamp interfaces.Timestamp

	DBHeightStart uint32 // First block missing
	DBHeightEnd   uint32 // Last block missing.

}

func (*DBStateMissing) ComputeVMIndex

func (m *DBStateMissing) ComputeVMIndex(state interfaces.IState)

func (*DBStateMissing) FollowerExecute

func (m *DBStateMissing) FollowerExecute(state interfaces.IState)

func (*DBStateMissing) GetHash

func (m *DBStateMissing) GetHash() (rval interfaces.IHash)

func (*DBStateMissing) GetMsgHash

func (m *DBStateMissing) GetMsgHash() (rval interfaces.IHash)

func (*DBStateMissing) GetRepeatHash

func (m *DBStateMissing) GetRepeatHash() (rval interfaces.IHash)

func (*DBStateMissing) GetTimestamp

func (m *DBStateMissing) GetTimestamp() interfaces.Timestamp

func (*DBStateMissing) IsSameAs

func (a *DBStateMissing) IsSameAs(b *DBStateMissing) bool

func (*DBStateMissing) JSONByte

func (e *DBStateMissing) JSONByte() ([]byte, error)

func (*DBStateMissing) JSONString

func (e *DBStateMissing) JSONString() (string, error)

func (*DBStateMissing) LeaderExecute

func (m *DBStateMissing) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*DBStateMissing) LogFields

func (m *DBStateMissing) LogFields() log.Fields

func (*DBStateMissing) MarshalBinary

func (m *DBStateMissing) MarshalBinary() (rval []byte, err error)

func (*DBStateMissing) MarshalForSignature

func (m *DBStateMissing) MarshalForSignature() (rval []byte, err error)

func (*DBStateMissing) Process

func (e *DBStateMissing) Process(dbheight uint32, state interfaces.IState) bool

Acknowledgements do not go into the process list.

func (*DBStateMissing) String

func (m *DBStateMissing) String() string

func (*DBStateMissing) Type

func (m *DBStateMissing) Type() byte

func (*DBStateMissing) UnmarshalBinary

func (m *DBStateMissing) UnmarshalBinary(data []byte) error

func (*DBStateMissing) UnmarshalBinaryData

func (m *DBStateMissing) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*DBStateMissing) Validate

func (m *DBStateMissing) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

type DBStateMsg

type DBStateMsg struct {
	msgbase.MessageBase
	Timestamp interfaces.Timestamp

	//TODO: handle malformed DBStates!
	DirectoryBlock   interfaces.IDirectoryBlock
	AdminBlock       interfaces.IAdminBlock
	FactoidBlock     interfaces.IFBlock
	EntryCreditBlock interfaces.IEntryCreditBlock

	EBlocks []interfaces.IEntryBlock
	Entries []interfaces.IEBEntry

	SignatureList SigList

	//Not marshalled
	IgnoreSigs bool
	Sent       interfaces.Timestamp
	IsInDB     bool
	IsLast     bool // Flag from state.LoadDatabase() that this is the last saved block loaded at boot.
}

func (*DBStateMsg) ComputeVMIndex

func (m *DBStateMsg) ComputeVMIndex(state interfaces.IState)

func (*DBStateMsg) FollowerExecute

func (m *DBStateMsg) FollowerExecute(state interfaces.IState)

func (*DBStateMsg) GetHash

func (m *DBStateMsg) GetHash() (rval interfaces.IHash)

func (*DBStateMsg) GetMsgHash

func (m *DBStateMsg) GetMsgHash() (rval interfaces.IHash)

func (*DBStateMsg) GetRepeatHash

func (m *DBStateMsg) GetRepeatHash() (rval interfaces.IHash)

func (*DBStateMsg) GetTimestamp

func (m *DBStateMsg) GetTimestamp() interfaces.Timestamp

func (*DBStateMsg) IsSameAs

func (a *DBStateMsg) IsSameAs(b *DBStateMsg) bool

func (*DBStateMsg) JSONByte

func (e *DBStateMsg) JSONByte() ([]byte, error)

func (*DBStateMsg) JSONString

func (e *DBStateMsg) JSONString() (string, error)

func (*DBStateMsg) LeaderExecute

func (m *DBStateMsg) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*DBStateMsg) LogFields

func (m *DBStateMsg) LogFields() log.Fields

func (*DBStateMsg) MarshalBinary

func (m *DBStateMsg) MarshalBinary() (rval []byte, err error)

func (*DBStateMsg) Process

func (e *DBStateMsg) Process(dbheight uint32, state interfaces.IState) bool

DBState messages do not go into the process list.

func (*DBStateMsg) SigTally

func (m *DBStateMsg) SigTally(state interfaces.IState) int

func (*DBStateMsg) String

func (m *DBStateMsg) String() string

func (*DBStateMsg) Type

func (m *DBStateMsg) Type() byte

func (*DBStateMsg) UnmarshalBinary

func (m *DBStateMsg) UnmarshalBinary(data []byte) error

func (*DBStateMsg) UnmarshalBinaryData

func (m *DBStateMsg) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*DBStateMsg) Validate

func (m *DBStateMsg) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
1   -- Message is valid

NOTE! Do no return 0, that sticks this message in the holding map, vs the DBStateList

ValidateSignatures is called when actually applying the DBState.

func (*DBStateMsg) ValidateData

func (m *DBStateMsg) ValidateData(state interfaces.IState) int

ValidateData will check the data attached to the DBState against the directory block it contains. This is ensure no additional junk is attached to a valid DBState

func (*DBStateMsg) ValidateSignatures

func (m *DBStateMsg) ValidateSignatures(state interfaces.IState) int

type DataResponse

type DataResponse struct {
	msgbase.MessageBase
	Timestamp interfaces.Timestamp

	DataType   int // 0 = Entry, 1 = EntryBlock
	DataHash   interfaces.IHash
	DataObject interfaces.BinaryMarshallable //Entry or EntryBlock

}

func (*DataResponse) ComputeVMIndex

func (m *DataResponse) ComputeVMIndex(state interfaces.IState)

func (*DataResponse) FollowerExecute

func (m *DataResponse) FollowerExecute(state interfaces.IState)

func (*DataResponse) GetHash

func (m *DataResponse) GetHash() (rval interfaces.IHash)

func (*DataResponse) GetMsgHash

func (m *DataResponse) GetMsgHash() (rval interfaces.IHash)

func (*DataResponse) GetRepeatHash

func (m *DataResponse) GetRepeatHash() (rval interfaces.IHash)

func (*DataResponse) GetTimestamp

func (m *DataResponse) GetTimestamp() interfaces.Timestamp

func (*DataResponse) IsSameAs

func (a *DataResponse) IsSameAs(b *DataResponse) bool

func (*DataResponse) JSONByte

func (e *DataResponse) JSONByte() ([]byte, error)

func (*DataResponse) JSONString

func (e *DataResponse) JSONString() (string, error)

func (*DataResponse) LeaderExecute

func (m *DataResponse) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*DataResponse) LogFields

func (m *DataResponse) LogFields() log.Fields

func (*DataResponse) MarshalBinary

func (m *DataResponse) MarshalBinary() (rval []byte, err error)

func (*DataResponse) Process

func (e *DataResponse) Process(dbheight uint32, state interfaces.IState) bool

Acknowledgements do not go into the process list.

func (*DataResponse) String

func (m *DataResponse) String() string

func (*DataResponse) Type

func (m *DataResponse) Type() byte

func (*DataResponse) UnmarshalBinary

func (m *DataResponse) UnmarshalBinary(data []byte) error

func (*DataResponse) UnmarshalBinaryData

func (m *DataResponse) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*DataResponse) Validate

func (m *DataResponse) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

type DirectoryBlockSignature

type DirectoryBlockSignature struct {
	msgbase.MessageBase
	Timestamp             interfaces.Timestamp
	DBHeight              uint32
	DirectoryBlockHeader  interfaces.IDirectoryBlockHeader
	ServerIdentityChainID interfaces.IHash

	Signature interfaces.IFullSignature

	// Signature that goes into the admin block
	// Signature of directory block header
	DBSignature interfaces.IFullSignature
	SysHeight   uint32
	SysHash     interfaces.IHash

	//Not marshalled
	Matches bool
	// contains filtered or unexported fields
}

func (*DirectoryBlockSignature) ComputeVMIndex

func (m *DirectoryBlockSignature) ComputeVMIndex(state interfaces.IState)

Returns true if this is a message for this server to execute as a leader.

func (*DirectoryBlockSignature) FollowerExecute

func (m *DirectoryBlockSignature) FollowerExecute(state interfaces.IState)

func (*DirectoryBlockSignature) GetHash

func (m *DirectoryBlockSignature) GetHash() (rval interfaces.IHash)

func (*DirectoryBlockSignature) GetMsgHash

func (m *DirectoryBlockSignature) GetMsgHash() (rval interfaces.IHash)

func (*DirectoryBlockSignature) GetRepeatHash

func (m *DirectoryBlockSignature) GetRepeatHash() (rval interfaces.IHash)

func (*DirectoryBlockSignature) GetSignature

func (*DirectoryBlockSignature) GetTimestamp

func (m *DirectoryBlockSignature) GetTimestamp() interfaces.Timestamp

func (*DirectoryBlockSignature) IsSameAs

func (*DirectoryBlockSignature) JSONByte

func (e *DirectoryBlockSignature) JSONByte() ([]byte, error)

func (*DirectoryBlockSignature) JSONString

func (e *DirectoryBlockSignature) JSONString() (string, error)

func (*DirectoryBlockSignature) LeaderExecute

func (m *DirectoryBlockSignature) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*DirectoryBlockSignature) LogFields

func (m *DirectoryBlockSignature) LogFields() log.Fields

func (*DirectoryBlockSignature) MarshalBinary

func (m *DirectoryBlockSignature) MarshalBinary() (data []byte, err error)

func (*DirectoryBlockSignature) MarshalForSignature

func (m *DirectoryBlockSignature) MarshalForSignature() (rval []byte, err error)

func (*DirectoryBlockSignature) Process

func (e *DirectoryBlockSignature) Process(dbheight uint32, state interfaces.IState) bool

func (*DirectoryBlockSignature) Sign

func (*DirectoryBlockSignature) SignHeader

func (m *DirectoryBlockSignature) SignHeader(key interfaces.Signer) error

func (*DirectoryBlockSignature) String

func (m *DirectoryBlockSignature) String() string

func (*DirectoryBlockSignature) Type

func (m *DirectoryBlockSignature) Type() byte

func (*DirectoryBlockSignature) UnmarshalBinary

func (m *DirectoryBlockSignature) UnmarshalBinary(data []byte) error

func (*DirectoryBlockSignature) UnmarshalBinaryData

func (m *DirectoryBlockSignature) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*DirectoryBlockSignature) Validate

func (m *DirectoryBlockSignature) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

func (*DirectoryBlockSignature) VerifySignature

func (m *DirectoryBlockSignature) VerifySignature() (bool, error)

type EOM

type EOM struct {
	msgbase.MessageBase
	Timestamp interfaces.Timestamp
	Minute    byte

	DBHeight  uint32
	SysHeight uint32
	SysHash   interfaces.IHash
	ChainID   interfaces.IHash
	Signature interfaces.IFullSignature
	FactoidVM bool

	MarkerSent bool // If we have set EOM markers on blocks like Factoid blocks and such.
	// contains filtered or unexported fields
}

func (*EOM) ComputeVMIndex

func (m *EOM) ComputeVMIndex(state interfaces.IState)

Returns true if this is a message for this server to execute as a leader.

func (*EOM) FollowerExecute

func (m *EOM) FollowerExecute(state interfaces.IState)

func (*EOM) GetHash

func (m *EOM) GetHash() (rval interfaces.IHash)

func (*EOM) GetMsgHash

func (m *EOM) GetMsgHash() (rval interfaces.IHash)

func (*EOM) GetRepeatHash

func (m *EOM) GetRepeatHash() (rval interfaces.IHash)

Fix EOM hash to match and not have the sig so duplicates are not generated.

func (*EOM) GetSignature

func (m *EOM) GetSignature() interfaces.IFullSignature

func (*EOM) GetTimestamp

func (m *EOM) GetTimestamp() interfaces.Timestamp

func (*EOM) IsSameAs

func (a *EOM) IsSameAs(b *EOM) bool

func (*EOM) JSONByte

func (e *EOM) JSONByte() ([]byte, error)

func (*EOM) JSONString

func (e *EOM) JSONString() (string, error)

func (*EOM) LeaderExecute

func (m *EOM) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*EOM) LogFields

func (m *EOM) LogFields() log.Fields

func (*EOM) MarshalBinary

func (m *EOM) MarshalBinary() (data []byte, err error)

func (*EOM) MarshalForSignature

func (m *EOM) MarshalForSignature() (data []byte, err error)

func (*EOM) Process

func (e *EOM) Process(dbheight uint32, state interfaces.IState) bool

func (*EOM) Sign

func (m *EOM) Sign(key interfaces.Signer) error

func (*EOM) String

func (m *EOM) String() string

func (*EOM) Type

func (m *EOM) Type() byte

func (*EOM) UnmarshalBinary

func (m *EOM) UnmarshalBinary(data []byte) error

func (*EOM) UnmarshalBinaryData

func (m *EOM) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*EOM) Validate

func (m *EOM) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

func (*EOM) VerifySignature

func (m *EOM) VerifySignature() (bool, error)

type FactoidTransaction

type FactoidTransaction struct {
	msgbase.MessageBase
	Transaction interfaces.ITransaction
	// contains filtered or unexported fields
}

A placeholder structure for messages

func (*FactoidTransaction) ComputeVMIndex

func (m *FactoidTransaction) ComputeVMIndex(state interfaces.IState)

func (*FactoidTransaction) FollowerExecute

func (m *FactoidTransaction) FollowerExecute(state interfaces.IState)

func (*FactoidTransaction) GetHash

func (m *FactoidTransaction) GetHash() (rval interfaces.IHash)

func (*FactoidTransaction) GetMsgHash

func (m *FactoidTransaction) GetMsgHash() (rval interfaces.IHash)

func (*FactoidTransaction) GetRepeatHash

func (m *FactoidTransaction) GetRepeatHash() (rval interfaces.IHash)

func (*FactoidTransaction) GetTimestamp

func (m *FactoidTransaction) GetTimestamp() interfaces.Timestamp

func (*FactoidTransaction) GetTransaction

func (m *FactoidTransaction) GetTransaction() interfaces.ITransaction

func (*FactoidTransaction) IsSameAs

func (a *FactoidTransaction) IsSameAs(b *FactoidTransaction) bool

func (*FactoidTransaction) JSONByte

func (e *FactoidTransaction) JSONByte() ([]byte, error)

func (*FactoidTransaction) JSONString

func (e *FactoidTransaction) JSONString() (string, error)

func (*FactoidTransaction) LeaderExecute

func (m *FactoidTransaction) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*FactoidTransaction) LogFields

func (m *FactoidTransaction) LogFields() log.Fields

func (*FactoidTransaction) MarshalBinary

func (m *FactoidTransaction) MarshalBinary() (data []byte, err error)

func (*FactoidTransaction) Process

func (m *FactoidTransaction) Process(dbheight uint32, state interfaces.IState) bool

func (*FactoidTransaction) SetTransaction

func (m *FactoidTransaction) SetTransaction(transaction interfaces.ITransaction)

func (*FactoidTransaction) String

func (m *FactoidTransaction) String() string

func (*FactoidTransaction) Type

func (m *FactoidTransaction) Type() byte

func (*FactoidTransaction) UnmarshalBinary

func (m *FactoidTransaction) UnmarshalBinary(data []byte) error

func (*FactoidTransaction) UnmarshalBinaryData

func (m *FactoidTransaction) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*FactoidTransaction) UnmarshalTransData

func (m *FactoidTransaction) UnmarshalTransData(datax []byte) (newData []byte, err error)

func (*FactoidTransaction) Validate

func (m *FactoidTransaction) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

type Heartbeat

type Heartbeat struct {
	msgbase.MessageBase
	Timestamp       interfaces.Timestamp
	SecretNumber    uint32
	DBHeight        uint32
	DBlockHash      interfaces.IHash //Hash of last Directory Block
	IdentityChainID interfaces.IHash //Identity Chain ID

	Signature interfaces.IFullSignature
	// contains filtered or unexported fields
}

A placeholder structure for messages

func (*Heartbeat) ChainID

func (m *Heartbeat) ChainID() []byte

func (*Heartbeat) ComputeVMIndex

func (m *Heartbeat) ComputeVMIndex(state interfaces.IState)

Returns true if this is a message for this server to execute as a leader.

func (*Heartbeat) FollowerExecute

func (m *Heartbeat) FollowerExecute(is interfaces.IState)

func (*Heartbeat) GetHash

func (m *Heartbeat) GetHash() (rval interfaces.IHash)

func (*Heartbeat) GetMsgHash

func (m *Heartbeat) GetMsgHash() (rval interfaces.IHash)

func (*Heartbeat) GetRepeatHash

func (m *Heartbeat) GetRepeatHash() (rval interfaces.IHash)

func (*Heartbeat) GetSignature

func (m *Heartbeat) GetSignature() interfaces.IFullSignature

func (*Heartbeat) GetTimestamp

func (m *Heartbeat) GetTimestamp() interfaces.Timestamp

func (*Heartbeat) IsSameAs

func (a *Heartbeat) IsSameAs(b *Heartbeat) bool

func (*Heartbeat) JSONByte

func (e *Heartbeat) JSONByte() ([]byte, error)

func (*Heartbeat) JSONString

func (e *Heartbeat) JSONString() (string, error)

func (*Heartbeat) LeaderExecute

func (m *Heartbeat) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*Heartbeat) ListHeight

func (m *Heartbeat) ListHeight() int

func (*Heartbeat) LogFields

func (m *Heartbeat) LogFields() log.Fields

func (*Heartbeat) MarshalBinary

func (m *Heartbeat) MarshalBinary() (data []byte, err error)

func (*Heartbeat) MarshalForSignature

func (m *Heartbeat) MarshalForSignature() (data []byte, err error)

func (*Heartbeat) Process

func (m *Heartbeat) Process(uint32, interfaces.IState) bool

func (*Heartbeat) SerialHash

func (m *Heartbeat) SerialHash() []byte

func (*Heartbeat) Sign

func (m *Heartbeat) Sign(key interfaces.Signer) error

func (*Heartbeat) String

func (m *Heartbeat) String() string

func (*Heartbeat) Type

func (m *Heartbeat) Type() byte

func (*Heartbeat) UnmarshalBinary

func (m *Heartbeat) UnmarshalBinary(data []byte) error

func (*Heartbeat) UnmarshalBinaryData

func (m *Heartbeat) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*Heartbeat) Validate

func (m *Heartbeat) Validate(is interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

func (*Heartbeat) VerifySignature

func (m *Heartbeat) VerifySignature() (bool, error)

type MissingData

type MissingData struct {
	msgbase.MessageBase
	Timestamp interfaces.Timestamp

	RequestHash interfaces.IHash
}

Structure to request missing messages in a node's process list

func (*MissingData) ComputeVMIndex

func (m *MissingData) ComputeVMIndex(state interfaces.IState)

func (*MissingData) FollowerExecute

func (m *MissingData) FollowerExecute(state interfaces.IState)

func (*MissingData) GetHash

func (m *MissingData) GetHash() (rval interfaces.IHash)

func (*MissingData) GetMsgHash

func (m *MissingData) GetMsgHash() (rval interfaces.IHash)

func (*MissingData) GetRepeatHash

func (m *MissingData) GetRepeatHash() (rval interfaces.IHash)

func (*MissingData) GetTimestamp

func (m *MissingData) GetTimestamp() interfaces.Timestamp

func (*MissingData) IsSameAs

func (a *MissingData) IsSameAs(b *MissingData) bool

func (*MissingData) JSONByte

func (e *MissingData) JSONByte() ([]byte, error)

func (*MissingData) JSONString

func (e *MissingData) JSONString() (string, error)

func (*MissingData) LeaderExecute

func (m *MissingData) LeaderExecute(state interfaces.IState)

func (*MissingData) LogFields

func (m *MissingData) LogFields() log.Fields

func (*MissingData) MarshalBinary

func (m *MissingData) MarshalBinary() (rval []byte, err error)

func (*MissingData) Process

func (m *MissingData) Process(uint32, interfaces.IState) bool

func (*MissingData) String

func (m *MissingData) String() string

func (*MissingData) Type

func (m *MissingData) Type() byte

func (*MissingData) UnmarshalBinary

func (m *MissingData) UnmarshalBinary(data []byte) error

func (*MissingData) UnmarshalBinaryData

func (m *MissingData) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*MissingData) Validate

func (m *MissingData) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

type MissingMsg

type MissingMsg struct {
	msgbase.MessageBase

	Timestamp         interfaces.Timestamp
	Asking            interfaces.IHash
	DBHeight          uint32
	SystemHeight      uint32 // Might as well check for a missing Server Fault
	ProcessListHeight []uint32
	// contains filtered or unexported fields
}

Structure to request missing messages in a node's process list

func NewMissingMsg

func NewMissingMsg(state interfaces.IState, vm int, dbHeight uint32, processlistHeight uint32) *MissingMsg

NewMissingMsg: Build a missing Message request, and add the first Height

func (*MissingMsg) AddHeight

func (e *MissingMsg) AddHeight(h uint32)

AddHeight: Add a Missing Message Height to the request

func (*MissingMsg) ChainID

func (m *MissingMsg) ChainID() []byte

func (*MissingMsg) ComputeVMIndex

func (m *MissingMsg) ComputeVMIndex(state interfaces.IState)

func (*MissingMsg) FollowerExecute

func (m *MissingMsg) FollowerExecute(state interfaces.IState)

func (*MissingMsg) GetHash

func (m *MissingMsg) GetHash() (rval interfaces.IHash)

func (*MissingMsg) GetMsgHash

func (m *MissingMsg) GetMsgHash() (rval interfaces.IHash)

func (*MissingMsg) GetRepeatHash

func (m *MissingMsg) GetRepeatHash() (rval interfaces.IHash)

func (*MissingMsg) GetTimestamp

func (m *MissingMsg) GetTimestamp() interfaces.Timestamp

func (*MissingMsg) IsSameAs

func (a *MissingMsg) IsSameAs(b *MissingMsg) bool

func (*MissingMsg) JSONByte

func (e *MissingMsg) JSONByte() ([]byte, error)

func (*MissingMsg) JSONString

func (e *MissingMsg) JSONString() (string, error)

func (*MissingMsg) LeaderExecute

func (m *MissingMsg) LeaderExecute(state interfaces.IState)

func (*MissingMsg) ListHeight

func (m *MissingMsg) ListHeight() int

func (*MissingMsg) LogFields

func (m *MissingMsg) LogFields() log.Fields

func (*MissingMsg) MarshalBinary

func (m *MissingMsg) MarshalBinary() (rval []byte, err error)

func (*MissingMsg) Process

func (m *MissingMsg) Process(uint32, interfaces.IState) bool

func (*MissingMsg) String

func (m *MissingMsg) String() string

func (*MissingMsg) Type

func (m *MissingMsg) Type() byte

func (*MissingMsg) UnmarshalBinary

func (m *MissingMsg) UnmarshalBinary(data []byte) error

func (*MissingMsg) UnmarshalBinaryData

func (m *MissingMsg) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*MissingMsg) Validate

func (m *MissingMsg) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

type MissingMsgResponse

type MissingMsgResponse struct {
	msgbase.MessageBase

	Timestamp   interfaces.Timestamp
	AckResponse interfaces.IMsg
	MsgResponse interfaces.IMsg
	// contains filtered or unexported fields
}

Structure to request missing messages in a node's process list

func (*MissingMsgResponse) ChainID

func (m *MissingMsgResponse) ChainID() []byte

func (*MissingMsgResponse) ComputeVMIndex

func (m *MissingMsgResponse) ComputeVMIndex(state interfaces.IState)

func (*MissingMsgResponse) FollowerExecute

func (m *MissingMsgResponse) FollowerExecute(state interfaces.IState)

func (*MissingMsgResponse) GetHash

func (m *MissingMsgResponse) GetHash() (rval interfaces.IHash)

func (*MissingMsgResponse) GetMsgHash

func (m *MissingMsgResponse) GetMsgHash() (rval interfaces.IHash)

func (*MissingMsgResponse) GetRepeatHash

func (m *MissingMsgResponse) GetRepeatHash() (rval interfaces.IHash)

func (*MissingMsgResponse) GetTimestamp

func (m *MissingMsgResponse) GetTimestamp() interfaces.Timestamp

func (*MissingMsgResponse) IsSameAs

func (a *MissingMsgResponse) IsSameAs(b *MissingMsgResponse) bool

func (*MissingMsgResponse) JSONByte

func (e *MissingMsgResponse) JSONByte() ([]byte, error)

func (*MissingMsgResponse) JSONString

func (e *MissingMsgResponse) JSONString() (string, error)

func (*MissingMsgResponse) LeaderExecute

func (m *MissingMsgResponse) LeaderExecute(state interfaces.IState)

func (*MissingMsgResponse) ListHeight

func (m *MissingMsgResponse) ListHeight() int

func (*MissingMsgResponse) LogFields

func (m *MissingMsgResponse) LogFields() log.Fields

func (*MissingMsgResponse) MarshalBinary

func (m *MissingMsgResponse) MarshalBinary() (rval []byte, err error)

func (*MissingMsgResponse) MarshalBinaryOld

func (m *MissingMsgResponse) MarshalBinaryOld() (rval []byte, err error)

func (*MissingMsgResponse) Process

func (*MissingMsgResponse) String

func (m *MissingMsgResponse) String() string

func (*MissingMsgResponse) Type

func (m *MissingMsgResponse) Type() byte

func (*MissingMsgResponse) UnmarshalBinary

func (m *MissingMsgResponse) UnmarshalBinary(data []byte) error

func (*MissingMsgResponse) UnmarshalBinaryData

func (m *MissingMsgResponse) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*MissingMsgResponse) Validate

func (m *MissingMsgResponse) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

type RemoveServerMsg

type RemoveServerMsg struct {
	msgbase.MessageBase
	Timestamp     interfaces.Timestamp // Message Timestamp
	ServerChainID interfaces.IHash     // ChainID of new server
	ServerType    int                  // 0 = Federated, 1 = Audit

	Signature interfaces.IFullSignature
}

func (*RemoveServerMsg) ComputeVMIndex

func (m *RemoveServerMsg) ComputeVMIndex(state interfaces.IState)

Returns true if this is a message for this server to execute as a leader.

func (*RemoveServerMsg) FollowerExecute

func (m *RemoveServerMsg) FollowerExecute(state interfaces.IState)

func (*RemoveServerMsg) GetHash

func (m *RemoveServerMsg) GetHash() (rval interfaces.IHash)

func (*RemoveServerMsg) GetMsgHash

func (m *RemoveServerMsg) GetMsgHash() (rval interfaces.IHash)

func (*RemoveServerMsg) GetRepeatHash

func (m *RemoveServerMsg) GetRepeatHash() (rval interfaces.IHash)

func (*RemoveServerMsg) GetSignature

func (m *RemoveServerMsg) GetSignature() interfaces.IFullSignature

func (*RemoveServerMsg) GetTimestamp

func (m *RemoveServerMsg) GetTimestamp() interfaces.Timestamp

func (*RemoveServerMsg) IsSameAs

func (m *RemoveServerMsg) IsSameAs(b *RemoveServerMsg) bool

func (*RemoveServerMsg) JSONByte

func (e *RemoveServerMsg) JSONByte() ([]byte, error)

func (*RemoveServerMsg) JSONString

func (e *RemoveServerMsg) JSONString() (string, error)

func (*RemoveServerMsg) LeaderExecute

func (m *RemoveServerMsg) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*RemoveServerMsg) LogFields

func (m *RemoveServerMsg) LogFields() log.Fields

func (*RemoveServerMsg) MarshalBinary

func (m *RemoveServerMsg) MarshalBinary() (rval []byte, err error)

func (*RemoveServerMsg) MarshalForSignature

func (m *RemoveServerMsg) MarshalForSignature() (rval []byte, err error)

func (*RemoveServerMsg) Process

func (e *RemoveServerMsg) Process(dbheight uint32, state interfaces.IState) bool

Acknowledgements do not go into the process list.

func (*RemoveServerMsg) Sign

func (m *RemoveServerMsg) Sign(key interfaces.Signer) error

func (*RemoveServerMsg) String

func (m *RemoveServerMsg) String() string

func (*RemoveServerMsg) Type

func (m *RemoveServerMsg) Type() byte

func (*RemoveServerMsg) UnmarshalBinary

func (m *RemoveServerMsg) UnmarshalBinary(data []byte) error

func (*RemoveServerMsg) UnmarshalBinaryData

func (m *RemoveServerMsg) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*RemoveServerMsg) Validate

func (m *RemoveServerMsg) Validate(state interfaces.IState) int

func (*RemoveServerMsg) VerifySignature

func (m *RemoveServerMsg) VerifySignature() (bool, error)

type RequestBlock

type RequestBlock struct {
	msgbase.MessageBase
	Timestamp interfaces.Timestamp
	// contains filtered or unexported fields
}

A placeholder structure for messages

func (*RequestBlock) ChainID

func (m *RequestBlock) ChainID() []byte

func (*RequestBlock) ComputeVMIndex

func (m *RequestBlock) ComputeVMIndex(state interfaces.IState)

func (*RequestBlock) DBHeight

func (m *RequestBlock) DBHeight() int

func (*RequestBlock) FollowerExecute

func (m *RequestBlock) FollowerExecute(interfaces.IState)

func (*RequestBlock) GetHash

func (m *RequestBlock) GetHash() (rval interfaces.IHash)

func (*RequestBlock) GetMsgHash

func (m *RequestBlock) GetMsgHash() (rval interfaces.IHash)

func (*RequestBlock) GetRepeatHash

func (m *RequestBlock) GetRepeatHash() (rval interfaces.IHash)

func (*RequestBlock) GetTimestamp

func (m *RequestBlock) GetTimestamp() interfaces.Timestamp

func (*RequestBlock) IsSameAs

func (a *RequestBlock) IsSameAs(b *RequestBlock) bool

func (*RequestBlock) JSONByte

func (e *RequestBlock) JSONByte() ([]byte, error)

func (*RequestBlock) JSONString

func (e *RequestBlock) JSONString() (string, error)

func (*RequestBlock) LeaderExecute

func (m *RequestBlock) LeaderExecute(state interfaces.IState)

func (*RequestBlock) ListHeight

func (m *RequestBlock) ListHeight() int

func (*RequestBlock) LogFields

func (m *RequestBlock) LogFields() log.Fields

func (*RequestBlock) MarshalBinary

func (m *RequestBlock) MarshalBinary() (data []byte, err error)

func (*RequestBlock) MarshalForSignature

func (m *RequestBlock) MarshalForSignature() (data []byte, err error)

func (*RequestBlock) Process

func (m *RequestBlock) Process(uint32, interfaces.IState) bool

func (*RequestBlock) SerialHash

func (m *RequestBlock) SerialHash() []byte

func (*RequestBlock) Signature

func (m *RequestBlock) Signature() []byte

func (*RequestBlock) String

func (m *RequestBlock) String() string

func (*RequestBlock) Type

func (m *RequestBlock) Type() byte

func (*RequestBlock) UnmarshalBinary

func (m *RequestBlock) UnmarshalBinary(data []byte) error

func (*RequestBlock) UnmarshalBinaryData

func (m *RequestBlock) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*RequestBlock) Validate

func (m *RequestBlock) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

type RevealEntryMsg

type RevealEntryMsg struct {
	msgbase.MessageBase
	Timestamp interfaces.Timestamp
	Entry     interfaces.IEntry

	IsEntry     bool
	CommitChain *CommitChainMsg
	// contains filtered or unexported fields
}

A placeholder structure for messages

func NewRevealEntryMsg

func NewRevealEntryMsg() *RevealEntryMsg

func (*RevealEntryMsg) ComputeVMIndex

func (m *RevealEntryMsg) ComputeVMIndex(state interfaces.IState)

Returns true if this is a message for this server to execute as a leader.

func (*RevealEntryMsg) FollowerExecute

func (m *RevealEntryMsg) FollowerExecute(state interfaces.IState)

func (*RevealEntryMsg) GetChainIDHash

func (m *RevealEntryMsg) GetChainIDHash() (rval interfaces.IHash)

func (*RevealEntryMsg) GetHash

func (m *RevealEntryMsg) GetHash() (rval interfaces.IHash)

func (*RevealEntryMsg) GetMsgHash

func (m *RevealEntryMsg) GetMsgHash() (rval interfaces.IHash)

func (*RevealEntryMsg) GetRepeatHash

func (m *RevealEntryMsg) GetRepeatHash() (rval interfaces.IHash)

func (*RevealEntryMsg) GetTimestamp

func (m *RevealEntryMsg) GetTimestamp() interfaces.Timestamp

func (*RevealEntryMsg) IsSameAs

func (m *RevealEntryMsg) IsSameAs(msg interfaces.IMsg) bool

func (*RevealEntryMsg) JSONByte

func (e *RevealEntryMsg) JSONByte() ([]byte, error)

func (*RevealEntryMsg) JSONString

func (e *RevealEntryMsg) JSONString() (string, error)

func (*RevealEntryMsg) LeaderExecute

func (m *RevealEntryMsg) LeaderExecute(state interfaces.IState)

Execute the leader functions of the given message

func (*RevealEntryMsg) LogFields

func (m *RevealEntryMsg) LogFields() log.Fields

func (*RevealEntryMsg) MarshalBinary

func (m *RevealEntryMsg) MarshalBinary() (data []byte, err error)

func (*RevealEntryMsg) Process

func (m *RevealEntryMsg) Process(dbheight uint32, state interfaces.IState) bool

func (*RevealEntryMsg) String

func (m *RevealEntryMsg) String() string

func (*RevealEntryMsg) Type

func (m *RevealEntryMsg) Type() byte

func (*RevealEntryMsg) UnmarshalBinary

func (m *RevealEntryMsg) UnmarshalBinary(data []byte) error

func (*RevealEntryMsg) UnmarshalBinaryData

func (m *RevealEntryMsg) UnmarshalBinaryData(data []byte) (newData []byte, err error)

func (*RevealEntryMsg) Validate

func (m *RevealEntryMsg) Validate(state interfaces.IState) int

Validate the message, given the state. Three possible results:

< 0 -- Message is invalid.  Discard
0   -- Cannot tell if message is Valid
1   -- Message is valid

Also return the matching commit, if 1 (Don't put it back into the Commit List)

type SigList

type SigList struct {
	Length uint32
	List   []interfaces.IFullSignature
}

func (*SigList) MarshalBinary

func (sl *SigList) MarshalBinary() (data []byte, err error)

func (*SigList) UnmarshalBinaryData

func (sl *SigList) UnmarshalBinaryData(data []byte) (newData []byte, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL