server

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2026 License: MIT Imports: 38 Imported by: 0

Documentation

Overview

Package server implements the base server that manages all the other services. Conceptually it's the server that represents the entire xmtpd node.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseServer added in v1.0.0

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

func NewBaseServer added in v1.0.0

func NewBaseServer(
	opts ...BaseServerOption,
) (*BaseServer, error)

NewBaseServer creates a new base server. The Base server is the root service that manages the other services: - API server: Replication and metadata APIs. - Sync service: internal sync and communication between nodes. - Indexer service: indexes the blockchain and provides the data to the APIs. - Migration service: migrates an old V3 database to the D14N network. - Payer report service: generates and sends payer reports to the nodes.

func (*BaseServer) Addr added in v1.0.0

func (s *BaseServer) Addr() string

func (*BaseServer) Shutdown added in v1.0.0

func (s *BaseServer) Shutdown(timeout time.Duration)

func (*BaseServer) WaitForShutdown added in v1.0.0

func (s *BaseServer) WaitForShutdown(timeout time.Duration)

type BaseServerConfig added in v1.0.0

type BaseServerConfig struct {
	Ctx           context.Context
	DB            *db.Handler
	Logger        *zap.Logger
	NodeRegistry  registry.NodeRegistry
	Options       *config.ServerOptions
	ServerVersion *semver.Version
	FeeCalculator fees.IFeeCalculator
	PromReg       *prometheus.Registry
}

func (BaseServerConfig) Valid added in v1.1.0

func (cfg BaseServerConfig) Valid() error

type BaseServerOption added in v1.0.0

type BaseServerOption func(*BaseServerConfig)

func WithContext added in v0.4.0

func WithContext(ctx context.Context) BaseServerOption

func WithDB added in v0.4.0

func WithDB(db *db.Handler) BaseServerOption

func WithFeeCalculator added in v1.0.0

func WithFeeCalculator(feeCalculator fees.IFeeCalculator) BaseServerOption

func WithLogger added in v0.4.0

func WithLogger(logger *zap.Logger) BaseServerOption

func WithNodeRegistry added in v0.4.0

func WithNodeRegistry(reg registry.NodeRegistry) BaseServerOption

func WithPromReg added in v1.0.0

func WithPromReg(promReg *prometheus.Registry) BaseServerOption

func WithServerOptions added in v0.4.0

func WithServerOptions(opts *config.ServerOptions) BaseServerOption

func WithServerVersion added in v0.4.0

func WithServerVersion(version *semver.Version) BaseServerOption

Jump to

Keyboard shortcuts

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