Documentation ¶
Index ¶
- Variables
- func RegisterBraftServer(s *grpc.Server, srv BraftServer)
- type AccuseRecord
- func (*AccuseRecord) Descriptor() ([]byte, []int)
- func (m *AccuseRecord) GetAccuseType() int32
- func (m *AccuseRecord) GetLeaderId() int32
- func (m *AccuseRecord) GetLocalId() int32
- func (m *AccuseRecord) GetReason() string
- func (m *AccuseRecord) GetTerm() int64
- func (m *AccuseRecord) GetTimestamp() int64
- func (*AccuseRecord) ProtoMessage()
- func (m *AccuseRecord) Reset()
- func (m *AccuseRecord) String() string
- func (m *AccuseRecord) XXX_DiscardUnknown()
- func (m *AccuseRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *AccuseRecord) XXX_Merge(src proto.Message)
- func (m *AccuseRecord) XXX_Size() int
- func (m *AccuseRecord) XXX_Unmarshal(b []byte) error
- type AddressInfo
- func (*AddressInfo) Descriptor() ([]byte, []int)
- func (m *AddressInfo) GetAddress() string
- func (m *AddressInfo) GetAmount() int64
- func (*AddressInfo) ProtoMessage()
- func (m *AddressInfo) Reset()
- func (m *AddressInfo) String() string
- func (m *AddressInfo) XXX_DiscardUnknown()
- func (m *AddressInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *AddressInfo) XXX_Merge(src proto.Message)
- func (m *AddressInfo) XXX_Size() int
- func (m *AddressInfo) XXX_Unmarshal(b []byte) error
- type BchBlockHeader
- func (*BchBlockHeader) Descriptor() ([]byte, []int)
- func (m *BchBlockHeader) GetBlockId() *crypto.Digest256
- func (m *BchBlockHeader) GetHeight() int32
- func (m *BchBlockHeader) GetPrevId() *crypto.Digest256
- func (header *BchBlockHeader) Id() *crypto.Digest256
- func (header *BchBlockHeader) IsPrevOf(other *BchBlockHeader) bool
- func (*BchBlockHeader) ProtoMessage()
- func (m *BchBlockHeader) Reset()
- func (m *BchBlockHeader) String() string
- func (m *BchBlockHeader) XXX_DiscardUnknown()
- func (m *BchBlockHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *BchBlockHeader) XXX_Merge(src proto.Message)
- func (m *BchBlockHeader) XXX_Size() int
- func (m *BchBlockHeader) XXX_Unmarshal(b []byte) error
- type Block
- func CreateBchBlock(timestampMs int64, prevBlockId *crypto.Digest256, txs []*Transaction, ...) *Block
- func CreateJoinReconfigBlock(timestampMs int64, prevBlockId *crypto.Digest256, t Reconfig_Type, host string, ...) *Block
- func CreateLeaveReconfigBlock(timestampMs int64, prevBlockId *crypto.Digest256, t Reconfig_Type, ...) *Block
- func CreateTxsBlock(timestampMs int64, prevBlockId *crypto.Digest256, txs []*Transaction) *Block
- func (*Block) Descriptor() ([]byte, []int)
- func (m *Block) GetBchBlockHeader() *BchBlockHeader
- func (m *Block) GetId() *crypto.Digest256
- func (m *Block) GetPrevBlockId() *crypto.Digest256
- func (m *Block) GetReconfig() *Reconfig
- func (m *Block) GetTimestampMs() int64
- func (m *Block) GetTxs() []*Transaction
- func (m *Block) GetType() Block_Type
- func (b *Block) IsBchBlock() bool
- func (b *Block) IsGenesis() bool
- func (b *Block) IsReconfig() bool
- func (b *Block) IsTxsBlock() bool
- func (*Block) ProtoMessage()
- func (m *Block) Reset()
- func (m *Block) String() string
- func (b *Block) UpdateBlockId()
- func (m *Block) XXX_DiscardUnknown()
- func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Block) XXX_Merge(src proto.Message)
- func (m *Block) XXX_Size() int
- func (m *Block) XXX_Unmarshal(b []byte) error
- type BlockInfo
- func (*BlockInfo) Descriptor() ([]byte, []int)
- func (m *BlockInfo) GetBlock() *Block
- func (m *BlockInfo) GetBlockId() *crypto.Digest256
- func (m *BlockInfo) GetHeight() int64
- func (m *BlockInfo) GetTerm() int64
- func (*BlockInfo) ProtoMessage()
- func (m *BlockInfo) Reset()
- func (m *BlockInfo) String() string
- func (m *BlockInfo) XXX_DiscardUnknown()
- func (m *BlockInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *BlockInfo) XXX_Merge(src proto.Message)
- func (m *BlockInfo) XXX_Size() int
- func (m *BlockInfo) XXX_Unmarshal(b []byte) error
- type BlockPack
- func (bp *BlockPack) Block() *Block
- func (bp *BlockPack) BlockId() *crypto.Digest256
- func (bp *BlockPack) BlockIdEqualTo(other *BlockPack) bool
- func (bp *BlockPack) BlockInfo() *BlockInfo
- func (bp *BlockPack) Clone() *BlockPack
- func (bp *BlockPack) DebugString() string
- func (*BlockPack) Descriptor() ([]byte, []int)
- func (m *BlockPack) GetCommits() map[int32]*CommitMsg
- func (m *BlockPack) GetInit() *InitMsg
- func (m *BlockPack) GetPrepares() map[int32]*PrepareMsg
- func (bp *BlockPack) HasLessTermHeightThan(other *BlockPack) bool
- func (bp *BlockPack) Height() int64
- func (bp *BlockPack) Id() *crypto.Digest256
- func (bp *BlockPack) IsBchBlock() bool
- func (bp *BlockPack) IsReconfigBlock() bool
- func (bp *BlockPack) IsTxsBlock() bool
- func (bp *BlockPack) PrevBlockId() *crypto.Digest256
- func (*BlockPack) ProtoMessage()
- func (m *BlockPack) Reset()
- func (bp *BlockPack) ShallowCopy() *BlockPack
- func (m *BlockPack) String() string
- func (bp *BlockPack) Term() int64
- func (bp *BlockPack) TimestampMs() int64
- func (bp *BlockPack) ToVotie() *Votie
- func (m *BlockPack) XXX_DiscardUnknown()
- func (m *BlockPack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *BlockPack) XXX_Merge(src proto.Message)
- func (m *BlockPack) XXX_Size() int
- func (m *BlockPack) XXX_Unmarshal(b []byte) error
- type Block_Type
- type BraftClient
- type BraftServer
- type ChainTxIdMsg
- func (*ChainTxIdMsg) Descriptor() ([]byte, []int)
- func (m *ChainTxIdMsg) GetNodeId() int32
- func (m *ChainTxIdMsg) GetSig() []byte
- func (m *ChainTxIdMsg) GetSignMsgId() string
- func (m *ChainTxIdMsg) GetTxId() string
- func (msg *ChainTxIdMsg) Id() *crypto.Digest256
- func (*ChainTxIdMsg) ProtoMessage()
- func (m *ChainTxIdMsg) Reset()
- func (m *ChainTxIdMsg) String() string
- func (m *ChainTxIdMsg) XXX_DiscardUnknown()
- func (m *ChainTxIdMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *ChainTxIdMsg) XXX_Merge(src proto.Message)
- func (m *ChainTxIdMsg) XXX_Size() int
- func (m *ChainTxIdMsg) XXX_Unmarshal(b []byte) error
- type CodeType
- type CommitMsg
- func (msg *CommitMsg) BlockInfoLite() *BlockInfo
- func (*CommitMsg) Descriptor() ([]byte, []int)
- func (m *CommitMsg) GetBlockId() *crypto.Digest256
- func (m *CommitMsg) GetHeight() int64
- func (m *CommitMsg) GetNodeId() int32
- func (m *CommitMsg) GetSig() []byte
- func (m *CommitMsg) GetTerm() int64
- func (msg *CommitMsg) Id() *crypto.Digest256
- func (*CommitMsg) ProtoMessage()
- func (m *CommitMsg) Reset()
- func (m *CommitMsg) String() string
- func (m *CommitMsg) XXX_DiscardUnknown()
- func (m *CommitMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *CommitMsg) XXX_Merge(src proto.Message)
- func (m *CommitMsg) XXX_Size() int
- func (m *CommitMsg) XXX_Unmarshal(b []byte) error
- type EchoRequest
- func (*EchoRequest) Descriptor() ([]byte, []int)
- func (m *EchoRequest) GetNonce() int32
- func (*EchoRequest) ProtoMessage()
- func (m *EchoRequest) Reset()
- func (m *EchoRequest) String() string
- func (m *EchoRequest) XXX_DiscardUnknown()
- func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *EchoRequest) XXX_Merge(src proto.Message)
- func (m *EchoRequest) XXX_Size() int
- func (m *EchoRequest) XXX_Unmarshal(b []byte) error
- type EchoResponse
- func (*EchoResponse) Descriptor() ([]byte, []int)
- func (m *EchoResponse) GetNonce() int32
- func (*EchoResponse) ProtoMessage()
- func (m *EchoResponse) Reset()
- func (m *EchoResponse) String() string
- func (m *EchoResponse) XXX_DiscardUnknown()
- func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *EchoResponse) XXX_Merge(src proto.Message)
- func (m *EchoResponse) XXX_Size() int
- func (m *EchoResponse) XXX_Unmarshal(b []byte) error
- type HeatbeatMsg
- func (*HeatbeatMsg) Descriptor() ([]byte, []int)
- func (m *HeatbeatMsg) GetTerm() int64
- func (m *HeatbeatMsg) GetVotes() []*Vote
- func (*HeatbeatMsg) ProtoMessage()
- func (m *HeatbeatMsg) Reset()
- func (m *HeatbeatMsg) String() string
- func (m *HeatbeatMsg) XXX_DiscardUnknown()
- func (m *HeatbeatMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *HeatbeatMsg) XXX_Merge(src proto.Message)
- func (m *HeatbeatMsg) XXX_Size() int
- func (m *HeatbeatMsg) XXX_Unmarshal(b []byte) error
- type InitMsg
- func (init *InitMsg) BlockId() *crypto.Digest256
- func (init *InitMsg) BlockInfo() *BlockInfo
- func (*InitMsg) Descriptor() ([]byte, []int)
- func (m *InitMsg) GetBlock() *Block
- func (m *InitMsg) GetHeight() int64
- func (m *InitMsg) GetNodeId() int32
- func (m *InitMsg) GetSig() []byte
- func (m *InitMsg) GetTerm() int64
- func (m *InitMsg) GetVotes() map[int32]*Vote
- func (init *InitMsg) Id() *crypto.Digest256
- func (init *InitMsg) PrevBlockId() *crypto.Digest256
- func (*InitMsg) ProtoMessage()
- func (m *InitMsg) Reset()
- func (m *InitMsg) String() string
- func (m *InitMsg) XXX_DiscardUnknown()
- func (m *InitMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *InitMsg) XXX_Merge(src proto.Message)
- func (m *InitMsg) XXX_Size() int
- func (m *InitMsg) XXX_Unmarshal(b []byte) error
- type IsCommitedResponse
- func (*IsCommitedResponse) Descriptor() ([]byte, []int)
- func (m *IsCommitedResponse) GetCommited() bool
- func (*IsCommitedResponse) ProtoMessage()
- func (m *IsCommitedResponse) Reset()
- func (m *IsCommitedResponse) String() string
- func (m *IsCommitedResponse) XXX_DiscardUnknown()
- func (m *IsCommitedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *IsCommitedResponse) XXX_Merge(src proto.Message)
- func (m *IsCommitedResponse) XXX_Size() int
- func (m *IsCommitedResponse) XXX_Unmarshal(b []byte) error
- type JoinRequest
- func (*JoinRequest) Descriptor() ([]byte, []int)
- func (m *JoinRequest) GetHost() string
- func (m *JoinRequest) GetPubkey() string
- func (m *JoinRequest) GetSig() []byte
- func (m *JoinRequest) GetVote() *Vote
- func (msg *JoinRequest) Id() *crypto.Digest256
- func (*JoinRequest) ProtoMessage()
- func (m *JoinRequest) Reset()
- func (m *JoinRequest) String() string
- func (m *JoinRequest) XXX_DiscardUnknown()
- func (m *JoinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *JoinRequest) XXX_Merge(src proto.Message)
- func (m *JoinRequest) XXX_Size() int
- func (m *JoinRequest) XXX_Unmarshal(b []byte) error
- type JoinResponse
- func (*JoinResponse) Descriptor() ([]byte, []int)
- func (m *JoinResponse) GetNodeID() int32
- func (m *JoinResponse) GetSynced() bool
- func (*JoinResponse) ProtoMessage()
- func (m *JoinResponse) Reset()
- func (m *JoinResponse) String() string
- func (m *JoinResponse) XXX_DiscardUnknown()
- func (m *JoinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *JoinResponse) XXX_Merge(src proto.Message)
- func (m *JoinResponse) XXX_Size() int
- func (m *JoinResponse) XXX_Unmarshal(b []byte) error
- type LeaveRequest
- func (*LeaveRequest) Descriptor() ([]byte, []int)
- func (m *LeaveRequest) GetMsg() string
- func (m *LeaveRequest) GetNodeId() int32
- func (m *LeaveRequest) GetSig() []byte
- func (msg *LeaveRequest) Id() *crypto.Digest256
- func (*LeaveRequest) ProtoMessage()
- func (m *LeaveRequest) Reset()
- func (m *LeaveRequest) String() string
- func (m *LeaveRequest) XXX_DiscardUnknown()
- func (m *LeaveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *LeaveRequest) XXX_Merge(src proto.Message)
- func (m *LeaveRequest) XXX_Size() int
- func (m *LeaveRequest) XXX_Unmarshal(b []byte) error
- type MultiSigInfo
- func (*MultiSigInfo) Descriptor() ([]byte, []int)
- func (m *MultiSigInfo) GetBchAddress() string
- func (m *MultiSigInfo) GetBchRedeemScript() []byte
- func (m *MultiSigInfo) GetBtcAddress() string
- func (m *MultiSigInfo) GetBtcRedeemScript() []byte
- func (*MultiSigInfo) ProtoMessage()
- func (m *MultiSigInfo) Reset()
- func (m *MultiSigInfo) String() string
- func (m *MultiSigInfo) XXX_DiscardUnknown()
- func (m *MultiSigInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *MultiSigInfo) XXX_Merge(src proto.Message)
- func (m *MultiSigInfo) XXX_Size() int
- func (m *MultiSigInfo) XXX_Unmarshal(b []byte) error
- type NewlyTx
- func (*NewlyTx) Descriptor() ([]byte, []int)
- func (m *NewlyTx) GetAmount() int64
- func (m *NewlyTx) GetData() []byte
- func (m *NewlyTx) GetTimestamp() int64
- func (*NewlyTx) ProtoMessage()
- func (m *NewlyTx) Reset()
- func (m *NewlyTx) String() string
- func (m *NewlyTx) XXX_DiscardUnknown()
- func (m *NewlyTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *NewlyTx) XXX_Merge(src proto.Message)
- func (m *NewlyTx) XXX_Size() int
- func (m *NewlyTx) XXX_Unmarshal(b []byte) error
- type NodeInfo
- func (*NodeInfo) Descriptor() ([]byte, []int)
- func (m *NodeInfo) GetHost() string
- func (m *NodeInfo) GetIsNormal() bool
- func (m *NodeInfo) GetName() string
- func (m *NodeInfo) GetNodeId() int32
- func (m *NodeInfo) GetPubkey() string
- func (*NodeInfo) ProtoMessage()
- func (m *NodeInfo) Reset()
- func (m *NodeInfo) String() string
- func (m *NodeInfo) XXX_DiscardUnknown()
- func (m *NodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *NodeInfo) XXX_Merge(src proto.Message)
- func (m *NodeInfo) XXX_Size() int
- func (m *NodeInfo) XXX_Unmarshal(b []byte) error
- type NodeList
- func (*NodeList) Descriptor() ([]byte, []int)
- func (m *NodeList) GetBlockHeight() int64
- func (m *NodeList) GetLeaderId() int32
- func (m *NodeList) GetMultiSigInfoList() []*MultiSigInfo
- func (m *NodeList) GetNodeList() []*NodeInfo
- func (nl NodeList) GetPubkeys() []string
- func (m *NodeList) GetQuorumN() int32
- func (*NodeList) ProtoMessage()
- func (m *NodeList) Reset()
- func (m *NodeList) String() string
- func (m *NodeList) XXX_DiscardUnknown()
- func (m *NodeList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *NodeList) XXX_Merge(src proto.Message)
- func (m *NodeList) XXX_Size() int
- func (m *NodeList) XXX_Unmarshal(b []byte) error
- type NodeRuntimeInfo
- func (*NodeRuntimeInfo) Descriptor() ([]byte, []int)
- func (m *NodeRuntimeInfo) GetBchHeight() int64
- func (m *NodeRuntimeInfo) GetBtcHeight() int64
- func (m *NodeRuntimeInfo) GetEthHeight() int64
- func (m *NodeRuntimeInfo) GetLeaderCnt() int32
- func (m *NodeRuntimeInfo) GetNodeID() int32
- func (*NodeRuntimeInfo) ProtoMessage()
- func (m *NodeRuntimeInfo) Reset()
- func (m *NodeRuntimeInfo) String() string
- func (m *NodeRuntimeInfo) XXX_DiscardUnknown()
- func (m *NodeRuntimeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *NodeRuntimeInfo) XXX_Merge(src proto.Message)
- func (m *NodeRuntimeInfo) XXX_Size() int
- func (m *NodeRuntimeInfo) XXX_Unmarshal(b []byte) error
- type PrepareMsg
- func (msg *PrepareMsg) BlockInfoLite() *BlockInfo
- func (msg *PrepareMsg) DebugString() string
- func (*PrepareMsg) Descriptor() ([]byte, []int)
- func (m *PrepareMsg) GetBlockId() *crypto.Digest256
- func (m *PrepareMsg) GetHeight() int64
- func (m *PrepareMsg) GetNodeId() int32
- func (m *PrepareMsg) GetSig() []byte
- func (m *PrepareMsg) GetTerm() int64
- func (msg *PrepareMsg) Id() *crypto.Digest256
- func (*PrepareMsg) ProtoMessage()
- func (m *PrepareMsg) Reset()
- func (m *PrepareMsg) String() string
- func (m *PrepareMsg) XXX_DiscardUnknown()
- func (m *PrepareMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PrepareMsg) XXX_Merge(src proto.Message)
- func (m *PrepareMsg) XXX_Size() int
- func (m *PrepareMsg) XXX_Unmarshal(b []byte) error
- type Reconfig
- func (*Reconfig) Descriptor() ([]byte, []int)
- func (m *Reconfig) GetHost() string
- func (m *Reconfig) GetNodeId() int32
- func (m *Reconfig) GetPubkey() string
- func (m *Reconfig) GetType() Reconfig_Type
- func (m *Reconfig) GetVote() *Vote
- func (reconfig *Reconfig) Id() *crypto.Digest256
- func (*Reconfig) ProtoMessage()
- func (m *Reconfig) Reset()
- func (m *Reconfig) String() string
- func (m *Reconfig) XXX_DiscardUnknown()
- func (m *Reconfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Reconfig) XXX_Merge(src proto.Message)
- func (m *Reconfig) XXX_Size() int
- func (m *Reconfig) XXX_Unmarshal(b []byte) error
- type Reconfig_Type
- type SignTxRequest
- func (*SignTxRequest) Descriptor() ([]byte, []int)
- func (m *SignTxRequest) GetMultisigAddress() string
- func (m *SignTxRequest) GetNewlyTx() *NewlyTx
- func (m *SignTxRequest) GetNodeId() int32
- func (m *SignTxRequest) GetSig() []byte
- func (m *SignTxRequest) GetTerm() int64
- func (m *SignTxRequest) GetTime() int64
- func (m *SignTxRequest) GetWatchedTx() *WatchedTxInfo
- func (msg *SignTxRequest) Id() *crypto.Digest256
- func (msg *SignTxRequest) MsgHash() string
- func (*SignTxRequest) ProtoMessage()
- func (m *SignTxRequest) Reset()
- func (m *SignTxRequest) String() string
- func (m *SignTxRequest) XXX_DiscardUnknown()
- func (m *SignTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SignTxRequest) XXX_Merge(src proto.Message)
- func (m *SignTxRequest) XXX_Size() int
- func (m *SignTxRequest) XXX_Unmarshal(b []byte) error
- type SignTxResponse
- func (*SignTxResponse) Descriptor() ([]byte, []int)
- func (m *SignTxResponse) GetCode() CodeType
- func (m *SignTxResponse) GetNodeId() int32
- func (m *SignTxResponse) GetSig() [][]byte
- func (*SignTxResponse) ProtoMessage()
- func (m *SignTxResponse) Reset()
- func (m *SignTxResponse) String() string
- func (m *SignTxResponse) XXX_DiscardUnknown()
- func (m *SignTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SignTxResponse) XXX_Merge(src proto.Message)
- func (m *SignTxResponse) XXX_Size() int
- func (m *SignTxResponse) XXX_Unmarshal(b []byte) error
- type SignedResult
- func (*SignedResult) Descriptor() ([]byte, []int)
- func (m *SignedResult) GetCode() CodeType
- func (m *SignedResult) GetData() [][]byte
- func (m *SignedResult) GetNodeId() int32
- func (m *SignedResult) GetSig() []byte
- func (m *SignedResult) GetTerm() int64
- func (m *SignedResult) GetTo() string
- func (m *SignedResult) GetTxId() string
- func (msg *SignedResult) Id() *crypto.Digest256
- func (*SignedResult) ProtoMessage()
- func (m *SignedResult) Reset()
- func (m *SignedResult) String() string
- func (m *SignedResult) XXX_DiscardUnknown()
- func (m *SignedResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SignedResult) XXX_Merge(src proto.Message)
- func (m *SignedResult) XXX_Size() int
- func (m *SignedResult) XXX_Unmarshal(b []byte) error
- type SignedStatistic
- func (*SignedStatistic) Descriptor() ([]byte, []int)
- func (m *SignedStatistic) GetSignedMsgId() string
- func (m *SignedStatistic) GetStat() map[int32]CodeType
- func (m *SignedStatistic) GetStatus() TxStatus
- func (*SignedStatistic) ProtoMessage()
- func (m *SignedStatistic) Reset()
- func (m *SignedStatistic) String() string
- func (m *SignedStatistic) XXX_DiscardUnknown()
- func (m *SignedStatistic) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SignedStatistic) XXX_Merge(src proto.Message)
- func (m *SignedStatistic) XXX_Size() int
- func (m *SignedStatistic) XXX_Unmarshal(b []byte) error
- type StrongAccuse
- func (sa *StrongAccuse) DebugString() string
- func (*StrongAccuse) Descriptor() ([]byte, []int)
- func (m *StrongAccuse) GetWeakAccuses() map[int32]*WeakAccuse
- func (*StrongAccuse) ProtoMessage()
- func (m *StrongAccuse) Reset()
- func (m *StrongAccuse) String() string
- func (sa *StrongAccuse) Term() int64
- func (m *StrongAccuse) XXX_DiscardUnknown()
- func (m *StrongAccuse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *StrongAccuse) XXX_Merge(src proto.Message)
- func (m *StrongAccuse) XXX_Size() int
- func (m *StrongAccuse) XXX_Unmarshal(b []byte) error
- type SyncUpByHashRequest
- func (*SyncUpByHashRequest) Descriptor() ([]byte, []int)
- func (m *SyncUpByHashRequest) GetLocator() []*crypto.Digest256
- func (*SyncUpByHashRequest) ProtoMessage()
- func (m *SyncUpByHashRequest) Reset()
- func (m *SyncUpByHashRequest) String() string
- func (m *SyncUpByHashRequest) XXX_DiscardUnknown()
- func (m *SyncUpByHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SyncUpByHashRequest) XXX_Merge(src proto.Message)
- func (m *SyncUpByHashRequest) XXX_Size() int
- func (m *SyncUpByHashRequest) XXX_Unmarshal(b []byte) error
- type SyncUpRequest
- func (*SyncUpRequest) Descriptor() ([]byte, []int)
- func (m *SyncUpRequest) GetBaseHeight() int64
- func (*SyncUpRequest) ProtoMessage()
- func (m *SyncUpRequest) Reset()
- func (m *SyncUpRequest) String() string
- func (m *SyncUpRequest) XXX_DiscardUnknown()
- func (m *SyncUpRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SyncUpRequest) XXX_Merge(src proto.Message)
- func (m *SyncUpRequest) XXX_Size() int
- func (m *SyncUpRequest) XXX_Unmarshal(b []byte) error
- type SyncUpResponse
- func (*SyncUpResponse) Descriptor() ([]byte, []int)
- func (m *SyncUpResponse) GetCommits() []*BlockPack
- func (m *SyncUpResponse) GetFresh() *BlockPack
- func (m *SyncUpResponse) GetMore() bool
- func (m *SyncUpResponse) GetStrongAccuse() *StrongAccuse
- func (*SyncUpResponse) ProtoMessage()
- func (m *SyncUpResponse) Reset()
- func (m *SyncUpResponse) String() string
- func (m *SyncUpResponse) XXX_DiscardUnknown()
- func (m *SyncUpResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SyncUpResponse) XXX_Merge(src proto.Message)
- func (m *SyncUpResponse) XXX_Size() int
- func (m *SyncUpResponse) XXX_Unmarshal(b []byte) error
- type Transaction
- func (*Transaction) Descriptor() ([]byte, []int)
- func (tx *Transaction) EqualTo(other *Transaction) bool
- func (m *Transaction) GetAmount() int64
- func (m *Transaction) GetId() *crypto.Digest256
- func (m *Transaction) GetNewlyTxId() string
- func (m *Transaction) GetTime() int64
- func (m *Transaction) GetWatchedTx() *WatchedTxInfo
- func (*Transaction) ProtoMessage()
- func (m *Transaction) Reset()
- func (m *Transaction) String() string
- func (tx *Transaction) UpdateId()
- func (m *Transaction) XXX_DiscardUnknown()
- func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Transaction) XXX_Merge(src proto.Message)
- func (m *Transaction) XXX_Size() int
- func (m *Transaction) XXX_Unmarshal(b []byte) error
- type Transactions
- func (*Transactions) Descriptor() ([]byte, []int)
- func (m *Transactions) GetTxs() []*Transaction
- func (*Transactions) ProtoMessage()
- func (m *Transactions) Reset()
- func (m *Transactions) String() string
- func (m *Transactions) XXX_DiscardUnknown()
- func (m *Transactions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Transactions) XXX_Merge(src proto.Message)
- func (m *Transactions) XXX_Size() int
- func (m *Transactions) XXX_Unmarshal(b []byte) error
- type TxLookupEntry
- func (*TxLookupEntry) Descriptor() ([]byte, []int)
- func (m *TxLookupEntry) GetHeight() int64
- func (m *TxLookupEntry) GetIndex() int32
- func (*TxLookupEntry) ProtoMessage()
- func (m *TxLookupEntry) Reset()
- func (m *TxLookupEntry) String() string
- func (m *TxLookupEntry) XXX_DiscardUnknown()
- func (m *TxLookupEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *TxLookupEntry) XXX_Merge(src proto.Message)
- func (m *TxLookupEntry) XXX_Size() int
- func (m *TxLookupEntry) XXX_Unmarshal(b []byte) error
- type TxStatus
- type Void
- func (*Void) Descriptor() ([]byte, []int)
- func (*Void) ProtoMessage()
- func (m *Void) Reset()
- func (m *Void) String() string
- func (m *Void) XXX_DiscardUnknown()
- func (m *Void) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Void) XXX_Merge(src proto.Message)
- func (m *Void) XXX_Size() int
- func (m *Void) XXX_Unmarshal(b []byte) error
- type Vote
- func (vote *Vote) DebugString() string
- func (*Vote) Descriptor() ([]byte, []int)
- func (m *Vote) GetNodeId() int32
- func (m *Vote) GetSig() []byte
- func (m *Vote) GetTerm() int64
- func (m *Vote) GetVotie() *Votie
- func (vote *Vote) Id() *crypto.Digest256
- func (*Vote) ProtoMessage()
- func (m *Vote) Reset()
- func (m *Vote) String() string
- func (m *Vote) XXX_DiscardUnknown()
- func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Vote) XXX_Merge(src proto.Message)
- func (m *Vote) XXX_Size() int
- func (m *Vote) XXX_Unmarshal(b []byte) error
- type VoteMap
- type Votie
- func (*Votie) Descriptor() ([]byte, []int)
- func (m *Votie) GetBlock() *Block
- func (m *Votie) GetCommits() map[int32]*CommitMsg
- func (m *Votie) GetHeight() int64
- func (m *Votie) GetPrepares() map[int32]*PrepareMsg
- func (m *Votie) GetTerm() int64
- func (v *Votie) HasLessTermHeightThan(other *Votie) bool
- func (v *Votie) Id() *crypto.Digest256
- func (*Votie) ProtoMessage()
- func (m *Votie) Reset()
- func (m *Votie) String() string
- func (m *Votie) XXX_DiscardUnknown()
- func (m *Votie) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Votie) XXX_Merge(src proto.Message)
- func (m *Votie) XXX_Size() int
- func (m *Votie) XXX_Unmarshal(b []byte) error
- type WatchedTxInfo
- func (tx *WatchedTxInfo) Clone() *WatchedTxInfo
- func (*WatchedTxInfo) Descriptor() ([]byte, []int)
- func (tx *WatchedTxInfo) EqualTo(other *WatchedTxInfo) bool
- func (m *WatchedTxInfo) GetAmount() int64
- func (m *WatchedTxInfo) GetFee() int64
- func (m *WatchedTxInfo) GetFrom() string
- func (m *WatchedTxInfo) GetRechargeList() []*AddressInfo
- func (m *WatchedTxInfo) GetTo() string
- func (m *WatchedTxInfo) GetTokenFrom() uint32
- func (m *WatchedTxInfo) GetTokenTo() uint32
- func (m *WatchedTxInfo) GetTxid() string
- func (tx *WatchedTxInfo) IsDistributionTx() bool
- func (tx *WatchedTxInfo) IsTransferTx() bool
- func (*WatchedTxInfo) ProtoMessage()
- func (m *WatchedTxInfo) Reset()
- func (m *WatchedTxInfo) String() string
- func (m *WatchedTxInfo) XXX_DiscardUnknown()
- func (m *WatchedTxInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *WatchedTxInfo) XXX_Merge(src proto.Message)
- func (m *WatchedTxInfo) XXX_Size() int
- func (m *WatchedTxInfo) XXX_Unmarshal(b []byte) error
- type WeakAccuse
- func (*WeakAccuse) Descriptor() ([]byte, []int)
- func (m *WeakAccuse) GetNodeId() int32
- func (m *WeakAccuse) GetSig() []byte
- func (m *WeakAccuse) GetTerm() int64
- func (m *WeakAccuse) GetTime() int64
- func (wa *WeakAccuse) Id() *crypto.Digest256
- func (*WeakAccuse) ProtoMessage()
- func (m *WeakAccuse) Reset()
- func (m *WeakAccuse) String() string
- func (m *WeakAccuse) XXX_DiscardUnknown()
- func (m *WeakAccuse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *WeakAccuse) XXX_Merge(src proto.Message)
- func (m *WeakAccuse) XXX_Size() int
- func (m *WeakAccuse) XXX_Unmarshal(b []byte) error
- type WeakAccuses
- func (*WeakAccuses) Descriptor() ([]byte, []int)
- func (wa *WeakAccuses) Get(nodeId int32) *WeakAccuse
- func (m *WeakAccuses) GetAccuses() map[int32]*WeakAccuse
- func (*WeakAccuses) ProtoMessage()
- func (m *WeakAccuses) Reset()
- func (wa *WeakAccuses) Set(nodeId int32, weakAccuse *WeakAccuse)
- func (wa *WeakAccuses) Size() int
- func (m *WeakAccuses) String() string
- func (m *WeakAccuses) XXX_DiscardUnknown()
- func (m *WeakAccuses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *WeakAccuses) XXX_Merge(src proto.Message)
- func (m *WeakAccuses) XXX_Size() int
- func (m *WeakAccuses) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var Block_Type_name = map[int32]string{
0: "UNKNOWN",
1: "GENESIS",
2: "TXS",
3: "BCH",
4: "RECONFIG",
}
var Block_Type_value = map[string]int32{
"UNKNOWN": 0,
"GENESIS": 1,
"TXS": 2,
"BCH": 3,
"RECONFIG": 4,
}
var CodeType_name = map[int32]string{
0: "SIGNED",
1: "NEEDSYNC",
2: "REJECT",
}
var CodeType_value = map[string]int32{
"SIGNED": 0,
"NEEDSYNC": 1,
"REJECT": 2,
}
var Reconfig_Type_name = map[int32]string{
0: "JOIN",
1: "LEAVE",
}
var Reconfig_Type_value = map[string]int32{
"JOIN": 0,
"LEAVE": 1,
}
var TxStatus_name = map[int32]string{
0: "WAITING",
1: "COMMITTED",
2: "REJECTED",
}
var TxStatus_value = map[string]int32{
"WAITING": 0,
"COMMITTED": 1,
"REJECTED": 2,
}
Functions ¶
func RegisterBraftServer ¶
func RegisterBraftServer(s *grpc.Server, srv BraftServer)
Types ¶
type AccuseRecord ¶
type AccuseRecord struct { Term int64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` LocalId int32 `protobuf:"varint,2,opt,name=local_id,json=localId,proto3" json:"local_id,omitempty"` LeaderId int32 `protobuf:"varint,3,opt,name=leader_id,json=leaderId,proto3" json:"leader_id,omitempty"` // accuse_type: accuse类型,1表示weak,2表示strong AccuseType int32 `protobuf:"varint,4,opt,name=accuse_type,json=accuseType,proto3" json:"accuse_type,omitempty"` Timestamp int64 `protobuf:"varint,5,opt,name=timestamp,proto3" json:"timestamp,omitempty"` Reason string `protobuf:"bytes,6,opt,name=reason,proto3" json:"reason,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*AccuseRecord) Descriptor ¶
func (*AccuseRecord) Descriptor() ([]byte, []int)
func (*AccuseRecord) GetAccuseType ¶
func (m *AccuseRecord) GetAccuseType() int32
func (*AccuseRecord) GetLeaderId ¶
func (m *AccuseRecord) GetLeaderId() int32
func (*AccuseRecord) GetLocalId ¶
func (m *AccuseRecord) GetLocalId() int32
func (*AccuseRecord) GetReason ¶
func (m *AccuseRecord) GetReason() string
func (*AccuseRecord) GetTerm ¶
func (m *AccuseRecord) GetTerm() int64
func (*AccuseRecord) GetTimestamp ¶
func (m *AccuseRecord) GetTimestamp() int64
func (*AccuseRecord) ProtoMessage ¶
func (*AccuseRecord) ProtoMessage()
func (*AccuseRecord) Reset ¶
func (m *AccuseRecord) Reset()
func (*AccuseRecord) String ¶
func (m *AccuseRecord) String() string
func (*AccuseRecord) XXX_DiscardUnknown ¶
func (m *AccuseRecord) XXX_DiscardUnknown()
func (*AccuseRecord) XXX_Marshal ¶
func (m *AccuseRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AccuseRecord) XXX_Merge ¶
func (dst *AccuseRecord) XXX_Merge(src proto.Message)
func (*AccuseRecord) XXX_Size ¶
func (m *AccuseRecord) XXX_Size() int
func (*AccuseRecord) XXX_Unmarshal ¶
func (m *AccuseRecord) XXX_Unmarshal(b []byte) error
type AddressInfo ¶
type AddressInfo struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
AddressInfo 充值到侧链的地址和金额或者提币到主链的地址和金额
func (*AddressInfo) Descriptor ¶
func (*AddressInfo) Descriptor() ([]byte, []int)
func (*AddressInfo) GetAddress ¶
func (m *AddressInfo) GetAddress() string
func (*AddressInfo) GetAmount ¶
func (m *AddressInfo) GetAmount() int64
func (*AddressInfo) ProtoMessage ¶
func (*AddressInfo) ProtoMessage()
func (*AddressInfo) Reset ¶
func (m *AddressInfo) Reset()
func (*AddressInfo) String ¶
func (m *AddressInfo) String() string
func (*AddressInfo) XXX_DiscardUnknown ¶
func (m *AddressInfo) XXX_DiscardUnknown()
func (*AddressInfo) XXX_Marshal ¶
func (m *AddressInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*AddressInfo) XXX_Merge ¶
func (dst *AddressInfo) XXX_Merge(src proto.Message)
func (*AddressInfo) XXX_Size ¶
func (m *AddressInfo) XXX_Size() int
func (*AddressInfo) XXX_Unmarshal ¶
func (m *AddressInfo) XXX_Unmarshal(b []byte) error
type BchBlockHeader ¶
type BchBlockHeader struct { Height int32 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` BlockId *crypto.Digest256 `protobuf:"bytes,2,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` PrevId *crypto.Digest256 `protobuf:"bytes,3,opt,name=prev_id,json=prevId,proto3" json:"prev_id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func UnmarshalBchBlockHeader ¶
func UnmarshalBchBlockHeader(bytes []byte) *BchBlockHeader
UnmarshalBchBlockHeader 反序列化一个pb对象
func (*BchBlockHeader) Descriptor ¶
func (*BchBlockHeader) Descriptor() ([]byte, []int)
func (*BchBlockHeader) GetBlockId ¶
func (m *BchBlockHeader) GetBlockId() *crypto.Digest256
func (*BchBlockHeader) GetHeight ¶
func (m *BchBlockHeader) GetHeight() int32
func (*BchBlockHeader) GetPrevId ¶
func (m *BchBlockHeader) GetPrevId() *crypto.Digest256
func (*BchBlockHeader) Id ¶
func (header *BchBlockHeader) Id() *crypto.Digest256
func (*BchBlockHeader) IsPrevOf ¶
func (header *BchBlockHeader) IsPrevOf(other *BchBlockHeader) bool
func (*BchBlockHeader) ProtoMessage ¶
func (*BchBlockHeader) ProtoMessage()
func (*BchBlockHeader) Reset ¶
func (m *BchBlockHeader) Reset()
func (*BchBlockHeader) String ¶
func (m *BchBlockHeader) String() string
func (*BchBlockHeader) XXX_DiscardUnknown ¶
func (m *BchBlockHeader) XXX_DiscardUnknown()
func (*BchBlockHeader) XXX_Marshal ¶
func (m *BchBlockHeader) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BchBlockHeader) XXX_Merge ¶
func (dst *BchBlockHeader) XXX_Merge(src proto.Message)
func (*BchBlockHeader) XXX_Size ¶
func (m *BchBlockHeader) XXX_Size() int
func (*BchBlockHeader) XXX_Unmarshal ¶
func (m *BchBlockHeader) XXX_Unmarshal(b []byte) error
type Block ¶
type Block struct { TimestampMs int64 `protobuf:"varint,1,opt,name=timestampMs,proto3" json:"timestampMs,omitempty"` PrevBlockId *crypto.Digest256 `protobuf:"bytes,2,opt,name=prev_block_id,json=prevBlockId,proto3" json:"prev_block_id,omitempty"` Type Block_Type `protobuf:"varint,3,opt,name=type,proto3,enum=proto.Block_Type" json:"type,omitempty"` Txs []*Transaction `protobuf:"bytes,4,rep,name=txs,proto3" json:"txs,omitempty"` BchBlockHeader *BchBlockHeader `protobuf:"bytes,5,opt,name=bch_block_header,json=bchBlockHeader,proto3" json:"bch_block_header,omitempty"` Reconfig *Reconfig `protobuf:"bytes,6,opt,name=reconfig,proto3" json:"reconfig,omitempty"` Id *crypto.Digest256 `protobuf:"bytes,7,opt,name=id,proto3" json:"id,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func CreateBchBlock ¶
func CreateBchBlock(timestampMs int64, prevBlockId *crypto.Digest256, txs []*Transaction, header *BchBlockHeader) *Block
func CreateJoinReconfigBlock ¶
func CreateTxsBlock ¶
func CreateTxsBlock(timestampMs int64, prevBlockId *crypto.Digest256, txs []*Transaction) *Block
func (*Block) Descriptor ¶
func (*Block) GetBchBlockHeader ¶
func (m *Block) GetBchBlockHeader() *BchBlockHeader
func (*Block) GetPrevBlockId ¶
func (*Block) GetReconfig ¶
func (*Block) GetTimestampMs ¶
func (*Block) GetTxs ¶
func (m *Block) GetTxs() []*Transaction
func (*Block) GetType ¶
func (m *Block) GetType() Block_Type
func (*Block) IsBchBlock ¶
func (*Block) IsReconfig ¶
func (*Block) IsTxsBlock ¶
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) UpdateBlockId ¶
func (b *Block) UpdateBlockId()
func (*Block) XXX_DiscardUnknown ¶
func (m *Block) XXX_DiscardUnknown()
func (*Block) XXX_Marshal ¶
func (*Block) XXX_Unmarshal ¶
type BlockInfo ¶
type BlockInfo struct { Term int64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` BlockId *crypto.Digest256 `protobuf:"bytes,3,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` Block *Block `protobuf:"bytes,4,opt,name=block,proto3" json:"block,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewBlockInfoFull ¶
func NewBlockInfoLite ¶
func (*BlockInfo) Descriptor ¶
func (*BlockInfo) GetBlockId ¶
func (*BlockInfo) ProtoMessage ¶
func (*BlockInfo) ProtoMessage()
func (*BlockInfo) XXX_DiscardUnknown ¶
func (m *BlockInfo) XXX_DiscardUnknown()
func (*BlockInfo) XXX_Marshal ¶
func (*BlockInfo) XXX_Unmarshal ¶
type BlockPack ¶
type BlockPack struct { Init *InitMsg `protobuf:"bytes,1,opt,name=init,proto3" json:"init,omitempty"` // Key is nodeid, must match {init}'s term, height and block_id Prepares map[int32]*PrepareMsg `` /* 158-byte string literal not displayed */ // Key is nodeid, must match {init}'s term, height and block_id Commits map[int32]*CommitMsg `` /* 156-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func NewBlockPack ¶
func UnmarshalBlockPack ¶
func (*BlockPack) BlockIdEqualTo ¶
func (*BlockPack) DebugString ¶
func (*BlockPack) Descriptor ¶
func (*BlockPack) GetCommits ¶
func (*BlockPack) GetPrepares ¶
func (m *BlockPack) GetPrepares() map[int32]*PrepareMsg
func (*BlockPack) HasLessTermHeightThan ¶
func (*BlockPack) IsBchBlock ¶
func (*BlockPack) IsReconfigBlock ¶
func (*BlockPack) IsTxsBlock ¶
func (*BlockPack) PrevBlockId ¶
func (*BlockPack) ProtoMessage ¶
func (*BlockPack) ProtoMessage()
func (*BlockPack) ShallowCopy ¶
func (*BlockPack) TimestampMs ¶
func (*BlockPack) XXX_DiscardUnknown ¶
func (m *BlockPack) XXX_DiscardUnknown()
func (*BlockPack) XXX_Marshal ¶
func (*BlockPack) XXX_Unmarshal ¶
type Block_Type ¶
type Block_Type int32
const ( Block_UNKNOWN Block_Type = 0 Block_GENESIS Block_Type = 1 Block_TXS Block_Type = 2 Block_BCH Block_Type = 3 Block_RECONFIG Block_Type = 4 )
func (Block_Type) EnumDescriptor ¶
func (Block_Type) EnumDescriptor() ([]byte, []int)
func (Block_Type) String ¶
func (x Block_Type) String() string
type BraftClient ¶
type BraftClient interface { // just for testing Echo(ctx context.Context, in *EchoRequest, opts ...grpc.CallOption) (*EchoResponse, error) // Among core nodes in the cluster SyncUp(ctx context.Context, in *SyncUpRequest, opts ...grpc.CallOption) (*SyncUpResponse, error) NotifyInitMsg(ctx context.Context, in *InitMsg, opts ...grpc.CallOption) (*Void, error) NotifyPrepareMsg(ctx context.Context, in *PrepareMsg, opts ...grpc.CallOption) (*Void, error) NotifyCommitMsg(ctx context.Context, in *CommitMsg, opts ...grpc.CallOption) (*Void, error) NotifyWeakAccuse(ctx context.Context, in *WeakAccuse, opts ...grpc.CallOption) (*Void, error) NotifyStrongAccuse(ctx context.Context, in *StrongAccuse, opts ...grpc.CallOption) (*Void, error) NotifyVote(ctx context.Context, in *Vote, opts ...grpc.CallOption) (*Void, error) NotifyTxs(ctx context.Context, in *Transactions, opts ...grpc.CallOption) (*Void, error) NotifySignTx(ctx context.Context, in *SignTxRequest, opts ...grpc.CallOption) (*Void, error) // 新节点加入 NotifyJoin(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*Void, error) NotifyJoinCheckSynced(ctx context.Context, in *JoinRequest, opts ...grpc.CallOption) (*JoinResponse, error) NotifyLeave(ctx context.Context, in *LeaveRequest, opts ...grpc.CallOption) (*Void, error) GetClusterNodes(ctx context.Context, in *Void, opts ...grpc.CallOption) (*NodeList, error) WatchSyncUp(ctx context.Context, in *SyncUpRequest, opts ...grpc.CallOption) (*SyncUpResponse, error) NotifySignedResult(ctx context.Context, in *SignedResult, opts ...grpc.CallOption) (*Void, error) // rpc NotifyChainTxIdMsg(ChainTxIdMsg) returns (Void); IsCommited(ctx context.Context, in *crypto.Digest256, opts ...grpc.CallOption) (*IsCommitedResponse, error) // 获取节点运行中的info,监听的区块的高度和成为主节点的次数 GetNodeRuntimeInfo(ctx context.Context, in *Void, opts ...grpc.CallOption) (*NodeRuntimeInfo, error) NotifyHeatbeat(ctx context.Context, in *HeatbeatMsg, opts ...grpc.CallOption) (*Void, error) }
BraftClient is the client API for Braft service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewBraftClient ¶
func NewBraftClient(cc *grpc.ClientConn) BraftClient
type BraftServer ¶
type BraftServer interface { // just for testing Echo(context.Context, *EchoRequest) (*EchoResponse, error) // Among core nodes in the cluster SyncUp(context.Context, *SyncUpRequest) (*SyncUpResponse, error) NotifyInitMsg(context.Context, *InitMsg) (*Void, error) NotifyPrepareMsg(context.Context, *PrepareMsg) (*Void, error) NotifyCommitMsg(context.Context, *CommitMsg) (*Void, error) NotifyWeakAccuse(context.Context, *WeakAccuse) (*Void, error) NotifyStrongAccuse(context.Context, *StrongAccuse) (*Void, error) NotifyVote(context.Context, *Vote) (*Void, error) NotifyTxs(context.Context, *Transactions) (*Void, error) NotifySignTx(context.Context, *SignTxRequest) (*Void, error) // 新节点加入 NotifyJoin(context.Context, *JoinRequest) (*Void, error) NotifyJoinCheckSynced(context.Context, *JoinRequest) (*JoinResponse, error) NotifyLeave(context.Context, *LeaveRequest) (*Void, error) GetClusterNodes(context.Context, *Void) (*NodeList, error) WatchSyncUp(context.Context, *SyncUpRequest) (*SyncUpResponse, error) NotifySignedResult(context.Context, *SignedResult) (*Void, error) // rpc NotifyChainTxIdMsg(ChainTxIdMsg) returns (Void); IsCommited(context.Context, *crypto.Digest256) (*IsCommitedResponse, error) // 获取节点运行中的info,监听的区块的高度和成为主节点的次数 GetNodeRuntimeInfo(context.Context, *Void) (*NodeRuntimeInfo, error) NotifyHeatbeat(context.Context, *HeatbeatMsg) (*Void, error) }
BraftServer is the server API for Braft service.
type ChainTxIdMsg ¶
type ChainTxIdMsg struct { NodeId int32 `protobuf:"varint,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` TxId string `protobuf:"bytes,2,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` SignMsgId string `protobuf:"bytes,3,opt,name=sign_msg_id,json=signMsgId,proto3" json:"sign_msg_id,omitempty"` Sig []byte `protobuf:"bytes,4,opt,name=sig,proto3" json:"sig,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func MakeChainTxIdMsg ¶
func MakeChainTxIdMsg(txId string, signMsgId string, signer *crypto.SecureSigner) (*ChainTxIdMsg, error)
func (*ChainTxIdMsg) Descriptor ¶
func (*ChainTxIdMsg) Descriptor() ([]byte, []int)
func (*ChainTxIdMsg) GetNodeId ¶
func (m *ChainTxIdMsg) GetNodeId() int32
func (*ChainTxIdMsg) GetSig ¶
func (m *ChainTxIdMsg) GetSig() []byte
func (*ChainTxIdMsg) GetSignMsgId ¶
func (m *ChainTxIdMsg) GetSignMsgId() string
func (*ChainTxIdMsg) GetTxId ¶
func (m *ChainTxIdMsg) GetTxId() string
func (*ChainTxIdMsg) Id ¶
func (msg *ChainTxIdMsg) Id() *crypto.Digest256
func (*ChainTxIdMsg) ProtoMessage ¶
func (*ChainTxIdMsg) ProtoMessage()
func (*ChainTxIdMsg) Reset ¶
func (m *ChainTxIdMsg) Reset()
func (*ChainTxIdMsg) String ¶
func (m *ChainTxIdMsg) String() string
func (*ChainTxIdMsg) XXX_DiscardUnknown ¶
func (m *ChainTxIdMsg) XXX_DiscardUnknown()
func (*ChainTxIdMsg) XXX_Marshal ¶
func (m *ChainTxIdMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ChainTxIdMsg) XXX_Merge ¶
func (dst *ChainTxIdMsg) XXX_Merge(src proto.Message)
func (*ChainTxIdMsg) XXX_Size ¶
func (m *ChainTxIdMsg) XXX_Size() int
func (*ChainTxIdMsg) XXX_Unmarshal ¶
func (m *ChainTxIdMsg) XXX_Unmarshal(b []byte) error
type CommitMsg ¶
type CommitMsg struct { Term int64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` BlockId *crypto.Digest256 `protobuf:"bytes,3,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` NodeId int32 `protobuf:"varint,4,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` Sig []byte `protobuf:"bytes,5,opt,name=sig,proto3" json:"sig,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
CommitMsgId = Hash("CommitMsg", term, height, block_id, node_id)
func MakeCommitMsg ¶
func (*CommitMsg) BlockInfoLite ¶
func (*CommitMsg) Descriptor ¶
func (*CommitMsg) GetBlockId ¶
func (*CommitMsg) ProtoMessage ¶
func (*CommitMsg) ProtoMessage()
func (*CommitMsg) XXX_DiscardUnknown ¶
func (m *CommitMsg) XXX_DiscardUnknown()
func (*CommitMsg) XXX_Marshal ¶
func (*CommitMsg) XXX_Unmarshal ¶
type EchoRequest ¶
type EchoRequest struct { Nonce int32 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*EchoRequest) Descriptor ¶
func (*EchoRequest) Descriptor() ([]byte, []int)
func (*EchoRequest) GetNonce ¶
func (m *EchoRequest) GetNonce() int32
func (*EchoRequest) ProtoMessage ¶
func (*EchoRequest) ProtoMessage()
func (*EchoRequest) Reset ¶
func (m *EchoRequest) Reset()
func (*EchoRequest) String ¶
func (m *EchoRequest) String() string
func (*EchoRequest) XXX_DiscardUnknown ¶
func (m *EchoRequest) XXX_DiscardUnknown()
func (*EchoRequest) XXX_Marshal ¶
func (m *EchoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EchoRequest) XXX_Merge ¶
func (dst *EchoRequest) XXX_Merge(src proto.Message)
func (*EchoRequest) XXX_Size ¶
func (m *EchoRequest) XXX_Size() int
func (*EchoRequest) XXX_Unmarshal ¶
func (m *EchoRequest) XXX_Unmarshal(b []byte) error
type EchoResponse ¶
type EchoResponse struct { Nonce int32 `protobuf:"varint,1,opt,name=nonce,proto3" json:"nonce,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*EchoResponse) Descriptor ¶
func (*EchoResponse) Descriptor() ([]byte, []int)
func (*EchoResponse) GetNonce ¶
func (m *EchoResponse) GetNonce() int32
func (*EchoResponse) ProtoMessage ¶
func (*EchoResponse) ProtoMessage()
func (*EchoResponse) Reset ¶
func (m *EchoResponse) Reset()
func (*EchoResponse) String ¶
func (m *EchoResponse) String() string
func (*EchoResponse) XXX_DiscardUnknown ¶
func (m *EchoResponse) XXX_DiscardUnknown()
func (*EchoResponse) XXX_Marshal ¶
func (m *EchoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EchoResponse) XXX_Merge ¶
func (dst *EchoResponse) XXX_Merge(src proto.Message)
func (*EchoResponse) XXX_Size ¶
func (m *EchoResponse) XXX_Size() int
func (*EchoResponse) XXX_Unmarshal ¶
func (m *EchoResponse) XXX_Unmarshal(b []byte) error
type HeatbeatMsg ¶ added in v1.1.1
type HeatbeatMsg struct { Term int64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` Votes []*Vote `protobuf:"bytes,2,rep,name=votes,proto3" json:"votes,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*HeatbeatMsg) Descriptor ¶ added in v1.1.1
func (*HeatbeatMsg) Descriptor() ([]byte, []int)
func (*HeatbeatMsg) GetTerm ¶ added in v1.1.1
func (m *HeatbeatMsg) GetTerm() int64
func (*HeatbeatMsg) GetVotes ¶ added in v1.1.1
func (m *HeatbeatMsg) GetVotes() []*Vote
func (*HeatbeatMsg) ProtoMessage ¶ added in v1.1.1
func (*HeatbeatMsg) ProtoMessage()
func (*HeatbeatMsg) Reset ¶ added in v1.1.1
func (m *HeatbeatMsg) Reset()
func (*HeatbeatMsg) String ¶ added in v1.1.1
func (m *HeatbeatMsg) String() string
func (*HeatbeatMsg) XXX_DiscardUnknown ¶ added in v1.1.1
func (m *HeatbeatMsg) XXX_DiscardUnknown()
func (*HeatbeatMsg) XXX_Marshal ¶ added in v1.1.1
func (m *HeatbeatMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*HeatbeatMsg) XXX_Merge ¶ added in v1.1.1
func (dst *HeatbeatMsg) XXX_Merge(src proto.Message)
func (*HeatbeatMsg) XXX_Size ¶ added in v1.1.1
func (m *HeatbeatMsg) XXX_Size() int
func (*HeatbeatMsg) XXX_Unmarshal ¶ added in v1.1.1
func (m *HeatbeatMsg) XXX_Unmarshal(b []byte) error
type InitMsg ¶
type InitMsg struct { Term int64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` Block *Block `protobuf:"bytes,3,opt,name=block,proto3" json:"block,omitempty"` NodeId int32 `protobuf:"varint,4,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` Sig []byte `protobuf:"bytes,5,opt,name=sig,proto3" json:"sig,omitempty"` // only needed when the previous block has a lower term Votes map[int32]*Vote `` /* 152-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
InitMsgId = Hash("InitMsg", term, height, block_id, node_id, voteid)
func (*InitMsg) Descriptor ¶
func (*InitMsg) PrevBlockId ¶
func (*InitMsg) ProtoMessage ¶
func (*InitMsg) ProtoMessage()
func (*InitMsg) XXX_DiscardUnknown ¶
func (m *InitMsg) XXX_DiscardUnknown()
func (*InitMsg) XXX_Marshal ¶
func (*InitMsg) XXX_Unmarshal ¶
type IsCommitedResponse ¶
type IsCommitedResponse struct { Commited bool `protobuf:"varint,1,opt,name=commited,proto3" json:"commited,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*IsCommitedResponse) Descriptor ¶
func (*IsCommitedResponse) Descriptor() ([]byte, []int)
func (*IsCommitedResponse) GetCommited ¶
func (m *IsCommitedResponse) GetCommited() bool
func (*IsCommitedResponse) ProtoMessage ¶
func (*IsCommitedResponse) ProtoMessage()
func (*IsCommitedResponse) Reset ¶
func (m *IsCommitedResponse) Reset()
func (*IsCommitedResponse) String ¶
func (m *IsCommitedResponse) String() string
func (*IsCommitedResponse) XXX_DiscardUnknown ¶
func (m *IsCommitedResponse) XXX_DiscardUnknown()
func (*IsCommitedResponse) XXX_Marshal ¶
func (m *IsCommitedResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*IsCommitedResponse) XXX_Merge ¶
func (dst *IsCommitedResponse) XXX_Merge(src proto.Message)
func (*IsCommitedResponse) XXX_Size ¶
func (m *IsCommitedResponse) XXX_Size() int
func (*IsCommitedResponse) XXX_Unmarshal ¶
func (m *IsCommitedResponse) XXX_Unmarshal(b []byte) error
type JoinRequest ¶
type JoinRequest struct { Host string `protobuf:"bytes,1,opt,name=host,proto3" json:"host,omitempty"` Pubkey string `protobuf:"bytes,2,opt,name=pubkey,proto3" json:"pubkey,omitempty"` Vote *Vote `protobuf:"bytes,3,opt,name=vote,proto3" json:"vote,omitempty"` Sig []byte `protobuf:"bytes,4,opt,name=sig,proto3" json:"sig,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func MakeJoinRequest ¶
func MakeJoinRequest(host string, pubkey string, vote *Vote, signer *crypto.SecureSigner) (*JoinRequest, error)
func UnmarshalJoinRequest ¶
func UnmarshalJoinRequest(bytes []byte) *JoinRequest
func (*JoinRequest) Descriptor ¶
func (*JoinRequest) Descriptor() ([]byte, []int)
func (*JoinRequest) GetHost ¶
func (m *JoinRequest) GetHost() string
func (*JoinRequest) GetPubkey ¶
func (m *JoinRequest) GetPubkey() string
func (*JoinRequest) GetSig ¶
func (m *JoinRequest) GetSig() []byte
func (*JoinRequest) GetVote ¶
func (m *JoinRequest) GetVote() *Vote
func (*JoinRequest) Id ¶
func (msg *JoinRequest) Id() *crypto.Digest256
func (*JoinRequest) ProtoMessage ¶
func (*JoinRequest) ProtoMessage()
func (*JoinRequest) Reset ¶
func (m *JoinRequest) Reset()
func (*JoinRequest) String ¶
func (m *JoinRequest) String() string
func (*JoinRequest) XXX_DiscardUnknown ¶
func (m *JoinRequest) XXX_DiscardUnknown()
func (*JoinRequest) XXX_Marshal ¶
func (m *JoinRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*JoinRequest) XXX_Merge ¶
func (dst *JoinRequest) XXX_Merge(src proto.Message)
func (*JoinRequest) XXX_Size ¶
func (m *JoinRequest) XXX_Size() int
func (*JoinRequest) XXX_Unmarshal ¶
func (m *JoinRequest) XXX_Unmarshal(b []byte) error
type JoinResponse ¶
type JoinResponse struct { NodeID int32 `protobuf:"varint,1,opt,name=nodeID,proto3" json:"nodeID,omitempty"` Synced bool `protobuf:"varint,2,opt,name=synced,proto3" json:"synced,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*JoinResponse) Descriptor ¶
func (*JoinResponse) Descriptor() ([]byte, []int)
func (*JoinResponse) GetNodeID ¶
func (m *JoinResponse) GetNodeID() int32
func (*JoinResponse) GetSynced ¶
func (m *JoinResponse) GetSynced() bool
func (*JoinResponse) ProtoMessage ¶
func (*JoinResponse) ProtoMessage()
func (*JoinResponse) Reset ¶
func (m *JoinResponse) Reset()
func (*JoinResponse) String ¶
func (m *JoinResponse) String() string
func (*JoinResponse) XXX_DiscardUnknown ¶
func (m *JoinResponse) XXX_DiscardUnknown()
func (*JoinResponse) XXX_Marshal ¶
func (m *JoinResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*JoinResponse) XXX_Merge ¶
func (dst *JoinResponse) XXX_Merge(src proto.Message)
func (*JoinResponse) XXX_Size ¶
func (m *JoinResponse) XXX_Size() int
func (*JoinResponse) XXX_Unmarshal ¶
func (m *JoinResponse) XXX_Unmarshal(b []byte) error
type LeaveRequest ¶
type LeaveRequest struct { NodeId int32 `protobuf:"varint,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` Sig []byte `protobuf:"bytes,3,opt,name=sig,proto3" json:"sig,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func MakeLeaveRequest ¶
func MakeLeaveRequest(nodeId int32, msg string, signer *crypto.SecureSigner) (*LeaveRequest, error)
func UnmarshalLeaveRequest ¶
func UnmarshalLeaveRequest(bytes []byte) *LeaveRequest
func (*LeaveRequest) Descriptor ¶
func (*LeaveRequest) Descriptor() ([]byte, []int)
func (*LeaveRequest) GetMsg ¶
func (m *LeaveRequest) GetMsg() string
func (*LeaveRequest) GetNodeId ¶
func (m *LeaveRequest) GetNodeId() int32
func (*LeaveRequest) GetSig ¶
func (m *LeaveRequest) GetSig() []byte
func (*LeaveRequest) Id ¶
func (msg *LeaveRequest) Id() *crypto.Digest256
func (*LeaveRequest) ProtoMessage ¶
func (*LeaveRequest) ProtoMessage()
func (*LeaveRequest) Reset ¶
func (m *LeaveRequest) Reset()
func (*LeaveRequest) String ¶
func (m *LeaveRequest) String() string
func (*LeaveRequest) XXX_DiscardUnknown ¶
func (m *LeaveRequest) XXX_DiscardUnknown()
func (*LeaveRequest) XXX_Marshal ¶
func (m *LeaveRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LeaveRequest) XXX_Merge ¶
func (dst *LeaveRequest) XXX_Merge(src proto.Message)
func (*LeaveRequest) XXX_Size ¶
func (m *LeaveRequest) XXX_Size() int
func (*LeaveRequest) XXX_Unmarshal ¶
func (m *LeaveRequest) XXX_Unmarshal(b []byte) error
type MultiSigInfo ¶
type MultiSigInfo struct { BtcAddress string `protobuf:"bytes,1,opt,name=btc_address,json=btcAddress,proto3" json:"btc_address,omitempty"` BtcRedeemScript []byte `protobuf:"bytes,2,opt,name=btc_redeem_script,json=btcRedeemScript,proto3" json:"btc_redeem_script,omitempty"` BchAddress string `protobuf:"bytes,3,opt,name=bch_address,json=bchAddress,proto3" json:"bch_address,omitempty"` BchRedeemScript []byte `protobuf:"bytes,4,opt,name=bch_redeem_script,json=bchRedeemScript,proto3" json:"bch_redeem_script,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*MultiSigInfo) Descriptor ¶
func (*MultiSigInfo) Descriptor() ([]byte, []int)
func (*MultiSigInfo) GetBchAddress ¶
func (m *MultiSigInfo) GetBchAddress() string
func (*MultiSigInfo) GetBchRedeemScript ¶
func (m *MultiSigInfo) GetBchRedeemScript() []byte
func (*MultiSigInfo) GetBtcAddress ¶
func (m *MultiSigInfo) GetBtcAddress() string
func (*MultiSigInfo) GetBtcRedeemScript ¶
func (m *MultiSigInfo) GetBtcRedeemScript() []byte
func (*MultiSigInfo) ProtoMessage ¶
func (*MultiSigInfo) ProtoMessage()
func (*MultiSigInfo) Reset ¶
func (m *MultiSigInfo) Reset()
func (*MultiSigInfo) String ¶
func (m *MultiSigInfo) String() string
func (*MultiSigInfo) XXX_DiscardUnknown ¶
func (m *MultiSigInfo) XXX_DiscardUnknown()
func (*MultiSigInfo) XXX_Marshal ¶
func (m *MultiSigInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MultiSigInfo) XXX_Merge ¶
func (dst *MultiSigInfo) XXX_Merge(src proto.Message)
func (*MultiSigInfo) XXX_Size ¶
func (m *MultiSigInfo) XXX_Size() int
func (*MultiSigInfo) XXX_Unmarshal ¶
func (m *MultiSigInfo) XXX_Unmarshal(b []byte) error
type NewlyTx ¶
type NewlyTx struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
网关在主/侧链上新发起的交易
func (*NewlyTx) Descriptor ¶
func (*NewlyTx) GetTimestamp ¶ added in v1.1.0
func (*NewlyTx) ProtoMessage ¶
func (*NewlyTx) ProtoMessage()
func (*NewlyTx) XXX_DiscardUnknown ¶
func (m *NewlyTx) XXX_DiscardUnknown()
func (*NewlyTx) XXX_Marshal ¶
func (*NewlyTx) XXX_Unmarshal ¶
type NodeInfo ¶
type NodeInfo struct { NodeId int32 `protobuf:"varint,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Pubkey string `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"` Host string `protobuf:"bytes,4,opt,name=host,proto3" json:"host,omitempty"` IsNormal bool `protobuf:"varint,5,opt,name=is_normal,json=isNormal,proto3" json:"is_normal,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*NodeInfo) Descriptor ¶
func (*NodeInfo) GetIsNormal ¶
func (*NodeInfo) ProtoMessage ¶
func (*NodeInfo) ProtoMessage()
func (*NodeInfo) XXX_DiscardUnknown ¶
func (m *NodeInfo) XXX_DiscardUnknown()
func (*NodeInfo) XXX_Marshal ¶
func (*NodeInfo) XXX_Unmarshal ¶
type NodeList ¶
type NodeList struct { NodeList []*NodeInfo `protobuf:"bytes,1,rep,name=node_list,json=nodeList,proto3" json:"node_list,omitempty"` MultiSigInfoList []*MultiSigInfo `protobuf:"bytes,2,rep,name=multi_sig_info_list,json=multiSigInfoList,proto3" json:"multi_sig_info_list,omitempty"` LeaderId int32 `protobuf:"varint,3,opt,name=leader_id,json=leaderId,proto3" json:"leader_id,omitempty"` QuorumN int32 `protobuf:"varint,4,opt,name=quorum_n,json=quorumN,proto3" json:"quorum_n,omitempty"` BlockHeight int64 `protobuf:"varint,5,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*NodeList) Descriptor ¶
func (*NodeList) GetBlockHeight ¶ added in v1.1.0
func (*NodeList) GetLeaderId ¶
func (*NodeList) GetMultiSigInfoList ¶
func (m *NodeList) GetMultiSigInfoList() []*MultiSigInfo
func (*NodeList) GetNodeList ¶
func (NodeList) GetPubkeys ¶
func (*NodeList) GetQuorumN ¶
func (*NodeList) ProtoMessage ¶
func (*NodeList) ProtoMessage()
func (*NodeList) XXX_DiscardUnknown ¶
func (m *NodeList) XXX_DiscardUnknown()
func (*NodeList) XXX_Marshal ¶
func (*NodeList) XXX_Unmarshal ¶
type NodeRuntimeInfo ¶
type NodeRuntimeInfo struct { NodeID int32 `protobuf:"varint,1,opt,name=nodeID,proto3" json:"nodeID,omitempty"` BtcHeight int64 `protobuf:"varint,2,opt,name=btcHeight,proto3" json:"btcHeight,omitempty"` BchHeight int64 `protobuf:"varint,3,opt,name=bchHeight,proto3" json:"bchHeight,omitempty"` EthHeight int64 `protobuf:"varint,4,opt,name=ethHeight,proto3" json:"ethHeight,omitempty"` LeaderCnt int32 `protobuf:"varint,5,opt,name=leaderCnt,proto3" json:"leaderCnt,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*NodeRuntimeInfo) Descriptor ¶
func (*NodeRuntimeInfo) Descriptor() ([]byte, []int)
func (*NodeRuntimeInfo) GetBchHeight ¶
func (m *NodeRuntimeInfo) GetBchHeight() int64
func (*NodeRuntimeInfo) GetBtcHeight ¶
func (m *NodeRuntimeInfo) GetBtcHeight() int64
func (*NodeRuntimeInfo) GetEthHeight ¶
func (m *NodeRuntimeInfo) GetEthHeight() int64
func (*NodeRuntimeInfo) GetLeaderCnt ¶
func (m *NodeRuntimeInfo) GetLeaderCnt() int32
func (*NodeRuntimeInfo) GetNodeID ¶
func (m *NodeRuntimeInfo) GetNodeID() int32
func (*NodeRuntimeInfo) ProtoMessage ¶
func (*NodeRuntimeInfo) ProtoMessage()
func (*NodeRuntimeInfo) Reset ¶
func (m *NodeRuntimeInfo) Reset()
func (*NodeRuntimeInfo) String ¶
func (m *NodeRuntimeInfo) String() string
func (*NodeRuntimeInfo) XXX_DiscardUnknown ¶
func (m *NodeRuntimeInfo) XXX_DiscardUnknown()
func (*NodeRuntimeInfo) XXX_Marshal ¶
func (m *NodeRuntimeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*NodeRuntimeInfo) XXX_Merge ¶
func (dst *NodeRuntimeInfo) XXX_Merge(src proto.Message)
func (*NodeRuntimeInfo) XXX_Size ¶
func (m *NodeRuntimeInfo) XXX_Size() int
func (*NodeRuntimeInfo) XXX_Unmarshal ¶
func (m *NodeRuntimeInfo) XXX_Unmarshal(b []byte) error
type PrepareMsg ¶
type PrepareMsg struct { Term int64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` BlockId *crypto.Digest256 `protobuf:"bytes,3,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` NodeId int32 `protobuf:"varint,4,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` Sig []byte `protobuf:"bytes,5,opt,name=sig,proto3" json:"sig,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
PrepareMsgId = Hash("PrepareMsg", term, height, block_id, node_id)
func MakePrepareMsg ¶
func MakePrepareMsg(blockInfo *BlockInfo, nodeId int32, signer *crypto.SecureSigner) (*PrepareMsg, error)
func (*PrepareMsg) BlockInfoLite ¶
func (msg *PrepareMsg) BlockInfoLite() *BlockInfo
func (*PrepareMsg) DebugString ¶
func (msg *PrepareMsg) DebugString() string
func (*PrepareMsg) Descriptor ¶
func (*PrepareMsg) Descriptor() ([]byte, []int)
func (*PrepareMsg) GetBlockId ¶
func (m *PrepareMsg) GetBlockId() *crypto.Digest256
func (*PrepareMsg) GetHeight ¶
func (m *PrepareMsg) GetHeight() int64
func (*PrepareMsg) GetNodeId ¶
func (m *PrepareMsg) GetNodeId() int32
func (*PrepareMsg) GetSig ¶
func (m *PrepareMsg) GetSig() []byte
func (*PrepareMsg) GetTerm ¶
func (m *PrepareMsg) GetTerm() int64
func (*PrepareMsg) Id ¶
func (msg *PrepareMsg) Id() *crypto.Digest256
func (*PrepareMsg) ProtoMessage ¶
func (*PrepareMsg) ProtoMessage()
func (*PrepareMsg) Reset ¶
func (m *PrepareMsg) Reset()
func (*PrepareMsg) String ¶
func (m *PrepareMsg) String() string
func (*PrepareMsg) XXX_DiscardUnknown ¶
func (m *PrepareMsg) XXX_DiscardUnknown()
func (*PrepareMsg) XXX_Marshal ¶
func (m *PrepareMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PrepareMsg) XXX_Merge ¶
func (dst *PrepareMsg) XXX_Merge(src proto.Message)
func (*PrepareMsg) XXX_Size ¶
func (m *PrepareMsg) XXX_Size() int
func (*PrepareMsg) XXX_Unmarshal ¶
func (m *PrepareMsg) XXX_Unmarshal(b []byte) error
type Reconfig ¶
type Reconfig struct { Type Reconfig_Type `protobuf:"varint,1,opt,name=type,proto3,enum=proto.Reconfig_Type" json:"type,omitempty"` Host string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"` NodeId int32 `protobuf:"varint,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` Pubkey string `protobuf:"bytes,4,opt,name=pubkey,proto3" json:"pubkey,omitempty"` Vote *Vote `protobuf:"bytes,5,opt,name=vote,proto3" json:"vote,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Reconfig) Descriptor ¶
func (*Reconfig) GetType ¶
func (m *Reconfig) GetType() Reconfig_Type
func (*Reconfig) ProtoMessage ¶
func (*Reconfig) ProtoMessage()
func (*Reconfig) XXX_DiscardUnknown ¶
func (m *Reconfig) XXX_DiscardUnknown()
func (*Reconfig) XXX_Marshal ¶
func (*Reconfig) XXX_Unmarshal ¶
type Reconfig_Type ¶
type Reconfig_Type int32
const ( Reconfig_JOIN Reconfig_Type = 0 Reconfig_LEAVE Reconfig_Type = 1 )
func (Reconfig_Type) EnumDescriptor ¶
func (Reconfig_Type) EnumDescriptor() ([]byte, []int)
func (Reconfig_Type) String ¶
func (x Reconfig_Type) String() string
type SignTxRequest ¶
type SignTxRequest struct { Term int64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` NodeId int32 `protobuf:"varint,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` MultisigAddress string `protobuf:"bytes,3,opt,name=multisig_address,json=multisigAddress,proto3" json:"multisig_address,omitempty"` WatchedTx *WatchedTxInfo `protobuf:"bytes,4,opt,name=watched_tx,json=watchedTx,proto3" json:"watched_tx,omitempty"` NewlyTx *NewlyTx `protobuf:"bytes,5,opt,name=newly_tx,json=newlyTx,proto3" json:"newly_tx,omitempty"` Sig []byte `protobuf:"bytes,6,opt,name=sig,proto3" json:"sig,omitempty"` Time int64 `protobuf:"varint,7,opt,name=time,proto3" json:"time,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func MakeSignTxMsg ¶
func MakeSignTxMsg(term int64, nodeId int32, watchedTx *WatchedTxInfo, newlyTx *NewlyTx, multisigAddress string, signer *crypto.SecureSigner) (*SignTxRequest, error)
MakeSignTxMsg 创建一个SignTxMsg并返回
func UnmarshalSignTxRequest ¶
func UnmarshalSignTxRequest(bytes []byte) *SignTxRequest
func (*SignTxRequest) Descriptor ¶
func (*SignTxRequest) Descriptor() ([]byte, []int)
func (*SignTxRequest) GetMultisigAddress ¶
func (m *SignTxRequest) GetMultisigAddress() string
func (*SignTxRequest) GetNewlyTx ¶
func (m *SignTxRequest) GetNewlyTx() *NewlyTx
func (*SignTxRequest) GetNodeId ¶
func (m *SignTxRequest) GetNodeId() int32
func (*SignTxRequest) GetSig ¶
func (m *SignTxRequest) GetSig() []byte
func (*SignTxRequest) GetTerm ¶
func (m *SignTxRequest) GetTerm() int64
func (*SignTxRequest) GetTime ¶
func (m *SignTxRequest) GetTime() int64
func (*SignTxRequest) GetWatchedTx ¶
func (m *SignTxRequest) GetWatchedTx() *WatchedTxInfo
func (*SignTxRequest) Id ¶
func (msg *SignTxRequest) Id() *crypto.Digest256
Id 计算SignTxRequest的hashid
func (*SignTxRequest) MsgHash ¶
func (msg *SignTxRequest) MsgHash() string
func (*SignTxRequest) ProtoMessage ¶
func (*SignTxRequest) ProtoMessage()
func (*SignTxRequest) Reset ¶
func (m *SignTxRequest) Reset()
func (*SignTxRequest) String ¶
func (m *SignTxRequest) String() string
func (*SignTxRequest) XXX_DiscardUnknown ¶
func (m *SignTxRequest) XXX_DiscardUnknown()
func (*SignTxRequest) XXX_Marshal ¶
func (m *SignTxRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SignTxRequest) XXX_Merge ¶
func (dst *SignTxRequest) XXX_Merge(src proto.Message)
func (*SignTxRequest) XXX_Size ¶
func (m *SignTxRequest) XXX_Size() int
func (*SignTxRequest) XXX_Unmarshal ¶
func (m *SignTxRequest) XXX_Unmarshal(b []byte) error
type SignTxResponse ¶
type SignTxResponse struct { Code CodeType `protobuf:"varint,1,opt,name=code,proto3,enum=proto.CodeType" json:"code,omitempty"` NodeId int32 `protobuf:"varint,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` Sig [][]byte `protobuf:"bytes,3,rep,name=sig,proto3" json:"sig,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*SignTxResponse) Descriptor ¶
func (*SignTxResponse) Descriptor() ([]byte, []int)
func (*SignTxResponse) GetCode ¶
func (m *SignTxResponse) GetCode() CodeType
func (*SignTxResponse) GetNodeId ¶
func (m *SignTxResponse) GetNodeId() int32
func (*SignTxResponse) GetSig ¶
func (m *SignTxResponse) GetSig() [][]byte
func (*SignTxResponse) ProtoMessage ¶
func (*SignTxResponse) ProtoMessage()
func (*SignTxResponse) Reset ¶
func (m *SignTxResponse) Reset()
func (*SignTxResponse) String ¶
func (m *SignTxResponse) String() string
func (*SignTxResponse) XXX_DiscardUnknown ¶
func (m *SignTxResponse) XXX_DiscardUnknown()
func (*SignTxResponse) XXX_Marshal ¶
func (m *SignTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SignTxResponse) XXX_Merge ¶
func (dst *SignTxResponse) XXX_Merge(src proto.Message)
func (*SignTxResponse) XXX_Size ¶
func (m *SignTxResponse) XXX_Size() int
func (*SignTxResponse) XXX_Unmarshal ¶
func (m *SignTxResponse) XXX_Unmarshal(b []byte) error
type SignedResult ¶
type SignedResult struct { Code CodeType `protobuf:"varint,1,opt,name=code,proto3,enum=proto.CodeType" json:"code,omitempty"` NodeId int32 `protobuf:"varint,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` TxId string `protobuf:"bytes,3,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` To string `protobuf:"bytes,4,opt,name=to,proto3" json:"to,omitempty"` Term int64 `protobuf:"varint,5,opt,name=term,proto3" json:"term,omitempty"` Data [][]byte `protobuf:"bytes,6,rep,name=data,proto3" json:"data,omitempty"` Sig []byte `protobuf:"bytes,7,opt,name=sig,proto3" json:"sig,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func MakeSignedResult ¶
func MakeSignedResult(code CodeType, nodeId int32, txId string, data [][]byte, to string, term int64, signer *crypto.SecureSigner) (*SignedResult, error)
func (*SignedResult) Descriptor ¶
func (*SignedResult) Descriptor() ([]byte, []int)
func (*SignedResult) GetCode ¶
func (m *SignedResult) GetCode() CodeType
func (*SignedResult) GetData ¶
func (m *SignedResult) GetData() [][]byte
func (*SignedResult) GetNodeId ¶
func (m *SignedResult) GetNodeId() int32
func (*SignedResult) GetSig ¶
func (m *SignedResult) GetSig() []byte
func (*SignedResult) GetTerm ¶
func (m *SignedResult) GetTerm() int64
func (*SignedResult) GetTo ¶
func (m *SignedResult) GetTo() string
func (*SignedResult) GetTxId ¶
func (m *SignedResult) GetTxId() string
func (*SignedResult) Id ¶
func (msg *SignedResult) Id() *crypto.Digest256
func (*SignedResult) ProtoMessage ¶
func (*SignedResult) ProtoMessage()
func (*SignedResult) Reset ¶
func (m *SignedResult) Reset()
func (*SignedResult) String ¶
func (m *SignedResult) String() string
func (*SignedResult) XXX_DiscardUnknown ¶
func (m *SignedResult) XXX_DiscardUnknown()
func (*SignedResult) XXX_Marshal ¶
func (m *SignedResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SignedResult) XXX_Merge ¶
func (dst *SignedResult) XXX_Merge(src proto.Message)
func (*SignedResult) XXX_Size ¶
func (m *SignedResult) XXX_Size() int
func (*SignedResult) XXX_Unmarshal ¶
func (m *SignedResult) XXX_Unmarshal(b []byte) error
type SignedStatistic ¶
type SignedStatistic struct { SignedMsgId string `protobuf:"bytes,1,opt,name=SignedMsgId,proto3" json:"SignedMsgId,omitempty"` Stat map[int32]CodeType `` /* 171-byte string literal not displayed */ Status TxStatus `protobuf:"varint,3,opt,name=status,proto3,enum=proto.TxStatus" json:"status,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func MakeSignedStatistic ¶
func MakeSignedStatistic(msgId string, nodeId int32, code CodeType) *SignedStatistic
func UnmarshalSignedStatistic ¶
func UnmarshalSignedStatistic(bytes []byte) *SignedStatistic
func (*SignedStatistic) Descriptor ¶
func (*SignedStatistic) Descriptor() ([]byte, []int)
func (*SignedStatistic) GetSignedMsgId ¶
func (m *SignedStatistic) GetSignedMsgId() string
func (*SignedStatistic) GetStat ¶
func (m *SignedStatistic) GetStat() map[int32]CodeType
func (*SignedStatistic) GetStatus ¶
func (m *SignedStatistic) GetStatus() TxStatus
func (*SignedStatistic) ProtoMessage ¶
func (*SignedStatistic) ProtoMessage()
func (*SignedStatistic) Reset ¶
func (m *SignedStatistic) Reset()
func (*SignedStatistic) String ¶
func (m *SignedStatistic) String() string
func (*SignedStatistic) XXX_DiscardUnknown ¶
func (m *SignedStatistic) XXX_DiscardUnknown()
func (*SignedStatistic) XXX_Marshal ¶
func (m *SignedStatistic) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SignedStatistic) XXX_Merge ¶
func (dst *SignedStatistic) XXX_Merge(src proto.Message)
func (*SignedStatistic) XXX_Size ¶
func (m *SignedStatistic) XXX_Size() int
func (*SignedStatistic) XXX_Unmarshal ¶
func (m *SignedStatistic) XXX_Unmarshal(b []byte) error
type StrongAccuse ¶
type StrongAccuse struct { WeakAccuses map[int32]*WeakAccuse `` /* 183-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
a strong accuse has at least f+1 weak accuses
func NewStrongAccuse ¶
func NewStrongAccuse(weakAccuses map[int32]*WeakAccuse) *StrongAccuse
func UnmarshalStrongAccuse ¶
func UnmarshalStrongAccuse(bytes []byte) *StrongAccuse
func (*StrongAccuse) DebugString ¶
func (sa *StrongAccuse) DebugString() string
func (*StrongAccuse) Descriptor ¶
func (*StrongAccuse) Descriptor() ([]byte, []int)
func (*StrongAccuse) GetWeakAccuses ¶
func (m *StrongAccuse) GetWeakAccuses() map[int32]*WeakAccuse
func (*StrongAccuse) ProtoMessage ¶
func (*StrongAccuse) ProtoMessage()
func (*StrongAccuse) Reset ¶
func (m *StrongAccuse) Reset()
func (*StrongAccuse) String ¶
func (m *StrongAccuse) String() string
func (*StrongAccuse) Term ¶
func (sa *StrongAccuse) Term() int64
func (*StrongAccuse) XXX_DiscardUnknown ¶
func (m *StrongAccuse) XXX_DiscardUnknown()
func (*StrongAccuse) XXX_Marshal ¶
func (m *StrongAccuse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StrongAccuse) XXX_Merge ¶
func (dst *StrongAccuse) XXX_Merge(src proto.Message)
func (*StrongAccuse) XXX_Size ¶
func (m *StrongAccuse) XXX_Size() int
func (*StrongAccuse) XXX_Unmarshal ¶
func (m *StrongAccuse) XXX_Unmarshal(b []byte) error
type SyncUpByHashRequest ¶
type SyncUpByHashRequest struct { Locator []*crypto.Digest256 `protobuf:"bytes,1,rep,name=locator,proto3" json:"locator,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*SyncUpByHashRequest) Descriptor ¶
func (*SyncUpByHashRequest) Descriptor() ([]byte, []int)
func (*SyncUpByHashRequest) GetLocator ¶
func (m *SyncUpByHashRequest) GetLocator() []*crypto.Digest256
func (*SyncUpByHashRequest) ProtoMessage ¶
func (*SyncUpByHashRequest) ProtoMessage()
func (*SyncUpByHashRequest) Reset ¶
func (m *SyncUpByHashRequest) Reset()
func (*SyncUpByHashRequest) String ¶
func (m *SyncUpByHashRequest) String() string
func (*SyncUpByHashRequest) XXX_DiscardUnknown ¶
func (m *SyncUpByHashRequest) XXX_DiscardUnknown()
func (*SyncUpByHashRequest) XXX_Marshal ¶
func (m *SyncUpByHashRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SyncUpByHashRequest) XXX_Merge ¶
func (dst *SyncUpByHashRequest) XXX_Merge(src proto.Message)
func (*SyncUpByHashRequest) XXX_Size ¶
func (m *SyncUpByHashRequest) XXX_Size() int
func (*SyncUpByHashRequest) XXX_Unmarshal ¶
func (m *SyncUpByHashRequest) XXX_Unmarshal(b []byte) error
type SyncUpRequest ¶
type SyncUpRequest struct { BaseHeight int64 `protobuf:"varint,1,opt,name=base_height,json=baseHeight,proto3" json:"base_height,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*SyncUpRequest) Descriptor ¶
func (*SyncUpRequest) Descriptor() ([]byte, []int)
func (*SyncUpRequest) GetBaseHeight ¶
func (m *SyncUpRequest) GetBaseHeight() int64
func (*SyncUpRequest) ProtoMessage ¶
func (*SyncUpRequest) ProtoMessage()
func (*SyncUpRequest) Reset ¶
func (m *SyncUpRequest) Reset()
func (*SyncUpRequest) String ¶
func (m *SyncUpRequest) String() string
func (*SyncUpRequest) XXX_DiscardUnknown ¶
func (m *SyncUpRequest) XXX_DiscardUnknown()
func (*SyncUpRequest) XXX_Marshal ¶
func (m *SyncUpRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SyncUpRequest) XXX_Merge ¶
func (dst *SyncUpRequest) XXX_Merge(src proto.Message)
func (*SyncUpRequest) XXX_Size ¶
func (m *SyncUpRequest) XXX_Size() int
func (*SyncUpRequest) XXX_Unmarshal ¶
func (m *SyncUpRequest) XXX_Unmarshal(b []byte) error
type SyncUpResponse ¶
type SyncUpResponse struct { Commits []*BlockPack `protobuf:"bytes,1,rep,name=commits,proto3" json:"commits,omitempty"` // if {more} is true, {fresh} and {strong_accuse} are nils Fresh *BlockPack `protobuf:"bytes,2,opt,name=fresh,proto3" json:"fresh,omitempty"` StrongAccuse *StrongAccuse `protobuf:"bytes,3,opt,name=strong_accuse,json=strongAccuse,proto3" json:"strong_accuse,omitempty"` More bool `protobuf:"varint,4,opt,name=more,proto3" json:"more,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*SyncUpResponse) Descriptor ¶
func (*SyncUpResponse) Descriptor() ([]byte, []int)
func (*SyncUpResponse) GetCommits ¶
func (m *SyncUpResponse) GetCommits() []*BlockPack
func (*SyncUpResponse) GetFresh ¶
func (m *SyncUpResponse) GetFresh() *BlockPack
func (*SyncUpResponse) GetMore ¶
func (m *SyncUpResponse) GetMore() bool
func (*SyncUpResponse) GetStrongAccuse ¶
func (m *SyncUpResponse) GetStrongAccuse() *StrongAccuse
func (*SyncUpResponse) ProtoMessage ¶
func (*SyncUpResponse) ProtoMessage()
func (*SyncUpResponse) Reset ¶
func (m *SyncUpResponse) Reset()
func (*SyncUpResponse) String ¶
func (m *SyncUpResponse) String() string
func (*SyncUpResponse) XXX_DiscardUnknown ¶
func (m *SyncUpResponse) XXX_DiscardUnknown()
func (*SyncUpResponse) XXX_Marshal ¶
func (m *SyncUpResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*SyncUpResponse) XXX_Merge ¶
func (dst *SyncUpResponse) XXX_Merge(src proto.Message)
func (*SyncUpResponse) XXX_Size ¶
func (m *SyncUpResponse) XXX_Size() int
func (*SyncUpResponse) XXX_Unmarshal ¶
func (m *SyncUpResponse) XXX_Unmarshal(b []byte) error
type Transaction ¶
type Transaction struct { Id *crypto.Digest256 `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` WatchedTx *WatchedTxInfo `protobuf:"bytes,2,opt,name=watched_tx,json=watchedTx,proto3" json:"watched_tx,omitempty"` NewlyTxId string `protobuf:"bytes,3,opt,name=newly_tx_id,json=newlyTxId,proto3" json:"newly_tx_id,omitempty"` Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` // 扣除手续费后最终在侧链上的金额 Amount int64 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Transaction) Descriptor ¶
func (*Transaction) Descriptor() ([]byte, []int)
func (*Transaction) EqualTo ¶
func (tx *Transaction) EqualTo(other *Transaction) bool
EqualTo 会更新两个ID,再进行比较。比较函数里面进行更新不是很合理的说
func (*Transaction) GetAmount ¶
func (m *Transaction) GetAmount() int64
func (*Transaction) GetId ¶
func (m *Transaction) GetId() *crypto.Digest256
func (*Transaction) GetNewlyTxId ¶
func (m *Transaction) GetNewlyTxId() string
func (*Transaction) GetTime ¶
func (m *Transaction) GetTime() int64
func (*Transaction) GetWatchedTx ¶
func (m *Transaction) GetWatchedTx() *WatchedTxInfo
func (*Transaction) ProtoMessage ¶
func (*Transaction) ProtoMessage()
func (*Transaction) Reset ¶
func (m *Transaction) Reset()
func (*Transaction) String ¶
func (m *Transaction) String() string
func (*Transaction) XXX_DiscardUnknown ¶
func (m *Transaction) XXX_DiscardUnknown()
func (*Transaction) XXX_Marshal ¶
func (m *Transaction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Transaction) XXX_Merge ¶
func (dst *Transaction) XXX_Merge(src proto.Message)
func (*Transaction) XXX_Size ¶
func (m *Transaction) XXX_Size() int
func (*Transaction) XXX_Unmarshal ¶
func (m *Transaction) XXX_Unmarshal(b []byte) error
type Transactions ¶
type Transactions struct { Txs []*Transaction `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Transactions) Descriptor ¶
func (*Transactions) Descriptor() ([]byte, []int)
func (*Transactions) GetTxs ¶
func (m *Transactions) GetTxs() []*Transaction
func (*Transactions) ProtoMessage ¶
func (*Transactions) ProtoMessage()
func (*Transactions) Reset ¶
func (m *Transactions) Reset()
func (*Transactions) String ¶
func (m *Transactions) String() string
func (*Transactions) XXX_DiscardUnknown ¶
func (m *Transactions) XXX_DiscardUnknown()
func (*Transactions) XXX_Marshal ¶
func (m *Transactions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*Transactions) XXX_Merge ¶
func (dst *Transactions) XXX_Merge(src proto.Message)
func (*Transactions) XXX_Size ¶
func (m *Transactions) XXX_Size() int
func (*Transactions) XXX_Unmarshal ¶
func (m *Transactions) XXX_Unmarshal(b []byte) error
type TxLookupEntry ¶
type TxLookupEntry struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Index int32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
TxLoopupEntry 保存了tx的存储位置信息,哪一个区块里面的第几笔交易
func UnmarshalTxLookupEntry ¶
func UnmarshalTxLookupEntry(bytes []byte) *TxLookupEntry
UnmarshalTxLookupEntry 反序列化TxLookupEntry
func (*TxLookupEntry) Descriptor ¶
func (*TxLookupEntry) Descriptor() ([]byte, []int)
func (*TxLookupEntry) GetHeight ¶
func (m *TxLookupEntry) GetHeight() int64
func (*TxLookupEntry) GetIndex ¶
func (m *TxLookupEntry) GetIndex() int32
func (*TxLookupEntry) ProtoMessage ¶
func (*TxLookupEntry) ProtoMessage()
func (*TxLookupEntry) Reset ¶
func (m *TxLookupEntry) Reset()
func (*TxLookupEntry) String ¶
func (m *TxLookupEntry) String() string
func (*TxLookupEntry) XXX_DiscardUnknown ¶
func (m *TxLookupEntry) XXX_DiscardUnknown()
func (*TxLookupEntry) XXX_Marshal ¶
func (m *TxLookupEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TxLookupEntry) XXX_Merge ¶
func (dst *TxLookupEntry) XXX_Merge(src proto.Message)
func (*TxLookupEntry) XXX_Size ¶
func (m *TxLookupEntry) XXX_Size() int
func (*TxLookupEntry) XXX_Unmarshal ¶
func (m *TxLookupEntry) XXX_Unmarshal(b []byte) error
type Void ¶
type Void struct { XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Void) Descriptor ¶
func (*Void) ProtoMessage ¶
func (*Void) ProtoMessage()
func (*Void) XXX_DiscardUnknown ¶
func (m *Void) XXX_DiscardUnknown()
func (*Void) XXX_Unmarshal ¶
type Vote ¶
type Vote struct { Term int64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` Votie *Votie `protobuf:"bytes,2,opt,name=votie,proto3" json:"votie,omitempty"` NodeId int32 `protobuf:"varint,3,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` Sig []byte `protobuf:"bytes,4,opt,name=sig,proto3" json:"sig,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func (*Vote) DebugString ¶
func (*Vote) Descriptor ¶
func (*Vote) ProtoMessage ¶
func (*Vote) ProtoMessage()
func (*Vote) XXX_DiscardUnknown ¶
func (m *Vote) XXX_DiscardUnknown()
func (*Vote) XXX_Unmarshal ¶
type VoteMap ¶
func (VoteMap) GetMaxVotie ¶
type Votie ¶
type Votie struct { Term int64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` Height int64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` Block *Block `protobuf:"bytes,3,opt,name=block,proto3" json:"block,omitempty"` Prepares map[int32]*PrepareMsg `` /* 158-byte string literal not displayed */ Commits map[int32]*CommitMsg `` /* 156-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func GetMaxVotie ¶
func UnmarshalVotie ¶
func (*Votie) Descriptor ¶
func (*Votie) GetCommits ¶
func (*Votie) GetPrepares ¶
func (m *Votie) GetPrepares() map[int32]*PrepareMsg
func (*Votie) HasLessTermHeightThan ¶
func (*Votie) ProtoMessage ¶
func (*Votie) ProtoMessage()
func (*Votie) XXX_DiscardUnknown ¶
func (m *Votie) XXX_DiscardUnknown()
func (*Votie) XXX_Marshal ¶
func (*Votie) XXX_Unmarshal ¶
type WatchedTxInfo ¶
type WatchedTxInfo struct { Txid string `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"` Amount int64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` RechargeList []*AddressInfo `protobuf:"bytes,3,rep,name=recharge_list,json=rechargeList,proto3" json:"recharge_list,omitempty"` // 发起交易的链的名称,例如"bch" From string `protobuf:"bytes,4,opt,name=from,proto3" json:"from,omitempty"` // 目标链的名称,例如"eth" To string `protobuf:"bytes,5,opt,name=to,proto3" json:"to,omitempty"` // BTC/BCH的矿工费 Fee int64 `protobuf:"varint,6,opt,name=fee,proto3" json:"fee,omitempty"` // from的token类型 TokenFrom uint32 `protobuf:"varint,7,opt,name=token_from,json=tokenFrom,proto3" json:"token_from,omitempty"` // to的token类型 TokenTo uint32 `protobuf:"varint,8,opt,name=token_to,json=tokenTo,proto3" json:"token_to,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
watcher监测到的主/侧链交易信息
func BtcToPbTx ¶
func BtcToPbTx(tx *btcwatcher.SubTransaction) *WatchedTxInfo
BtcToPbTx BCH链监听的交易结构转成pb结构 会统一在这边做金额校验,如果输出金额比输入金额大,则按地址顺序修正金额,最后为0的输出地址被忽略 做金额修正主要是为了防止金额作弊的情况
func EOSToPbTx ¶ added in v1.1.1
func EOSToPbTx(event *eoswatcher.EOSPushEvent) *WatchedTxInfo
EOSToPbTx eosEvent->watchedInfo
func EthToPbTx ¶
func EthToPbTx(tx *ethwatcher.ExtraBurnData) *WatchedTxInfo
EthToPbTx ETH链监听到的交易转pb结构。
func XINToPbTx ¶ added in v1.1.0
func XINToPbTx(tx *eoswatcher.EOSPushEvent) *WatchedTxInfo
XINToPbTx XIN链监听到的交易转pb结构
func (*WatchedTxInfo) Clone ¶
func (tx *WatchedTxInfo) Clone() *WatchedTxInfo
Clone 深拷贝一个WatchedTxInfo对象
func (*WatchedTxInfo) Descriptor ¶
func (*WatchedTxInfo) Descriptor() ([]byte, []int)
func (*WatchedTxInfo) EqualTo ¶
func (tx *WatchedTxInfo) EqualTo(other *WatchedTxInfo) bool
EqualTo 比较两个WatchedTxInfo内容是否相等
func (*WatchedTxInfo) GetAmount ¶
func (m *WatchedTxInfo) GetAmount() int64
func (*WatchedTxInfo) GetFee ¶
func (m *WatchedTxInfo) GetFee() int64
func (*WatchedTxInfo) GetFrom ¶
func (m *WatchedTxInfo) GetFrom() string
func (*WatchedTxInfo) GetRechargeList ¶
func (m *WatchedTxInfo) GetRechargeList() []*AddressInfo
func (*WatchedTxInfo) GetTo ¶
func (m *WatchedTxInfo) GetTo() string
func (*WatchedTxInfo) GetTokenFrom ¶
func (m *WatchedTxInfo) GetTokenFrom() uint32
func (*WatchedTxInfo) GetTokenTo ¶
func (m *WatchedTxInfo) GetTokenTo() uint32
func (*WatchedTxInfo) GetTxid ¶
func (m *WatchedTxInfo) GetTxid() string
func (*WatchedTxInfo) IsDistributionTx ¶ added in v1.1.0
func (tx *WatchedTxInfo) IsDistributionTx() bool
IsDistributionTx 判断WatchedTxInfo是否是一个分配多签资产的交易
func (*WatchedTxInfo) IsTransferTx ¶
func (tx *WatchedTxInfo) IsTransferTx() bool
IsTransferTx 判断WatchedTxInfo是否是一个多签地址的资产转移的交易
func (*WatchedTxInfo) ProtoMessage ¶
func (*WatchedTxInfo) ProtoMessage()
func (*WatchedTxInfo) Reset ¶
func (m *WatchedTxInfo) Reset()
func (*WatchedTxInfo) String ¶
func (m *WatchedTxInfo) String() string
func (*WatchedTxInfo) XXX_DiscardUnknown ¶
func (m *WatchedTxInfo) XXX_DiscardUnknown()
func (*WatchedTxInfo) XXX_Marshal ¶
func (m *WatchedTxInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*WatchedTxInfo) XXX_Merge ¶
func (dst *WatchedTxInfo) XXX_Merge(src proto.Message)
func (*WatchedTxInfo) XXX_Size ¶
func (m *WatchedTxInfo) XXX_Size() int
func (*WatchedTxInfo) XXX_Unmarshal ¶
func (m *WatchedTxInfo) XXX_Unmarshal(b []byte) error
type WeakAccuse ¶
type WeakAccuse struct { Term int64 `protobuf:"varint,1,opt,name=term,proto3" json:"term,omitempty"` NodeId int32 `protobuf:"varint,2,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"` Sig []byte `protobuf:"bytes,3,opt,name=sig,proto3" json:"sig,omitempty"` Time int64 `protobuf:"varint,4,opt,name=time,proto3" json:"time,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
WeakAccuseId = Hash("WeakAccuse", term, node_id)
func MakeWeakAccuse ¶
func MakeWeakAccuse(term int64, nodeId int32, signer *crypto.SecureSigner) (*WeakAccuse, error)
func (*WeakAccuse) Descriptor ¶
func (*WeakAccuse) Descriptor() ([]byte, []int)
func (*WeakAccuse) GetNodeId ¶
func (m *WeakAccuse) GetNodeId() int32
func (*WeakAccuse) GetSig ¶
func (m *WeakAccuse) GetSig() []byte
func (*WeakAccuse) GetTerm ¶
func (m *WeakAccuse) GetTerm() int64
func (*WeakAccuse) GetTime ¶
func (m *WeakAccuse) GetTime() int64
func (*WeakAccuse) Id ¶
func (wa *WeakAccuse) Id() *crypto.Digest256
func (*WeakAccuse) ProtoMessage ¶
func (*WeakAccuse) ProtoMessage()
func (*WeakAccuse) Reset ¶
func (m *WeakAccuse) Reset()
func (*WeakAccuse) String ¶
func (m *WeakAccuse) String() string
func (*WeakAccuse) XXX_DiscardUnknown ¶
func (m *WeakAccuse) XXX_DiscardUnknown()
func (*WeakAccuse) XXX_Marshal ¶
func (m *WeakAccuse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*WeakAccuse) XXX_Merge ¶
func (dst *WeakAccuse) XXX_Merge(src proto.Message)
func (*WeakAccuse) XXX_Size ¶
func (m *WeakAccuse) XXX_Size() int
func (*WeakAccuse) XXX_Unmarshal ¶
func (m *WeakAccuse) XXX_Unmarshal(b []byte) error
type WeakAccuses ¶
type WeakAccuses struct { Accuses map[int32]*WeakAccuse `` /* 156-byte string literal not displayed */ XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` }
func EmptyWeakAccuses ¶
func EmptyWeakAccuses() *WeakAccuses
func UnmarshalWeakAccuses ¶
func UnmarshalWeakAccuses(bytes []byte) *WeakAccuses
func (*WeakAccuses) Descriptor ¶
func (*WeakAccuses) Descriptor() ([]byte, []int)
func (*WeakAccuses) Get ¶
func (wa *WeakAccuses) Get(nodeId int32) *WeakAccuse
func (*WeakAccuses) GetAccuses ¶
func (m *WeakAccuses) GetAccuses() map[int32]*WeakAccuse
func (*WeakAccuses) ProtoMessage ¶
func (*WeakAccuses) ProtoMessage()
func (*WeakAccuses) Reset ¶
func (m *WeakAccuses) Reset()
func (*WeakAccuses) Set ¶
func (wa *WeakAccuses) Set(nodeId int32, weakAccuse *WeakAccuse)
func (*WeakAccuses) Size ¶
func (wa *WeakAccuses) Size() int
func (*WeakAccuses) String ¶
func (m *WeakAccuses) String() string
func (*WeakAccuses) XXX_DiscardUnknown ¶
func (m *WeakAccuses) XXX_DiscardUnknown()
func (*WeakAccuses) XXX_Marshal ¶
func (m *WeakAccuses) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*WeakAccuses) XXX_Merge ¶
func (dst *WeakAccuses) XXX_Merge(src proto.Message)
func (*WeakAccuses) XXX_Size ¶
func (m *WeakAccuses) XXX_Size() int
func (*WeakAccuses) XXX_Unmarshal ¶
func (m *WeakAccuses) XXX_Unmarshal(b []byte) error