Documentation
¶
Index ¶
- Variables
- func ErrExceedLogFilterAddrLimit(size int) error
- func ErrExceedLogFilterBlockHashLimit(size int) error
- func ErrExceedLogFilterTopicDimension(size int) error
- func ErrExceedLogFilterTopicLimit(size int) error
- func GetCfxClientFromContext(ctx context.Context) sdk.ClientOperator
- func GetCfxClientProviderFromContext(ctx context.Context) *node.CfxClientProvider
- func GetClientGroupFromContext(ctx context.Context) node.Group
- func GetEthClientFromContext(ctx context.Context) *node.Web3goClient
- func GetEthClientProviderFromContext(ctx context.Context) *node.EthClientProvider
- func MustInit()
- func MustNewDebugServer() *rpc.Server
- func MustNewEvmSpaceServer(registry *rate.Registry, clientProvider *infuraNode.EthClientProvider, ...) *rpc.Server
- func MustNewNativeSpaceBridgeServer(registry *rate.Registry, config *CfxBridgeServerConfig) *rpc.Server
- func MustNewNativeSpaceServer(registry *rate.Registry, clientProvider *infuraNode.CfxClientProvider, ...) *rpc.Server
- func NormalizeEthLogFilter(resolver util.EthBlockNumberResolver, flag LogFilterType, ...) error
- func NormalizeLogFilter(cfx sdk.ClientOperator, flag LogFilterType, filter *types.LogFilter) error
- func ValidateEthLogFilter(flag LogFilterType, filter *web3Types.FilterQuery) error
- func ValidateLogFilter(flag LogFilterType, filter *types.LogFilter) error
- type API
- type CfxAPIOption
- type CfxBridgeServerConfig
- type EthAPIOption
- type LogFilterType
- type RateLimitStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLogFilter = errors.Errorf( "Filter must provide one of the following: %v, %v, %v", "(1) an epoch range through `fromEpoch` and `toEpoch`", "(2) a block number range through `fromBlock` and `toBlock`", "(3) a set of block hashes through `blockHashes`", ) ErrInvalidLogFilterBlockRange = errors.New( "invalid block range (from block larger than to block)", ) ErrInvalidLogFilterEpochRange = errors.New( "invalid epoch range (from epoch larger than to epoch)", ) ErrInvalidEthLogFilter = errors.Errorf( "Filter must provide one of the following: %v, %v", "(1) a block number range through `fromBlock` and `toBlock`", "(2) a set of block hashes through `blockHash`", ) )
View Source
var (
ErrRateLimitRegistryNotConfigured = errors.New("rate limit registry is not configured")
)
Functions ¶
func GetCfxClientFromContext ¶
func GetCfxClientFromContext(ctx context.Context) sdk.ClientOperator
func GetCfxClientProviderFromContext ¶
func GetCfxClientProviderFromContext(ctx context.Context) *node.CfxClientProvider
func GetEthClientFromContext ¶
func GetEthClientFromContext(ctx context.Context) *node.Web3goClient
func GetEthClientProviderFromContext ¶
func GetEthClientProviderFromContext(ctx context.Context) *node.EthClientProvider
func MustNewDebugServer ¶
MustNewDebugServer new debug RPC server for internal debugging use.
func MustNewEvmSpaceServer ¶
func MustNewEvmSpaceServer( registry *rate.Registry, clientProvider *infuraNode.EthClientProvider, gasHandler *handler.EthGasStationHandler, exposedModules []string, option ...EthAPIOption, ) *rpc.Server
MustNewEvmSpaceServer new evm space RPC server by specifying router, and exposed modules. `exposedModules` is a list of API modules to expose via the RPC interface. If the module list is empty, all RPC API endpoints designated public will be exposed.
func MustNewNativeSpaceBridgeServer ¶
func MustNewNativeSpaceBridgeServer(registry *rate.Registry, config *CfxBridgeServerConfig) *rpc.Server
func MustNewNativeSpaceServer ¶
func MustNewNativeSpaceServer( registry *rate.Registry, clientProvider *infuraNode.CfxClientProvider, gashandler *handler.CfxGasStationHandler, exposedModules []string, option ...CfxAPIOption, ) *rpc.Server
MustNewNativeSpaceServer new core space RPC server by specifying router, handler and exposed modules. Argument exposedModules is a list of API modules to expose via the RPC interface. If the module list is empty, all RPC API endpoints designated public will be exposed.
func NormalizeEthLogFilter ¶
func NormalizeEthLogFilter( resolver util.EthBlockNumberResolver, flag LogFilterType, filter *web3Types.FilterQuery, hardforkBlockNum web3Types.BlockNumber, ) error
func NormalizeLogFilter ¶
func NormalizeLogFilter(cfx sdk.ClientOperator, flag LogFilterType, filter *types.LogFilter) error
func ValidateEthLogFilter ¶
func ValidateEthLogFilter(flag LogFilterType, filter *web3Types.FilterQuery) error
func ValidateLogFilter ¶
func ValidateLogFilter(flag LogFilterType, filter *types.LogFilter) error
Types ¶
type API ¶
type API struct {
Namespace string // namespace under which the rpc methods of Service are exposed
Version string // api version
Service interface{} // receiver instance which holds the methods
Public bool // indication if the methods must be considered safe for public use
}
API describes the set of methods offered over the RPC interface
type CfxAPIOption ¶
type CfxAPIOption struct {
StoreHandler *handler.CfxStoreHandler
LogApiHandler *handler.CfxLogsApiHandler
TxnHandler *handler.CfxTxnHandler
VirtualFilterClient *vfclient.CfxClient
}
type CfxBridgeServerConfig ¶
type EthAPIOption ¶
type EthAPIOption struct {
StoreHandler *handler.EthStoreHandler
LogApiHandler *handler.EthLogsApiHandler
TxnHandler *handler.EthTxnHandler
VirtualFilterClient *vfclient.EthClient
}
type LogFilterType ¶
type LogFilterType int
const ( // Log filter types LogFilterTypeBlockHash LogFilterType = 1 << iota // 0001 LogFilterTypeEpochRange // 0010 LogFilterTypeBlockRange // 0100 )
func ParseEthLogFilterType ¶
func ParseEthLogFilterType(filter *web3Types.FilterQuery) (LogFilterType, bool)
func ParseLogFilterType ¶
func ParseLogFilterType(filter *types.LogFilter) (LogFilterType, bool)
type RateLimitStatus ¶
type RateLimitStatus struct {
Strategy *rate.Strategy `json:"strategy"`
LimitType string `json:"limitType"`
Info rate.UserMetaData `json:"info"`
}
Source Files
¶
- apis.go
- cfx_api.go
- cfx_api_debug.go
- cfx_api_filter.go
- cfx_api_pubsub.go
- cfx_debug_api.go
- cfx_gastation_api.go
- debug_api.go
- diagnostic_api.go
- error.go
- eth_api.go
- eth_api_filter.go
- eth_api_pubsub.go
- eth_debug_api.go
- eth_gastation_api.go
- eth_pubsub.go
- eth_trace_api.go
- eth_txpool_api.go
- log_filter.go
- net_api.go
- parity_api.go
- pos_api.go
- pubsub.go
- server.go
- server_middleware.go
- trace_api.go
- txpool_api.go
- web3_api.go
Click to show internal directories.
Click to hide internal directories.