webrpc

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: Apache-2.0, MIT Imports: 33 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Routes

func Routes(r *mux.Router, deps *deps.Deps)

Types

type ActorDeadline added in v1.23.0

type ActorDeadline struct {
	Empty      bool
	Current    bool
	Proven     bool
	PartFaulty bool
	Faulty     bool
}

type ActorSummary added in v1.23.0

type ActorSummary struct {
	Address string
	CLayers []string

	QualityAdjustedPower string
	RawBytePower         string

	ActorBalance, ActorAvailable, WorkerBalance string

	Win1, Win7, Win30 int64

	Deadlines []ActorDeadline
}

type FileLocations added in v1.23.0

type FileLocations struct {
	StorageID string
	Urls      []string
}

type HarmonyMachineDesc

type HarmonyMachineDesc struct {
	MachineID   int64  `db:"machine_id"`
	Name        string `db:"machine_name"`
	MachineAddr string `db:"host_and_port"`
	Actors      string `db:"miners"`
}

type HarmonyTaskHistory

type HarmonyTaskHistory struct {
	TaskID int64  `db:"task_id"`
	Name   string `db:"name"`

	WorkStart time.Time `db:"work_start"`
	WorkEnd   time.Time `db:"work_end"`
	Posted    time.Time `db:"posted"`

	Result bool   `db:"result"`
	Err    string `db:"err"`

	CompletedBy     string  `db:"completed_by_host_and_port"`
	CompletedById   *int64  `db:"completed_by_machine"`
	CompletedByName *string `db:"completed_by_machine_name"`
}

type HarmonyTaskStats

type HarmonyTaskStats struct {
	Name       string `db:"name"`
	TrueCount  int    `db:"true_count"`
	FalseCount int    `db:"false_count"`
	TotalCount int    `db:"total_count"`
}

type LocationTable added in v1.23.0

type LocationTable struct {
	PathType        *string
	PathTypeRowSpan int

	FileType        *string
	FileTypeRowSpan int

	Locations []FileLocations
}

type MachineInfo added in v1.23.0

type MachineInfo struct {
	Info struct {
		Name        string
		Host        string
		ID          int64
		LastContact string
		CPU         int64
		Memory      int64
		GPU         int64
	}

	// Storage
	Storage []struct {
		ID            string
		Weight        int64
		MaxStorage    int64
		CanSeal       bool
		CanStore      bool
		Groups        string
		AllowTo       string
		AllowTypes    string
		DenyTypes     string
		Capacity      int64
		Available     int64
		FSAvailable   int64
		Reserved      int64
		Used          int64
		AllowMiners   string
		DenyMiners    string
		LastHeartbeat time.Time
		HeartbeatErr  *string

		UsedPercent     float64
		ReservedPercent float64
	}

	// Tasks
	RunningTasks []struct {
		ID     int64
		Task   string
		Posted string

		PoRepSector, PoRepSectorSP *int64
	}

	FinishedTasks []struct {
		ID      int64
		Task    string
		Posted  string
		Start   string
		Queued  string
		Took    string
		Outcome string
		Message string
	}
}

type MachineSummary added in v1.23.0

type MachineSummary struct {
	Address      string
	ID           int64
	Name         string
	SinceContact string

	Tasks        string
	Cpu          int
	RamHumanized string
	Gpu          int
	Layers       string
}

type OpenDealInfo added in v1.23.0

type OpenDealInfo struct {
	Actor        int64     `db:"sp_id"`
	SectorNumber uint64    `db:"sector_number"`
	PieceCID     string    `db:"piece_cid"`
	PieceSize    uint64    `db:"piece_size"`
	CreatedAt    time.Time `db:"created_at"`
	SnapDeals    bool      `db:"is_snap"`

	PieceSizeStr string `db:"-"`
	CreatedAtStr string `db:"-"`
}

type PipelineTask added in v1.23.0

