Run NodesReferenceService

backup

Package backup provides database backup and restore functionality.

import "github.com/luxfi/node/service/backup"

Package backup provides database backup and restore functionality. It supports incremental backups using ZapDB's native backup mechanism with optional zstd compression.

Types

Config

Config configures the backup service.

Metadata

Metadata stores information about the last backup.

Service

Service provides backup and restore operations.

func New(cfg Config) (*Service, error)
func (s *Service) Backup(w io.Writer, since uint64, compress bool) (uint64, error)
func (s *Service) BackupChunked(since uint64, compress bool) (<-chan []byte, <-chan error, <-chan uint64)
func (s *Service) BackupToFile(path string, since uint64, compress bool) (uint64, error)
func (s *Service) GetLastVersion() uint64
func (s *Service) GetMetadata() *Metadata
func (s *Service) Restore(r io.Reader, compressed bool) error
func (s *Service) RestoreChunked(compressed bool) (chan<- []byte, <-chan error)
func (s *Service) RestoreFromFile(path string, compressed bool) error