core

package
v0.21.3-mocha Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = "9090"
)

Variables

View Source
var MetricsEnabled bool

Functions

func ConstructModule

func ConstructModule(tp node.Type, cfg *Config, options ...fx.Option) fx.Option

ConstructModule collects all the components and services related to managing the relationship with the Core node.

func Flags

func Flags() *flag.FlagSet

Flags gives a set of hardcoded Core flags.

func ParseFlags

func ParseFlags(
	cmd *cobra.Command,
	cfg *Config,
) error

ParseFlags parses Core flags from the given cmd and saves them to the passed config.

func WithConnection

func WithConnection(conn *grpc.ClientConn) fx.Option

WithConnection sets a custom client for core process

func WithHeaderConstructFn

func WithHeaderConstructFn(construct header.ConstructFn) fx.Option

WithHeaderConstructFn sets custom func that creates extended header

Types

type Config

type Config struct {
	IP   string
	Port string
	// TLSEnabled specifies whether the connection is secure or not.
	// PLEASE NOTE: it should be set to true in order to handle XTokenPath.
	TLSEnabled bool
	// XTokenPath specifies the path to the directory with JSON file containing the X-Token for gRPC authentication.
	// The JSON file should have a key-value pair where the key is "x-token" and the value is the authentication token.
	// If left empty, the client will not include the X-Token in its requests.
	XTokenPath string
}

Config combines all configuration fields for managing the relationship with a Core node.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default configuration for managing the node's connection to a Celestia-Core endpoint.

func (*Config) IsEndpointConfigured added in v0.11.0

func (cfg *Config) IsEndpointConfigured() bool

IsEndpointConfigured returns whether a core endpoint has been set on the config (true if set).

func (*Config) Validate

func (cfg *Config) Validate() error

Validate performs basic validation of the config.

Jump to

Keyboard shortcuts

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