model

package
v0.0.0-...-8cfcfd0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
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.

View Source
var (
	GenesisBlockId     = "00000000000000000000000000000000"
	GenesisPrevBlockId = "00000000000000000000000000000000"
	GenesisTime        = 20190520
	GenesisBlockNum    = 0
	GenesisContent     = []byte("one world one dream")
)
View Source
var File_account_proto protoreflect.FileDescriptor
View Source
var File_block_meta_proto protoreflect.FileDescriptor
View Source
var File_consensus_proto protoreflect.FileDescriptor
View Source
var File_transaction_proto protoreflect.FileDescriptor

Functions

func Compare

func Compare(a, b string) int

Compare a==b: 0 a>b:1 a<b:-1

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 (acc *Account) AddBalance(am *Amount)

func (*Account) Descriptor deprecated

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

Deprecated: Use Account.ProtoReflect.Descriptor instead.

func (*Account) GetAccountType

func (x *Account) GetAccountType() int32

func (*Account) GetBalance

func (x *Account) GetBalance() *Amount

func (*Account) GetCode

func (x *Account) GetCode() []byte

func (*Account) GetId

func (x *Account) GetId() *Address

func (*Account) GetPublickKey

func (x *Account) GetPublickKey() []byte

func (*Account) ProtoMessage

func (*Account) ProtoMessage()

func (*Account) ProtoReflect

func (x *Account) ProtoReflect() protoreflect.Message

func (*Account) Reset

func (x *Account) Reset()

func (*Account) String

func (x *Account) String() string

func (*Account) SubBalance

func (acc *Account) SubBalance(am *Amount)

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) 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

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 PublicKeyToAddress(pub []byte) *Address

func (*Address) Descriptor deprecated

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

Deprecated: Use Address.ProtoReflect.Descriptor instead.

func (*Address) GetAddress

func (x *Address) GetAddress() string

func (*Address) ProtoMessage

func (*Address) ProtoMessage()

func (*Address) ProtoReflect

func (x *Address) ProtoReflect() protoreflect.Message

func (*Address) Reset

func (x *Address) Reset()

func (*Address) String

func (x *Address) String() string

type Amount

type Amount struct {
	Amount string `protobuf:"bytes,1,opt,name=amount,proto3" json:"amount,omitempty"`
	// contains filtered or unexported fields
}

func (*Amount) AddAmount

func (am *Amount) AddAmount(amb *Amount)

func (*Amount) Descriptor deprecated

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

Deprecated: Use Amount.ProtoReflect.Descriptor instead.

func (*Amount) GetAmount

func (x *Amount) GetAmount() string

func (*Amount) ProtoMessage

func (*Amount) ProtoMessage()

func (*Amount) ProtoReflect

func (x *Amount) ProtoReflect() protoreflect.Message

func (*Amount) Reset

func (x *Amount) Reset()

func (*Amount) String

func (x *Amount) String() string

func (*Amount) SubAmount

func (am *Amount) SubAmount(amb *Amount)

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) Descriptor() ([]byte, []int)

Deprecated: Use BlockMeta.ProtoReflect.Descriptor instead.

func (*BlockMeta) GetBlockHeight

func (x *BlockMeta) GetBlockHeight() uint64

func (*BlockMeta) GetCurVerfier

func (x *BlockMeta) GetCurVerfier() *Verifier

func (*BlockMeta) GetLastView

func (x *BlockMeta) GetLastView() uint64

func (*BlockMeta) GetVerifierNo

func (x *BlockMeta) GetVerifierNo() uint32

func (*BlockMeta) GetVerifiers

func (x *BlockMeta) GetVerifiers() []*Verifier

func (*BlockMeta) ProtoMessage

func (*BlockMeta) ProtoMessage()

func (*BlockMeta) ProtoReflect

func (x *BlockMeta) ProtoReflect() protoreflect.Message

func (*BlockMeta) Reset

func (x *BlockMeta) Reset()

