consensus

package
v0.0.0-...-a4757fd Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2018 License: Apache-2.0, Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package consensus is a generated protocol buffer package.

It is generated from these files:

message.proto

It has these top-level messages:

NewRoundStepMessage
ProtoBitArray
CommitStepMessage
ProposalMessage
ProposalPOLMessage
BlockPartMessage
VoteMessage
HasVoteMessage
VoteSetMaj23Message
VoteSetBitsMessage
ConsensusMessage

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthMessage = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMessage   = fmt.Errorf("proto: integer overflow")
)
View Source
var MsgType_name = map[int32]string{
	0: "None",
	1: "NewRoundStep",
	2: "CommitStep",
	3: "Proposal",
	4: "ProposalPOL",
	5: "BlockPart",
	6: "Vote",
	7: "HasVote",
	8: "VoteSetMaj23",
	9: "VoteSetBits",
}
View Source
var MsgType_value = map[string]int32{
	"None":         0,
	"NewRoundStep": 1,
	"CommitStep":   2,
	"Proposal":     3,
	"ProposalPOL":  4,
	"BlockPart":    5,
	"Vote":         6,
	"HasVote":      7,
	"VoteSetMaj23": 8,
	"VoteSetBits":  9,
}
View Source
var RoundStepType_name = map[int32]string{
	0: "EnumBegin",
	1: "NewHeight",
	2: "NewRound",
	3: "Propose",
	4: "Prevote",
	5: "PrevoteWait",
	6: "Precommit",
	7: "PrecommitWait",
	8: "Commit",
}
View Source
var RoundStepType_value = map[string]int32{
	"EnumBegin":     0,
	"NewHeight":     1,
	"NewRound":      2,
	"Propose":       3,
	"Prevote":       4,
	"PrevoteWait":   5,
	"Precommit":     6,
	"PrecommitWait": 7,
	"Commit":        8,
}

Functions

func MarshalData

func MarshalData(msg ConsensusMsgItfc) []byte

Must ok

func MarshalDataToCssMsg

func MarshalDataToCssMsg(msg proto.Message) []byte

func TransferProtoBitArray

func TransferProtoBitArray(p *ProtoBitArray) (ba *BitArray)

Types

type BlockPartMessage

type BlockPartMessage struct {
	Height int64       `protobuf:"varint,1,opt,name=Height,proto3" json:"Height,omitempty"`
	Round  int64       `protobuf:"varint,2,opt,name=Round,proto3" json:"Round,omitempty"`
	Part   *types.Part `protobuf:"bytes,3,opt,name=Part" json:"Part,omitempty"`
}

func (*BlockPartMessage) CString

func (m *BlockPartMessage) CString() string

func (*BlockPartMessage) Descriptor

func (*BlockPartMessage) Descriptor() ([]byte, []int)

func (*BlockPartMessage) GetHeight

func (m *BlockPartMessage) GetHeight() int64

func (*BlockPartMessage) GetPart

func (m *BlockPartMessage) GetPart() *types.Part

func (*BlockPartMessage) GetRound

func (m *BlockPartMessage) GetRound() int64

func (*BlockPartMessage) Marshal

func (m *BlockPartMessage) Marshal() (dAtA []byte, err error)

func (*BlockPartMessage) MarshalTo

func (m *BlockPartMessage) MarshalTo(dAtA []byte) (int, error)

func (*BlockPartMessage) ProtoMessage

func (*BlockPartMessage) ProtoMessage()

func (*BlockPartMessage) Reset

func (m *BlockPartMessage) Reset()

func (*BlockPartMessage) Size

func (m *BlockPartMessage) Size() (n int)

func (*BlockPartMessage) String

func (m *BlockPartMessage) String() string

func (*BlockPartMessage) Unmarshal

func (m *BlockPartMessage) Unmarshal(dAtA []byte) error

type CommitStepMessage

