kernel

package
v1.14.49 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//https://eips.ethereum.org/EIPS/eip-721
	ERC721InterfaceID = [4]byte{0x80, 0xac, 0x58, 0xcd}
	//https://eips.ethereum.org/EIPS/eip-1155
	ERC1155InterfaceID = [4]byte{0xd9, 0xb6, 0x7a, 0x26}
	SBTInterfaceID     = [4]byte{180, 90, 60, 14}
)
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 ChainClientWithEndPoint added in v1.4.0

func ChainClientWithEndPoint(endpoint string, withInsecure bool) (iotexapi.APIServiceClient, error)

func CheckInterfaceID added in v1.8.20

func CheckInterfaceID(addr string, interfaceID [4]byte) (bool, error)

func FairbankEffectiveHeight added in v1.4.0

func FairbankEffectiveHeight() uint64

FairbankEffectiveHeight returns the effective height of fairbank = 5166361

func GetBlockByHeightFromBlockDAO

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

func GetBlockByHeightFromChain

func GetBlockByHeightFromChain(ctx context.Context, 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 GetPluginConfigCtx added in v1.8.52

func GetPluginConfigCtx(ctx context.Context) ([]byte, bool)

GetPluginConfigCtx gets plugin config

func GetSubEpochNum

func GetSubEpochNum(height uint64) uint64

GetSubEpochNum returns the sub epoch number of a block height

func IsErc721 added in v1.8.20

func IsErc721(addr string) (bool, error)

func IsErc1155 added in v1.8.20

func IsErc1155(addr string) (bool, error)

func IsSBT added in v1.8.20

func IsSBT(addr string) (bool, error)

func NewVirtualDao

func NewVirtualDao() blockdao.BlockDAO

func NumSubEpochs

func NumSubEpochs(height uint64) uint64

NumSubEpochs returns the number of subEpochs given a block height

func UnpackLog added in v1.4.0

func UnpackLog(a abi.ABI, out interface{}, event string, log *action.Log) error

UnpackLog parses the log data and returns the corresponding event name and arguments

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.

func WithPluginConfigCtx added in v1.8.52

func WithPluginConfigCtx(ctx context.Context, config []byte) context.Context

WithPluginConfigCtx add plugin config 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