Documentation
¶
Index ¶
- Variables
- func Compare(a, b string) int
- type Account
- func (acc *Account) AddBalance(am *Amount)
- func (*Account) Descriptor() ([]byte, []int)deprecated
- func (x *Account) GetAccountType() int32
- func (x *Account) GetBalance() *Amount
- func (x *Account) GetCode() []byte
- func (x *Account) GetId() *Address
- func (x *Account) GetPublickKey() []byte
- func (*Account) ProtoMessage()
- func (x *Account) ProtoReflect() protoreflect.Message
- func (x *Account) Reset()
- func (x *Account) String() string
- func (acc *Account) SubBalance(am *Amount)
- type AccountType
- func (AccountType) Descriptor() protoreflect.EnumDescriptor
- func (x AccountType) Enum() *AccountType
- func (AccountType) EnumDescriptor() ([]byte, []int)deprecated
- func (x AccountType) Number() protoreflect.EnumNumber
- func (x AccountType) String() string
- func (AccountType) Type() protoreflect.EnumType
- type Address
- type Amount
- func (am *Amount) AddAmount(amb *Amount)
- func (*Amount) Descriptor() ([]byte, []int)deprecated
- func (x *Amount) GetAmount() string
- func (*Amount) ProtoMessage()
- func (x *Amount) ProtoReflect() protoreflect.Message
- func (x *Amount) Reset()
- func (x *Amount) String() string
- func (am *Amount) SubAmount(amb *Amount)
- type BlockMeta
- func (*BlockMeta) Descriptor() ([]byte, []int)deprecated
- func (x *BlockMeta) GetBlockHeight() uint64
- func (x *BlockMeta) GetCurVerfier() *Verifier
- func (x *BlockMeta) GetLastView() uint64
- func (x *BlockMeta) GetVerifierNo() uint32
- func (x *BlockMeta) GetVerifiers() []*Verifier
- func (*BlockMeta) ProtoMessage()
- func (x *BlockMeta) ProtoReflect() protoreflect.Message
- func (x *BlockMeta) Reset()
- func (x *BlockMeta) String() string
- type BlockRequest
- func (*BlockRequest) Descriptor() ([]byte, []int)deprecated
- func (x *BlockRequest) GetBlockNum() int64
- func (x *BlockRequest) GetRequestType() BlockRequestType
- func (*BlockRequest) ProtoMessage()
- func (x *BlockRequest) ProtoReflect() protoreflect.Message
- func (x *BlockRequest) Reset()
- func (x *BlockRequest) String() string
- type BlockRequestType
- func (BlockRequestType) Descriptor() protoreflect.EnumDescriptor
- func (x BlockRequestType) Enum() *BlockRequestType
- func (BlockRequestType) EnumDescriptor() ([]byte, []int)deprecated
- func (x BlockRequestType) Number() protoreflect.EnumNumber
- func (x BlockRequestType) String() string
- func (BlockRequestType) Type() protoreflect.EnumType
- type BlockResponse
- func (*BlockResponse) Descriptor() ([]byte, []int)deprecated
- func (x *BlockResponse) GetBlock() *PbftBlock
- func (x *BlockResponse) GetRequestType() BlockRequestType
- func (*BlockResponse) ProtoMessage()
- func (x *BlockResponse) ProtoReflect() protoreflect.Message
- func (x *BlockResponse) Reset()
- func (x *BlockResponse) String() string
- type BroadcastMsgType
- func (BroadcastMsgType) Descriptor() protoreflect.EnumDescriptor
- func (x BroadcastMsgType) Enum() *BroadcastMsgType
- func (BroadcastMsgType) EnumDescriptor() ([]byte, []int)deprecated
- func (x BroadcastMsgType) Number() protoreflect.EnumNumber
- func (x BroadcastMsgType) String() string
- func (BroadcastMsgType) Type() protoreflect.EnumType
- type Genesis
- type MessageType
- func (MessageType) Descriptor() protoreflect.EnumDescriptor
- func (x MessageType) Enum() *MessageType
- func (MessageType) EnumDescriptor() ([]byte, []int)deprecated
- func (x MessageType) Number() protoreflect.EnumNumber
- func (x MessageType) String() string
- func (MessageType) Type() protoreflect.EnumType
- type PbftBlock
- func (*PbftBlock) Descriptor() ([]byte, []int)deprecated
- func (x *PbftBlock) GetBlockId() string
- func (x *PbftBlock) GetBlockNum() uint64
- func (x *PbftBlock) GetPrevBlock() string
- func (x *PbftBlock) GetSign() []byte
- func (x *PbftBlock) GetSignPairs() []*SignPairs
- func (x *PbftBlock) GetSignerId() []byte
- func (x *PbftBlock) GetTansactions() *Txs
- func (x *PbftBlock) GetTimeStamp() uint64
- func (x *PbftBlock) GetTransactionReceipts() *TxReceipts
- func (x *PbftBlock) GetTxReceiptsRoot() []byte
- func (x *PbftBlock) GetTxRoot() []byte
- func (x *PbftBlock) GetView() uint64
- func (*PbftBlock) ProtoMessage()
- func (x *PbftBlock) ProtoReflect() protoreflect.Message
- func (x *PbftBlock) Reset()
- func (x *PbftBlock) String() string
- type PbftGenericMessage
- func (*PbftGenericMessage) Descriptor() ([]byte, []int)deprecated
- func (x *PbftGenericMessage) GetBlock() *PbftBlock
- func (x *PbftGenericMessage) GetInfo() *PbftMessageInfo
- func (x *PbftGenericMessage) GetOtherInfos() []*PbftMessageInfo
- func (*PbftGenericMessage) ProtoMessage()
- func (x *PbftGenericMessage) ProtoReflect() protoreflect.Message
- func (x *PbftGenericMessage) Reset()
- func (x *PbftGenericMessage) String() string
- type PbftMessage
- func (*PbftMessage) Descriptor() ([]byte, []int)deprecated
- func (x *PbftMessage) GetGeneric() *PbftGenericMessage
- func (m *PbftMessage) GetMsg() isPbftMessage_Msg
- func (x *PbftMessage) GetViewChange() *PbftViewChange
- func (*PbftMessage) ProtoMessage()
- func (x *PbftMessage) ProtoReflect() protoreflect.Message
- func (x *PbftMessage) Reset()
- func (x *PbftMessage) String() string
- type PbftMessageInfo
- func (*PbftMessageInfo) Descriptor() ([]byte, []int)deprecated
- func (x *PbftMessageInfo) GetMsgType() MessageType
- func (x *PbftMessageInfo) GetSeqNum() uint64
- func (x *PbftMessageInfo) GetSign() []byte
- func (x *PbftMessageInfo) GetSignerId() []byte
- func (x *PbftMessageInfo) GetView() uint64
- func (*PbftMessageInfo) ProtoMessage()
- func (x *PbftMessageInfo) ProtoReflect() protoreflect.Message
- func (x *PbftMessageInfo) Reset()
- func (x *PbftMessageInfo) String() string
- type PbftMessage_Generic
- type PbftMessage_ViewChange
- type PbftViewChange
- func (*PbftViewChange) Descriptor() ([]byte, []int)deprecated
- func (x *PbftViewChange) GetCheckpointMessages() []*PbftGenericMessage
- func (x *PbftViewChange) GetInfo() *PbftMessageInfo
- func (*PbftViewChange) ProtoMessage()
- func (x *PbftViewChange) ProtoReflect() protoreflect.Message
- func (x *PbftViewChange) Reset()
- func (x *PbftViewChange) String() string
- type SignPairs
- type States
- type Tx
- func (*Tx) Descriptor() ([]byte, []int)deprecated
- func (x *Tx) GetAmount() *Amount
- func (x *Tx) GetInput() []byte
- func (x *Tx) GetPublickKey() []byte
- func (x *Tx) GetRecipient() *Address
- func (x *Tx) GetSender() *Address
- func (x *Tx) GetSequeue() string
- func (x *Tx) GetSign() []byte
- func (x *Tx) GetTimeStamp() uint64
- func (tx *Tx) IsVaildTx() bool
- func (*Tx) ProtoMessage()
- func (x *Tx) ProtoReflect() protoreflect.Message
- func (x *Tx) Reset()
- func (tx *Tx) SignTx(priv *ecdsa.PrivateKey) error
- func (x *Tx) String() string
- func (tx *Tx) VerifySignedTx() (bool, error)
- type TxReceipt
- func (*TxReceipt) Descriptor() ([]byte, []int)deprecated
- func (x *TxReceipt) GetSign() []byte
- func (x *TxReceipt) GetStatus() int32
- func (x *TxReceipt) GetTxId() []byte
- func (txr *TxReceipt) IsVaildTxR(publicKey []byte) bool
- func (*TxReceipt) ProtoMessage()
- func (x *TxReceipt) ProtoReflect() protoreflect.Message
- func (x *TxReceipt) Reset()
- func (txr *TxReceipt) SignedTxReceipt(priv *ecdsa.PrivateKey) error
- func (x *TxReceipt) String() string
- func (txr *TxReceipt) VerifySignedTxReciept(publicKey []byte) (bool, error)
- type TxReceipts
- func (*TxReceipts) Descriptor() ([]byte, []int)deprecated
- func (x *TxReceipts) GetTansactionReceipts() []*TxReceipt
- func (txRs *TxReceipts) MerkleRoot() []byte
- func (*TxReceipts) ProtoMessage()
- func (x *TxReceipts) ProtoReflect() protoreflect.Message
- func (x *TxReceipts) Reset()
- func (x *TxReceipts) String() string
- type Txs
- type Verifier
- func (*Verifier) Descriptor() ([]byte, []int)deprecated
- func (x *Verifier) GetPrivateKey() []byte
- func (x *Verifier) GetPublickKey() []byte
- func (x *Verifier) GetSeqNum() int32
- func (*Verifier) ProtoMessage()
- func (x *Verifier) ProtoReflect() protoreflect.Message
- func (x *Verifier) Reset()
- func (x *Verifier) String() string
Constants ¶
This section is empty.
Variables ¶
var ( AccountType_name = map[int32]string{ 0: "Unkown", 1: "Normal", 2: "Code", 4: "Admin", 8: "Verifier", } AccountType_value = map[string]int32{ "Unkown": 0, "Normal": 1, "Code": 2, "Admin": 4, "Verifier": 8, } )
Enum value maps for AccountType.
var ( BlockRequestType_name = map[int32]string{ 0: "default_type", 1: "only_header", 2: "whole_content", } BlockRequestType_value = map[string]int32{ "default_type": 0, "only_header": 1, "whole_content": 2, } )
Enum value maps for BlockRequestType.
var ( BroadcastMsgType_name = map[int32]string{ 0: "unknown_msg", 1: "send_pbft_msg", 2: "send_block_meta", 10: "send_tx", 20: "request_load_block", 21: "send_specific_block", } BroadcastMsgType_value = map[string]int32{ "unknown_msg": 0, "send_pbft_msg": 1, "send_block_meta": 2, "send_tx": 10, "request_load_block": 20, "send_specific_block": 21, } )
Enum value maps for BroadcastMsgType.
var ( MessageType_name = map[int32]string{ 0: "Default", 1: "PrePrepare", 2: "Prepare", 3: "Commit", 4: "Checkpoint", 5: "ViewChange", 6: "NewBlockProposal", } MessageType_value = map[string]int32{ "Default": 0, "PrePrepare": 1, "Prepare": 2, "Commit": 3, "Checkpoint": 4, "ViewChange": 5, "NewBlockProposal": 6, } )
Enum value maps for MessageType.
var ( States_name = map[int32]string{ 0: "NotStartd", 1: "PrePreparing", 2: "Preparing", 3: "Checking", 4: "Committing", 5: "Finished", 6: "ViewChanging", 7: "Checkpointing", } States_value = map[string]int32{ "NotStartd": 0, "PrePreparing": 1, "Preparing": 2, "Checking": 3, "Committing": 4, "Finished": 5, "ViewChanging": 6, "Checkpointing": 7, } )
Enum value maps for States.
var ( GenesisBlockId = "00000000000000000000000000000000" GenesisPrevBlockId = "00000000000000000000000000000000" GenesisTime = 20190520 GenesisBlockNum = 0 GenesisContent = []byte("one world one dream") )
var File_account_proto protoreflect.FileDescriptor
var File_block_meta_proto protoreflect.FileDescriptor
var File_consensus_proto protoreflect.FileDescriptor
var File_transaction_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type Account ¶
type Account struct { Id *Address `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Code []byte `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` Balance *Amount `protobuf:"bytes,3,opt,name=balance,proto3" json:"balance,omitempty"` AccountType int32 `protobuf:"varint,4,opt,name=account_type,json=accountType,proto3" json:"account_type,omitempty"` PublickKey []byte `protobuf:"bytes,5,opt,name=publick_key,json=publickKey,proto3" json:"publick_key,omitempty"` // contains filtered or unexported fields }
func (*Account) AddBalance ¶
func (*Account) Descriptor
deprecated
func (*Account) GetAccountType ¶
func (*Account) GetBalance ¶
func (*Account) GetPublickKey ¶
func (*Account) ProtoMessage ¶
func (*Account) ProtoMessage()
func (*Account) ProtoReflect ¶
func (x *Account) ProtoReflect() protoreflect.Message
func (*Account) SubBalance ¶
type AccountType ¶
type AccountType int32
一个账户 可以是下面几个类型的合集
const ( AccountType_Unkown AccountType = 0 // default AccountType_Normal AccountType = 1 // 普通账户 AccountType_Code AccountType = 2 // 合约账户 AccountType_Admin AccountType = 4 // 管理员账户 AccountType_Verifier AccountType = 8 // 验证者账户 )
func (AccountType) Descriptor ¶
func (AccountType) Descriptor() protoreflect.EnumDescriptor
func (AccountType) Enum ¶
func (x AccountType) Enum() *AccountType
func (AccountType) EnumDescriptor
deprecated
func (AccountType) EnumDescriptor() ([]byte, []int)
Deprecated: Use AccountType.Descriptor instead.
func (AccountType) Number ¶
func (x AccountType) Number() protoreflect.EnumNumber
func (AccountType) String ¶
func (x AccountType) String() string
func (AccountType) Type ¶
func (AccountType) Type() protoreflect.EnumType
type Address ¶
type Address struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // contains filtered or unexported fields }
func PublicKeyToAddress ¶
func (*Address) Descriptor
deprecated
func (*Address) GetAddress ¶
func (*Address) ProtoMessage ¶
func (*Address) ProtoMessage()
func (*Address) ProtoReflect ¶
func (x *Address) ProtoReflect() protoreflect.Message
type Amount ¶
type Amount struct { Amount string `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"` // contains filtered or unexported fields }
func (*Amount) Descriptor
deprecated
func (*Amount) ProtoMessage ¶
func (*Amount) ProtoMessage()
func (*Amount) ProtoReflect ¶
func (x *Amount) ProtoReflect() protoreflect.Message
type BlockMeta ¶
type BlockMeta struct { BlockHeight uint64 `protobuf:"varint,1,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"` CurVerfier *Verifier `protobuf:"bytes,2,opt,name=cur_verfier,json=curVerfier,proto3" json:"cur_verfier,omitempty"` VerifierNo uint32 `protobuf:"varint,3,opt,name=verifier_no,json=verifierNo,proto3" json:"verifier_no,omitempty"` Verifiers []*Verifier `protobuf:"bytes,4,rep,name=verifiers,proto3" json:"verifiers,omitempty"` LastView uint64 `protobuf:"varint,5,opt,name=last_view,json=lastView,proto3" json:"last_view,omitempty"` // contains filtered or unexported fields }
func (*BlockMeta) Descriptor
deprecated
func (*BlockMeta) GetBlockHeight ¶
func (*BlockMeta) GetCurVerfier ¶
func (*BlockMeta) GetLastView ¶
func (*BlockMeta) GetVerifierNo ¶
func (*BlockMeta) GetVerifiers ¶
func (*BlockMeta) ProtoMessage ¶
func (*BlockMeta) ProtoMessage()
func (*BlockMeta) ProtoReflect ¶
func (x *BlockMeta) ProtoReflect() protoreflect.Message
type BlockRequest ¶
type BlockRequest struct { BlockNum int64 `protobuf:"varint,1,opt,name=block_num,json=blockNum,proto3" json:"block_num,omitempty"` RequestType BlockRequestType `protobuf:"varint,2,opt,name=request_type,json=requestType,proto3,enum=BlockRequestType" json:"request_type,omitempty"` // contains filtered or unexported fields }
func (*BlockRequest) Descriptor
deprecated
func (*BlockRequest) Descriptor() ([]byte, []int)
Deprecated: Use BlockRequest.ProtoReflect.Descriptor instead.
func (*BlockRequest) GetBlockNum ¶
func (x *BlockRequest) GetBlockNum() int64
func (*BlockRequest) GetRequestType ¶
func (x *BlockRequest) GetRequestType() BlockRequestType
func (*BlockRequest) ProtoMessage ¶
func (*BlockRequest) ProtoMessage()
func (*BlockRequest) ProtoReflect ¶
func (x *BlockRequest) ProtoReflect() protoreflect.Message
func (*BlockRequest) Reset ¶
func (x *BlockRequest) Reset()
func (*BlockRequest) String ¶
func (x *BlockRequest) String() string
type BlockRequestType ¶
type BlockRequestType int32
const ( BlockRequestType_default_type BlockRequestType = 0 BlockRequestType_only_header BlockRequestType = 1 BlockRequestType_whole_content BlockRequestType = 2 )
func (BlockRequestType) Descriptor ¶
func (BlockRequestType) Descriptor() protoreflect.EnumDescriptor
func (BlockRequestType) Enum ¶
func (x BlockRequestType) Enum() *BlockRequestType
func (BlockRequestType) EnumDescriptor
deprecated
func (BlockRequestType) EnumDescriptor() ([]byte, []int)
Deprecated: Use BlockRequestType.Descriptor instead.
func (BlockRequestType) Number ¶
func (x BlockRequestType) Number() protoreflect.EnumNumber
func (BlockRequestType) String ¶
func (x BlockRequestType) String() string
func (BlockRequestType) Type ¶
func (BlockRequestType) Type() protoreflect.EnumType
type BlockResponse ¶
type BlockResponse struct { RequestType BlockRequestType `protobuf:"varint,2,opt,name=request_type,json=requestType,proto3,enum=BlockRequestType" json:"request_type,omitempty"` Block *PbftBlock `protobuf:"bytes,3,opt,name=block,proto3" json:"block,omitempty"` // contains filtered or unexported fields }
func (*BlockResponse) Descriptor
deprecated
func (*BlockResponse) Descriptor() ([]byte, []int)
Deprecated: Use BlockResponse.ProtoReflect.Descriptor instead.
func (*BlockResponse) GetBlock ¶
func (x *BlockResponse) GetBlock() *PbftBlock
func (*BlockResponse) GetRequestType ¶
func (x *BlockResponse) GetRequestType() BlockRequestType
func (*BlockResponse) ProtoMessage ¶
func (*BlockResponse) ProtoMessage()
func (*BlockResponse) ProtoReflect ¶
func (x *BlockResponse) ProtoReflect() protoreflect.Message
func (*BlockResponse) Reset ¶
func (x *BlockResponse) Reset()
func (*BlockResponse) String ¶
func (x *BlockResponse) String() string
type BroadcastMsgType ¶
type BroadcastMsgType int32
const ( BroadcastMsgType_unknown_msg BroadcastMsgType = 0 // 共识相关 BroadcastMsgType_send_pbft_msg BroadcastMsgType = 1 BroadcastMsgType_send_block_meta BroadcastMsgType = 2 // tx BroadcastMsgType_send_tx BroadcastMsgType = 10 // 意味着接收到从其他节点发过来的交易 // blockchain BroadcastMsgType_request_load_block BroadcastMsgType = 20 BroadcastMsgType_send_specific_block BroadcastMsgType = 21 )
func (BroadcastMsgType) Descriptor ¶
func (BroadcastMsgType) Descriptor() protoreflect.EnumDescriptor
func (BroadcastMsgType) Enum ¶
func (x BroadcastMsgType) Enum() *BroadcastMsgType
func (BroadcastMsgType) EnumDescriptor
deprecated
func (BroadcastMsgType) EnumDescriptor() ([]byte, []int)
Deprecated: Use BroadcastMsgType.Descriptor instead.
func (BroadcastMsgType) Number ¶
func (x BroadcastMsgType) Number() protoreflect.EnumNumber
func (BroadcastMsgType) String ¶
func (x BroadcastMsgType) String() string
func (BroadcastMsgType) Type ¶
func (BroadcastMsgType) Type() protoreflect.EnumType
type Genesis ¶
type Genesis struct { Verifiers []*Verifier `protobuf:"bytes,1,rep,name=verifiers,proto3" json:"verifiers,omitempty"` // contains filtered or unexported fields }
func (*Genesis) Descriptor
deprecated
func (*Genesis) GetVerifiers ¶
func (*Genesis) ProtoMessage ¶
func (*Genesis) ProtoMessage()
func (*Genesis) ProtoReflect ¶
func (x *Genesis) ProtoReflect() protoreflect.Message
type MessageType ¶
type MessageType int32
const ( MessageType_Default MessageType = 0 MessageType_PrePrepare MessageType = 1 // 预准备 MessageType_Prepare MessageType = 2 // 准备 MessageType_Commit MessageType = 3 MessageType_Checkpoint MessageType = 4 MessageType_ViewChange MessageType = 5 MessageType_NewBlockProposal MessageType = 6 )
func (MessageType) Descriptor ¶
func (MessageType) Descriptor() protoreflect.EnumDescriptor
func (MessageType) Enum ¶
func (x MessageType) Enum() *MessageType
func (MessageType) EnumDescriptor
deprecated
func (MessageType) EnumDescriptor() ([]byte, []int)
Deprecated: Use MessageType.Descriptor instead.
func (MessageType) Number ¶
func (x MessageType) Number() protoreflect.EnumNumber
func (MessageType) String ¶
func (x MessageType) String() string
func (MessageType) Type ¶
func (MessageType) Type() protoreflect.EnumType
type PbftBlock ¶
type PbftBlock struct { PrevBlock string `protobuf:"bytes,1,opt,name=prev_block,json=prevBlock,proto3" json:"prev_block,omitempty"` // 区块链的hash值 BlockId string `protobuf:"bytes,2,opt,name=block_id,json=blockId,proto3" json:"block_id,omitempty"` // 主验证者公钥 SignerId []byte `protobuf:"bytes,3,opt,name=signer_id,json=signerId,proto3" json:"signer_id,omitempty"` // 以UTC时间为准 TimeStamp uint64 `protobuf:"varint,4,opt,name=time_stamp,json=timeStamp,proto3" json:"time_stamp,omitempty"` BlockNum uint64 `protobuf:"varint,5,opt,name=block_num,json=blockNum,proto3" json:"block_num,omitempty"` // 交易列表 // bytes content = 6; Tansactions *Txs `protobuf:"bytes,6,opt,name=tansactions,proto3" json:"tansactions,omitempty"` TransactionReceipts *TxReceipts `protobuf:"bytes,9,opt,name=transaction_receipts,json=transactionReceipts,proto3" json:"transaction_receipts,omitempty"` TxRoot []byte `protobuf:"bytes,11,opt,name=tx_root,json=txRoot,proto3" json:"tx_root,omitempty"` TxReceiptsRoot []byte `protobuf:"bytes,12,opt,name=tx_receipts_root,json=txReceiptsRoot,proto3" json:"tx_receipts_root,omitempty"` // 内容签名 Sign []byte `protobuf:"bytes,7,opt,name=sign,proto3" json:"sign,omitempty"` // 视图编号 View uint64 `protobuf:"varint,10,opt,name=view,proto3" json:"view,omitempty"` SignPairs []*SignPairs `protobuf:"bytes,8,rep,name=sign_pairs,json=signPairs,proto3" json:"sign_pairs,omitempty"` // contains filtered or unexported fields }
func (*PbftBlock) Descriptor
deprecated
func (*PbftBlock) GetBlockId ¶
func (*PbftBlock) GetBlockNum ¶
func (*PbftBlock) GetPrevBlock ¶
func (*PbftBlock) GetSignPairs ¶
func (*PbftBlock) GetSignerId ¶
func (*PbftBlock) GetTansactions ¶
func (*PbftBlock) GetTimeStamp ¶
func (*PbftBlock) GetTransactionReceipts ¶
func (x *PbftBlock) GetTransactionReceipts() *TxReceipts
func (*PbftBlock) GetTxReceiptsRoot ¶
func (*PbftBlock) ProtoMessage ¶
func (*PbftBlock) ProtoMessage()
func (*PbftBlock) ProtoReflect ¶
func (x *PbftBlock) ProtoReflect() protoreflect.Message
type PbftGenericMessage ¶
type PbftGenericMessage struct { // Message information Info *PbftMessageInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` // The actual message Block *PbftBlock `protobuf:"bytes,2,opt,name=block,proto3" json:"block,omitempty"` // 收到的其他节点发送的消息 OtherInfos []*PbftMessageInfo `protobuf:"bytes,3,rep,name=other_infos,json=otherInfos,proto3" json:"other_infos,omitempty"` // contains filtered or unexported fields }
PbftGenericMessage A generic PBFT message (PrePrepare, Prepare, Commit, Checkpoint)
func (*PbftGenericMessage) Descriptor
deprecated
func (*PbftGenericMessage) Descriptor() ([]byte, []int)
Deprecated: Use PbftGenericMessage.ProtoReflect.Descriptor instead.
func (*PbftGenericMessage) GetBlock ¶
func (x *PbftGenericMessage) GetBlock() *PbftBlock
func (*PbftGenericMessage) GetInfo ¶
func (x *PbftGenericMessage) GetInfo() *PbftMessageInfo
func (*PbftGenericMessage) GetOtherInfos ¶
func (x *PbftGenericMessage) GetOtherInfos() []*PbftMessageInfo
func (*PbftGenericMessage) ProtoMessage ¶
func (*PbftGenericMessage) ProtoMessage()
func (*PbftGenericMessage) ProtoReflect ¶
func (x *PbftGenericMessage) ProtoReflect() protoreflect.Message
func (*PbftGenericMessage) Reset ¶
func (x *PbftGenericMessage) Reset()
func (*PbftGenericMessage) String ¶
func (x *PbftGenericMessage) String() string
type PbftMessage ¶
type PbftMessage struct { // Types that are assignable to Msg: // *PbftMessage_Generic // *PbftMessage_ViewChange Msg isPbftMessage_Msg `protobuf_oneof:"msg"` // contains filtered or unexported fields }
func NewPbftMessage ¶
func NewPbftMessage(val interface{}) *PbftMessage
func (*PbftMessage) Descriptor
deprecated
func (*PbftMessage) Descriptor() ([]byte, []int)
Deprecated: Use PbftMessage.ProtoReflect.Descriptor instead.
func (*PbftMessage) GetGeneric ¶
func (x *PbftMessage) GetGeneric() *PbftGenericMessage
func (*PbftMessage) GetMsg ¶
func (m *PbftMessage) GetMsg() isPbftMessage_Msg
func (*PbftMessage) GetViewChange ¶
func (x *PbftMessage) GetViewChange() *PbftViewChange
func (*PbftMessage) ProtoMessage ¶
func (*PbftMessage) ProtoMessage()
func (*PbftMessage) ProtoReflect ¶
func (x *PbftMessage) ProtoReflect() protoreflect.Message
func (*PbftMessage) Reset ¶
func (x *PbftMessage) Reset()
func (*PbftMessage) String ¶
func (x *PbftMessage) String() string
type PbftMessageInfo ¶
type PbftMessageInfo struct { // Type of the message MsgType MessageType `protobuf:"varint,1,opt,name=msg_type,json=msgType,proto3,enum=MessageType" json:"msg_type,omitempty"` // View number View uint64 `protobuf:"varint,2,opt,name=view,proto3" json:"view,omitempty"` // Sequence number SeqNum uint64 `protobuf:"varint,3,opt,name=seq_num,json=seqNum,proto3" json:"seq_num,omitempty"` // Node who signed the message SignerId []byte `protobuf:"bytes,4,opt,name=signer_id,json=signerId,proto3" json:"signer_id,omitempty"` // 签名内容 Sign []byte `protobuf:"bytes,5,opt,name=sign,proto3" json:"sign,omitempty"` // contains filtered or unexported fields }
func (*PbftMessageInfo) Descriptor
deprecated
func (*PbftMessageInfo) Descriptor() ([]byte, []int)
Deprecated: Use PbftMessageInfo.ProtoReflect.Descriptor instead.
func (*PbftMessageInfo) GetMsgType ¶
func (x *PbftMessageInfo) GetMsgType() MessageType
func (*PbftMessageInfo) GetSeqNum ¶
func (x *PbftMessageInfo) GetSeqNum() uint64
func (*PbftMessageInfo) GetSign ¶
func (x *PbftMessageInfo) GetSign() []byte
func (*PbftMessageInfo) GetSignerId ¶
func (x *PbftMessageInfo) GetSignerId() []byte
func (*PbftMessageInfo) GetView ¶
func (x *PbftMessageInfo) GetView() uint64
func (*PbftMessageInfo) ProtoMessage ¶
func (*PbftMessageInfo) ProtoMessage()
func (*PbftMessageInfo) ProtoReflect ¶
func (x *PbftMessageInfo) ProtoReflect() protoreflect.Message
func (*PbftMessageInfo) Reset ¶
func (x *PbftMessageInfo) Reset()
func (*PbftMessageInfo) String ¶
func (x *PbftMessageInfo) String() string
type PbftMessage_Generic ¶
type PbftMessage_Generic struct {
Generic *PbftGenericMessage `protobuf:"bytes,1,opt,name=generic,proto3,oneof"`
}
type PbftMessage_ViewChange ¶
type PbftMessage_ViewChange struct {
ViewChange *PbftViewChange `protobuf:"bytes,2,opt,name=view_change,json=viewChange,proto3,oneof"`
}
type PbftViewChange ¶
type PbftViewChange struct { // Message information Info *PbftMessageInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` // Set of `2f + 1` Checkpoint messages, proving correctness of stable // Checkpoint mentioned in info's `seq_num` CheckpointMessages []*PbftGenericMessage `protobuf:"bytes,2,rep,name=checkpoint_messages,json=checkpointMessages,proto3" json:"checkpoint_messages,omitempty"` // contains filtered or unexported fields }
View change message, for when a node suspects the primary node is faulty
func (*PbftViewChange) Descriptor
deprecated
func (*PbftViewChange) Descriptor() ([]byte, []int)
Deprecated: Use PbftViewChange.ProtoReflect.Descriptor instead.
func (*PbftViewChange) GetCheckpointMessages ¶
func (x *PbftViewChange) GetCheckpointMessages() []*PbftGenericMessage
func (*PbftViewChange) GetInfo ¶
func (x *PbftViewChange) GetInfo() *PbftMessageInfo
func (*PbftViewChange) ProtoMessage ¶
func (*PbftViewChange) ProtoMessage()
func (*PbftViewChange) ProtoReflect ¶
func (x *PbftViewChange) ProtoReflect() protoreflect.Message
func (*PbftViewChange) Reset ¶
func (x *PbftViewChange) Reset()
func (*PbftViewChange) String ¶
func (x *PbftViewChange) String() string
type SignPairs ¶
type SignPairs struct { // 签名公钥 SignerId []byte `protobuf:"bytes,1,opt,name=signer_id,json=signerId,proto3" json:"signer_id,omitempty"` // 签名内容 Sign []byte `protobuf:"bytes,2,opt,name=sign,proto3" json:"sign,omitempty"` // contains filtered or unexported fields }
func (*SignPairs) Descriptor
deprecated
func (*SignPairs) GetSignerId ¶
func (*SignPairs) ProtoMessage ¶
func (*SignPairs) ProtoMessage()
func (*SignPairs) ProtoReflect ¶
func (x *SignPairs) ProtoReflect() protoreflect.Message
type States ¶
type States int32
状态机流转列表
func (States) Descriptor ¶
func (States) Descriptor() protoreflect.EnumDescriptor
func (States) EnumDescriptor
deprecated
func (States) Number ¶
func (x States) Number() protoreflect.EnumNumber
func (States) Type ¶
func (States) Type() protoreflect.EnumType
type Tx ¶
type Tx struct { Sender *Address `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"` Recipient *Address `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"` Amount *Amount `protobuf:"bytes,3,opt,name=amount,proto3" json:"amount,omitempty"` Sequeue string `protobuf:"bytes,4,opt,name=sequeue,proto3" json:"sequeue,omitempty"` Input []byte `protobuf:"bytes,5,opt,name=input,proto3" json:"input,omitempty"` Sign []byte `protobuf:"bytes,6,opt,name=sign,proto3" json:"sign,omitempty"` PublickKey []byte `protobuf:"bytes,7,opt,name=publick_key,json=publickKey,proto3" json:"publick_key,omitempty"` TimeStamp uint64 `protobuf:"varint,8,opt,name=time_stamp,json=timeStamp,proto3" json:"time_stamp,omitempty"` // contains filtered or unexported fields }
func (*Tx) Descriptor
deprecated
func (*Tx) GetPublickKey ¶
func (*Tx) GetRecipient ¶
func (*Tx) GetSequeue ¶
func (*Tx) GetTimeStamp ¶
func (*Tx) ProtoMessage ¶
func (*Tx) ProtoMessage()
func (*Tx) ProtoReflect ¶
func (x *Tx) ProtoReflect() protoreflect.Message
func (*Tx) VerifySignedTx ¶
type TxReceipt ¶
type TxReceipt struct { Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"` TxId []byte `protobuf:"bytes,6,opt,name=tx_id,json=txId,proto3" json:"tx_id,omitempty"` Sign []byte `protobuf:"bytes,7,opt,name=sign,proto3" json:"sign,omitempty"` // contains filtered or unexported fields }
func (*TxReceipt) Descriptor
deprecated
func (*TxReceipt) IsVaildTxR ¶
func (*TxReceipt) ProtoMessage ¶
func (*TxReceipt) ProtoMessage()
func (*TxReceipt) ProtoReflect ¶
func (x *TxReceipt) ProtoReflect() protoreflect.Message
func (*TxReceipt) SignedTxReceipt ¶
func (txr *TxReceipt) SignedTxReceipt(priv *ecdsa.PrivateKey) error
type TxReceipts ¶
type TxReceipts struct { TansactionReceipts []*TxReceipt `protobuf:"bytes,1,rep,name=tansaction_receipts,json=tansactionReceipts,proto3" json:"tansaction_receipts,omitempty"` // contains filtered or unexported fields }
func (*TxReceipts) Descriptor
deprecated
func (*TxReceipts) Descriptor() ([]byte, []int)
Deprecated: Use TxReceipts.ProtoReflect.Descriptor instead.
func (*TxReceipts) GetTansactionReceipts ¶
func (x *TxReceipts) GetTansactionReceipts() []*TxReceipt
func (*TxReceipts) MerkleRoot ¶
func (txRs *TxReceipts) MerkleRoot() []byte
func (*TxReceipts) ProtoMessage ¶
func (*TxReceipts) ProtoMessage()
func (*TxReceipts) ProtoReflect ¶
func (x *TxReceipts) ProtoReflect() protoreflect.Message
func (*TxReceipts) Reset ¶
func (x *TxReceipts) Reset()
func (*TxReceipts) String ¶
func (x *TxReceipts) String() string
type Txs ¶
type Txs struct { Tansactions []*Tx `protobuf:"bytes,1,rep,name=tansactions,proto3" json:"tansactions,omitempty"` // contains filtered or unexported fields }
func (*Txs) Descriptor
deprecated
func (*Txs) GetTansactions ¶
func (*Txs) MerkleRoot ¶
func (*Txs) ProtoMessage ¶
func (*Txs) ProtoMessage()
func (*Txs) ProtoReflect ¶
func (x *Txs) ProtoReflect() protoreflect.Message
type Verifier ¶
type Verifier struct { PublickKey []byte `protobuf:"bytes,1,opt,name=publick_key,json=publickKey,proto3" json:"publick_key,omitempty"` PrivateKey []byte `protobuf:"bytes,2,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` SeqNum int32 `protobuf:"varint,3,opt,name=seq_num,json=seqNum,proto3" json:"seq_num,omitempty"` // contains filtered or unexported fields }
func (*Verifier) Descriptor
deprecated
func (*Verifier) GetPrivateKey ¶
func (*Verifier) GetPublickKey ¶
func (*Verifier) ProtoMessage ¶
func (*Verifier) ProtoMessage()
func (*Verifier) ProtoReflect ¶
func (x *Verifier) ProtoReflect() protoreflect.Message