Documentation ¶
Index ¶
- type WroldState
- func (ws *WroldState) GetBlock(key interface{}) (*model.PbftBlock, error)
- func (ws *WroldState) GetBlockMeta() (*model.BlockMeta, error)
- func (ws *WroldState) GetGenesis() (*model.Genesis, error)
- func (ws *WroldState) IncreaseBlockNum()
- func (ws *WroldState) IncreaseView()
- func (ws *WroldState) InsertBlock(block *model.PbftBlock) error
- func (ws *WroldState) InsertTxRecords(txs []*model.Tx, txrs []*model.TxReceipt, blockNum int64) error
- func (ws *WroldState) IsVerfier(publicKey []byte) bool
- func (ws *WroldState) SetBlockNum(num uint64)
- func (ws *WroldState) SetGenesis(g *model.Genesis) error
- func (ws *WroldState) SetValue(blockNum uint64, prevBlock string, blockID string, verifiers []*model.Verifier)
- func (ws *WroldState) SetView(v uint64)
- func (ws *WroldState) StartAPI(g *echo.Group)
- func (ws *WroldState) UpdateLastWorldState() error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WroldState ¶
type WroldState struct { BlockNum uint64 `json:"blockNum"` // 当前区块编号 PrevBlock string `json:"prevBlock"` // 前一个区块hash BlockID string `json:"blockID"` // 当前区块hash Verifiers []*model.Verifier `json:"verifiers"` // 当前所有的验证者 VerifiersMap map[string]struct{} VerifierNo int `josn:"verifierNo"` // 验证者所处编号 如果为-1 表示不是验证者 CurVerfier *model.Verifier `json:"curVerfier"` View uint64 `json:"view"` // 当前视图 sync.RWMutex `json:"-"` // contains filtered or unexported fields }
func (*WroldState) GetBlock ¶
func (ws *WroldState) GetBlock(key interface{}) (*model.PbftBlock, error)
func (*WroldState) GetBlockMeta ¶
func (ws *WroldState) GetBlockMeta() (*model.BlockMeta, error)
func (*WroldState) GetGenesis ¶
func (ws *WroldState) GetGenesis() (*model.Genesis, error)
func (*WroldState) IncreaseBlockNum ¶
func (ws *WroldState) IncreaseBlockNum()
func (*WroldState) IncreaseView ¶
func (ws *WroldState) IncreaseView()
func (*WroldState) InsertBlock ¶
func (ws *WroldState) InsertBlock(block *model.PbftBlock) error
func (*WroldState) InsertTxRecords ¶
func (*WroldState) IsVerfier ¶
func (ws *WroldState) IsVerfier(publicKey []byte) bool
func (*WroldState) SetBlockNum ¶
func (ws *WroldState) SetBlockNum(num uint64)
func (*WroldState) SetGenesis ¶
func (ws *WroldState) SetGenesis(g *model.Genesis) error
func (*WroldState) SetView ¶
func (ws *WroldState) SetView(v uint64)
func (*WroldState) StartAPI ¶
func (ws *WroldState) StartAPI(g *echo.Group)
func (*WroldState) UpdateLastWorldState ¶
func (ws *WroldState) UpdateLastWorldState() error
Click to show internal directories.
Click to hide internal directories.