kernel

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultHTTPClient = &http.Client{
	Transport: &http.Transport{
		Dial: (&net.Dialer{
			Timeout: 5 * time.Second,
		}).Dial,
		TLSHandshakeTimeout: 5 * time.Second,
	},
	Timeout: time.Second * 10,
}
View Source
var (
	ErrBlockNotExist = errors.New("block not exist")
)

Functions

func ChainClient

func ChainClient() iotexapi.APIServiceClient

func GetBlockByHeightFromBlockDAO

func GetBlockByHeightFromBlockDAO(blkHeight uint64, dao blockdao.BlockDAO) (blk *block.Block, err error)

func GetBlockByHeightFromChain

func GetBlockByHeightFromChain(height uint64) (*block.Block, error)

func GetBlockDAOCtx

func GetBlockDAOCtx(ctx context.Context) (blockdao.BlockDAO, bool)

GetBlockDAOCtx gets blockDAOCtx

func GetConfigCtx

func GetConfigCtx(ctx context.Context) (string, bool)

GetConfigCtx gets configCtx

func GetEpochHeight

func GetEpochHeight(epochNum uint64) uint64

GetEpochHeight returns the start height of an epoch

func GetEpochLastBlockHeight

func GetEpochLastBlockHeight(epochNum uint64) uint64

GetEpochLastBlockHeight returns the last height of an epoch

func GetEpochNum

func GetEpochNum(height uint64) uint64

https://github.com/millken/iotex-core/blob/77950cec681d2e441a77b2b9a162ffa1c4ca4f55/action/protocol/rolldpos/epoch.go#L213 GetEpochNum returns the number of the epoch for a given height

func GetSubEpochNum

func GetSubEpochNum(height uint64) uint64

GetSubEpochNum returns the sub epoch number of a block height

func NewVirtualDao

func NewVirtualDao() blockdao.BlockDAO

func NumSubEpochs

func NumSubEpochs(height uint64) uint64

NumSubEpochs returns the number of subEpochs given a block height

func WithBlockDAOCtx

func WithBlockDAOCtx(ctx context.Context, dao blockdao.BlockDAO) context.Context

WithBlockDAOCtx add blockDAOCtx into context.

func WithConfigCtx

func WithConfigCtx(ctx context.Context, config string) context.Context

WithConfigCtx add config path into context.

Types

type AtomicBool

type AtomicBool struct {
	// contains filtered or unexported fields
}

func (*AtomicBool) Get

func (b *AtomicBool) Get() bool

func (*AtomicBool) Set

func (b *AtomicBool) Set(value bool)

Jump to

Keyboard shortcuts

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