sync

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PutDirectoryManifest

func PutDirectoryManifest(ctx context.Context, da celestia.BlobStore, directoryManifest *pbStorageV1.DirectoryManifest) (*types.BlobIdentifier, error)

func PutFileData

func PutFileData(
	ctx context.Context,
	submitter *Submitter,
	fileName string,
	fileData []byte,
	maxBlobSize int,
) (*types.BlobIdentifier, crypto.Hash, error)

func PutFileManifest

func PutFileManifest(ctx context.Context, submitter *Submitter, fileManifest *pbStorageV1.FileManifest) (*types.BlobIdentifier, error)

Types

type BlobcastChain

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

func NewBlobcastChain

func NewBlobcastChain(ctx context.Context, celestiaDA celestia.BlobStore) (*BlobcastChain, error)

func (*BlobcastChain) ApplyBlock

func (bc *BlobcastChain) ApplyBlock(ctx context.Context, tx *state.ChainStateTransaction, block *types.Block, prevBlock *types.Block) error

func (*BlobcastChain) CreateGenesisBlock

func (bc *BlobcastChain) CreateGenesisBlock(ctx context.Context, tx *state.ChainStateTransaction, celestiaHeight uint64) (*types.Block, error)

func (*BlobcastChain) FinalizeBlock

func (bc *BlobcastChain) FinalizeBlock(ctx context.Context, tx *state.ChainStateTransaction, height uint64) error

func (*BlobcastChain) ProduceBlock

func (bc *BlobcastChain) ProduceBlock(ctx context.Context, tx *state.ChainStateTransaction, height uint64, celestiaHeight uint64) (*types.Block, error)

func (*BlobcastChain) ProduceBlockFromCelestiaHeight

func (bc *BlobcastChain) ProduceBlockFromCelestiaHeight(ctx context.Context, tx *state.ChainStateTransaction, height uint64) (*types.Block, error)

func (*BlobcastChain) SyncBlobs

func (bc *BlobcastChain) SyncBlobs(
	ctx context.Context,
	tx *state.ChainStateTransaction,
	height uint64,
	blobs []*blob.Blob,
) (chunks []*types.BlobIdentifier, files []*types.BlobIdentifier, dirs []*types.BlobIdentifier, err error)

func (*BlobcastChain) SyncCelestiaHeight

func (bc *BlobcastChain) SyncCelestiaHeight(
	ctx context.Context,
	tx *state.ChainStateTransaction,
	height uint64,
) (chunks []*types.BlobIdentifier, files []*types.BlobIdentifier, dirs []*types.BlobIdentifier, err error)

func (*BlobcastChain) SyncChain

func (bc *BlobcastChain) SyncChain(ctx context.Context) (err error)

func (*BlobcastChain) SyncChainFromGrpc added in v0.2.0

func (bc *BlobcastChain) SyncChainFromGrpc(
	ctx context.Context,
	rollupClient pbRollupapisV1.RollupServiceClient,
	syncClient pbSyncapisV1.SyncServiceClient,
) error

func (*BlobcastChain) SyncChunk

func (bc *BlobcastChain) SyncChunk(
	ctx context.Context,
	tx *state.ChainStateTransaction,
	height uint64,
	blob *blob.Blob,
	chunkData *pbStorageV1.ChunkData,
) (bool, error)

func (*BlobcastChain) SyncDirectoryManifest

func (bc *BlobcastChain) SyncDirectoryManifest(
	ctx context.Context,
	tx *state.ChainStateTransaction,
	height uint64,
	blob *blob.Blob,
	directoryManifest *pbStorageV1.DirectoryManifest,
) (bool, error)

func (*BlobcastChain) SyncFileManifest

func (bc *BlobcastChain) SyncFileManifest(
	ctx context.Context,
	tx *state.ChainStateTransaction,
	height uint64,
	blob *blob.Blob,
	fileManifest *pbStorageV1.FileManifest,
) (bool, error)

type FileSystemClient

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

func (*FileSystemClient) ExportDirectory

func (c *FileSystemClient) ExportDirectory(ctx context.Context, id *types.BlobIdentifier, target string, encryptionKey []byte) error

func (*FileSystemClient) ExportFile

func (c *FileSystemClient) ExportFile(ctx context.Context, id *types.BlobIdentifier, target string, encryptionKey []byte) error

func (*FileSystemClient) UploadDirectory

func (c *FileSystemClient) UploadDirectory(
	ctx context.Context,
	source string,
	maxBlobSize int,
	encryptionKey []byte,
) (*types.BlobIdentifier, crypto.Hash, error)

func (*FileSystemClient) UploadFile

func (c *FileSystemClient) UploadFile(
	ctx context.Context,
	source string,
	relativePath string,
	maxBlobSize int,
	encryptionKey []byte,
) (*types.BlobIdentifier, crypto.Hash, error)

type SubmissionItem added in v0.3.2

type SubmissionItem struct {
	Payload []byte
	Result  chan SubmissionResult
}

type SubmissionResult added in v0.3.2

type SubmissionResult struct {
	BlobID *types.BlobIdentifier
	Error  error
}

type Submitter added in v0.3.2

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

func GetSubmitter added in v0.3.2

func GetSubmitter(da celestia.BlobStore) *Submitter

func NewSubmitter added in v0.3.2

func NewSubmitter(da celestia.BlobStore) *Submitter

func (*Submitter) Close added in v0.3.2

func (s *Submitter) Close()

func (*Submitter) Submit added in v0.3.2

func (s *Submitter) Submit(payload []byte) chan SubmissionResult

func (*Submitter) SubmitWithPriority added in v0.3.2

func (s *Submitter) SubmitWithPriority(payload []byte) chan SubmissionResult

Jump to

Keyboard shortcuts

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