type CommitStepMessage struct {
	Height           int64                `protobuf:"varint,1,opt,name=Height,proto3" json:"Height,omitempty"`
	BlockPartsHeader *types.PartSetHeader `protobuf:"bytes,2,opt,name=BlockPartsHeader" json:"BlockPartsHeader,omitempty"`
	BlockParts       *ProtoBitArray       `protobuf:"bytes,3,opt,name=BlockParts" json:"BlockParts,omitempty"`
}

func (*CommitStepMessage) CString

func (m *CommitStepMessage) CString() string

func (*CommitStepMessage) Descriptor

func (*CommitStepMessage) Descriptor() ([]byte, []int)

func (*CommitStepMessage) GetBlockParts

func (m *CommitStepMessage) GetBlockParts() *ProtoBitArray

func (*CommitStepMessage) GetBlockPartsHeader

func (m *CommitStepMessage) GetBlockPartsHeader() *types.PartSetHeader

func (*CommitStepMessage) GetHeight

func (m *CommitStepMessage) GetHeight() int64

func (*CommitStepMessage) Marshal

func (m *CommitStepMessage) Marshal() (dAtA []byte, err error)

func (*CommitStepMessage) MarshalTo

func (m *CommitStepMessage) MarshalTo(dAtA []byte) (int, error)

func (*CommitStepMessage) ProtoMessage

func (*CommitStepMessage) ProtoMessage()

func (*CommitStepMessage) Reset

func (m *CommitStepMessage) Reset()

func (*CommitStepMessage) Size

func (m *CommitStepMessage) Size() (n int)

func (*CommitStepMessage) String

func (m *CommitStepMessage) String() string

func (*CommitStepMessage) Unmarshal

func (m *CommitStepMessage) Unmarshal(dAtA []byte) error

type ConsensusMessage

type ConsensusMessage struct {
	Type MsgType `protobuf:"varint,1,opt,name=Type,proto3,enum=consensus.MsgType" json:"Type,omitempty"`
	Data []byte  `protobuf:"bytes,2,opt,name=Data,proto3" json:"Data,omitempty"`
}

func (*ConsensusMessage) Descriptor

func (*ConsensusMessage) Descriptor() ([]byte, []int)

func (*ConsensusMessage) GetData

func (m *ConsensusMessage) GetData() []byte

func (*ConsensusMessage) GetType

func (m *ConsensusMessage) GetType() MsgType

func (*ConsensusMessage) Marshal

func (m *ConsensusMessage) Marshal() (dAtA []byte, err error)

func (*ConsensusMessage) MarshalTo

func (m *ConsensusMessage) MarshalTo(dAtA []byte) (int, error)

func (*ConsensusMessage) ProtoMessage

func (*ConsensusMessage) ProtoMessage()

func (*ConsensusMessage) Reset

func (m *ConsensusMessage) Reset()

func (*ConsensusMessage) Size

func (m *ConsensusMessage) Size() (n int)

func (*ConsensusMessage) String

func (m *ConsensusMessage) String() string

func (*ConsensusMessage) Unmarshal

func (m *ConsensusMessage) Unmarshal(dAtA []byte) error

type ConsensusMsgItfc

type ConsensusMsgItfc proto.Message

func MsgFromType

func MsgFromType(typ MsgType) (msgItfc ConsensusMsgItfc, err error)

func UnmarshalCssMsg

func UnmarshalCssMsg(bz []byte) (ConsensusMsgItfc, error)

type HasVoteMessage

type HasVoteMessage struct {
	Height int64          `protobuf:"varint,1,opt,name=Height,proto3" json:"Height,omitempty"`
	Round  int64          `protobuf:"varint,2,opt,name=Round,proto3" json:"Round,omitempty"`
	Type   types.VoteType `protobuf:"varint,3,opt,name=Type,proto3,enum=types.VoteType" json:"Type,omitempty"`
	Index  int64          `protobuf:"varint,4,opt,name=Index,proto3" json:"Index,omitempty"`
}

func (*HasVoteMessage) CString

func (m *HasVoteMessage) CString() string

