Documentation ¶
Index ¶
- Constants
- Variables
- func GetFirstStartTime(ctx context.Context, redisClient rueidis.Client) (int64, error)
- func NewComponent(_ context.Context, apiServer *echo.Echo, config *config.File, ...) component.Component
- func UpdateFirstStartTime(ctx context.Context, redisClient rueidis.Client, timestamp int64) error
- type Authentication
- type Component
- func (c *Component) CollectMetric(ctx context.Context, path, value string)
- func (c *Component) CollectTrace(ctx context.Context, path, value string)
- func (c *Component) GetActivityCount(ctx echo.Context) error
- func (c *Component) GetEndpointConfig(ctx echo.Context) error
- func (c *Component) GetNetworksHandler(ctx echo.Context) error
- func (c *Component) GetNodeInfo(ctx echo.Context) error
- func (c *Component) GetNodeOperator(ctx echo.Context) error
- func (c *Component) GetVersion(ctx echo.Context) error
- func (c *Component) GetWorkerConfig(ctx echo.Context) error
- func (c *Component) GetWorkersByNetwork(ctx echo.Context) error
- func (c *Component) GetWorkersStatus(ctx echo.Context) error
- func (c *Component) InitMeter() (err error)
- func (c *Component) Name() string
- type ComponentInfo
- type ConfigDetail
- type ConfigDetailValueType
- type Endpoint
- type EndpointConfigResponse
- type GINodeInfoResponse
- type GIRewardsResponse
- type ListWorkerResponse
- type MinimumResource
- type NodeInfo
- type NodeInfoResponse
- type Parameters
- type Record
- type Request
- type Response
- type Reward
- type StatisticResponse
- type Version
- type VersionResponse
- type WorkerConfigResponse
- type WorkerInfo
- type WorkerRequest
- type WorkerResponse
Constants ¶
const Name = "info"
Variables ¶
var NetworkToWorkersMap = map[network.Network][]worker.Worker{ network.Ethereum: { decentralized.Aave, decentralized.Core, decentralized.Curve, decentralized.ENS, decentralized.Highlight, decentralized.Lido, decentralized.Looksrare, decentralized.Oneinch, decentralized.OpenSea, decentralized.Optimism, decentralized.RSS3, decentralized.Stargate, decentralized.Uniswap, }, network.Arweave: { decentralized.Mirror, decentralized.Momoka, decentralized.Paragraph, }, network.Farcaster: { decentralized.Core, }, network.Polygon: { decentralized.Aave, decentralized.Aavegotchi, decentralized.Core, decentralized.Curve, decentralized.Highlight, decentralized.IQWiki, decentralized.Lens, decentralized.Stargate, }, network.Crossbell: { decentralized.Crossbell, }, network.Avalanche: { decentralized.Aave, decentralized.Curve, decentralized.Stargate, }, network.Base: { decentralized.Aave, decentralized.Core, decentralized.Stargate, }, network.Optimism: { decentralized.Aave, decentralized.Core, decentralized.Curve, decentralized.Highlight, decentralized.KiwiStand, decentralized.Matters, decentralized.Stargate, }, network.Arbitrum: { decentralized.Aave, decentralized.Core, decentralized.Curve, decentralized.Highlight, decentralized.Stargate, }, network.VSL: { decentralized.Core, decentralized.RSS3, decentralized.VSL, }, network.SatoshiVM: { decentralized.Core, decentralized.SAVM, decentralized.Uniswap, }, network.BinanceSmartChain: { decentralized.Core, decentralized.Stargate, }, network.Gnosis: { decentralized.Core, decentralized.Curve, }, network.Linea: { decentralized.Core, decentralized.Stargate, decentralized.Uniswap, }, network.RSS: { rss.RSSHub, }, }
NetworkToWorkersMap is a map of Network-has-Workers.
var WorkerToConfigMap = map[network.Source]map[worker.Worker]workerConfig{ network.EthereumSource: { decentralized.Aave: defaultWorkerConfig(decentralized.Aave, network.EthereumSource, nil), decentralized.Aavegotchi: defaultWorkerConfig(decentralized.Aavegotchi, network.EthereumSource, nil), decentralized.Core: defaultWorkerConfig(decentralized.Core, network.EthereumSource, nil), decentralized.Crossbell: customWorkerConfigWithIPFS(decentralized.Crossbell, network.EthereumSource, ""), decentralized.Curve: defaultWorkerConfig(decentralized.Curve, network.EthereumSource, nil), decentralized.ENS: defaultWorkerConfig(decentralized.ENS, network.EthereumSource, nil), decentralized.Highlight: defaultWorkerConfig(decentralized.Highlight, network.EthereumSource, nil), decentralized.IQWiki: customWorkerConfigWithIPFS(decentralized.IQWiki, network.EthereumSource, ""), decentralized.KiwiStand: defaultWorkerConfig(decentralized.KiwiStand, network.EthereumSource, nil), decentralized.Lens: customWorkerConfigWithIPFS(decentralized.Lens, network.EthereumSource, ""), decentralized.Lido: defaultWorkerConfig(decentralized.Lido, network.EthereumSource, nil), decentralized.Looksrare: defaultWorkerConfig(decentralized.Looksrare, network.EthereumSource, nil), decentralized.Matters: customWorkerConfigWithIPFS(decentralized.Matters, network.EthereumSource, ""), decentralized.OpenSea: defaultWorkerConfig(decentralized.OpenSea, network.EthereumSource, nil), decentralized.Optimism: defaultWorkerConfig(decentralized.Optimism, network.EthereumSource, nil), decentralized.RSS3: defaultWorkerConfig(decentralized.RSS3, network.EthereumSource, nil), decentralized.SAVM: defaultWorkerConfig(decentralized.SAVM, network.EthereumSource, nil), decentralized.Stargate: defaultWorkerConfig(decentralized.Stargate, network.EthereumSource, nil), decentralized.Uniswap: defaultWorkerConfig(decentralized.Uniswap, network.EthereumSource, nil), decentralized.VSL: defaultWorkerConfig(decentralized.VSL, network.EthereumSource, nil), }, network.ArweaveSource: { decentralized.Mirror: customWorkerConfigWithoutEndpoint(decentralized.Mirror, network.ArweaveSource, nil, true), decentralized.Momoka: customWorkerConfigWithIPFS(decentralized.Momoka, network.ArweaveSource, "A Polygon RPC is required for Momoka"), decentralized.Paragraph: customWorkerConfigWithoutEndpoint(decentralized.Paragraph, network.ArweaveSource, nil, false), }, network.FarcasterSource: { decentralized.Core: customWorkerConfig(decentralized.Core, network.FarcasterSource, &Parameters{ APIKey: &ConfigDetail{ IsRequired: false, Type: StringType, Description: "API key to access your Farcaster Hubble on Neynar", }, }, "A Farcaster Hubble is required"), }, network.RSSSource: { rss.RSSHub: customWorkerConfig(rss.RSSHub, network.RSSSource, &Parameters{ Authentication: &Authentication{ AccessKey: &ConfigDetail{ IsRequired: false, Type: StringType, Description: "A key to access the RSS Feed", }, }, }, ""), }, }
WorkerToConfigMap is a map of worker to config.
Functions ¶
func GetFirstStartTime ¶ added in v0.5.26
GetFirstStartTime Get the first start time from redis cache
func NewComponent ¶
Types ¶
type Authentication ¶ added in v0.5.16
type Authentication struct {
AccessKey *ConfigDetail `json:"access_key"`
}
type Component ¶
type Component struct {
// contains filtered or unexported fields
}
func (*Component) CollectMetric ¶
func (*Component) CollectTrace ¶ added in v0.5.19
func (*Component) GetActivityCount ¶ added in v0.5.1
GetActivityCount returns the total number of activities indexed by this Node.
func (*Component) GetEndpointConfig ¶ added in v0.5.16
GetEndpointConfig returns possible configurations for an endpoint
func (*Component) GetNetworksHandler ¶ added in v0.5.16
GetNetworksHandler returns the list of all networks that the node can support.
func (*Component) GetNodeInfo ¶
GetNodeInfo returns the node information.
func (*Component) GetNodeOperator ¶ added in v0.5.1
GetNodeOperator returns the node information.
func (*Component) GetVersion ¶ added in v0.5.8
GetVersion returns the version of the network component.
func (*Component) GetWorkerConfig ¶ added in v0.5.16
GetWorkerConfig returns the recommended configuration for the specified worker.
func (*Component) GetWorkersByNetwork ¶ added in v0.5.16
GetWorkersByNetwork returns list of all workers for the specified network.
func (*Component) GetWorkersStatus ¶ added in v0.5.1
GetWorkersStatus returns the status of all workers.
type ComponentInfo ¶ added in v0.5.16
type ComponentInfo struct { Decentralized []*WorkerInfo `json:"decentralized"` RSS []*WorkerInfo `json:"rss"` Federated []*WorkerInfo `json:"federated"` }
type ConfigDetail ¶ added in v0.5.16
type ConfigDetail struct { IsRequired bool `json:"is_required"` Type ConfigDetailValueType `json:"type"` Value interface{} `json:"value"` Description string `json:"description"` }
type ConfigDetailValueType ¶ added in v0.5.16
type ConfigDetailValueType string
const ( BooleanType ConfigDetailValueType = "bool" StringType ConfigDetailValueType = "string" StringMapType ConfigDetailValueType = "map[string]string" UintType ConfigDetailValueType = "uint" URLType ConfigDetailValueType = "url" URLArrayType ConfigDetailValueType = "[]url" )
type Endpoint ¶ added in v0.5.16
type Endpoint struct { URL *ConfigDetail `json:"url"` HTTPHeaders *ConfigDetail `json:"http_headers"` HTTP2Disabled *ConfigDetail `json:"http2_disabled"` }
type EndpointConfigResponse ¶ added in v0.5.16
type EndpointConfigResponse struct {
Data Endpoint `json:"data"`
}
type GINodeInfoResponse ¶ added in v0.5.26
type GIRewardsResponse ¶ added in v0.5.26
type GIRewardsResponse struct { Data []struct { ID uint64 `json:"id"` Distributions []struct { ID uint64 `json:"id"` RewardedNodes []struct { EpochID uint64 `json:"epoch_id"` OperationRewards decimal.Decimal `json:"operation_rewards"` StakingRewards decimal.Decimal `json:"staking_rewards"` RequestCount decimal.Decimal `json:"request_count"` } `json:"rewarded_nodes"` } `json:"distributions"` } `json:"data"` }
type ListWorkerResponse ¶ added in v0.5.16
type MinimumResource ¶ added in v0.5.16
type MinimumResource struct { CPUCore float32 `json:"cpu_core"` MemoryInGb float32 `json:"memory_in_gb"` DiskSpaceInGb uint `json:"disk_space_in_gb"` }
func (MinimumResource) Mul ¶ added in v0.5.16
func (r MinimumResource) Mul(multiplier float32) MinimumResource
Mul multiplies the resource by a given multiplier
type NodeInfoResponse ¶ added in v0.5.26
type NodeInfoResponse struct {
Data NodeInfo `json:"data"`
}
type Parameters ¶ added in v0.5.16
type Parameters struct { BlockStart *ConfigDetail `json:"block_start,omitempty"` BlockTarget *ConfigDetail `json:"block_target,omitempty"` ConcurrentBlockRequests *ConfigDetail `json:"concurrent_block_requests,omitempty"` BlockBatchSize *ConfigDetail `json:"block_batch_size,omitempty"` ReceiptsBatchSize *ConfigDetail `json:"receipts_batch_size,omitempty"` BlockReceiptBatchSize *ConfigDetail `json:"block_receipts_batch_size,omitempty"` APIKey *ConfigDetail `json:"api_key,omitempty"` Authentication *Authentication `json:"authentication,omitempty"` }
type Request ¶ added in v0.5.16
type Request struct {
Network string `param:"network" validate:"required"`
}
type StatisticResponse ¶ added in v0.5.1
type VersionResponse ¶ added in v0.5.8
type VersionResponse struct {
Data Version `json:"data"`
}
type WorkerConfigResponse ¶ added in v0.5.16
type WorkerConfigResponse struct {
Data workerConfig `json:"data"`
}
type WorkerInfo ¶ added in v0.5.1
type WorkerRequest ¶ added in v0.5.16
type WorkerResponse ¶ added in v0.5.1
type WorkerResponse struct {
Data ComponentInfo `json:"data"`
}