cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 56 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceName = "ledger"

	NumscriptInterpreterFlag        = "experimental-numscript-interpreter"
	NumscriptInterpreterFlagsToPass = "experimental-numscript-interpreter-flags"
	ExperimentalFeaturesFlag        = "experimental-features"
	ExperimentalExporters           = "experimental-exporters"
)
View Source
const (
	BindFlag                   = "bind"
	BallastSizeInBytesFlag     = "ballast-size"
	NumscriptCacheMaxCountFlag = "numscript-cache-max-count"
	AutoUpgradeFlag            = "auto-upgrade"
	BulkMaxSizeFlag            = "bulk-max-size"
	BulkParallelFlag           = "bulk-parallel"

	DefaultPageSizeFlag   = "default-page-size"
	MaxPageSizeFlag       = "max-page-size"
	WorkerEnabledFlag     = "worker"
	SemconvMetricsNames   = "semconv-metrics-names"
	SchemaEnforcementMode = "schema-enforcement-mode"
)
View Source
const (
	WorkerPipelinesPullIntervalFlag    = "worker-pipelines-pull-interval"
	WorkerPipelinesPushRetryPeriodFlag = "worker-pipelines-push-retry-period"
	WorkerPipelinesSyncPeriod          = "worker-pipelines-sync-period"
	WorkerPipelinesLogsPageSize        = "worker-pipelines-logs-page-size"

	WorkerAsyncBlockHasherMaxBlockSizeFlag = "worker-async-block-hasher-max-block-size"
	WorkerAsyncBlockHasherScheduleFlag     = "worker-async-block-hasher-schedule"

	WorkerBucketCleanupRetentionPeriodFlag = "worker-bucket-cleanup-retention-period"
	WorkerBucketCleanupScheduleFlag        = "worker-bucket-cleanup-schedule"

	WorkerGRPCAddressFlag = "worker-grpc-address"
)

Variables

View Source
var (
	Version   = "develop"
	BuildDate = "-"
	Commit    = "-"
)

Functions

func Execute

func Execute()

func LoadConfig

func LoadConfig[V any](cmd *cobra.Command) (*V, error)

func NewBucketUpgrade

func NewBucketUpgrade() *cobra.Command

func NewBucketsCommand

func NewBucketsCommand() *cobra.Command

func NewDocEventsCommand

func NewDocEventsCommand() *cobra.Command

func NewDocFlagsCommand

func NewDocFlagsCommand() *cobra.Command

func NewDocsCommand

func NewDocsCommand() *cobra.Command

func NewRootCommand

func NewRootCommand() *cobra.Command

func NewServeCommand

func NewServeCommand() *cobra.Command

func NewVersionCommand

func NewVersionCommand() *cobra.Command

func NewWorkerCommand

func NewWorkerCommand() *cobra.Command

NewWorkerCommand constructs the "worker" Cobra command which initializes and runs the worker service using loaded configuration and composed FX modules. The command registers worker-specific flags via addWorkerFlags and common service, bunconnect, and OTLP flags, and exposes the --worker-grpc-address flag (default ":8081"). When executed it loads configuration and starts the service with the configured modules and a gRPC server.

func PrintVersion

func PrintVersion(_ *cobra.Command, _ []string)

Types

type ServeCommandConfig

type ServeCommandConfig struct {
	WorkerConfiguration `mapstructure:",squash"`

	Bind                   string `mapstructure:"bind"`
	BallastSizeInBytes     uint   `mapstructure:"ballast-size"`
	NumscriptCacheMaxCount uint   `mapstructure:"numscript-cache-max-count"`
	AutoUpgrade            bool   `mapstructure:"auto-upgrade"`
	BulkMaxSize            int    `mapstructure:"bulk-max-size"`
	BulkParallel           int    `mapstructure:"bulk-parallel"`
	DefaultPageSize        uint64 `mapstructure:"default-page-size"`
	MaxPageSize            uint64 `mapstructure:"max-page-size"`
	WorkerEnabled          bool   `mapstructure:"worker"`
	WorkerAddress          string `mapstructure:"worker-grpc-address"`
	// contains filtered or unexported fields
}

type WorkerCommandConfiguration

type WorkerCommandConfiguration struct {
	WorkerConfiguration `mapstructure:",squash"`

	WorkerGRPCConfig `mapstructure:",squash"`
	// contains filtered or unexported fields
}

type WorkerConfiguration

type WorkerConfiguration struct {
	HashLogsBlockMaxSize  int           `mapstructure:"worker-async-block-hasher-max-block-size"`
	HashLogsBlockCRONSpec cron.Schedule `mapstructure:"worker-async-block-hasher-schedule"`

	PushRetryPeriod time.Duration `mapstructure:"worker-pipelines-push-retry-period"`
	PullInterval    time.Duration `mapstructure:"worker-pipelines-pull-interval"`
	SyncPeriod      time.Duration `mapstructure:"worker-pipelines-sync-period"`
	LogsPageSize    uint64        `mapstructure:"worker-pipelines-logs-page-size"`

	BucketCleanupRetentionPeriod time.Duration `mapstructure:"worker-bucket-cleanup-retention-period"`
	BucketCleanupCRONSpec        cron.Schedule `mapstructure:"worker-bucket-cleanup-schedule"`
}

func (WorkerConfiguration) Validate

func (cfg WorkerConfiguration) Validate() error

type WorkerGRPCConfig

type WorkerGRPCConfig struct {
	Address string `mapstructure:"worker-grpc-address"`
}

Jump to

Keyboard shortcuts

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