network

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "networks"

Variables

NetworkToWorkersMap is a map of Network-has-Workers.

View Source
var WorkerToConfigMap = map[network.Source]map[worker.Worker]workerConfig{
	network.EthereumSource: {
		worker.Aave:       defaultWorkerConfig(worker.Aave, network.EthereumSource, nil),
		worker.Aavegotchi: defaultWorkerConfig(worker.Aavegotchi, network.EthereumSource, nil),
		worker.Core:       defaultWorkerConfig(worker.Core, network.EthereumSource, nil),
		worker.Crossbell:  customWorkerConfigWithIPFS(worker.Crossbell, network.EthereumSource, ""),
		worker.Curve:      defaultWorkerConfig(worker.Curve, network.EthereumSource, nil),
		worker.ENS:        defaultWorkerConfig(worker.ENS, network.EthereumSource, nil),
		worker.Highlight:  defaultWorkerConfig(worker.Highlight, network.EthereumSource, nil),
		worker.IQWiki:     customWorkerConfigWithIPFS(worker.IQWiki, network.EthereumSource, ""),
		worker.KiwiStand:  defaultWorkerConfig(worker.KiwiStand, network.EthereumSource, nil),
		worker.Lens:       customWorkerConfigWithIPFS(worker.Lens, network.EthereumSource, ""),
		worker.Lido:       defaultWorkerConfig(worker.Lido, network.EthereumSource, nil),
		worker.Looksrare:  defaultWorkerConfig(worker.Looksrare, network.EthereumSource, nil),
		worker.Matters:    customWorkerConfigWithIPFS(worker.Matters, network.EthereumSource, ""),
		worker.OpenSea:    defaultWorkerConfig(worker.OpenSea, network.EthereumSource, nil),
		worker.Optimism:   defaultWorkerConfig(worker.Optimism, network.EthereumSource, nil),
		worker.RSS3:       defaultWorkerConfig(worker.RSS3, network.EthereumSource, nil),
		worker.SAVM:       defaultWorkerConfig(worker.SAVM, network.EthereumSource, nil),
		worker.Stargate:   defaultWorkerConfig(worker.Stargate, network.EthereumSource, nil),
		worker.Uniswap:    defaultWorkerConfig(worker.Uniswap, network.EthereumSource, nil),
		worker.VSL:        defaultWorkerConfig(worker.VSL, network.EthereumSource, nil),
	},
	network.ArweaveSource: {
		worker.Mirror:    customWorkerConfigWithoutEndpoint(worker.Mirror, network.ArweaveSource, nil, true),
		worker.Momoka:    customWorkerConfigWithIPFS(worker.Momoka, network.ArweaveSource, "A Polygon RPC is required for Momoka"),
		worker.Paragraph: customWorkerConfigWithoutEndpoint(worker.Paragraph, network.ArweaveSource, nil, false),
	},
	network.FarcasterSource: {
		worker.Core: customWorkerConfig(worker.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"),
	},
}

WorkerToConfigMap is a map of worker to config.

Functions

func NewComponent

func NewComponent(_ context.Context, apiServer *echo.Echo, config *config.File) component.Component

Types

type Component

type Component struct {
	// contains filtered or unexported fields
}

func (*Component) CollectMetric

func (c *Component) CollectMetric(ctx context.Context, value string)

func (*Component) GetEndpointConfig added in v0.4.42

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

GetEndpointConfig returns possible configurations for an endpoint

func (*Component) GetNetworksHandler

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

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

func (*Component) GetWorkerConfig

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

GetWorkerConfig returns the recommended configuration for the specified worker.

func (*Component) GetWorkersByNetwork

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

GetWorkersByNetwork returns list of all workers for the specified network.

func (*Component) InitMeter

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

func (*Component) Name

func (c *Component) Name() string

type ConfigDetail

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.4.33

type ConfigDetailValueType string
const (
	BigIntType      ConfigDetailValueType = "big.Int"
	StringArrayType ConfigDetailValueType = "[]string"
	StringType      ConfigDetailValueType = "string"
	UintType        ConfigDetailValueType = "uint"
	BooleanType     ConfigDetailValueType = "bool"
	StringMapType   ConfigDetailValueType = "map[string]string"
)

type Endpoint

type Endpoint struct {
	URL           *ConfigDetail `json:"url"`
	HTTPHeaders   *ConfigDetail `json:"http_headers"`
	HTTP2Disabled *ConfigDetail `json:"http2_disabled"`
}

type EndpointConfigResponse added in v0.4.42

type EndpointConfigResponse struct {
	Data Endpoint `json:"data"`
}

type ListWorkerResponse

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

type MinimumResource added in v0.4.39

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.4.39

func (r MinimumResource) Mul(multiplier float32) MinimumResource

Mul multiplies the resource by a given multiplier

type Parameters

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"`
}

type Request

type Request struct {
	Network string `param:"network" validate:"required"`
}

type Response

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

type WorkerConfigResponse

type WorkerConfigResponse struct {
	Data workerConfig `json:"data"`
}

type WorkerRequest

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

Jump to

Keyboard shortcuts

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