Documentation ¶
Index ¶
- func New(logger *zap.Logger, key dbft.PrivateKey, pub dbft.PublicKey, ...) (*dbft.DBFT[crypto.Uint256], error)
- func NewBlock(timestamp uint64, index uint32, prevHash crypto.Uint256, nonce uint64, ...) dbft.Block[crypto.Uint256]
- func NewChangeView(newViewNumber byte, _ dbft.ChangeViewReason, ts uint64) dbft.ChangeView
- func NewCommit(signature []byte) dbft.Commit
- func NewConsensusPayload(t dbft.MessageType, height uint32, validatorIndex uint16, viewNumber byte, ...) dbft.ConsensusPayload[crypto.Uint256]
- func NewPrepareRequest(ts uint64, nonce uint64, transactionsHashes []crypto.Uint256) dbft.PrepareRequest[crypto.Uint256]
- func NewPrepareResponse(preparationHash crypto.Uint256) dbft.PrepareResponse[crypto.Uint256]
- func NewRecoveryMessage(preparationHash *crypto.Uint256) dbft.RecoveryMessage[crypto.Uint256]
- func NewRecoveryRequest(ts uint64) dbft.RecoveryRequest
- type Payload
- func (p *Payload) DecodeBinary(r *gob.Decoder) error
- func (p Payload) EncodeBinary(w *gob.Encoder) error
- func (m Payload) GetChangeView() dbft.ChangeView
- func (m Payload) GetCommit() dbft.Commit
- func (m Payload) GetPrepareRequest() dbft.PrepareRequest[crypto.Uint256]
- func (m Payload) GetPrepareResponse() dbft.PrepareResponse[crypto.Uint256]
- func (m Payload) GetRecoveryMessage() dbft.RecoveryMessage[crypto.Uint256]
- func (m Payload) GetRecoveryRequest() dbft.RecoveryRequest
- func (p *Payload) Hash() crypto.Uint256
- func (p Payload) Height() uint32
- func (p Payload) MarshalUnsigned() []byte
- func (m Payload) Payload() any
- func (p Payload) PrevHash() crypto.Uint256
- func (p *Payload) SetValidatorIndex(i uint16)
- func (m Payload) Type() dbft.MessageType
- func (p *Payload) UnmarshalUnsigned(data []byte) error
- func (p Payload) ValidatorIndex() uint16
- func (p Payload) Version() uint32
- func (m Payload) ViewNumber() byte
- type Serializable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(logger *zap.Logger, key dbft.PrivateKey, pub dbft.PublicKey, getTx func(uint256 crypto.Uint256) dbft.Transaction[crypto.Uint256], getVerified func() []dbft.Transaction[crypto.Uint256], broadcast func(dbft.ConsensusPayload[crypto.Uint256]), processBlock func(dbft.Block[crypto.Uint256]), currentHeight func() uint32, currentBlockHash func() crypto.Uint256, getValidators func(...dbft.Transaction[crypto.Uint256]) []dbft.PublicKey, verifyPayload func(consensusPayload dbft.ConsensusPayload[crypto.Uint256]) error) (*dbft.DBFT[crypto.Uint256], error)
func NewBlock ¶
func NewBlock(timestamp uint64, index uint32, prevHash crypto.Uint256, nonce uint64, txHashes []crypto.Uint256) dbft.Block[crypto.Uint256]
NewBlock returns new block.
func NewChangeView ¶
func NewChangeView(newViewNumber byte, _ dbft.ChangeViewReason, ts uint64) dbft.ChangeView
NewChangeView returns minimal ChangeView implementation.
func NewConsensusPayload ¶
func NewConsensusPayload(t dbft.MessageType, height uint32, validatorIndex uint16, viewNumber byte, consensusMessage any) dbft.ConsensusPayload[crypto.Uint256]
NewConsensusPayload returns minimal ConsensusPayload implementation.
func NewPrepareRequest ¶
func NewPrepareRequest(ts uint64, nonce uint64, transactionsHashes []crypto.Uint256) dbft.PrepareRequest[crypto.Uint256]
NewPrepareRequest returns minimal prepareRequest implementation.
func NewPrepareResponse ¶
NewPrepareResponse returns minimal PrepareResponse implementation.
func NewRecoveryMessage ¶
NewRecoveryMessage returns minimal RecoveryMessage implementation.
func NewRecoveryRequest ¶
func NewRecoveryRequest(ts uint64) dbft.RecoveryRequest
NewRecoveryRequest returns minimal RecoveryRequest implementation.
Types ¶
type Payload ¶
type Payload struct {
// contains filtered or unexported fields
}
Payload represents minimal payload containing all necessary fields.
func (*Payload) DecodeBinary ¶
DecodeBinary implements Serializable interface.
func (Payload) EncodeBinary ¶
EncodeBinary implements Serializable interface.
func (Payload) GetChangeView ¶
func (m Payload) GetChangeView() dbft.ChangeView
func (Payload) GetPrepareRequest ¶
func (m Payload) GetPrepareRequest() dbft.PrepareRequest[crypto.Uint256]
func (Payload) GetPrepareResponse ¶
func (m Payload) GetPrepareResponse() dbft.PrepareResponse[crypto.Uint256]
func (Payload) GetRecoveryMessage ¶
func (m Payload) GetRecoveryMessage() dbft.RecoveryMessage[crypto.Uint256]
func (Payload) GetRecoveryRequest ¶
func (m Payload) GetRecoveryRequest() dbft.RecoveryRequest
func (Payload) MarshalUnsigned ¶
MarshalUnsigned implements ConsensusPayload interface.
func (Payload) Payload ¶
func (m Payload) Payload() any
Payload implements ConsensusMessage interface.
func (*Payload) SetValidatorIndex ¶
SetValidatorIndex implements ConsensusPayload interface.
func (Payload) Type ¶
func (m Payload) Type() dbft.MessageType
Type implements ConsensusMessage interface.
func (*Payload) UnmarshalUnsigned ¶
UnmarshalUnsigned implements ConsensusPayload interface.
func (Payload) ValidatorIndex ¶
ValidatorIndex implements ConsensusPayload interface.
func (Payload) ViewNumber ¶
func (m Payload) ViewNumber() byte
ViewNumber implements ConsensusMessage interface.