storage

package
v0.2506.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package storage implements the storage backend.

Index

Constants

This section is empty.

Variables

Flags has the configuration flags.

Functions

func GetLocalBackendDBDir added in v0.2100.0

func GetLocalBackendDBDir(dataDir, backend string) string

GetLocalBackendDBDir returns the database name for local backends.

func NewLocalBackend added in v0.2012.3

func NewLocalBackend(
	dataDir string,
	namespace common.Namespace,
) (api.LocalBackend, error)

NewLocalBackend constructs a new Backend based on the configuration flags.

Types

type Worker

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

Worker is a worker handling storage operations for all common worker runtimes.

func New

func New(
	grpcInternal *grpc.Server,
	commonWorker *workerCommon.Worker,
	registration *registration.Worker,
) (*Worker, error)

New constructs a new storage worker.

func (*Worker) Cleanup

func (w *Worker) Cleanup()

Cleanup performs the service specific post-termination cleanup.

func (*Worker) Enabled

func (w *Worker) Enabled() bool

Enabled returns if worker is enabled.

func (*Worker) GetLastSyncedRound

func (w *Worker) GetLastSyncedRound(_ context.Context, request *api.GetLastSyncedRoundRequest) (*api.GetLastSyncedRoundResponse, error)

func (*Worker) GetRuntime added in v0.2010.0

func (w *Worker) GetRuntime(id common.Namespace) *committee.Worker

GetRuntime returns a storage committee node for the given runtime (if available).

In case the runtime with the specified id was not configured for this node it returns nil.

func (*Worker) Initialized

func (w *Worker) Initialized() <-chan struct{}

Initialized returns a channel that will be closed when the storage worker is initialized and ready to service requests.

func (*Worker) Name

func (w *Worker) Name() string

Name returns the worker name.

func (*Worker) PauseCheckpointer added in v0.2102.0

func (w *Worker) PauseCheckpointer(_ context.Context, request *api.PauseCheckpointerRequest) error

func (*Worker) Quit

func (w *Worker) Quit() <-chan struct{}

Quit returns a channel that will be closed when the service terminates.

func (*Worker) Serve added in v0.2506.0

func (w *Worker) Serve(ctx context.Context) error

Serve starts a state sync worker for each of the configured runtime, unless disabled.

If any state sync worker returns an error, it cancels the remaining ones and waits for all of them to finish. The error from the first failing worker is returned.

func (*Worker) Start

func (w *Worker) Start() error

Start starts the storage service.

func (*Worker) Stop

func (w *Worker) Stop()

Stop halts the service.

Directories

Path Synopsis
Package committee defines the logic responsible for initializing, syncing, and pruning of the runtime state using the relevant p2p protocol clients.
Package committee defines the logic responsible for initializing, syncing, and pruning of the runtime state using the relevant p2p protocol clients.
Package config implements global configuration options.
Package config implements global configuration options.
p2p
checkpointsync
Package checkpointsync defines wire protocol together with client/server implementations for the checkpoint sync protocol, used for runtime state sync.
Package checkpointsync defines wire protocol together with client/server implementations for the checkpoint sync protocol, used for runtime state sync.
diffsync
Package diffsync defines wire protocol together with client/server implementations for the diff sync protocol, used for runtime block sync.
Package diffsync defines wire protocol together with client/server implementations for the diff sync protocol, used for runtime block sync.
pub
synclegacy
Package synclegacy defines wire protocol together with client/server implementations for the legacy storage sync protocol, used for runtime block sync.
Package synclegacy defines wire protocol together with client/server implementations for the legacy storage sync protocol, used for runtime block sync.
Package tests is a collection of storage worker test cases.
Package tests is a collection of storage worker test cases.

Jump to

Keyboard shortcuts

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