Documentation ¶
Index ¶
- func CalEpSlbyTd(blkTd uint64) (epochID uint64, slotID uint64)
- func CalEpochSlotID(time uint64) (epochId, slotId uint64)
- func CalEpochSlotIDByNow()
- func CompressPk(pk *ecdsa.PublicKey) ([]byte, error)
- func FirstPosBlockNumber() uint64
- func FromWin(win *big.Int) float64
- func GetAbi(abiString string) (abi.ABI, error)
- func GetCurrentBlkEpochSlotID() (epochID, slotID uint64)
- func GetEpochBlock(epochID uint64) uint64
- func GetEpochBlockHash(epochID uint64) common.Hash
- func GetEpochSlotID() (uint64, uint64)
- func GetEpochSlotIDFromDifficulty(difficulty *big.Int) (epochID, slotID uint64)
- func GetProposerBn256PK(epochID uint64, idx uint64, addr common.Address) []byte
- func IsPosBlock(number uint64) bool
- func IsWhiteAddr(addr *common.Address) bool
- func MemStat() uint64
- func PkEqual(pk1, pk2 *ecdsa.PublicKey) bool
- func RemoveEpochBlockCache(epochID uint64)
- func SendPosTx(rc *rpc.Client, tx map[string]interface{})
- func SendTx(rc *rpc.Client, tx map[string]interface{}) (common.Hash, error)
- func SetEpochBlock(epochID uint64, blockNumber uint64, hash common.Hash)
- func SetEpocherInst(sor SelectLead)
- func SetPosAvgInst(posavg PosAvgRetInterface)
- func TryGetAndSaveAllStakerInfoBytes(epochId uint64) (*[][]byte, error)
- func UncompressPk(buf []byte) (*ecdsa.PublicKey, error)
- func UpdateEpochBlock(block *types.Block)
- type PosAvgRetInterface
- type SelectLead
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalEpSlbyTd ¶
func CalEpochSlotID ¶
func CalEpochSlotIDByNow ¶
func CalEpochSlotIDByNow()
func FirstPosBlockNumber ¶
func FirstPosBlockNumber() uint64
func GetCurrentBlkEpochSlotID ¶
func GetCurrentBlkEpochSlotID() (epochID, slotID uint64)
func GetEpochBlockHash ¶
func GetEpochSlotID ¶
func GetEpochSlotIDFromDifficulty ¶
GetEpochSlotIDFromDifficulty can get epochID and slotID from difficulty.
func GetProposerBn256PK ¶
func IsPosBlock ¶
func IsWhiteAddr ¶
func RemoveEpochBlockCache ¶
func RemoveEpochBlockCache(epochID uint64)
func SendTx ¶
type SendTxArgs struct { From common.Address `json:"from"` To *common.Address `json:"to"` Gas *hexutil.Big `json:"gas"` GasPrice *hexutil.Big `json:"gasPrice"` Value *hexutil.Big `json:"value"` Data hexutil.Bytes `json:"data"` Nonce *hexutil.Uint64 `json:"nonce"` }
func SetEpocherInst ¶
func SetEpocherInst(sor SelectLead)
func SetPosAvgInst ¶
func SetPosAvgInst(posavg PosAvgRetInterface)
func UpdateEpochBlock ¶
Types ¶
type PosAvgRetInterface ¶
type PosAvgRetInterface interface { GetPosAverageReturnRate(epochID uint64) (uint64, error) GetAllStakeAndReturn(epochID uint64) (*big.Int, error) GetAllIncentive(epochID uint64) (*big.Int, error) }
func PosAvgRetInst ¶
func PosAvgRetInst() PosAvgRetInterface
type SelectLead ¶
type SelectLead interface { SelectLeadersLoop(epochId uint64) error GetProposerBn256PK(epochID uint64, idx uint64, addr common.Address) []byte GetRBProposerG1(epochID uint64) []bn256.G1 GetEpochLeaders(epochID uint64) [][]byte GetEpochLastBlkNumber(targetEpochId uint64) uint64 GetCurrentHeader() *types.Header }
func GetEpocherInst ¶
func GetEpocherInst() SelectLead
Click to show internal directories.
Click to hide internal directories.