tasks

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: Apache-2.0, MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeRetrievalDeal

func MakeRetrievalDeal(ctx context.Context, config NodeConfig, node api.FullNode, task RetrievalTask, log UpdateStatus) error

func MakeStorageDeal

func MakeStorageDeal(ctx context.Context, config NodeConfig, node api.FullNode, task StorageTask, log UpdateStatus) error

Types

type NodeConfig

type NodeConfig struct {
	DataDir       string
	NodeDataDir   string
	WalletAddress address.Address
}

type RetrievalTask

type RetrievalTask struct {
	Miner      string `json:"miner"`
	PayloadCID string `json:"payload_cid"`
	CARExport  bool   `json:"car_export"`
}

type Status

type Status int
const (
	Available Status = iota + 1
	InProgress
	Successful
	Failed
)

func (Status) String

func (s Status) String() string

type StorageTask

type StorageTask struct {
	Miner           string `json:"miner"`
	MaxPriceAttoFIL uint64 `json:"max_price_attofil"`
	Size            uint64 `json:"size"`
	StartOffset     uint64 `json:"start_offset"`
	FastRetrieval   bool   `json:"fast_retrieval"`
	Verified        bool   `json:"verified"`
}

type Task

type Task struct {
	UUID          string         `json:"uuid"`
	Status        Status         `json:"status"`
	WorkedBy      string         `json:"worked_by,omitempty"`  // which dealbot works on that task
	StartedAt     time.Time      `json:"started_at,omitempty"` // the time the task was assigned first assigned to the dealbot
	RetrievalTask *RetrievalTask `json:"retrieval_task,omitempty"`
	StorageTask   *StorageTask   `json:"storage_task,omitempty"`
	Signature     []byte         `json:"signature,omitempty"` // signature of Task with this field set to nil

}

func (Task) Bytes

func (t Task) Bytes() []byte

func (*Task) Log

func (t *Task) Log(log *logging.ZapEventLogger)

func (*Task) Sign added in v0.0.4

func (t *Task) Sign(privKey crypto.PrivKey) error

type TaskEvent added in v0.0.4

type TaskEvent struct {
	Status Status
	At     time.Time
}

type UpdateStatus

type UpdateStatus func(msg string, keysAndValues ...interface{})

Jump to

Keyboard shortcuts

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