38 lines
779 B
Go
38 lines
779 B
Go
package api
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/filecoin-project/specs-storage/storage"
|
|
|
|
"github.com/filecoin-project/lotus/build"
|
|
"github.com/filecoin-project/lotus/storage/sealmgr"
|
|
"github.com/filecoin-project/lotus/storage/sealmgr/stores"
|
|
)
|
|
|
|
type WorkerApi interface {
|
|
Version(context.Context) (build.Version, error)
|
|
// TODO: Info() (name, ...) ?
|
|
|
|
TaskTypes(context.Context) (map[sealmgr.TaskType]struct{}, error) // TaskType -> Weight
|
|
Paths(context.Context) ([]stores.StoragePath, error)
|
|
Info(context.Context) (WorkerInfo, error)
|
|
|
|
storage.Sealer
|
|
}
|
|
|
|
type WorkerResources struct {
|
|
MemPhysical uint64
|
|
MemSwap uint64
|
|
|
|
MemReserved uint64 // Used by system / other processes
|
|
|
|
GPUs []string
|
|
}
|
|
|
|
type WorkerInfo struct {
|
|
Hostname string
|
|
|
|
Resources WorkerResources
|
|
}
|