Documentation ¶
Overview ¶
Package ppos_storage is a generated protocol buffer package.
It is generated from these files:
ppos_storage.proto
It has these top-level messages:
CandidateInfo Refund RefundArr CandidateTemp Field TicketDependency TicketTemp PB_PPosTemp SortTemp
Index ¶
- Constants
- Variables
- func GetTicket(txHash common.Hash) *types.Ticket
- func PrintObject(s string, obj interface{})
- func PutTicket(txHash common.Hash, ticket *types.Ticket)
- func RemoveTicket(txHash common.Hash)
- type CandidateInfo
- func (*CandidateInfo) Descriptor() ([]byte, []int)
- func (m *CandidateInfo) GetBlockNumber() string
- func (m *CandidateInfo) GetCandidateId() string
- func (m *CandidateInfo) GetDeposit() string
- func (m *CandidateInfo) GetExtra() string
- func (m *CandidateInfo) GetFee() uint32
- func (m *CandidateInfo) GetHost() string
- func (m *CandidateInfo) GetOwner() string
- func (m *CandidateInfo) GetPort() string
- func (m *CandidateInfo) GetTOwner() string
- func (m *CandidateInfo) GetTxHash() string
- func (m *CandidateInfo) GetTxIndex() uint32
- func (*CandidateInfo) ProtoMessage()
- func (m *CandidateInfo) Reset()
- func (m *CandidateInfo) String() string
- type CandidateTemp
- func (*CandidateTemp) Descriptor() ([]byte, []int)
- func (m *CandidateTemp) GetCurrs() []*CandidateInfo
- func (m *CandidateTemp) GetImms() []*CandidateInfo
- func (m *CandidateTemp) GetNexts() []*CandidateInfo
- func (m *CandidateTemp) GetPres() []*CandidateInfo
- func (m *CandidateTemp) GetRefunds() map[string]*RefundArr
- func (m *CandidateTemp) GetRes() []*CandidateInfo
- func (*CandidateTemp) ProtoMessage()
- func (m *CandidateTemp) Reset()
- func (m *CandidateTemp) String() string
- type Field
- type PB_PPosTemp
- func (*PB_PPosTemp) Descriptor() ([]byte, []int)
- func (m *PB_PPosTemp) GetBlockHash() string
- func (m *PB_PPosTemp) GetBlockNumber() string
- func (m *PB_PPosTemp) GetCanTmp() *CandidateTemp
- func (m *PB_PPosTemp) GetTickTmp() *TicketTemp
- func (*PB_PPosTemp) ProtoMessage()
- func (m *PB_PPosTemp) Reset()
- func (m *PB_PPosTemp) String() string
- type PPOS_TEMP
- func (temp *PPOS_TEMP) Commit2DB(blockNumber *big.Int, blockHash common.Hash) error
- func (temp *PPOS_TEMP) GetPPosStorageProto() (common.Hash, []byte, error)
- func (temp *PPOS_TEMP) PushPPosStorageProto(data []byte) error
- func (temp *PPOS_TEMP) SubmitPposCache2Temp(blockNumber, blockInterval *big.Int, blockHash common.Hash, ...)
- type Ppos_storage
- func (p *Ppos_storage) AppendRefunds(nodeId discover.NodeID, refundArr types.RefundQueue)
- func (p *Ppos_storage) AppendTicket(nodeId discover.NodeID, txHash common.Hash, count uint32, price *big.Int) error
- func (p *Ppos_storage) CalculateHash(blockNumber *big.Int, blockHash common.Hash) (common.Hash, error)
- func (ps *Ppos_storage) Copy() *Ppos_storage
- func (p *Ppos_storage) CopyCandidateStorage() *candidate_temp
- func (p *Ppos_storage) CopyTicketStorage() *ticket_temp
- func (p *Ppos_storage) DelCandidateQueue(flag int)
- func (p *Ppos_storage) DelRefunds(nodeId discover.NodeID)
- func (p *Ppos_storage) GetCandidateQueue(flag int) types.CandidateQueue
- func (p *Ppos_storage) GetCandidateTicketAge(nodeId discover.NodeID) uint64
- func (p *Ppos_storage) GetCandidateTicketCount(nodeId discover.NodeID) uint32
- func (p *Ppos_storage) GetCandidateTxHashs(nodeId discover.NodeID) []common.Hash
- func (p *Ppos_storage) GetRefunds(nodeId discover.NodeID) types.RefundQueue
- func (p *Ppos_storage) GetTicketDependency(nodeId discover.NodeID) *ticketDependency
- func (p *Ppos_storage) GetTicketInfo(txHash common.Hash) *ticketInfo
- func (p *Ppos_storage) GetTicketRemainByTxHash(txHash common.Hash) uint32
- func (p *Ppos_storage) GetTotalRemian() int32
- func (p *Ppos_storage) RemoveTicket(nodeId discover.NodeID, txHash common.Hash) (*ticketInfo, error)
- func (p *Ppos_storage) RemoveTicketDependency(nodeId discover.NodeID)
- func (p *Ppos_storage) SetCandidateQueue(queue types.CandidateQueue, flag int)
- func (p *Ppos_storage) SetCandidateTicketAge(nodeId discover.NodeID, age uint64)
- func (p *Ppos_storage) SetRefund(nodeId discover.NodeID, refund *types.CandidateRefund)
- func (p *Ppos_storage) SetRefunds(nodeId discover.NodeID, refundArr types.RefundQueue)
- func (p *Ppos_storage) SetTicketDependency(nodeId discover.NodeID, ependency *ticketDependency)
- func (p *Ppos_storage) SetTotalRemain(count int32)
- func (p *Ppos_storage) SubTicket(nodeId discover.NodeID, txHash common.Hash) (*ticketInfo, error)
- type Refund
- type RefundArr
- type SortTemp
- func (*SortTemp) Descriptor() ([]byte, []int)
- func (m *SortTemp) GetCans() []*CandidateInfo
- func (m *SortTemp) GetDeps() []*TicketDependency
- func (m *SortTemp) GetNodeIds() []string
- func (m *SortTemp) GetReIds() []string
- func (m *SortTemp) GetRefunds() []*RefundArr
- func (m *SortTemp) GetSq() int32
- func (*SortTemp) ProtoMessage()
- func (m *SortTemp) Reset()
- func (m *SortTemp) String() string
- type TicketDependency
- type TicketTemp
Constants ¶
View Source
const ( PREVIOUS = iota CURRENT NEXT IMMEDIATE RESERVE )
Variables ¶
View Source
var ( ParamsIllegalErr = errors.New("Params illegal") TicketNotFindErr = errors.New("The Ticket not find") )
View Source
var ( WRITE_PPOS_ERR = errors.New("Failed to Write ppos storage into disk") // The key of ppos storage in disk (leveldb) PPOS_STORAGE_KEY = []byte("PPOS_STORAGE_KEY") )
Functions ¶
func PrintObject ¶
func PrintObject(s string, obj interface{})
func RemoveTicket ¶
Types ¶
type CandidateInfo ¶
type CandidateInfo struct { Deposit string `protobuf:"bytes,1,opt,name=Deposit" json:"Deposit,omitempty"` BlockNumber string `protobuf:"bytes,2,opt,name=BlockNumber" json:"BlockNumber,omitempty"` TxIndex uint32 `protobuf:"varint,3,opt,name=TxIndex" json:"TxIndex,omitempty"` CandidateId string `protobuf:"bytes,4,opt,name=CandidateId" json:"CandidateId,omitempty"` Host string `protobuf:"bytes,5,opt,name=Host" json:"Host,omitempty"` Port string `protobuf:"bytes,6,opt,name=Port" json:"Port,omitempty"` Owner string `protobuf:"bytes,7,opt,name=Owner" json:"Owner,omitempty"` // string From = 8; Extra string `protobuf:"bytes,8,opt,name=Extra" json:"Extra,omitempty"` Fee uint32 `protobuf:"varint,9,opt,name=Fee" json:"Fee,omitempty"` TxHash string `protobuf:"bytes,10,opt,name=TxHash" json:"TxHash,omitempty"` TOwner string `protobuf:"bytes,11,opt,name=TOwner" json:"TOwner,omitempty"` }
func (*CandidateInfo) Descriptor ¶
func (*CandidateInfo) Descriptor() ([]byte, []int)
func (*CandidateInfo) GetBlockNumber ¶
func (m *CandidateInfo) GetBlockNumber() string
func (*CandidateInfo) GetCandidateId ¶
func (m *CandidateInfo) GetCandidateId() string
func (*CandidateInfo) GetDeposit ¶
func (m *CandidateInfo) GetDeposit() string
func (*CandidateInfo) GetExtra ¶
func (m *CandidateInfo) GetExtra() string
func (*CandidateInfo) GetFee ¶
func (m *CandidateInfo) GetFee() uint32
func (*CandidateInfo) GetHost ¶
func (m *CandidateInfo) GetHost() string
func (*CandidateInfo) GetOwner ¶
func (m *CandidateInfo) GetOwner() string
func (*CandidateInfo) GetPort ¶
func (m *CandidateInfo) GetPort() string
func (*CandidateInfo) GetTOwner ¶
func (m *CandidateInfo) GetTOwner() string
func (*CandidateInfo) GetTxHash ¶
func (m *CandidateInfo) GetTxHash() string
func (*CandidateInfo) GetTxIndex ¶
func (m *CandidateInfo) GetTxIndex() uint32
func (*CandidateInfo) ProtoMessage ¶
func (*CandidateInfo) ProtoMessage()
func (*CandidateInfo) Reset ¶
func (m *CandidateInfo) Reset()
func (*CandidateInfo) String ¶
func (m *CandidateInfo) String() string
type CandidateTemp ¶
type CandidateTemp struct { // three round witness Pres []*CandidateInfo `protobuf:"bytes,1,rep,name=pres" json:"pres,omitempty"` Currs []*CandidateInfo `protobuf:"bytes,2,rep,name=currs" json:"currs,omitempty"` Nexts []*CandidateInfo `protobuf:"bytes,3,rep,name=nexts" json:"nexts,omitempty"` // can pool Imms []*CandidateInfo `protobuf:"bytes,4,rep,name=imms" json:"imms,omitempty"` Res []*CandidateInfo `protobuf:"bytes,5,rep,name=res" json:"res,omitempty"` // refunds Refunds map[string]*RefundArr `` /* 134-byte string literal not displayed */ }
func (*CandidateTemp) Descriptor ¶
func (*CandidateTemp) Descriptor() ([]byte, []int)
func (*CandidateTemp) GetCurrs ¶
func (m *CandidateTemp) GetCurrs() []*CandidateInfo
func (*CandidateTemp) GetImms ¶
func (m *CandidateTemp) GetImms() []*CandidateInfo
func (*CandidateTemp) GetNexts ¶
func (m *CandidateTemp) GetNexts() []*CandidateInfo
func (*CandidateTemp) GetPres ¶
func (m *CandidateTemp) GetPres() []*CandidateInfo
func (*CandidateTemp) GetRefunds ¶
func (m *CandidateTemp) GetRefunds() map[string]*RefundArr
func (*CandidateTemp) GetRes ¶
func (m *CandidateTemp) GetRes() []*CandidateInfo
func (*CandidateTemp) ProtoMessage ¶
func (*CandidateTemp) ProtoMessage()
func (*CandidateTemp) Reset ¶
func (m *CandidateTemp) Reset()
func (*CandidateTemp) String ¶
func (m *CandidateTemp) String() string
type Field ¶
type Field struct { TxHash string `protobuf:"bytes,1,opt,name=TxHash" json:"TxHash,omitempty"` Remaining uint32 `protobuf:"varint,2,opt,name=Remaining" json:"Remaining,omitempty"` Price string `protobuf:"bytes,3,opt,name=Price" json:"Price,omitempty"` }
func (*Field) Descriptor ¶
func (*Field) GetRemaining ¶
func (*Field) ProtoMessage ¶
func (*Field) ProtoMessage()
type PB_PPosTemp ¶
type PB_PPosTemp struct { CanTmp *CandidateTemp `protobuf:"bytes,1,opt,name=CanTmp" json:"CanTmp,omitempty"` TickTmp *TicketTemp `protobuf:"bytes,2,opt,name=TickTmp" json:"TickTmp,omitempty"` BlockNumber string `protobuf:"bytes,3,opt,name=BlockNumber" json:"BlockNumber,omitempty"` BlockHash string `protobuf:"bytes,4,opt,name=BlockHash" json:"BlockHash,omitempty"` }
func (*PB_PPosTemp) Descriptor ¶
func (*PB_PPosTemp) Descriptor() ([]byte, []int)
func (*PB_PPosTemp) GetBlockHash ¶
func (m *PB_PPosTemp) GetBlockHash() string
func (*PB_PPosTemp) GetBlockNumber ¶
func (m *PB_PPosTemp) GetBlockNumber() string
func (*PB_PPosTemp) GetCanTmp ¶
func (m *PB_PPosTemp) GetCanTmp() *CandidateTemp
func (*PB_PPosTemp) GetTickTmp ¶
func (m *PB_PPosTemp) GetTickTmp() *TicketTemp
func (*PB_PPosTemp) ProtoMessage ¶
func (*PB_PPosTemp) ProtoMessage()
func (*PB_PPosTemp) Reset ¶
func (m *PB_PPosTemp) Reset()
func (*PB_PPosTemp) String ¶
func (m *PB_PPosTemp) String() string
type PPOS_TEMP ¶
type PPOS_TEMP struct { BlockNumber *big.Int BlockHash common.Hash // Record block total count BlockCount uint32 // global data temp TempMap numTempMap // contains filtered or unexported fields }
Global PPOS Dependency TEMP
func GetPPosTempPtr ¶
func GetPPosTempPtr() *PPOS_TEMP
func NewPPosTemp ¶
func (*PPOS_TEMP) GetPPosStorageProto ¶
Gets ppos_storag pb from db
func (*PPOS_TEMP) PushPPosStorageProto ¶
Flush data into db
func (*PPOS_TEMP) SubmitPposCache2Temp ¶
func (temp *PPOS_TEMP) SubmitPposCache2Temp(blockNumber, blockInterval *big.Int, blockHash common.Hash, storage *Ppos_storage)
Set ppos storage cache by same block
type Ppos_storage ¶
type Ppos_storage struct {
// contains filtered or unexported fields
}
func BuildPposCache ¶
func BuildPposCache(blockNumber *big.Int, blockHash common.Hash) *Ppos_storage
func NewPPOS_storage ¶
func NewPPOS_storage() *Ppos_storage
func (*Ppos_storage) AppendRefunds ¶
func (p *Ppos_storage) AppendRefunds(nodeId discover.NodeID, refundArr types.RefundQueue)
func (*Ppos_storage) AppendTicket ¶
func (*Ppos_storage) CalculateHash ¶
func (*Ppos_storage) Copy ¶
func (ps *Ppos_storage) Copy() *Ppos_storage
func (*Ppos_storage) CopyCandidateStorage ¶
func (p *Ppos_storage) CopyCandidateStorage() *candidate_temp
func (*Ppos_storage) CopyTicketStorage ¶
func (p *Ppos_storage) CopyTicketStorage() *ticket_temp
func (*Ppos_storage) DelCandidateQueue ¶
func (p *Ppos_storage) DelCandidateQueue(flag int)
Delete CandidateQueue
func (*Ppos_storage) DelRefunds ¶
func (p *Ppos_storage) DelRefunds(nodeId discover.NodeID)
Delete RefundArr
func (*Ppos_storage) GetCandidateQueue ¶
func (p *Ppos_storage) GetCandidateQueue(flag int) types.CandidateQueue
Get CandidateQueue flag: 0: previous witness 1: current witness 2: next witness 3: immediate 4: reserve
func (*Ppos_storage) GetCandidateTicketAge ¶
func (p *Ppos_storage) GetCandidateTicketAge(nodeId discover.NodeID) uint64
func (*Ppos_storage) GetCandidateTicketCount ¶
func (p *Ppos_storage) GetCandidateTicketCount(nodeId discover.NodeID) uint32
func (*Ppos_storage) GetCandidateTxHashs ¶
func (p *Ppos_storage) GetCandidateTxHashs(nodeId discover.NodeID) []common.Hash
func (*Ppos_storage) GetRefunds ¶
func (p *Ppos_storage) GetRefunds(nodeId discover.NodeID) types.RefundQueue
Get Refund
func (*Ppos_storage) GetTicketDependency ¶
func (p *Ppos_storage) GetTicketDependency(nodeId discover.NodeID) *ticketDependency
Get ticket dependency
func (*Ppos_storage) GetTicketInfo ¶
func (p *Ppos_storage) GetTicketInfo(txHash common.Hash) *ticketInfo
func (*Ppos_storage) GetTicketRemainByTxHash ¶
func (p *Ppos_storage) GetTicketRemainByTxHash(txHash common.Hash) uint32
func (*Ppos_storage) GetTotalRemian ¶
func (p *Ppos_storage) GetTotalRemian() int32
Get total remian
func (*Ppos_storage) RemoveTicket ¶
func (*Ppos_storage) RemoveTicketDependency ¶
func (p *Ppos_storage) RemoveTicketDependency(nodeId discover.NodeID)
func (*Ppos_storage) SetCandidateQueue ¶
func (p *Ppos_storage) SetCandidateQueue(queue types.CandidateQueue, flag int)
Set CandidateQueue
func (*Ppos_storage) SetCandidateTicketAge ¶
func (p *Ppos_storage) SetCandidateTicketAge(nodeId discover.NodeID, age uint64)
func (*Ppos_storage) SetRefund ¶
func (p *Ppos_storage) SetRefund(nodeId discover.NodeID, refund *types.CandidateRefund)
Set Refund
func (*Ppos_storage) SetRefunds ¶
func (p *Ppos_storage) SetRefunds(nodeId discover.NodeID, refundArr types.RefundQueue)
func (*Ppos_storage) SetTicketDependency ¶
func (p *Ppos_storage) SetTicketDependency(nodeId discover.NodeID, ependency *ticketDependency)
Set ticket dependency
func (*Ppos_storage) SetTotalRemain ¶
func (p *Ppos_storage) SetTotalRemain(count int32)
Set total remain
type Refund ¶
type Refund struct { Deposit string `protobuf:"bytes,1,opt,name=Deposit" json:"Deposit,omitempty"` BlockNumber string `protobuf:"bytes,2,opt,name=BlockNumber" json:"BlockNumber,omitempty"` Owner string `protobuf:"bytes,3,opt,name=Owner" json:"Owner,omitempty"` }
func (*Refund) Descriptor ¶
func (*Refund) GetBlockNumber ¶
func (*Refund) GetDeposit ¶
func (*Refund) ProtoMessage ¶
func (*Refund) ProtoMessage()
type RefundArr ¶
type RefundArr struct {
Defeats []*Refund `protobuf:"bytes,1,rep,name=Defeats" json:"Defeats,omitempty"`
}
func (*RefundArr) Descriptor ¶
func (*RefundArr) GetDefeats ¶
func (*RefundArr) ProtoMessage ¶
func (*RefundArr) ProtoMessage()
type SortTemp ¶
type SortTemp struct { // can dependency Cans []*CandidateInfo `protobuf:"bytes,1,rep,name=cans" json:"cans,omitempty"` ReIds []string `protobuf:"bytes,2,rep,name=reIds" json:"reIds,omitempty"` Refunds []*RefundArr `protobuf:"bytes,3,rep,name=refunds" json:"refunds,omitempty"` // tick dependency Sq int32 `protobuf:"varint,4,opt,name=sq" json:"sq,omitempty"` NodeIds []string `protobuf:"bytes,5,rep,name=nodeIds" json:"nodeIds,omitempty"` Deps []*TicketDependency `protobuf:"bytes,6,rep,name=deps" json:"deps,omitempty"` }
func (*SortTemp) Descriptor ¶
func (*SortTemp) GetCans ¶
func (m *SortTemp) GetCans() []*CandidateInfo
func (*SortTemp) GetDeps ¶
func (m *SortTemp) GetDeps() []*TicketDependency
func (*SortTemp) GetNodeIds ¶
func (*SortTemp) GetRefunds ¶
func (*SortTemp) ProtoMessage ¶
func (*SortTemp) ProtoMessage()
type TicketDependency ¶
type TicketDependency struct { // uint64 Age = 1; Num uint32 `protobuf:"varint,2,opt,name=Num" json:"Num,omitempty"` // repeated bytes Tids = 3; Tinfo []*Field `protobuf:"bytes,3,rep,name=Tinfo" json:"Tinfo,omitempty"` }
func (*TicketDependency) Descriptor ¶
func (*TicketDependency) Descriptor() ([]byte, []int)
func (*TicketDependency) GetNum ¶
func (m *TicketDependency) GetNum() uint32
func (*TicketDependency) GetTinfo ¶
func (m *TicketDependency) GetTinfo() []*Field
func (*TicketDependency) ProtoMessage ¶
func (*TicketDependency) ProtoMessage()
func (*TicketDependency) Reset ¶
func (m *TicketDependency) Reset()
func (*TicketDependency) String ¶
func (m *TicketDependency) String() string
type TicketTemp ¶
type TicketTemp struct { Sq int32 `protobuf:"varint,1,opt,name=Sq" json:"Sq,omitempty"` // map<string, TicketInfo> Infos = 2; // map<string, TxHashArr> Ets = 3; Dependencys map[string]*TicketDependency `` /* 142-byte string literal not displayed */ }
func (*TicketTemp) Descriptor ¶
func (*TicketTemp) Descriptor() ([]byte, []int)
func (*TicketTemp) GetDependencys ¶
func (m *TicketTemp) GetDependencys() map[string]*TicketDependency
func (*TicketTemp) GetSq ¶
func (m *TicketTemp) GetSq() int32
func (*TicketTemp) ProtoMessage ¶
func (*TicketTemp) ProtoMessage()
func (*TicketTemp) Reset ¶
func (m *TicketTemp) Reset()
func (*TicketTemp) String ¶
func (m *TicketTemp) String() string
Click to show internal directories.
Click to hide internal directories.