func (*BlockMeta) String

func (x *BlockMeta) String() string

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) Enum

func (BlockRequestType) EnumDescriptor deprecated

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

Deprecated: Use BlockRequestType.Descriptor instead.

func (BlockRequestType) Number

func (BlockRequestType) String

func (x BlockRequestType) String() string

func (BlockRequestType) Type

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) Enum

func (BroadcastMsgType) EnumDescriptor deprecated

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

Deprecated: Use BroadcastMsgType.Descriptor instead.

func (BroadcastMsgType) Number

func (BroadcastMsgType) String

func (x BroadcastMsgType) String() string

func (BroadcastMsgType) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use Genesis.ProtoReflect.Descriptor instead.

func (*Genesis) GetVerifiers

func (x *Genesis) GetVerifiers() []*Verifier

func (*Genesis) ProtoMessage

func (*Genesis) ProtoMessage()

func (*Genesis) ProtoReflect

func (x *Genesis) ProtoReflect() protoreflect.Message

func (*Genesis) Reset

func (x *Genesis) Reset()

func (*Genesis) String

func (x *Genesis) String() string

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) 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

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) Descriptor() ([]byte, []int)

Deprecated: Use PbftBlock.ProtoReflect.Descriptor instead.

func (*PbftBlock) GetBlockId

func (x *PbftBlock) GetBlockId() string

func (*PbftBlock) GetBlockNum

func (x *PbftBlock) GetBlockNum() uint64

func (*PbftBlock) GetPrevBlock

func (x *PbftBlock) GetPrevBlock() string

func (*PbftBlock) GetSign

func (x *PbftBlock) GetSign() []byte

func (*PbftBlock) GetSignPairs

func (x *PbftBlock) GetSignPairs() []*SignPairs

func (*PbftBlock) GetSignerId

func (x *PbftBlock) GetSignerId() []byte

func (*PbftBlock) GetTansactions

func (x *PbftBlock) GetTansactions() *Txs

func (*PbftBlock) GetTimeStamp

func (x *PbftBlock) GetTimeStamp() uint64

func (*PbftBlock) GetTransactionReceipts

func (x *PbftBlock) GetTransactionReceipts() *TxReceipts

func (*PbftBlock) GetTxReceiptsRoot

func (x *PbftBlock) GetTxReceiptsRoot() []byte

func (*PbftBlock) GetTxRoot

func (x *PbftBlock) GetTxRoot() []byte

func (*PbftBlock) GetView

func (x *PbftBlock) GetView() uint64

func (*PbftBlock) ProtoMessage

func (*PbftBlock) ProtoMessage()

func (*PbftBlock) ProtoReflect

func (x *PbftBlock) ProtoReflect() protoreflect.Message

func (*PbftBlock) Reset

func (x *PbftBlock) Reset()

func (*PbftBlock) String

func (x *PbftBlock) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use SignPairs.ProtoReflect.Descriptor instead.

func (*SignPairs) GetSign

func (x *SignPairs) GetSign() []byte

func (*SignPairs) GetSignerId

func (x *SignPairs) GetSignerId() []byte

func (*SignPairs) ProtoMessage

func (*SignPairs) ProtoMessage()

func (*SignPairs) ProtoReflect

func (x *SignPairs) ProtoReflect() protoreflect.Message

func (*SignPairs) Reset

func (x *SignPairs) Reset()

func (*SignPairs) String

func (x *SignPairs) String() string

type States

type States int32

状态机流转列表

const (
	States_NotStartd     States = 0
	States_PrePreparing  States = 1
	States_Preparing     States = 2
	States_Checking      States = 3
	States_Committing    States = 4
	States_Finished      States = 5
	States_ViewChanging  States = 6
	States_Checkpointing States = 7
)

func (States) Descriptor

func (States) Descriptor() protoreflect.EnumDescriptor

func (States) Enum

func (x States) Enum() *States

func (States) EnumDescriptor deprecated

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