type PipelineTask struct {
	SpID         int64 `db:"sp_id"`
	SectorNumber int64 `db:"sector_number"`

	CreateTime time.Time `db:"create_time"`

	TaskSDR  *int64 `db:"task_id_sdr"`
	AfterSDR bool   `db:"after_sdr"`

	TaskTreeD  *int64 `db:"task_id_tree_d"`
	AfterTreeD bool   `db:"after_tree_d"`

	TaskTreeC  *int64 `db:"task_id_tree_c"`
	AfterTreeC bool   `db:"after_tree_c"`

	TaskTreeR  *int64 `db:"task_id_tree_r"`
	AfterTreeR bool   `db:"after_tree_r"`

	TaskSynthetic  *int64 `db:"task_id_synth"`
	AfterSynthetic bool   `db:"after_synth"`

	TaskPrecommitMsg  *int64 `db:"task_id_precommit_msg"`
	AfterPrecommitMsg bool   `db:"after_precommit_msg"`

	AfterPrecommitMsgSuccess bool   `db:"after_precommit_msg_success"`
	SeedEpoch                *int64 `db:"seed_epoch"`

	TaskPoRep  *int64 `db:"task_id_porep"`
	PoRepProof []byte `db:"porep_proof"`
	AfterPoRep bool   `db:"after_porep"`

	TaskFinalize  *int64 `db:"task_id_finalize"`
	AfterFinalize bool   `db:"after_finalize"`

	TaskMoveStorage  *int64 `db:"task_id_move_storage"`
	AfterMoveStorage bool   `db:"after_move_storage"`

	TaskCommitMsg  *int64 `db:"task_id_commit_msg"`
	AfterCommitMsg bool   `db:"after_commit_msg"`

	AfterCommitMsgSuccess bool `db:"after_commit_msg_success"`

	Failed       bool   `db:"failed"`
	FailedReason string `db:"failed_reason"`
}

type PorepPipelineSummary added in v1.23.0

type PorepPipelineSummary struct {
	Actor string

	CountSDR          int
	CountTrees        int
	CountPrecommitMsg int
	CountWaitSeed     int
	CountPoRep        int
	CountCommitMsg    int
	CountDone         int
	CountFailed       int
}

type RpcInfo

type RpcInfo struct {
	Address   string
	CLayers   []string
	Reachable bool
	SyncState string
	Version   string
}

type SectorExpirationBucket added in v1.23.0

type SectorExpirationBucket struct {
	Expiration int64 `db:"expiration_bucket"`
	Count      int64 `db:"count"`

	// db ignored
	Days int64 `db:"-"`
}

type SectorExpirations added in v1.23.0

type SectorExpirations struct {
	All []SectorExpirationBucket
	CC  []SectorExpirationBucket
}

type SectorInfo added in v1.23.0

type SectorInfo struct {
	SectorNumber  int64
	SpID          uint64
	PipelinePoRep *sectorListEntry

	Pieces    []SectorPieceMeta
	Locations []LocationTable
	Tasks     []SectorInfoTaskSummary

	TaskHistory []TaskHistory

	Resumable bool
}

type SectorInfoTaskSummary added in v1.23.0

type SectorInfoTaskSummary struct {
	Name           string
	SincePosted    string
	Owner, OwnerID *string
	ID             int64
}

type SectorPieceMeta added in v1.23.0

type SectorPieceMeta struct {
	PieceIndex int64  `db:"piece_index"`
	PieceCid   string `db:"piece_cid"`
	PieceSize  int64  `db:"piece_size"`

	DataUrl          string `db:"data_url"`
	DataRawSize      int64  `db:"data_raw_size"`
	DeleteOnFinalize bool   `db:"data_delete_on_finalize"`

	F05PublishCid *string `db:"f05_publish_cid"`
	F05DealID     *int64  `db:"f05_deal_id"`

	DDOPam *string `db:"direct_piece_activation_manifest"`

	// display
	StrPieceSize   string `db:"-"`
	StrDataRawSize string `db:"-"`

	// piece park
	IsParkedPiece          bool      `db:"-"`
	IsParkedPieceFound     bool      `db:"-"`
	PieceParkID            int64     `db:"-"`
	PieceParkDataUrl       string    `db:"-"`
	PieceParkCreatedAt     time.Time `db:"-"`
	PieceParkComplete      bool      `db:"-"`
	PieceParkTaskID        *int64    `db:"-"`
	PieceParkCleanupTaskID *int64    `db:"-"`
}

