proto

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Block_Type_name = map[int32]string{
	0: "UNKNOWN",
	1: "GENESIS",
	2: "TXS",
	3: "BCH",
	4: "RECONFIG",
}
View Source
var Block_Type_value = map[string]int32{
	"UNKNOWN":  0,
	"GENESIS":  1,
	"TXS":      2,
	"BCH":      3,
	"RECONFIG": 4,
}
View Source
var CodeType_name = map[int32]string{
	0: "SIGNED",
	1: "NEEDSYNC",
	2: "REJECT",
}
View Source
var CodeType_value = map[string]int32{
	"SIGNED":   0,
	"NEEDSYNC": 1,
	"REJECT":   2,
}
View Source
var Reconfig_Type_name = map[int32]string{
	0: "JOIN",
	1: "LEAVE",
}
View Source
var Reconfig_Type_value = map[string]int32{
	"JOIN":  0,
	"LEAVE": 1,
}
View Source
var TxStatus_name = map[int32]string{
	0: "WAITING",
	1: "COMMITTED",
	2: "REJECTED",
}
View Source
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 CreateJoinReconfigBlock(timestampMs int64, prevBlockId *crypto.Digest256, t Reconfig_Type, host string, nodeId int32, pubkey string, vote *Vote) *Block

func CreateLeaveReconfigBlock

func CreateLeaveReconfigBlock(timestampMs int64, prevBlockId *crypto.Digest256, t Reconfig_Type, nodeId int32) *Block

func CreateTxsBlock

func CreateTxsBlock(timestampMs int64, prevBlockId *crypto.Digest256, txs []*Transaction) *Block

func (*Block) Descriptor

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

func (*Block) GetBchBlockHeader

func (m *Block) GetBchBlockHeader() *BchBlockHeader

func (*Block) GetId

func (m *Block) GetId() *crypto.Digest256

func (*Block) GetPrevBlockId

func (m *Block) GetPrevBlockId() *crypto.Digest256

func (*Block) GetReconfig

func (m *Block) GetReconfig() *Reconfig

func (*Block) GetTimestampMs

func (m *Block) GetTimestampMs() int64

func (*Block) GetTxs

func (m *Block) GetTxs() []*Transaction

func (*Block) GetType

func (m *Block) GetType() Block_Type

func (*Block) IsBchBlock

func (b *Block) IsBchBlock() bool

func (*Block) IsGenesis

func (b *Block) IsGenesis() bool

func (*Block) IsReconfig

func (b *Block) IsReconfig() bool

func (*Block) IsTxsBlock

func (b *Block) IsTxsBlock() bool

func (*Block) ProtoMessage

func (*Block) ProtoMessage()

func (*Block) Reset

func (m *Block) Reset()

func (*Block) String

func (m *Block) String() string

func (*Block) UpdateBlockId

func (b *Block) UpdateBlockId()

func (*Block) XXX_DiscardUnknown

func (m *Block) XXX_DiscardUnknown()

func (*Block) XXX_Marshal

func (m *Block) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Block) XXX_Merge

func (dst *Block) XXX_Merge(src proto.Message)

func (*Block) XXX_Size

func (m *Block) XXX_Size() int

func (*Block) XXX_Unmarshal

func (m *Block) XXX_Unmarshal(b []byte) error

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 NewBlockInfoFull(term, height int64, block *Block) *BlockInfo

func NewBlockInfoLite

func NewBlockInfoLite(term, height int64, blockId *crypto.Digest256) *BlockInfo

func (*BlockInfo) Descriptor

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

func (*BlockInfo) GetBlock

func (m *BlockInfo) GetBlock() *Block

func (*BlockInfo) GetBlockId

func (m *BlockInfo) GetBlockId() *crypto.Digest256

func (*BlockInfo) GetHeight

func (m *BlockInfo) GetHeight() int64

func (*BlockInfo) GetTerm

func (m *BlockInfo) GetTerm() int64

func (*BlockInfo) ProtoMessage

func (*BlockInfo) ProtoMessage()

