miner

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0, MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	PreCommitAdded   = "PRECOMMIT_ADDED"
	PreCommitExpired = "PRECOMMIT_EXPIRED"

	CommitCapacityAdded = "COMMIT_CAPACITY_ADDED"

	SectorAdded      = "SECTOR_ADDED"
	SectorExtended   = "SECTOR_EXTENDED"
	SectorFaulted    = "SECTOR_FAULTED"
	SectorRecovering = "SECTOR_RECOVERING"
	SectorRecovered  = "SECTOR_RECOVERED"

	SectorExpired    = "SECTOR_EXPIRED"
	SectorTerminated = "SECTOR_TERMINATED"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MinerCurrentDeadlineInfo

type MinerCurrentDeadlineInfo struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	StateRoot string `pg:",pk,notnull"`

	DeadlineIndex uint64 `pg:",notnull,use_zero"`
	PeriodStart   int64  `pg:",notnull,use_zero"`
	Open          int64  `pg:",notnull,use_zero"`
	Close         int64  `pg:",notnull,use_zero"`
	Challenge     int64  `pg:",notnull,use_zero"`
	FaultCutoff   int64  `pg:",notnull,use_zero"`
}

func (*MinerCurrentDeadlineInfo) Persist

type MinerCurrentDeadlineInfoList

type MinerCurrentDeadlineInfoList []*MinerCurrentDeadlineInfo

func (MinerCurrentDeadlineInfoList) Persist

type MinerFeeDebt

type MinerFeeDebt struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	StateRoot string `pg:",pk,notnull"`

	FeeDebt string `pg:"type:numeric,notnull"`
}

func (*MinerFeeDebt) AsVersion

func (m *MinerFeeDebt) AsVersion(version model.Version) (interface{}, bool)

func (*MinerFeeDebt) Persist

func (m *MinerFeeDebt) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerFeeDebtList

type MinerFeeDebtList []*MinerFeeDebt

func (MinerFeeDebtList) Persist

func (ml MinerFeeDebtList) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerFeeDebtV0

type MinerFeeDebtV0 struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	StateRoot string `pg:",pk,notnull"`

	FeeDebt string `pg:",notnull"`
	// contains filtered or unexported fields
}

type MinerInfo

type MinerInfo struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	StateRoot string `pg:",pk,notnull"`

	OwnerID  string `pg:",notnull"`
	WorkerID string `pg:",notnull"`

	NewWorker         string
	WorkerChangeEpoch int64 `pg:",notnull,use_zero"`

	ConsensusFaultedElapsed int64 `pg:",notnull,use_zero"`

	PeerID           string
	ControlAddresses []string
	MultiAddresses   []string

	SectorSize uint64 `pg:",notnull,use_zero"`
}

func (*MinerInfo) Persist

func (m *MinerInfo) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerInfoList

type MinerInfoList []*MinerInfo

func (MinerInfoList) Persist

func (ml MinerInfoList) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerLockedFund

type MinerLockedFund struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	StateRoot string `pg:",pk,notnull"`

	LockedFunds       string `pg:"type:numeric,notnull"`
	InitialPledge     string `pg:"type:numeric,notnull"`
	PreCommitDeposits string `pg:"type:numeric,notnull"`
}

func (*MinerLockedFund) AsVersion

func (m *MinerLockedFund) AsVersion(version model.Version) (interface{}, bool)

func (*MinerLockedFund) Persist

func (m *MinerLockedFund) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerLockedFundV0

type MinerLockedFundV0 struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	StateRoot string `pg:",pk,notnull"`

	LockedFunds       string `pg:",notnull"`
	InitialPledge     string `pg:",notnull"`
	PreCommitDeposits string `pg:",notnull"`
	// contains filtered or unexported fields
}

type MinerLockedFundsList

type MinerLockedFundsList []*MinerLockedFund

func (MinerLockedFundsList) Persist

type MinerPreCommitInfo

type MinerPreCommitInfo struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	SectorID  uint64 `pg:",pk,use_zero"`
	StateRoot string `pg:",pk,notnull"`

	SealedCID       string `pg:",notnull"`
	SealRandEpoch   int64  `pg:",use_zero"`
	ExpirationEpoch int64  `pg:",use_zero"`

	PreCommitDeposit   string `pg:"type:numeric,notnull"`
	PreCommitEpoch     int64  `pg:",use_zero"`
	DealWeight         string `pg:"type:numeric,notnull"`
	VerifiedDealWeight string `pg:"type:numeric,notnull"`

	IsReplaceCapacity      bool
	ReplaceSectorDeadline  uint64 `pg:",use_zero"`
	ReplaceSectorPartition uint64 `pg:",use_zero"`
	ReplaceSectorNumber    uint64 `pg:",use_zero"`
}

func (*MinerPreCommitInfo) AsVersion

func (mpi *MinerPreCommitInfo) AsVersion(version model.Version) (interface{}, bool)

func (*MinerPreCommitInfo) Persist

func (mpi *MinerPreCommitInfo) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerPreCommitInfoList

type MinerPreCommitInfoList []*MinerPreCommitInfo

func (MinerPreCommitInfoList) Persist

type MinerPreCommitInfoV0

