transfer

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 16 Imported by: 3

Documentation

Index

Constants

View Source
const SubmitEventHash = "0x167ce04d2aa1981994d3a31695da0d785373335b1078cec239a1a3a2c7675555"

Variables

View Source
var DataAlreadyExistsError = "Invalid params: root; data: already uploaded and finalized"
View Source
var SegmentAlreadyExistsError = "segment has already been uploaded or is being uploaded"

Functions

This section is empty.

Types

type Downloader

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

func NewDownloader

func NewDownloader(clients ...*node.Client) *Downloader

func (*Downloader) Download

func (downloader *Downloader) Download(root, filename string, proof bool) error

type SegmentDownloader

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

func NewSegmentDownloader

func NewSegmentDownloader(clients []*node.Client, file *download.DownloadingFile, withProof bool) (*SegmentDownloader, error)

func (*SegmentDownloader) Download

func (downloader *SegmentDownloader) Download() error

Download downloads segments in parallel.

func (*SegmentDownloader) ParallelCollect

func (downloader *SegmentDownloader) ParallelCollect(result *parallel.Result) error

ParallelCollect implements the parallel.Interface interface.

func (*SegmentDownloader) ParallelDo

func (downloader *SegmentDownloader) ParallelDo(routine, task int) (interface{}, error)

ParallelDo implements the parallel.Interface interface.

type SegmentUploader

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

func (*SegmentUploader) ParallelCollect

func (uploader *SegmentUploader) ParallelCollect(result *parallel.Result) error

ParallelCollect implements parallel.Interface.

func (*SegmentUploader) ParallelDo

func (uploader *SegmentUploader) ParallelDo(routine int, task int) (interface{}, error)

ParallelDo implements parallel.Interface.

type UploadOption

type UploadOption struct {
	Tags     []byte // for kv operations
	Force    bool   // for kv to upload same file
	Disperse bool   // disperse files to different nodes
	TaskSize uint   // number of segment to upload in single rpc request
}

type Uploader

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

func NewUploader

func NewUploader(flow *contract.FlowContract, clients []*node.Client) *Uploader

func NewUploaderLight

func NewUploaderLight(clients []*node.Client) *Uploader

func (*Uploader) BatchUpload

func (uploader *Uploader) BatchUpload(datas []core.IterableData, waitForLogEntry bool, option ...[]UploadOption) (common.Hash, []common.Hash, error)

upload data(batchly in 1 blockchain transaction if there are more than one files)

func (*Uploader) SubmitLogEntry

func (uploader *Uploader) SubmitLogEntry(datas []core.IterableData, tags [][]byte, waitForReceipt bool) (common.Hash, *types.Receipt, error)

func (*Uploader) Upload

func (uploader *Uploader) Upload(data core.IterableData, option ...UploadOption) error

func (*Uploader) UploadFile

func (uploader *Uploader) UploadFile(data core.IterableData, tree *merkle.Tree, segIndex uint64, disperse bool, taskSize uint) error

TODO error tolerance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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