Documentation ¶
Index ¶
- Constants
- func GetMessageHash(msg p2p.Message) common.Uint256
- type Addr
- type ConsensusStatus
- type GetBlock
- type GetBlocks
- type IllegalProposals
- type IllegalVotes
- type Inventory
- type Ping
- type Pong
- type Proposal
- type Reject
- type RejectCode
- type RequestConsensus
- type RequestProposal
- type ResponseBlocks
- type ResponseConsensus
- type ResponseInactiveArbitrators
- func (i *ResponseInactiveArbitrators) CMD() string
- func (i *ResponseInactiveArbitrators) Deserialize(r io.Reader) (err error)
- func (i *ResponseInactiveArbitrators) DeserializeUnsigned(r io.Reader) (err error)
- func (i *ResponseInactiveArbitrators) MaxLength() uint32
- func (i *ResponseInactiveArbitrators) Serialize(w io.Writer) error
- func (i *ResponseInactiveArbitrators) SerializeUnsigned(w io.Writer) error
- type ResponseRevertToDPOS
- func (i *ResponseRevertToDPOS) CMD() string
- func (i *ResponseRevertToDPOS) Deserialize(r io.Reader) (err error)
- func (i *ResponseRevertToDPOS) DeserializeUnsigned(r io.Reader) (err error)
- func (i *ResponseRevertToDPOS) MaxLength() uint32
- func (i *ResponseRevertToDPOS) Serialize(w io.Writer) error
- func (i *ResponseRevertToDPOS) SerializeUnsigned(w io.Writer) error
- type SidechainIllegalData
- type VerAck
- type Version
- type Vote
Constants ¶
View Source
const ( CmdVersion = "version" CmdVerAck = "verack" CmdAddr = "addr" CmdPing = "ping" CmdPong = "pong" CmdInv = "inv" CmdGetBlock = "getblock" CmdReceivedProposal = "proposal" CmdAcceptVote = "acc_vote" CmdRejectVote = "rej_vote" CmdGetBlocks = "get_blc" CmdResponseBlocks = "res_blc" CmdRequestConsensus = "req_con" CmdResponseConsensus = "res_con" CmdRequestProposal = "req_pro" CmdIllegalProposals = "ill_pro" CmdIllegalVotes = "ill_vote" CmdSidechainIllegalData = "side_ill" CmdResponseInactiveArbitrators = "ina_ars" CmdResponseRevertToDPOS = "rev_to_dpos" )
View Source
const DefaultProposalMessageDataSize = 168 //67+32+4+65
View Source
const DefaultResponseBlocksMessageDataSize = 8000000 * 10
todo move to config
View Source
const DefaultResponseConsensusMessageDataSize = 8000000 * 10
View Source
const DefaultVoteMessageDataSize = 297 //164+67+1+65
View Source
const MaxIllegalProposalSize = 1000000
View Source
const MaxIllegalVoteSize = 1000000
View Source
const ResponseInactiveArbitratorsLength = 32 + 33 + 64 + 8*2
View Source
const ResponseRevertToDPOSLength = 512
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConsensusStatus ¶
type ConsensusStatus struct { ConsensusStatus uint32 ViewOffset uint32 ViewStartTime time.Time AcceptVotes []payload.DPOSProposalVote RejectedVotes []payload.DPOSProposalVote PendingProposals []payload.DPOSProposal PendingVotes []payload.DPOSProposalVote }
func (*ConsensusStatus) Deserialize ¶
func (s *ConsensusStatus) Deserialize(r io.Reader) error
type IllegalProposals ¶
type IllegalProposals struct {
Proposals payload.DPOSIllegalProposals
}
func (*IllegalProposals) CMD ¶
func (msg *IllegalProposals) CMD() string
func (*IllegalProposals) Deserialize ¶
func (msg *IllegalProposals) Deserialize(r io.Reader) error
func (*IllegalProposals) MaxLength ¶
func (msg *IllegalProposals) MaxLength() uint32
type IllegalVotes ¶
type IllegalVotes struct {
Votes payload.DPOSIllegalVotes
}
func (*IllegalVotes) CMD ¶
func (msg *IllegalVotes) CMD() string
func (*IllegalVotes) Deserialize ¶
func (msg *IllegalVotes) Deserialize(r io.Reader) error
func (*IllegalVotes) MaxLength ¶
func (msg *IllegalVotes) MaxLength() uint32
type Inventory ¶
func NewInventory ¶
type Proposal ¶
type Proposal struct {
Proposal payload.DPOSProposal
}
type Reject ¶
type Reject struct { // Cmd is the command for the message which was rejected such as // as CmdBlock or CmdReject. This can be obtained from the Command function // of a Message. Cmd string // RejectCode is a code indicating why the command was rejected. It // is encoded as a uint8 on the wire. Code RejectCode // Reason is a human-readable string with specific details (over and // above the reject code) about why the command was rejected. Reason string // Hash identifies a specific block or transaction that was rejected // and therefore only applies the MsgBlock and MsgReject messages. Hash common.Uint256 }
type RejectCode ¶
type RejectCode uint8
RejectCode represents a numeric value by which a remote peer indicates why a message was rejected.
const ( RejectMalformed RejectCode = 0x01 RejectInvalid RejectCode = 0x10 RejectObsolete RejectCode = 0x11 RejectDuplicate RejectCode = 0x12 RejectNonstandard RejectCode = 0x40 RejectDust RejectCode = 0x41 RejectInsufficientFee RejectCode = 0x42 RejectCheckpoint RejectCode = 0x43 )
These constants define the various supported reject codes.
func (RejectCode) String ¶
func (code RejectCode) String() string
String returns the RejectCode in human-readable form.
type RequestConsensus ¶
type RequestConsensus struct {
Height uint32
}
func (*RequestConsensus) CMD ¶
func (msg *RequestConsensus) CMD() string
func (*RequestConsensus) Deserialize ¶
func (msg *RequestConsensus) Deserialize(r io.Reader) error
func (*RequestConsensus) MaxLength ¶
func (msg *RequestConsensus) MaxLength() uint32
type RequestProposal ¶
func (*RequestProposal) CMD ¶
func (msg *RequestProposal) CMD() string
func (*RequestProposal) Deserialize ¶
func (msg *RequestProposal) Deserialize(r io.Reader) error
func (*RequestProposal) MaxLength ¶
func (msg *RequestProposal) MaxLength() uint32
type ResponseBlocks ¶
func (*ResponseBlocks) CMD ¶
func (m *ResponseBlocks) CMD() string
func (*ResponseBlocks) Deserialize ¶
func (m *ResponseBlocks) Deserialize(r io.Reader) error
func (*ResponseBlocks) MaxLength ¶
func (m *ResponseBlocks) MaxLength() uint32
type ResponseConsensus ¶
type ResponseConsensus struct {
Consensus ConsensusStatus
}
func (*ResponseConsensus) CMD ¶
func (msg *ResponseConsensus) CMD() string
func (*ResponseConsensus) Deserialize ¶
func (msg *ResponseConsensus) Deserialize(r io.Reader) error
func (*ResponseConsensus) MaxLength ¶
func (msg *ResponseConsensus) MaxLength() uint32
type ResponseInactiveArbitrators ¶ added in v0.3.0
func (*ResponseInactiveArbitrators) CMD ¶ added in v0.3.0
func (i *ResponseInactiveArbitrators) CMD() string
func (*ResponseInactiveArbitrators) Deserialize ¶ added in v0.3.0
func (i *ResponseInactiveArbitrators) Deserialize(r io.Reader) (err error)
func (*ResponseInactiveArbitrators) DeserializeUnsigned ¶ added in v0.3.0
func (i *ResponseInactiveArbitrators) DeserializeUnsigned(r io.Reader) (err error)
func (*ResponseInactiveArbitrators) MaxLength ¶ added in v0.3.0
func (i *ResponseInactiveArbitrators) MaxLength() uint32
func (*ResponseInactiveArbitrators) Serialize ¶ added in v0.3.0
func (i *ResponseInactiveArbitrators) Serialize(w io.Writer) error
func (*ResponseInactiveArbitrators) SerializeUnsigned ¶ added in v0.3.0
func (i *ResponseInactiveArbitrators) SerializeUnsigned(w io.Writer) error
type ResponseRevertToDPOS ¶ added in v0.7.0
func (*ResponseRevertToDPOS) CMD ¶ added in v0.7.0
func (i *ResponseRevertToDPOS) CMD() string
func (*ResponseRevertToDPOS) Deserialize ¶ added in v0.7.0
func (i *ResponseRevertToDPOS) Deserialize(r io.Reader) (err error)
func (*ResponseRevertToDPOS) DeserializeUnsigned ¶ added in v0.7.0
func (i *ResponseRevertToDPOS) DeserializeUnsigned(r io.Reader) (err error)
func (*ResponseRevertToDPOS) MaxLength ¶ added in v0.7.0
func (i *ResponseRevertToDPOS) MaxLength() uint32
func (*ResponseRevertToDPOS) Serialize ¶ added in v0.7.0
func (i *ResponseRevertToDPOS) Serialize(w io.Writer) error
func (*ResponseRevertToDPOS) SerializeUnsigned ¶ added in v0.7.0
func (i *ResponseRevertToDPOS) SerializeUnsigned(w io.Writer) error
type SidechainIllegalData ¶ added in v0.3.0
type SidechainIllegalData struct {
Data payload.SidechainIllegalData
}
func (*SidechainIllegalData) CMD ¶ added in v0.3.0
func (msg *SidechainIllegalData) CMD() string
func (*SidechainIllegalData) Deserialize ¶ added in v0.3.0
func (msg *SidechainIllegalData) Deserialize(r io.Reader) error
func (*SidechainIllegalData) MaxLength ¶ added in v0.3.0
func (msg *SidechainIllegalData) MaxLength() uint32
type Vote ¶
type Vote struct { Command string Vote payload.DPOSProposalVote }
Source Files ¶
- addr.go
- commands.go
- consensusstatus.go
- getblock.go
- getblocks.go
- illegalproposals.go
- illegalvotes.go
- inventory.go
- ping.go
- pong.go
- proposal.go
- reject.go
- requestconsensus.go
- requestproposal.go
- responseblocks.go
- responseconsensus.go
- responseinactivearbitrators.go
- responsereverttodpos.go
- sidechainillegaldata.go
- verack.go
- version.go
- vote.go
Click to show internal directories.
Click to hide internal directories.