func (*HasVoteMessage) Descriptor

func (*HasVoteMessage) Descriptor() ([]byte, []int)

func (*HasVoteMessage) GetHeight

func (m *HasVoteMessage) GetHeight() int64

func (*HasVoteMessage) GetIndex

func (m *HasVoteMessage) GetIndex() int64

func (*HasVoteMessage) GetRound

func (m *HasVoteMessage) GetRound() int64

func (*HasVoteMessage) GetType

func (m *HasVoteMessage) GetType() types.VoteType

func (*HasVoteMessage) Marshal

func (m *HasVoteMessage) Marshal() (dAtA []byte, err error)

func (*HasVoteMessage) MarshalTo

func (m *HasVoteMessage) MarshalTo(dAtA []byte) (int, error)

func (*HasVoteMessage) ProtoMessage

func (*HasVoteMessage) ProtoMessage()

func (*HasVoteMessage) Reset

func (m *HasVoteMessage) Reset()

func (*HasVoteMessage) Size

func (m *HasVoteMessage) Size() (n int)

func (*HasVoteMessage) String

func (m *HasVoteMessage) String() string

func (*HasVoteMessage) Unmarshal

func (m *HasVoteMessage) Unmarshal(dAtA []byte) error

type MsgType

type MsgType int32
const (
	MsgType_None         MsgType = 0
	MsgType_NewRoundStep MsgType = 1
	MsgType_CommitStep   MsgType = 2
	MsgType_Proposal     MsgType = 3
	MsgType_ProposalPOL  MsgType = 4
	MsgType_BlockPart    MsgType = 5
	MsgType_Vote         MsgType = 6
	MsgType_HasVote      MsgType = 7
	MsgType_VoteSetMaj23 MsgType = 8
	MsgType_VoteSetBits  MsgType = 9
)

func GetMessageType

func GetMessageType(msg proto.Message) MsgType

func (MsgType) EnumDescriptor

func (MsgType) EnumDescriptor() ([]byte, []int)

func (MsgType) String

func (x MsgType) String() string

type NewRoundStepMessage

type NewRoundStepMessage struct {
	Height                int64         `protobuf:"varint,1,opt,name=Height,proto3" json:"Height,omitempty"`
	Round                 int64         `protobuf:"varint,2,opt,name=Round,proto3" json:"Round,omitempty"`
	Step                  RoundStepType `protobuf:"varint,3,opt,name=Step,proto3,enum=consensus.RoundStepType" json:"Step,omitempty"`
	SecondsSinceStartTime int64         `protobuf:"varint,4,opt,name=SecondsSinceStartTime,proto3" json:"SecondsSinceStartTime,omitempty"`
	LastCommitRound       int64         `protobuf:"varint,5,opt,name=LastCommitRound,proto3" json:"LastCommitRound,omitempty"`
}

func (*NewRoundStepMessage) CString

func (m *NewRoundStepMessage) CString() string

For every height/round/step transition

func (*NewRoundStepMessage) Descriptor

func (*NewRoundStepMessage) Descriptor() ([]byte, []int)

func (*NewRoundStepMessage) GetHeight

func (m *NewRoundStepMessage) GetHeight() int64

func (*NewRoundStepMessage) GetLastCommitRound

func (m *NewRoundStepMessage) GetLastCommitRound() int64

func (*NewRoundStepMessage) GetRound

func (m *NewRoundStepMessage) GetRound() int64

func (*NewRoundStepMessage) GetSecondsSinceStartTime

func (m *NewRoundStepMessage) GetSecondsSinceStartTime() int64

func (*NewRoundStepMessage) GetStep

func (m *NewRoundStepMessage) GetStep() RoundStepType

func (*NewRoundStepMessage) Marshal

func (m *NewRoundStepMessage) Marshal() (dAtA []byte, err error)

func (*NewRoundStepMessage) MarshalTo

func (m *NewRoundStepMessage) MarshalTo(dAtA []byte) (int, error)

func (*NewRoundStepMessage) ProtoMessage