Pieces

type SpidGetter added in v1.22.1

type SpidGetter interface {
	GetSpid(db *harmonydb.DB, taskID int64) string
}

type StorageGCMarks

type StorageGCMarks struct {
	Actor     int64  `db:"sp_id"`
	SectorNum int64  `db:"sector_num"`
	FileType  int64  `db:"sector_filetype"`
	StorageID string `db:"storage_id"`

	CreatedAt  time.Time  `db:"created_at"`
	Approved   bool       `db:"approved"`
	ApprovedAt *time.Time `db:"approved_at"`

	// db ignored
	TypeName string `db:"-"`
}

type StorageGCStats

type StorageGCStats struct {
	Actor int64 `db:"sp_id"`
	Count int   `db:"count"`
}

type StorageUseStats

type StorageUseStats struct {
	CanSeal   bool `db:"can_seal"`
	CanStore  bool `db:"can_store"`
	Available int  `db:"available"`
	Capacity  int  `db:"capacity"`

	// Ignored
	Type   string `db:"-"`
	UseStr string `db:"-"`
	CapStr string `db:"-"`
}

type TaskHistory added in v1.23.0

type TaskHistory struct {
	PipelineTaskID int64      `db:"pipeline_task_id"`
	Name           *string    `db:"name"`
	CompletedBy    *string    `db:"completed_by_host_and_port"`
	Result         *bool      `db:"result"`
	Err            *string    `db:"err"`
	WorkStart      *time.Time `db:"work_start"`
	WorkEnd        *time.Time `db:"work_end"`

	// display
	Took string `db:"-"`
}

type TaskHistorySummary added in v1.23.0

type TaskHistorySummary struct {
	Name   string
	TaskID int64

	Posted, Start, Queued, Took string

	Result bool
	Err    string

	CompletedBy string
}

type TaskSummary added in v1.22.1

type TaskSummary struct {
	ID             int64
	Name           string
	SpID           string
	SincePosted    time.Time `db:"since_posted"`
	Owner, OwnerID *string

	// db ignored
	SincePostedStr string `db:"-"`
}

type UpgradeSector added in v1.23.0

type UpgradeSector struct {
	SpID      uint64 `db:"sp_id"`
	SectorNum uint64 `db:"sector_number"`

	TaskIDEncode *uint64 `db:"task_id_encode"`
	AfterEncode  bool    `db:"after_encode"`

	TaskIDProve *uint64 `db:"task_id_prove"`
	AfterProve  bool    `db:"after_prove"`

	TaskIDSubmit *uint64 `db:"task_id_submit"`
	AfterSubmit  bool    `db:"after_submit"`

	AfterProveSuccess bool `db:"after_prove_msg_success"`

	TaskIDMoveStorage *uint64 `db:"task_id_move_storage"`
	AfterMoveStorage  bool    `db:"after_move_storage"`
}

type WebRPC

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

func (*WebRPC) ActorList added in v1.23.0

func (a *WebRPC) ActorList(ctx context.Context) ([]string, error)

func (*WebRPC) ActorSectorExpirations added in v1.23.0

func (a *WebRPC) ActorSectorExpirations(ctx context.Context, maddr address.Address) (*SectorExpirations, error)

func (*WebRPC) ActorSummary added in v1.23.0

func (a *WebRPC) ActorSummary(ctx context.Context) ([]ActorSummary, error)

func (*WebRPC) BlockDelaySecs

func (a *WebRPC) BlockDelaySecs(context.Context) (uint64, error)

func (*WebRPC) ClusterMachines added in v1.23.0

func (a *WebRPC) ClusterMachines(ctx context.Context) ([]MachineSummary, error)

func (*WebRPC) ClusterNodeInfo added in v1.23.0

func (a *WebRPC) ClusterNodeInfo(ctx context.Context, id int64) (*MachineInfo, error)

func (*WebRPC) ClusterTaskHistory added in v1.23.0

func (a *WebRPC) ClusterTaskHistory(ctx context.Context) ([]TaskHistorySummary, error)

