Documentation
¶
Index ¶
- Variables
- func ChainClient() iotexapi.APIServiceClient
- func ChainClientWithEndPoint(endpoint string, withInsecure bool) (iotexapi.APIServiceClient, error)
- func CheckInterfaceID(addr string, interfaceID [4]byte) (bool, error)
- func FairbankEffectiveHeight() uint64
- func GetBlockByHeightFromBlockDAO(blkHeight uint64, dao blockdao.BlockDAO) (blk *block.Block, err error)
- func GetBlockByHeightFromChain(ctx context.Context, height uint64) (*block.Block, error)
- func GetBlockDAOCtx(ctx context.Context) (blockdao.BlockDAO, bool)
- func GetConfigCtx(ctx context.Context) (string, bool)
- func GetEpochHeight(epochNum uint64) uint64
- func GetEpochLastBlockHeight(epochNum uint64) uint64
- func GetEpochNum(height uint64) uint64
- func GetPluginConfigCtx(ctx context.Context) ([]byte, bool)
- func GetSubEpochNum(height uint64) uint64
- func IsErc721(addr string) (bool, error)
- func IsErc1155(addr string) (bool, error)
- func IsSBT(addr string) (bool, error)
- func NewVirtualDao() blockdao.BlockDAO
- func NumSubEpochs(height uint64) uint64
- func UnpackLog(a abi.ABI, out interface{}, event string, log *action.Log) error
- func WithBlockDAOCtx(ctx context.Context, dao blockdao.BlockDAO) context.Context
- func WithConfigCtx(ctx context.Context, config string) context.Context
- func WithPluginConfigCtx(ctx context.Context, config []byte) context.Context
- type AtomicBool
Constants ¶
This section is empty.
Variables ¶
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} )
var DefaultHTTPClient = &http.Client{ Transport: &http.Transport{ Dial: (&net.Dialer{ Timeout: 5 * time.Second, }).Dial, TLSHandshakeTimeout: 5 * time.Second, }, Timeout: time.Second * 10, }
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 FairbankEffectiveHeight ¶ added in v1.4.0
func FairbankEffectiveHeight() uint64
FairbankEffectiveHeight returns the effective height of fairbank = 5166361
func GetBlockDAOCtx ¶
GetBlockDAOCtx gets blockDAOCtx
func GetConfigCtx ¶
GetConfigCtx gets configCtx
func GetEpochHeight ¶
GetEpochHeight returns the start height of an epoch
func GetEpochLastBlockHeight ¶
GetEpochLastBlockHeight returns the last height of an epoch
func GetEpochNum ¶
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
GetPluginConfigCtx gets plugin config
func GetSubEpochNum ¶
GetSubEpochNum returns the sub epoch number of a block height
func NewVirtualDao ¶
func NumSubEpochs ¶
NumSubEpochs returns the number of subEpochs given a block height
func UnpackLog ¶ added in v1.4.0
UnpackLog parses the log data and returns the corresponding event name and arguments
func WithBlockDAOCtx ¶
WithBlockDAOCtx add blockDAOCtx into context.
func WithConfigCtx ¶
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)