func (*BlockInfo) Reset

func (m *BlockInfo) Reset()

func (*BlockInfo) String

func (m *BlockInfo) String() string

func (*BlockInfo) XXX_DiscardUnknown

func (m *BlockInfo) XXX_DiscardUnknown()

func (*BlockInfo) XXX_Marshal

func (m *BlockInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockInfo) XXX_Merge

func (dst *BlockInfo) XXX_Merge(src proto.Message)

func (*BlockInfo) XXX_Size

func (m *BlockInfo) XXX_Size() int

func (*BlockInfo) XXX_Unmarshal

func (m *BlockInfo) XXX_Unmarshal(b []byte) error

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 NewBlockPack(init *InitMsg) *BlockPack

func UnmarshalBlockPack

func UnmarshalBlockPack(bytes []byte) *BlockPack

func (*BlockPack) Block

func (bp *BlockPack) Block() *Block

func (*BlockPack) BlockId

func (bp *BlockPack) BlockId() *crypto.Digest256

func (*BlockPack) BlockIdEqualTo

func (bp *BlockPack) BlockIdEqualTo(other *BlockPack) bool

func (*BlockPack) BlockInfo

func (bp *BlockPack) BlockInfo() *BlockInfo

func (*BlockPack) Clone

func (bp *BlockPack) Clone() *BlockPack

func (*BlockPack) DebugString

func (bp *BlockPack) DebugString() string

func (*BlockPack) Descriptor

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

func (*BlockPack) GetCommits

func (m *BlockPack) GetCommits() map[int32]*CommitMsg

func (*BlockPack) GetInit

func (m *BlockPack) GetInit() *InitMsg

func (*BlockPack) GetPrepares

func (m *BlockPack) GetPrepares() map[int32]*PrepareMsg

func (*BlockPack) HasLessTermHeightThan

func (bp *BlockPack) HasLessTermHeightThan(other *BlockPack) bool

func (*BlockPack) Height

func (bp *BlockPack) Height() int64

func (*BlockPack) Id

func (bp *BlockPack) Id() *crypto.Digest256

func (*BlockPack) IsBchBlock

func (bp *BlockPack) IsBchBlock() bool

func (*BlockPack) IsReconfigBlock

func (bp *BlockPack) IsReconfigBlock() bool

func (*BlockPack) IsTxsBlock

func (bp *BlockPack) IsTxsBlock() bool

func (*BlockPack) PrevBlockId

func (bp *BlockPack) PrevBlockId() *crypto.Digest256

func (*BlockPack) ProtoMessage

func (*BlockPack) ProtoMessage()

func (*BlockPack) Reset

func (m *BlockPack) Reset()

func (*BlockPack) ShallowCopy

func (bp *BlockPack) ShallowCopy() *BlockPack

func (*BlockPack) String

func (m *BlockPack) String() string

func (*BlockPack) Term

func (bp *BlockPack) Term() int64

func (*BlockPack) TimestampMs

func (bp *BlockPack) TimestampMs() int64

func (*BlockPack) ToVotie

func (bp *BlockPack) ToVotie() *Votie

func (*BlockPack) XXX_DiscardUnknown

func (m *BlockPack) XXX_DiscardUnknown()

func (*BlockPack) XXX_Marshal

func (m *BlockPack) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*BlockPack) XXX_Merge

func (dst *BlockPack) XXX_Merge(src proto.Message)

func (*BlockPack) XXX_Size

func (m *BlockPack) XXX_Size() int

func (*BlockPack) XXX_Unmarshal

func (m *BlockPack) XXX_Unmarshal(b []byte) error

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 CodeType

type CodeType int32
const (
	CodeType_SIGNED   CodeType = 0
	CodeType_NEEDSYNC CodeType = 1
	CodeType_REJECT   CodeType = 2
)

func (CodeType) EnumDescriptor

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

func (CodeType) String

func (x CodeType) String() string

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 MakeCommitMsg(blockInfo *BlockInfo, nodeId int32, signer *crypto.SecureSigner) (*CommitMsg, error)