func (*NewRoundStepMessage) ProtoMessage()

func (*NewRoundStepMessage) Reset

func (m *NewRoundStepMessage) Reset()

func (*NewRoundStepMessage) Size

func (m *NewRoundStepMessage) Size() (n int)

func (*NewRoundStepMessage) String

func (m *NewRoundStepMessage) String() string

func (*NewRoundStepMessage) Unmarshal

func (m *NewRoundStepMessage) Unmarshal(dAtA []byte) error

type ProposalMessage

type ProposalMessage struct {
	Proposal *types.Proposal `protobuf:"bytes,1,opt,name=Proposal" json:"Proposal,omitempty"`
}

func (*ProposalMessage) CString

func (m *ProposalMessage) CString() string

func (*ProposalMessage) Descriptor

func (*ProposalMessage) Descriptor() ([]byte, []int)

func (*ProposalMessage) GetProposal

func (m *ProposalMessage) GetProposal() *types.Proposal

func (*ProposalMessage) Marshal

func (m *ProposalMessage) Marshal() (dAtA []byte, err error)

func (*ProposalMessage) MarshalTo

func (m *ProposalMessage) MarshalTo(dAtA []byte) (int, error)

func (*ProposalMessage) ProtoMessage

func (*ProposalMessage) ProtoMessage()

func (*ProposalMessage) Reset

func (m *ProposalMessage) Reset()

func (*ProposalMessage) Size

func (m *ProposalMessage) Size() (n int)

func (*ProposalMessage) String

func (m *ProposalMessage) String() string

func (*ProposalMessage) Unmarshal

func (m *ProposalMessage) Unmarshal(dAtA []byte) error

type ProposalPOLMessage

type ProposalPOLMessage struct {
	Height           int64          `protobuf:"varint,1,opt,name=Height,proto3" json:"Height,omitempty"`
	ProposalPOLRound int64          `protobuf:"varint,2,opt,name=ProposalPOLRound,proto3" json:"ProposalPOLRound,omitempty"`
	ProposalPOL      *ProtoBitArray `protobuf:"bytes,3,opt,name=ProposalPOL" json:"ProposalPOL,omitempty"`
}

func (*ProposalPOLMessage) CString

func (m *ProposalPOLMessage) CString() string

func (*ProposalPOLMessage) Descriptor

func (*ProposalPOLMessage) Descriptor() ([]byte, []int)

func (*ProposalPOLMessage) GetHeight

func (m *ProposalPOLMessage) GetHeight() int64

func (*ProposalPOLMessage) GetProposalPOL

func (m *ProposalPOLMessage) GetProposalPOL() *ProtoBitArray

func (*ProposalPOLMessage) GetProposalPOLRound

func (m *ProposalPOLMessage) GetProposalPOLRound() int64

func (*ProposalPOLMessage) Marshal

func (m *ProposalPOLMessage) Marshal() (dAtA []byte, err error)

func (*ProposalPOLMessage) MarshalTo

func (m *ProposalPOLMessage) MarshalTo(dAtA []byte) (int, error)

func (*ProposalPOLMessage) ProtoMessage

func (*ProposalPOLMessage) ProtoMessage()

func (*ProposalPOLMessage) Reset

func (m *ProposalPOLMessage) Reset()

func (*ProposalPOLMessage) Size

func (m *ProposalPOLMessage) Size() (n int)

func (*ProposalPOLMessage) String

func (m *ProposalPOLMessage) String() string

func (*ProposalPOLMessage) Unmarshal

func (m *ProposalPOLMessage) Unmarshal(dAtA []byte) error

type ProtoBitArray

type ProtoBitArray struct {
	Bits  int64    `protobuf:"varint,3,opt,name=Bits,proto3" json:"Bits,omitempty"`
	Elems []uint64 `protobuf:"varint,4,rep,packed,name=Elems" json:"Elems,omitempty"`
}

func TransferBitArray

