p2p

package
v1.4.13 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2025 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type Type `yaml:"type"`

	// Ethereum configuration.
	Ethereum *ethereum.Config `yaml:"ethereum"`

	Config *RawMessage `yaml:"config"`
}

func (*Config) GetNetworkIDs added in v1.3.0

func (c *Config) GetNetworkIDs() []uint64

GetNetworkIDs extracts network IDs from the p2p config based on its type.

func (*Config) Validate

func (c *Config) Validate() error

type ConsensusCrawler added in v1.3.0

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

func NewConsensusCrawler added in v1.3.0

func NewConsensusCrawler(ctx context.Context, log logrus.FieldLogger, cfg *crawler.Config) (*ConsensusCrawler, error)

func (*ConsensusCrawler) AddNodeRecord added in v1.3.0

func (c *ConsensusCrawler) AddNodeRecord(nodeRecord string, handler func(*xatu.ConsensusNodeStatus)) error

func (*ConsensusCrawler) Stop added in v1.3.0

func (c *ConsensusCrawler) Stop(ctx context.Context) error

type ConsensusPeer added in v1.3.0

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

func NewConsensusPeer added in v1.3.0

func NewConsensusPeer(
	_ context.Context,
	log logrus.FieldLogger,
	nodeRecord string,
	handler func(*xatu.ConsensusNodeStatus),
	crawler *ConsensusCrawler,
) (*ConsensusPeer, error)

func (*ConsensusPeer) Start added in v1.3.0

func (p *ConsensusPeer) Start(_ context.Context) <-chan error

func (*ConsensusPeer) Stop added in v1.3.0

func (p *ConsensusPeer) Stop(_ context.Context) error

func (*ConsensusPeer) Type added in v1.3.0

func (p *ConsensusPeer) Type() string

type ExecutionPeer added in v1.3.0

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

func NewExecutionPeer added in v1.3.0

func NewExecutionPeer(ctx context.Context, log logrus.FieldLogger, nodeRecord string, handlerFunc func(ctx context.Context, status *xatu.ExecutionNodeStatus)) (*ExecutionPeer, error)

func (*ExecutionPeer) Start added in v1.3.0

func (p *ExecutionPeer) Start(ctx context.Context) (<-chan error, error)

func (*ExecutionPeer) Stop added in v1.3.0

func (p *ExecutionPeer) Stop(ctx context.Context) error

type Metrics

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

func NewMetrics

func NewMetrics(namespace string) *Metrics

func (*Metrics) AddDialedNodeRecod

func (m *Metrics) AddDialedNodeRecod(count int, result, layer string)

func (*Metrics) SetActiveDialingNodeRecods

func (m *Metrics) SetActiveDialingNodeRecods(count int, layer string)

type P2P

type P2P interface {
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
	Type() string
	GetNetworkIds() []uint64
	GetForkIdHashes() []string
	GetForkDigests() []string
}

func NewP2P

func NewP2P(p2pType Type, config *RawMessage, handler func(ctx context.Context, node *enode.Node, source string) error, log logrus.FieldLogger) (P2P, error)

type RawMessage

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

func (*RawMessage) Unmarshal

func (r *RawMessage) Unmarshal(v interface{}) error

func (*RawMessage) UnmarshalYAML

func (r *RawMessage) UnmarshalYAML(unmarshal func(interface{}) error) error

type Status

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

func NewStatus

func NewStatus(ctx context.Context, config *Config, log logrus.FieldLogger) (*Status, error)

func (*Status) ActiveConsensus added in v1.3.0

func (s *Status) ActiveConsensus() int

func (*Status) ActiveExecution

func (s *Status) ActiveExecution() int

func (*Status) AddConsensusNodeRecords added in v1.3.0

func (s *Status) AddConsensusNodeRecords(_ context.Context, nodeRecords []string)

func (*Status) AddExecutionNodeRecords

func (s *Status) AddExecutionNodeRecords(ctx context.Context, nodeRecords []string)

func (*Status) OnConsensusStatus added in v1.3.0

func (s *Status) OnConsensusStatus(ctx context.Context, handler func(ctx context.Context, status *xatu.ConsensusNodeStatus) error)

func (*Status) OnExecutionStatus

func (s *Status) OnExecutionStatus(ctx context.Context, handler func(ctx context.Context, status *xatu.ExecutionNodeStatus) error, networkIds []uint64, forkIdHashes []string)

func (*Status) Start

func (s *Status) Start(ctx context.Context) error

func (*Status) Stop

func (s *Status) Stop(ctx context.Context) error

type Type

type Type string
const (
	TypeUnknown Type = "unknown"
	TypeStatic  Type = static.Type
	TypeXatu    Type = xatu.Type
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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