func (*CommitMsg) BlockInfoLite

func (msg *CommitMsg) BlockInfoLite() *BlockInfo

func (*CommitMsg) Descriptor

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

func (*CommitMsg) GetBlockId

func (m *CommitMsg) GetBlockId() *crypto.Digest256

func (*CommitMsg) GetHeight

func (m *CommitMsg) GetHeight() int64

func (*CommitMsg) GetNodeId

func (m *CommitMsg) GetNodeId() int32

func (*CommitMsg) GetSig

func (m *CommitMsg) GetSig() []byte

func (*CommitMsg) GetTerm

func (m *CommitMsg) GetTerm() int64

func (*CommitMsg) Id

func (msg *CommitMsg) Id() *crypto.Digest256

func (*CommitMsg) ProtoMessage

func (*CommitMsg) ProtoMessage()

func (*CommitMsg) Reset

func (m *CommitMsg) Reset()

func (*CommitMsg) String

func (m *CommitMsg) String() string

func (*CommitMsg) XXX_DiscardUnknown

func (m *CommitMsg) XXX_DiscardUnknown()

func (*CommitMsg) XXX_Marshal

func (m *CommitMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CommitMsg) XXX_Merge

func (dst *CommitMsg) XXX_Merge(src proto.Message)

func (*CommitMsg) XXX_Size

func (m *CommitMsg) XXX_Size() int

func (*CommitMsg) XXX_Unmarshal

func (m *CommitMsg) XXX_Unmarshal(b []byte) error

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

func (init *InitMsg) BlockId() *crypto.Digest256

func (*InitMsg) BlockInfo

func (init *InitMsg) BlockInfo() *BlockInfo

func (*InitMsg) Descriptor

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

func (*InitMsg) GetBlock

func (m *InitMsg) GetBlock() *Block

func (*InitMsg) GetHeight

func (m *InitMsg) GetHeight() int64

func (*InitMsg) GetNodeId

func (m *InitMsg) GetNodeId() int32

func (*InitMsg) GetSig

func (m *InitMsg) GetSig() []byte

func (*InitMsg) GetTerm

func (m *InitMsg) GetTerm() int64

func (*InitMsg) GetVotes

func (m *InitMsg) GetVotes() map[int32]*Vote

func (*InitMsg) Id

func (init *InitMsg) Id() *crypto.Digest256

func (*InitMsg) PrevBlockId

func (init *InitMsg) PrevBlockId() *crypto.Digest256

func (*InitMsg) ProtoMessage

func (*InitMsg) ProtoMessage()

func (*InitMsg) Reset

func (m *InitMsg) Reset()

func (*InitMsg) String

func (m *InitMsg) String() string

func (*InitMsg) XXX_DiscardUnknown

func (m *InitMsg) XXX_DiscardUnknown()

func (*InitMsg) XXX_Marshal

func (m *InitMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*InitMsg) XXX_Merge

func (dst *InitMsg) XXX_Merge(src proto.Message)

func (*InitMsg) XXX_Size

func (m *InitMsg) XXX_Size() int

func (*InitMsg) XXX_Unmarshal

func (m *InitMsg) XXX_Unmarshal(b []byte) error

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

func (*NewlyTx) GetAmount

func (m *NewlyTx) GetAmount() int64

func (*NewlyTx) GetData

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

func (*NewlyTx) GetTimestamp added in v1.1.0

func (m *NewlyTx) GetTimestamp() int64

func (*NewlyTx) ProtoMessage

func (*NewlyTx) ProtoMessage()

func (*NewlyTx) Reset

func (m *NewlyTx) Reset()

func (*NewlyTx) String

func (m *NewlyTx) String() string

func (*NewlyTx) XXX_DiscardUnknown

func (m *NewlyTx) XXX_DiscardUnknown()

func (*NewlyTx) XXX_Marshal

func (m *NewlyTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NewlyTx) XXX_Merge

func (dst *NewlyTx) XXX_Merge(src proto.Message)

func (*NewlyTx) XXX_Size