func (*WebRPC) ClusterTaskSummary added in v1.22.1

func (a *WebRPC) ClusterTaskSummary(ctx context.Context) ([]TaskSummary, error)

func (*WebRPC) DealsPending added in v1.23.0

func (a *WebRPC) DealsPending(ctx context.Context) ([]OpenDealInfo, error)

func (*WebRPC) DealsSealNow added in v1.23.0

func (a *WebRPC) DealsSealNow(ctx context.Context, spId, sectorNumber uint64) error

func (*WebRPC) HarmonyTaskHistory

func (a *WebRPC) HarmonyTaskHistory(ctx context.Context, taskName string) ([]HarmonyTaskHistory, error)

func (*WebRPC) HarmonyTaskMachines

func (a *WebRPC) HarmonyTaskMachines(ctx context.Context, taskName string) ([]HarmonyMachineDesc, error)

func (*WebRPC) HarmonyTaskStats

func (a *WebRPC) HarmonyTaskStats(ctx context.Context) ([]HarmonyTaskStats, error)

func (*WebRPC) PipelinePorepSectors added in v1.23.0

func (a *WebRPC) PipelinePorepSectors(ctx context.Context) ([]sectorListEntry, error)

func (*WebRPC) PorepPipelineSummary added in v1.23.0

func (a *WebRPC) PorepPipelineSummary(ctx context.Context) ([]PorepPipelineSummary, error)

func (*WebRPC) SectorInfo added in v1.23.0

func (a *WebRPC) SectorInfo(ctx context.Context, sp string, intid int64) (*SectorInfo, error)

func (*WebRPC) SectorRemove added in v1.23.0

func (a *WebRPC) SectorRemove(ctx context.Context, sp, id string) error

func (*WebRPC) SectorResume added in v1.23.0

func (a *WebRPC) SectorResume(ctx context.Context, sp, id string) error

func (*WebRPC) StorageGCApprove

func (a *WebRPC) StorageGCApprove(ctx context.Context, actor int64, sectorNum int64, fileType int64, storageID string) error

func (*WebRPC) StorageGCApproveAll

func (a *WebRPC) StorageGCApproveAll(ctx context.Context) error

func (*WebRPC) StorageGCMarks

func (a *WebRPC) StorageGCMarks(ctx context.Context) ([]StorageGCMarks, error)

func (*WebRPC) StorageGCStats

func (a *WebRPC) StorageGCStats(ctx context.Context) ([]StorageGCStats, error)

func (*WebRPC) StorageGCUnapproveAll

func (a *WebRPC) StorageGCUnapproveAll(ctx context.Context) error

func (*WebRPC) StorageUseStats

func (a *WebRPC) StorageUseStats(ctx context.Context) ([]StorageUseStats, error)

func (*WebRPC) SyncerState

func (a *WebRPC) SyncerState(ctx context.Context) ([]RpcInfo, error)

func (*WebRPC) UpgradeResetTaskIDs added in v1.23.0

func (a *WebRPC) UpgradeResetTaskIDs(ctx context.Context, spid, sectorNum uint64) error

func (*WebRPC) UpgradeSectors added in v1.23.0

func (a *WebRPC) UpgradeSectors(ctx context.Context) ([]UpgradeSector, error)

func (*WebRPC) Version

func (a *WebRPC) Version(context.Context) (string, error)

func (*WebRPC) WinStats

func (a *WebRPC) WinStats(ctx context.Context) ([]WinStats, error)

type WinStats

type WinStats struct {
	Actor       int64      `db:"sp_id"`
	Epoch       int64      `db:"epoch"`
	Block       string     `db:"mined_cid"`
	TaskID      int64      `db:"task_id"`
	SubmittedAt *time.Time `db:"submitted_at"`
	Included    *bool      `db:"included"`

	BaseComputeTime *time.Time `db:"base_compute_time"`
	MinedAt         *time.Time `db:"mined_at"`

	SubmittedAtStr string `db:"-"`
	TaskSuccess    string `db:"-"`
	IncludedStr    string `db:"-"`
	ComputeTime    string `db:"-"`
}

Jump to

Keyboard shortcuts

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