type MinerPreCommitInfoV0 struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	SectorID  uint64 `pg:",pk,use_zero"`
	StateRoot string `pg:",pk,notnull"`

	SealedCID       string `pg:",notnull"`
	SealRandEpoch   int64  `pg:",use_zero"`
	ExpirationEpoch int64  `pg:",use_zero"`

	PreCommitDeposit   string `pg:",notnull"`
	PreCommitEpoch     int64  `pg:",use_zero"`
	DealWeight         string `pg:",notnull"`
	VerifiedDealWeight string `pg:",notnull"`

	IsReplaceCapacity      bool
	ReplaceSectorDeadline  uint64 `pg:",use_zero"`
	ReplaceSectorPartition uint64 `pg:",use_zero"`
	ReplaceSectorNumber    uint64 `pg:",use_zero"`
	// contains filtered or unexported fields
}

type MinerSectorDeal

type MinerSectorDeal struct {
	Height   int64  `pg:",pk,notnull,use_zero"`
	MinerID  string `pg:",pk,notnull"`
	SectorID uint64 `pg:",pk,use_zero"`
	DealID   uint64 `pg:",pk,use_zero"`
}

func (*MinerSectorDeal) Persist

func (ds *MinerSectorDeal) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerSectorDealList

type MinerSectorDealList []*MinerSectorDeal

func (MinerSectorDealList) Persist

type MinerSectorEvent

type MinerSectorEvent struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	SectorID  uint64 `pg:",pk,use_zero"`
	StateRoot string `pg:",pk,notnull"`

	// https://github.com/go-pg/pg/issues/993
	// override the SQL type with enum type, see 1_chainwatch.go for enum definition
	//lint:ignore SA5008 duplicate tag allowed by go-pg
	Event string `pg:"type:miner_sector_event_type" pg:",pk,notnull"`
}

func (*MinerSectorEvent) Persist

func (mse *MinerSectorEvent) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerSectorEventList

type MinerSectorEventList []*MinerSectorEvent

func (MinerSectorEventList) Persist

type MinerSectorInfo

type MinerSectorInfo struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	SectorID  uint64 `pg:",pk,use_zero"`
	StateRoot string `pg:",pk,notnull"`

	SealedCID string `pg:",notnull"`

	ActivationEpoch int64 `pg:",use_zero"`
	ExpirationEpoch int64 `pg:",use_zero"`

	DealWeight         string `pg:"type:numeric,notnull"`
	VerifiedDealWeight string `pg:"type:numeric,notnull"`

	InitialPledge         string `pg:"type:numeric,notnull"`
	ExpectedDayReward     string `pg:"type:numeric,notnull"`
	ExpectedStoragePledge string `pg:"type:numeric,notnull"`
}

func (*MinerSectorInfo) AsVersion

func (msi *MinerSectorInfo) AsVersion(version model.Version) (interface{}, bool)

func (*MinerSectorInfo) Persist

func (msi *MinerSectorInfo) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerSectorInfoList

type MinerSectorInfoList []*MinerSectorInfo

func (MinerSectorInfoList) Persist

type MinerSectorInfoV0

type MinerSectorInfoV0 struct {
	Height    int64  `pg:",pk,notnull,use_zero"`
	MinerID   string `pg:",pk,notnull"`
	SectorID  uint64 `pg:",pk,use_zero"`
	StateRoot string `pg:",pk,notnull"`

	SealedCID string `pg:",notnull"`

	ActivationEpoch int64 `pg:",use_zero"`
	ExpirationEpoch int64 `pg:",use_zero"`

	DealWeight         string `pg:",notnull"`
	VerifiedDealWeight string `pg:",notnull"`

	InitialPledge         string `pg:",notnull"`
	ExpectedDayReward     string `pg:",notnull"`
	ExpectedStoragePledge string `pg:",notnull"`
	// contains filtered or unexported fields
}

type MinerSectorPost

type MinerSectorPost struct {
	Height   int64  `pg:",pk,notnull,use_zero"`
	MinerID  string `pg:",pk,notnull"`
	SectorID uint64 `pg:",pk,notnull,use_zero"`

	PostMessageCID string
}

func (*MinerSectorPost) Persist

func (msp *MinerSectorPost) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerSectorPostList

type MinerSectorPostList []*MinerSectorPost

func (MinerSectorPostList) Persist

type MinerTaskLists

type MinerTaskLists struct {
	MinerInfoModel           MinerInfoList
	FeeDebtModel             MinerFeeDebtList
	LockedFundsModel         MinerLockedFundsList
	CurrentDeadlineInfoModel MinerCurrentDeadlineInfoList
	PreCommitsModel          MinerPreCommitInfoList
	SectorsModel             MinerSectorInfoList
	SectorEventsModel        MinerSectorEventList
	SectorDealsModel         MinerSectorDealList
	SectorPostModel          MinerSectorPostList
}

MinerTaskLists allow better batched insertion of Miner-related models.

func (*MinerTaskLists) Persist

func (mtl *MinerTaskLists) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

Persist PersistModel with every field of MinerTasklists

type MinerTaskResult

type MinerTaskResult struct {
	Posts MinerSectorPostList

	MinerInfoModel           *MinerInfo
	FeeDebtModel             *MinerFeeDebt
	LockedFundsModel         *MinerLockedFund
	CurrentDeadlineInfoModel *MinerCurrentDeadlineInfo
	PreCommitsModel          MinerPreCommitInfoList
	SectorsModel             MinerSectorInfoList
	SectorEventsModel        MinerSectorEventList
	SectorDealsModel         MinerSectorDealList
}

func (*MinerTaskResult) Persist

func (res *MinerTaskResult) Persist(ctx context.Context, s model.StorageBatch, version model.Version) error

type MinerTaskResultList

type MinerTaskResultList []*MinerTaskResult

func (MinerTaskResultList) Persist

Jump to

Keyboard shortcuts

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