func (m *NewlyTx) XXX_Size() int

func (*NewlyTx) XXX_Unmarshal

func (m *NewlyTx) XXX_Unmarshal(b []byte) error

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

func (*NodeInfo) GetHost

func (m *NodeInfo) GetHost() string

func (*NodeInfo) GetIsNormal

func (m *NodeInfo) GetIsNormal() bool

func (*NodeInfo) GetName

func (m *NodeInfo) GetName() string

func (*NodeInfo) GetNodeId

func (m *NodeInfo) GetNodeId() int32

func (*NodeInfo) GetPubkey

func (m *NodeInfo) GetPubkey() string

func (*NodeInfo) ProtoMessage

func (*NodeInfo) ProtoMessage()

func (*NodeInfo) Reset

func (m *NodeInfo) Reset()

func (*NodeInfo) String

func (m *NodeInfo) String() string

func (*NodeInfo) XXX_DiscardUnknown

func (m *NodeInfo) XXX_DiscardUnknown()

func (*NodeInfo) XXX_Marshal

func (m *NodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NodeInfo) XXX_Merge

func (dst *NodeInfo) XXX_Merge(src proto.Message)

func (*NodeInfo) XXX_Size

func (m *NodeInfo) XXX_Size() int

func (*NodeInfo) XXX_Unmarshal

func (m *NodeInfo) XXX_Unmarshal(b []byte) error

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

func (*NodeList) GetBlockHeight added in v1.1.0

func (m *NodeList) GetBlockHeight() int64

func (*NodeList) GetLeaderId

func (m *NodeList) GetLeaderId() int32

func (*NodeList) GetMultiSigInfoList

func (m *NodeList) GetMultiSigInfoList() []*MultiSigInfo

func (*NodeList) GetNodeList

func (m *NodeList) GetNodeList() []*NodeInfo

func (NodeList) GetPubkeys

func (nl NodeList) GetPubkeys() []string

func (*NodeList) GetQuorumN

func (m *NodeList) GetQuorumN() int32

func (*NodeList) ProtoMessage

func (*NodeList) ProtoMessage()

func (*NodeList) Reset

func (m *NodeList) Reset()

func (*NodeList) String

func (m *NodeList) String() string

func (*NodeList) XXX_DiscardUnknown

func (m *NodeList) XXX_DiscardUnknown()

func (*NodeList) XXX_Marshal

func (m *NodeList) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NodeList) XXX_Merge

func (dst *NodeList) XXX_Merge(src proto.Message)

func (*NodeList) XXX_Size

func (m *NodeList) XXX_Size() int

func (*NodeList) XXX_Unmarshal

func (m *NodeList) XXX_Unmarshal(b []byte) error

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

func (*Reconfig) GetHost

func (m *Reconfig) GetHost() string

func (*Reconfig) GetNodeId

func (m *Reconfig) GetNodeId() int32

func (*Reconfig) GetPubkey added in v1.1.0

func (m *Reconfig) GetPubkey() string

func (*Reconfig) GetType

func (m *Reconfig) GetType() Reconfig_Type

func (*Reconfig) GetVote added in v1.1.0

func (m *Reconfig) GetVote() *Vote

func (*Reconfig) Id

func (reconfig *Reconfig) Id() *crypto.Digest256

func (*Reconfig) ProtoMessage

func (*Reconfig) ProtoMessage()

func (*Reconfig) Reset

func (m *Reconfig) Reset()

func (*Reconfig) String

func (m *Reconfig) String() string

func (*Reconfig) XXX_DiscardUnknown

func (m *Reconfig) XXX_DiscardUnknown()

func (*Reconfig) XXX_Marshal

func (m *Reconfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Reconfig) XXX_Merge

func (dst *Reconfig) XXX_Merge(src proto.Message)

func (*Reconfig) XXX_Size

func (m *Reconfig) XXX_Size() int

func (*Reconfig) XXX_Unmarshal

func (m *Reconfig) XXX_Unmarshal(b []byte) error

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

func (tx *Transaction) UpdateId()

