Documentation ¶
Index ¶
- func AddNode(lg ledger.StateLedger, newNode rbft.NodeInfo) (uint64, error)
- func GetCurrentEpochInfo(lg ledger.StateLedger) (*rbft.EpochInfo, error)
- func GetEpochInfo(lg ledger.StateLedger, epoch uint64) (*rbft.EpochInfo, error)
- func GetNextEpochInfo(lg ledger.StateLedger) (*rbft.EpochInfo, error)
- func InitEpochInfo(lg ledger.StateLedger, epochInfo *rbft.EpochInfo) error
- func RemoveNode(lg ledger.StateLedger, removeNodeID uint64) error
- func RemoveNodeByP2PNodeID(lg ledger.StateLedger, removeByP2PNodeID string) error
- func SetNextEpochInfo(lg ledger.StateLedger, n *rbft.EpochInfo) error
- func TurnIntoNewEpoch(electValidatorsByWrfSeed []byte, lg ledger.StateLedger) (*rbft.EpochInfo, error)
- type EpochManager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddNode ¶
AddNode adds a new node to the ledger. It takes a StateLedger instance and a pointer to a NodeInfo struct as parameters. It returns an error if any validation fails.
func GetCurrentEpochInfo ¶
func GetCurrentEpochInfo(lg ledger.StateLedger) (*rbft.EpochInfo, error)
func GetEpochInfo ¶
func GetNextEpochInfo ¶
func GetNextEpochInfo(lg ledger.StateLedger) (*rbft.EpochInfo, error)
func InitEpochInfo ¶
func InitEpochInfo(lg ledger.StateLedger, epochInfo *rbft.EpochInfo) error
func RemoveNode ¶
func RemoveNode(lg ledger.StateLedger, removeNodeID uint64) error
RemoveNode removes a node from the validator set, candidate set, or data syncer set. It takes a StateLedger and the ID of the node to remove as input. It returns an error if the node ID is not found in any of the sets.
func RemoveNodeByP2PNodeID ¶
func RemoveNodeByP2PNodeID(lg ledger.StateLedger, removeByP2PNodeID string) error
func SetNextEpochInfo ¶
func SetNextEpochInfo(lg ledger.StateLedger, n *rbft.EpochInfo) error
func TurnIntoNewEpoch ¶
func TurnIntoNewEpoch(electValidatorsByWrfSeed []byte, lg ledger.StateLedger) (*rbft.EpochInfo, error)
TurnIntoNewEpoch when execute epoch last, return new current epoch info
Types ¶
type EpochManager ¶
type EpochManager struct {
// contains filtered or unexported fields
}
func NewEpochManager ¶
func NewEpochManager(cfg *common.SystemContractConfig) *EpochManager
func (*EpochManager) EstimateGas ¶
func (m *EpochManager) EstimateGas(callArgs *types.CallArgs) (uint64, error)
func (*EpochManager) Reset ¶
func (m *EpochManager) Reset(lastHeight uint64, stateLedger ledger.StateLedger)
func (*EpochManager) Run ¶
func (m *EpochManager) Run(msg *vm.Message) (*vm.ExecutionResult, error)
Click to show internal directories.
Click to hide internal directories.