info

package
v0.5.17 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "info"

Variables

View Source
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.

View Source
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 NewComponent

func NewComponent(_ context.Context, apiServer *echo.Echo, config *config.File, databaseClient database.Client, redisClient rueidis.Client) component.Component

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 (c *Component) CollectMetric(ctx context.Context, value string)

func (*Component) GetActivityCount added in v0.5.1

func (c *Component) GetActivityCount(ctx echo.Context) error

GetActivityCount returns the total number of activities indexed by this Node.

func (*Component) GetEndpointConfig added in v0.5.16

func (c *Component) GetEndpointConfig(ctx echo.Context) error

GetEndpointConfig returns possible configurations for an endpoint

func (*Component) GetNetworksHandler added in v0.5.16

func (c *Component) GetNetworksHandler(ctx echo.Context) error

GetNetworksHandler returns the list of all networks that the node can support.

func (*Component) GetNodeOperator added in v0.5.1

func (c *Component) GetNodeOperator(ctx echo.Context) error

GetNodeOperator returns the node information.

func (*Component) GetVersion added in v0.5.8

func (c *Component) GetVersion(ctx echo.Context) error

GetVersion returns the version of the network component.

func (*Component) GetWorkerConfig added in v0.5.16

func (c *Component) GetWorkerConfig(ctx echo.Context) error

GetWorkerConfig returns the recommended configuration for the specified worker.

func (*Component) GetWorkersByNetwork added in v0.5.16

func (c *Component) GetWorkersByNetwork(ctx echo.Context) error

GetWorkersByNetwork returns list of all workers for the specified network.

func (*Component) GetWorkersStatus added in v0.5.1

func (c *Component) GetWorkersStatus(ctx echo.Context) error

GetWorkersStatus returns the status of all workers.

func (*Component) InitMeter

func (c *Component) InitMeter() (err error)

func (*Component) Name

func (c *Component) Name() string

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 ListWorkerResponse added in v0.5.16

type ListWorkerResponse struct {
	Data []worker.Worker `json:"data"`
}

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 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 Response added in v0.5.16

type Response struct {
	Data []string `json:"data"`
}

type StatisticResponse added in v0.5.1

type StatisticResponse struct {
	Count      int64      `json:"count"`
	LastUpdate *time.Time `json:"last_update,omitempty"`
}

type Version added in v0.5.8

type Version struct {
	Tag    string `json:"tag"`
	Commit string `json:"commit"`
}

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 WorkerInfo struct {
	Network  network.Network        `json:"network"`
	Worker   worker.Worker          `json:"worker"`
	Tags     []tag.Tag              `json:"tags"`
	Platform decentralized.Platform `json:"platform"`
	Status   worker.Status          `json:"status"`
	monitor.WorkerProgress
}

type WorkerKey added in v0.5.1

type WorkerKey struct {
	Network network.Network
	Worker  worker.Worker
}

WorkerKey is the key for the worker status aggregator.

type WorkerRequest added in v0.5.16

type WorkerRequest struct {
	Network string `param:"network" validate:"required"`
	Worker  string `param:"worker" validate:"required"`
}

type WorkerResponse added in v0.5.1

type WorkerResponse struct {
	Data ComponentInfo `json:"data"`
}

type WorkerStatusAggregator added in v0.5.1

type WorkerStatusAggregator struct {
	Statuses []worker.Status
	Progress []monitor.WorkerProgress
}

WorkerStatusAggregator aggregates the statuses of workers with the same Network+Worker.

Jump to

Keyboard shortcuts

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