UpdateId 更新Tx的ID

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 TxStatus

type TxStatus int32
const (
	TxStatus_WAITING   TxStatus = 0
	TxStatus_COMMITTED TxStatus = 1
	TxStatus_REJECTED  TxStatus = 2
)

func (TxStatus) EnumDescriptor

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

func (TxStatus) String

func (x TxStatus) String() string

type Void

type Void struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Void) Descriptor

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

func (*Void) ProtoMessage

func (*Void) ProtoMessage()

func (*Void) Reset

func (m *Void) Reset()

func (*Void) String

func (m *Void) String() string

func (*Void) XXX_DiscardUnknown

func (m *Void) XXX_DiscardUnknown()

func (*Void) XXX_Marshal

func (m *Void) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Void) XXX_Merge

func (dst *Void) XXX_Merge(src proto.Message)

func (*Void) XXX_Size

func (m *Void) XXX_Size() int

func (*Void) XXX_Unmarshal

func (m *Void) XXX_Unmarshal(b []byte) error

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 MakeVote

func MakeVote(term int64, votie *Votie, nodeId int32,
	signer *crypto.SecureSigner) (*Vote, error)

func (*Vote) DebugString

func (vote *Vote) DebugString() string

func (*Vote) Descriptor

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

func (*Vote) GetNodeId

func (m *Vote) GetNodeId() int32

func (*Vote) GetSig

func (m *Vote) GetSig() []byte

func (*Vote) GetTerm

func (m *Vote) GetTerm() int64

func (*Vote) GetVotie

func (m *Vote) GetVotie() *Votie

func (*Vote) Id

func (vote *Vote) Id() *crypto.Digest256

func (*Vote) ProtoMessage

func (*Vote) ProtoMessage()

func (*Vote) Reset

func (m *Vote) Reset()

func (*Vote) String

func (m *Vote) String() string

func (*Vote) XXX_DiscardUnknown

func (m *Vote) XXX_DiscardUnknown()

func (*Vote) XXX_Marshal

func (m *Vote) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Vote) XXX_Merge

func (dst *Vote) XXX_Merge(src proto.Message)

func (*Vote) XXX_Size

func (m *Vote) XXX_Size() int

func (*Vote) XXX_Unmarshal

func (m *Vote) XXX_Unmarshal(b []byte) error

type VoteMap

type VoteMap map[int32]*Vote //map: nodeId -> *vote

func (VoteMap) GetMaxVotie

func (vm VoteMap) GetMaxVotie() *Votie

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 GetMaxVotie(votes map[int32]*Vote) *Votie

func UnmarshalVotie

func UnmarshalVotie(bytes []byte) *Votie

func (*Votie) Descriptor

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

func (*Votie) GetBlock

func (m *Votie) GetBlock() *Block

func (*Votie) GetCommits

func (m *Votie) GetCommits() map[int32]*CommitMsg

func (*Votie) GetHeight

func (m *Votie) GetHeight() int64

func (*Votie) GetPrepares

func (m *Votie) GetPrepares() map[int32]*PrepareMsg

func (*Votie) GetTerm

func (m *Votie) GetTerm() int64

func (*Votie) HasLessTermHeightThan

func (v *Votie) HasLessTermHeightThan(other *Votie) bool

func (*Votie) Id

func (v *Votie) Id() *crypto.Digest256

func (*Votie) ProtoMessage

func (*Votie) ProtoMessage()

func (*Votie) Reset

func (m *Votie) Reset()

func (*Votie) String

func (m *Votie) String() string

func (*Votie) XXX_DiscardUnknown

func (m *Votie) XXX_DiscardUnknown()

func (*Votie) XXX_Marshal

func (m *Votie) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Votie) XXX_Merge

func (dst *Votie) XXX_Merge(src proto.Message)

func (*Votie) XXX_Size

func (m *Votie) XXX_Size() int

func (*Votie) XXX_Unmarshal

func (m *Votie) XXX_Unmarshal(b []byte) error

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

Jump to

Keyboard shortcuts

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