func TransferBitArray(bitArray *BitArray) (p *ProtoBitArray)

func (*ProtoBitArray) Descriptor

func (*ProtoBitArray) Descriptor() ([]byte, []int)

func (*ProtoBitArray) GetBits

func (m *ProtoBitArray) GetBits() int64

func (*ProtoBitArray) GetElems

func (m *ProtoBitArray) GetElems() []uint64

func (*ProtoBitArray) Marshal

func (m *ProtoBitArray) Marshal() (dAtA []byte, err error)

func (*ProtoBitArray) MarshalTo

func (m *ProtoBitArray) MarshalTo(dAtA []byte) (int, error)

func (*ProtoBitArray) ProtoMessage

func (*ProtoBitArray) ProtoMessage()

func (*ProtoBitArray) Reset

func (m *ProtoBitArray) Reset()

func (*ProtoBitArray) Size

func (m *ProtoBitArray) Size() (n int)

func (*ProtoBitArray) String

func (m *ProtoBitArray) String() string

func (*ProtoBitArray) Unmarshal

func (m *ProtoBitArray) Unmarshal(dAtA []byte) error

type RoundStepType

type RoundStepType int32
const (
	RoundStepType_EnumBegin     RoundStepType = 0
	RoundStepType_NewHeight     RoundStepType = 1
	RoundStepType_NewRound      RoundStepType = 2
	RoundStepType_Propose       RoundStepType = 3
	RoundStepType_Prevote       RoundStepType = 4
	RoundStepType_PrevoteWait   RoundStepType = 5
	RoundStepType_Precommit     RoundStepType = 6
	RoundStepType_PrecommitWait RoundStepType = 7
	RoundStepType_Commit        RoundStepType = 8
)

func (RoundStepType) CString

func (rs RoundStepType) CString() string

func (RoundStepType) EnumDescriptor

func (RoundStepType) EnumDescriptor() ([]byte, []int)

func (RoundStepType) String

func (x RoundStepType) String() string

type StConsensusMsg

type StConsensusMsg struct {
	ConsensusMsgItfc
}

func (StConsensusMsg) MarshalJSON

func (csm StConsensusMsg) MarshalJSON() ([]byte, error)

func (*StConsensusMsg) UnmarshalJSON

func (csm *StConsensusMsg) UnmarshalJSON(data []byte) error

type VoteMessage

type VoteMessage struct {
	Vote *types.Vote `protobuf:"bytes,1,opt,name=Vote" json:"Vote,omitempty"`
}

func (*VoteMessage) CString

func (m *VoteMessage) CString() string

func (*VoteMessage) Descriptor

func (*VoteMessage) Descriptor() ([]byte, []int)

func (*VoteMessage) GetVote

func (m *VoteMessage) GetVote() *types.Vote

func (*VoteMessage) Marshal

func (m *VoteMessage) Marshal() (dAtA []byte, err error)

func (*VoteMessage) MarshalTo

func (m *VoteMessage) MarshalTo(dAtA []byte) (int, error)

func (*VoteMessage) ProtoMessage

func (*VoteMessage) ProtoMessage()

func (*VoteMessage) Reset

func (m *VoteMessage) Reset()

func (*VoteMessage) Size

func (m *VoteMessage) Size() (n int)

func (*VoteMessage) String

func (m *VoteMessage) String() string

func (*VoteMessage) Unmarshal

func (m *VoteMessage) Unmarshal(dAtA []byte) error

type VoteSetBitsMessage

type VoteSetBitsMessage struct {
	Height  int64          `protobuf:"varint,1,opt,name=Height,proto3" json:"Height,omitempty"`
	Round   int64          `protobuf:"varint,2,opt,name=Round,proto3" json:"Round,omitempty"`
	Type    types.VoteType `protobuf:"varint,3,opt,name=Type,proto3,enum=types.VoteType" json:"Type,omitempty"`
	BlockID *types.BlockID `protobuf:"bytes,4,opt,name=BlockID" json:"BlockID,omitempty"`
	Votes   *ProtoBitArray `protobuf:"bytes,5,opt,name=Votes" json:"Votes,omitempty"`
}