Deprecated: Use States.Descriptor instead.

func (States) Number

func (x States) Number() protoreflect.EnumNumber

func (States) String

func (x States) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Tx.ProtoReflect.Descriptor instead.

func (*Tx) GetAmount

func (x *Tx) GetAmount() *Amount

func (*Tx) GetInput

func (x *Tx) GetInput() []byte

func (*Tx) GetPublickKey

func (x *Tx) GetPublickKey() []byte

func (*Tx) GetRecipient

func (x *Tx) GetRecipient() *Address

func (*Tx) GetSender

func (x *Tx) GetSender() *Address

func (*Tx) GetSequeue

func (x *Tx) GetSequeue() string

func (*Tx) GetSign

func (x *Tx) GetSign() []byte

func (*Tx) GetTimeStamp

func (x *Tx) GetTimeStamp() uint64

func (*Tx) IsVaildTx

func (tx *Tx) IsVaildTx() bool

func (*Tx) ProtoMessage

func (*Tx) ProtoMessage()

func (*Tx) ProtoReflect

func (x *Tx) ProtoReflect() protoreflect.Message

func (*Tx) Reset

func (x *Tx) Reset()

func (*Tx) SignTx

func (tx *Tx) SignTx(priv *ecdsa.PrivateKey) error

func (*Tx) String

func (x *Tx) String() string

func (*Tx) VerifySignedTx

func (tx *Tx) VerifySignedTx() (bool, error)

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) Descriptor() ([]byte, []int)

Deprecated: Use TxReceipt.ProtoReflect.Descriptor instead.

func (*TxReceipt) GetSign

func (x *TxReceipt) GetSign() []byte

func (*TxReceipt) GetStatus

func (x *TxReceipt) GetStatus() int32

func (*TxReceipt) GetTxId

func (x *TxReceipt) GetTxId() []byte

func (*TxReceipt) IsVaildTxR

func (txr *TxReceipt) IsVaildTxR(publicKey []byte) bool

func (*TxReceipt) ProtoMessage

func (*TxReceipt) ProtoMessage()

func (*TxReceipt) ProtoReflect

func (x *TxReceipt) ProtoReflect() protoreflect.Message

func (*TxReceipt) Reset

func (x *TxReceipt) Reset()

func (*TxReceipt) SignedTxReceipt

func (txr *TxReceipt) SignedTxReceipt(priv *ecdsa.PrivateKey) error

func (*TxReceipt) String

func (x *TxReceipt) String() string

func (*TxReceipt) VerifySignedTxReciept

func (txr *TxReceipt) VerifySignedTxReciept(publicKey []byte) (bool, 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) Descriptor() ([]byte, []int)

Deprecated: Use Txs.ProtoReflect.Descriptor instead.

func (*Txs) GetTansactions

func (x *Txs) GetTansactions() []*Tx

func (*Txs) MerkleRoot

func (txs *Txs) MerkleRoot() []byte

func (*Txs) ProtoMessage

func (*Txs) ProtoMessage()

func (*Txs) ProtoReflect

func (x *Txs) ProtoReflect() protoreflect.Message

func (*Txs) Reset

func (x *Txs) Reset()

func (*Txs) String

func (x *Txs) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use Verifier.ProtoReflect.Descriptor instead.

func (*Verifier) GetPrivateKey

func (x *Verifier) GetPrivateKey() []byte

func (*Verifier) GetPublickKey

func (x *Verifier) GetPublickKey() []byte

func (*Verifier) GetSeqNum

func (x *Verifier) GetSeqNum() int32

func (*Verifier) ProtoMessage

func (*Verifier) ProtoMessage()

func (*Verifier) ProtoReflect

func (x *Verifier) ProtoReflect() protoreflect.Message

func (*Verifier) Reset

func (x *Verifier) Reset()

func (*Verifier) String

func (x *Verifier) String() string

Jump to

Keyboard shortcuts

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