Documentation ¶
Index ¶
Constants ¶
View Source
const ( ResponseCodeOK = ResponseCode(0) ResponseCodeRejected = ResponseCode(1) ResponseCodeMoreBlocks = ResponseCode(2) ResponseCodeNoMoreBlocks = ResponseCode(3) ResponseCodeSynced = ResponseCode(4) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockAnnounceMessage ¶
type BlockAnnounceMessage struct { Block *block.Block `cbor:"1,keyasint"` Certificate *certificate.Certificate `cbor:"2,keyasint"` }
func NewBlockAnnounceMessage ¶
func NewBlockAnnounceMessage(blk *block.Block, cert *certificate.Certificate) *BlockAnnounceMessage
func (*BlockAnnounceMessage) BasicCheck ¶ added in v0.15.0
func (m *BlockAnnounceMessage) BasicCheck() error
func (*BlockAnnounceMessage) Height ¶
func (m *BlockAnnounceMessage) Height() uint32
func (*BlockAnnounceMessage) String ¶ added in v0.15.0
func (m *BlockAnnounceMessage) String() string
func (*BlockAnnounceMessage) Type ¶
func (m *BlockAnnounceMessage) Type() Type
type BlocksRequestMessage ¶
type BlocksRequestMessage struct { SessionID int `cbor:"1,keyasint"` From uint32 `cbor:"2,keyasint"` Count uint32 `cbor:"3,keyasint"` }
func NewBlocksRequestMessage ¶
func NewBlocksRequestMessage(sid int, from, count uint32) *BlocksRequestMessage
func (*BlocksRequestMessage) BasicCheck ¶ added in v0.15.0
func (m *BlocksRequestMessage) BasicCheck() error
func (*BlocksRequestMessage) String ¶ added in v0.15.0
func (m *BlocksRequestMessage) String() string
func (*BlocksRequestMessage) To ¶
func (m *BlocksRequestMessage) To() uint32
func (*BlocksRequestMessage) Type ¶
func (m *BlocksRequestMessage) Type() Type
type BlocksResponseMessage ¶
type BlocksResponseMessage struct { ResponseCode ResponseCode `cbor:"1,keyasint"` SessionID int `cbor:"2,keyasint"` From uint32 `cbor:"3,keyasint"` CommittedBlocksData [][]byte `cbor:"4,keyasint"` LastCertificate *certificate.Certificate `cbor:"5,keyasint"` Reason string `cbor:"6,keyasint"` }
func NewBlocksResponseMessage ¶
func NewBlocksResponseMessage(code ResponseCode, reason string, sid int, from uint32, blocksData [][]byte, lastCert *certificate.Certificate, ) *BlocksResponseMessage
func (*BlocksResponseMessage) BasicCheck ¶ added in v0.15.0
func (m *BlocksResponseMessage) BasicCheck() error
func (*BlocksResponseMessage) Count ¶ added in v0.11.0
func (m *BlocksResponseMessage) Count() uint32
func (*BlocksResponseMessage) IsRequestRejected ¶
func (m *BlocksResponseMessage) IsRequestRejected() bool
func (*BlocksResponseMessage) String ¶ added in v0.15.0
func (m *BlocksResponseMessage) String() string
func (*BlocksResponseMessage) To ¶
func (m *BlocksResponseMessage) To() uint32
func (*BlocksResponseMessage) Type ¶
func (m *BlocksResponseMessage) Type() Type
type HelloAckMessage ¶ added in v0.15.0
type HelloAckMessage struct { ResponseCode ResponseCode `cbor:"1,keyasint"` Reason string `cbor:"2,keyasint"` }
func NewHelloAckMessage ¶ added in v0.15.0
func NewHelloAckMessage(code ResponseCode, reason string) *HelloAckMessage
func (*HelloAckMessage) BasicCheck ¶ added in v0.15.0
func (m *HelloAckMessage) BasicCheck() error
func (*HelloAckMessage) String ¶ added in v0.15.0
func (m *HelloAckMessage) String() string
func (*HelloAckMessage) Type ¶ added in v0.15.0
func (m *HelloAckMessage) Type() Type
type HelloMessage ¶
type HelloMessage struct { PeerID peer.ID `cbor:"1,keyasint"` Agent string `cbor:"2,keyasint"` Moniker string `cbor:"3,keyasint"` PublicKeys []*bls.PublicKey `cbor:"4,keyasint"` Signature *bls.Signature `cbor:"5,keyasint"` Height uint32 `cbor:"6,keyasint"` Services services.Services `cbor:"7,keyasint"` GenesisHash hash.Hash `cbor:"8,keyasint"` BlockHash hash.Hash `cbor:"9,keyasint"` MyTimeUnixMilli int64 `cbor:"10,keyasint"` }
func NewHelloMessage ¶
func (*HelloMessage) BasicCheck ¶ added in v0.15.0
func (m *HelloMessage) BasicCheck() error
func (*HelloMessage) MyTime ¶ added in v0.15.0
func (m *HelloMessage) MyTime() time.Time
func (*HelloMessage) Sign ¶ added in v0.15.0
func (m *HelloMessage) Sign(valKeys []*bls.ValidatorKey)
func (*HelloMessage) SignBytes ¶
func (m *HelloMessage) SignBytes() []byte
func (*HelloMessage) String ¶ added in v0.15.0
func (m *HelloMessage) String() string
func (*HelloMessage) Type ¶
func (m *HelloMessage) Type() Type
type Message ¶
func MakeMessage ¶
type ProposalMessage ¶
func NewProposalMessage ¶
func NewProposalMessage(p *proposal.Proposal) *ProposalMessage
func (*ProposalMessage) BasicCheck ¶ added in v0.15.0
func (m *ProposalMessage) BasicCheck() error
func (*ProposalMessage) String ¶ added in v0.15.0
func (m *ProposalMessage) String() string
func (*ProposalMessage) Type ¶
func (m *ProposalMessage) Type() Type
type QueryProposalMessage ¶
type QueryProposalMessage struct {
Height uint32 `cbor:"1,keyasint"`
}
func NewQueryProposalMessage ¶
func NewQueryProposalMessage(h uint32) *QueryProposalMessage
func (*QueryProposalMessage) BasicCheck ¶ added in v0.15.0
func (m *QueryProposalMessage) BasicCheck() error
func (*QueryProposalMessage) String ¶ added in v0.15.0
func (m *QueryProposalMessage) String() string
func (*QueryProposalMessage) Type ¶
func (m *QueryProposalMessage) Type() Type
type QueryVotesMessage ¶
func NewQueryVotesMessage ¶
func NewQueryVotesMessage(h uint32, r int16) *QueryVotesMessage
func (*QueryVotesMessage) BasicCheck ¶ added in v0.15.0
func (m *QueryVotesMessage) BasicCheck() error
func (*QueryVotesMessage) String ¶ added in v0.15.0
func (m *QueryVotesMessage) String() string
func (*QueryVotesMessage) Type ¶
func (m *QueryVotesMessage) Type() Type
type ResponseCode ¶
type ResponseCode int
func (ResponseCode) String ¶
func (c ResponseCode) String() string
type TransactionsMessage ¶
func NewTransactionsMessage ¶
func NewTransactionsMessage(trxs []*tx.Tx) *TransactionsMessage
func (*TransactionsMessage) BasicCheck ¶ added in v0.15.0
func (m *TransactionsMessage) BasicCheck() error
func (*TransactionsMessage) String ¶ added in v0.15.0
func (m *TransactionsMessage) String() string
func (*TransactionsMessage) Type ¶
func (m *TransactionsMessage) Type() Type
type VoteMessage ¶
func NewVoteMessage ¶
func NewVoteMessage(v *vote.Vote) *VoteMessage
func (*VoteMessage) BasicCheck ¶ added in v0.15.0
func (m *VoteMessage) BasicCheck() error
func (*VoteMessage) String ¶ added in v0.15.0
func (m *VoteMessage) String() string
func (*VoteMessage) Type ¶
func (m *VoteMessage) Type() Type
Click to show internal directories.
Click to hide internal directories.