func (*VoteSetBitsMessage) CString

func (m *VoteSetBitsMessage) CString() string

func (*VoteSetBitsMessage) Descriptor

func (*VoteSetBitsMessage) Descriptor() ([]byte, []int)

func (*VoteSetBitsMessage) GetBlockID

func (m *VoteSetBitsMessage) GetBlockID() *types.BlockID

func (*VoteSetBitsMessage) GetHeight

func (m *VoteSetBitsMessage) GetHeight() int64

func (*VoteSetBitsMessage) GetRound

func (m *VoteSetBitsMessage) GetRound() int64

func (*VoteSetBitsMessage) GetType

func (m *VoteSetBitsMessage) GetType() types.VoteType

func (*VoteSetBitsMessage) GetVotes

func (m *VoteSetBitsMessage) GetVotes() *ProtoBitArray

func (*VoteSetBitsMessage) Marshal

func (m *VoteSetBitsMessage) Marshal() (dAtA []byte, err error)

func (*VoteSetBitsMessage) MarshalTo

func (m *VoteSetBitsMessage) MarshalTo(dAtA []byte) (int, error)

func (*VoteSetBitsMessage) ProtoMessage

func (*VoteSetBitsMessage) ProtoMessage()

func (*VoteSetBitsMessage) Reset

func (m *VoteSetBitsMessage) Reset()

func (*VoteSetBitsMessage) Size

func (m *VoteSetBitsMessage) Size() (n int)

func (*VoteSetBitsMessage) String

func (m *VoteSetBitsMessage) String() string

func (*VoteSetBitsMessage) Unmarshal

func (m *VoteSetBitsMessage) Unmarshal(dAtA []byte) error

type VoteSetMaj23Message

type VoteSetMaj23Message struct {
	Height  int64          `protobuf:"varint,1,opt,name=Height,proto3" json:"Height,omitempty"`
	Round   int64          `protobuf:"varint,2,opt,name=Round,proto3" json:"Round,omitempty"`
	Type    types.VoteType `protobuf:"varint,3,opt,name=Type,proto3,enum=types.VoteType" json:"Type,omitempty"`
	BlockID *types.BlockID `protobuf:"bytes,4,opt,name=BlockID" json:"BlockID,omitempty"`
}

func (*VoteSetMaj23Message) CString

func (m *VoteSetMaj23Message) CString() string

func (*VoteSetMaj23Message) Descriptor

func (*VoteSetMaj23Message) Descriptor() ([]byte, []int)

func (*VoteSetMaj23Message) GetBlockID

func (m *VoteSetMaj23Message) GetBlockID() *types.BlockID

func (*VoteSetMaj23Message) GetHeight

func (m *VoteSetMaj23Message) GetHeight() int64

func (*VoteSetMaj23Message) GetRound

func (m *VoteSetMaj23Message) GetRound() int64

func (*VoteSetMaj23Message) GetType

func (m *VoteSetMaj23Message) GetType() types.VoteType

func (*VoteSetMaj23Message) Marshal

func (m *VoteSetMaj23Message) Marshal() (dAtA []byte, err error)

func (*VoteSetMaj23Message) MarshalTo

func (m *VoteSetMaj23Message) MarshalTo(dAtA []byte) (int, error)

func (*VoteSetMaj23Message) ProtoMessage

func (*VoteSetMaj23Message) ProtoMessage()

func (*VoteSetMaj23Message) Reset

func (m *VoteSetMaj23Message) Reset()

func (*VoteSetMaj23Message) Size

func (m *VoteSetMaj23Message) Size() (n int)

func (*VoteSetMaj23Message) String

func (m *VoteSetMaj23Message) String() string

func (*VoteSetMaj23Message) Unmarshal

func (m *VoteSetMaj23Message) Unmarshal(dAtA []byte) error

Jump to

Keyboard shortcuts

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