model

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2023 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ZoneStatuAggregating    ZoneStatus = "aggregating"
	ZoneStatusConsolidating ZoneStatus = "consolidation"
	ZoneStatusDone          ZoneStatus = "done"
	ZoneStatusStuck         ZoneStatus = "stuck"
	ZoneStatusOpen          ZoneStatus = "open"

	ZoneMessageOpen          ZoneMessage = "Zone is open for content aggregation"
	ZoneMessageDone          ZoneMessage = "Zone has been aggregated and a deal will be made for it"
	ZoneMessageAggregating   ZoneMessage = "Zone contents are under aggregation processing"
	ZoneMessageConsolidating ZoneMessage = "Zone contents are under consolidation processing"
	ZoneMessageStuck         ZoneMessage = ""
)

Variables

View Source
var ErrNoChannelID = fmt.Errorf("no data transfer channel id in deal")

Functions

This section is empty.

Types

type ContentDeal

type ContentDeal struct {
	gorm.Model
	Content          uint       `json:"content" gorm:"index:,option:CONCURRENTLY"`
	UserID           uint       `json:"user_id" gorm:"index:,option:CONCURRENTLY"`
	PropCid          util.DbCID `json:"propCid"`
	DealUUID         string     `json:"dealUuid"`
	Miner            string     `json:"miner"`
	DealID           int64      `json:"dealId"`
	Failed           bool       `json:"failed"`
	Verified         bool       `json:"verified"`
	Slashed          bool       `json:"slashed"`
	FailedAt         time.Time  `json:"failedAt,omitempty"`
	DTChan           string     `json:"dtChan" gorm:"index"`
	TransferStarted  time.Time  `json:"transferStarted"`
	TransferFinished time.Time  `json:"transferFinished"`

	OnChainAt           time.Time   `json:"onChainAt"`
	SealedAt            time.Time   `json:"sealedAt"`
	DealProtocolVersion protocol.ID `json:"deal_protocol_version"`
	MinerVersion        string      `json:"miner_version"`
}

func (ContentDeal) ChannelID

func (cd ContentDeal) ChannelID() (datatransfer.ChannelID, error)

func (ContentDeal) MinerAddr

func (cd ContentDeal) MinerAddr() (address.Address, error)

type DfeRecord

type DfeRecord struct {
	gorm.Model
	Miner               string      `json:"miner"`
	DealUUID            string      `json:"deal_uuid"`
	Phase               string      `json:"phase"`
	Message             string      `json:"message"`
	Content             uint        `json:"content" gorm:"index"`
	MinerVersion        string      `json:"minerVersion"`
	UserID              uint        `json:"user_id" gorm:"index"`
	DealProtocolVersion protocol.ID `json:"deal_protocol_version"`
}

type MinerStorageAsk

type MinerStorageAsk struct {
	gorm.Model          `json:"-"`
	Miner               string              `gorm:"unique" json:"miner"`
	Price               string              `json:"price"`
	VerifiedPrice       string              `json:"verifiedPrice"`
	PriceBigInt         big.Int             `gorm:"-" json:"-"`
	VerifiedPriceBigInt big.Int             `gorm:"-" json:"-"`
	MinPieceSize        abi.PaddedPieceSize `json:"minPieceSize"`
	MaxPieceSize        abi.PaddedPieceSize `json:"maxPieceSize"`
	MinerVersion        string              `json:"miner_version"`
}

func (*MinerStorageAsk) GetPrice

func (msa *MinerStorageAsk) GetPrice(isVerifiedDeal bool) types.BigInt

func (*MinerStorageAsk) PriceIsTooHigh

func (msa *MinerStorageAsk) PriceIsTooHigh(cfg *config.Estuary) bool

func (*MinerStorageAsk) SizeIsCloseEnough

func (msa *MinerStorageAsk) SizeIsCloseEnough(pieceSize abi.PaddedPieceSize) bool

type PieceCommRecord

type PieceCommRecord struct {
	Data    util.DbCID `gorm:"unique"`
	Piece   util.DbCID
	CarSize uint64
	Size    abi.UnpaddedPieceSize
}

type ProposalRecord

type ProposalRecord struct {
	PropCid util.DbCID `gorm:"index"`
	Data    []byte
}

type RetrievalSuccessRecord

type RetrievalSuccessRecord struct {
	ID           uint       `gorm:"primarykey" json:"-"`
	CreatedAt    time.Time  `json:"createdAt"`
	Cid          util.DbCID `json:"cid"`
	Miner        string     `json:"miner"`
	Peer         string     `json:"peer"`
	Size         uint64     `json:"size"`
	DurationMs   int64      `json:"durationMs"`
	AverageSpeed uint64     `json:"averageSpeed"`
	TotalPayment string     `json:"totalPayment"`
	NumPayments  int        `json:"numPayments"`
	AskPrice     string     `json:"askPrice"`
}

type SanityCheck

type SanityCheck struct {
	gorm.Model
	ContentID uint       `json:"-" gorm:"uniqueIndex:cnt_blk_cid_index;index;not null"`
	BlockCid  util.DbCID `json:"-" gorm:"uniqueIndex:cnt_blk_cid_index;index;not null"`
	ErrMsg    string     `json:"-" gorm:"type:text;not null"`
}

type Shuttle

type Shuttle struct {
	gorm.Model
	Handle         string `gorm:"unique"`
	Token          string
	Host           string
	PeerID         string
	LastConnection time.Time
	Private        bool
	Open           bool
	Priority       int
}

type ShuttleConnection added in v0.3.7

type ShuttleConnection struct {
	gorm.Model
	UpdatedAt             time.Time
	Handle                string `gorm:"unique;index"`
	Hostname              string
	AddrInfo              util.DbAddrInfo
	Address               util.DbAddr
	Private               bool
	ContentAddingDisabled bool
	SpaceLow              bool
	BlockstoreSize        uint64
	BlockstoreFree        uint64
	PinCount              int64
	PinQueueLength        int64
	QueueEngEnabled       bool
}

type StagingZone added in v0.3.6

type StagingZone struct {
	gorm.Model
	ID        uint        `gorm:"index:id_size_status;index:id_status" json:"id"`
	CreatedAt time.Time   `gorm:"index;not null" json:"createdAt"`
	MinSize   int64       `gorm:"index;not null" json:"minSize"`
	MaxSize   int64       `json:"maxSize"`
	Size      int64       `gorm:"index:size_status;index:id_size_status;index:user_size_status;index;not null" json:"curSize"`
	UserID    uint        `gorm:"index:user_size_status;index;not null" json:"user"`
	ContID    uint        `gorm:"index;not null" json:"contentID"`
	Location  string      `gorm:"index;not null" json:"location"`
	Status    ZoneStatus  `gorm:"index:size_status;index:id_size_status;index:user_size_status;index:id_status" json:"status"`
	Message   ZoneMessage `json:"message" gorm:"type:text"`
}

type StagingZoneTracker added in v0.3.6

type StagingZoneTracker struct {
	gorm.Model
	LastContID uint `gorm:"index;not null" json:"-"`
}

type StorageMiner

type StorageMiner struct {
	gorm.Model
	Address         util.DbAddr `gorm:"unique"`
	Suspended       bool
	SuspendedReason string
	Name            string
	Version         string
	Location        string
	Owner           uint
}

type ZoneMessage added in v0.3.6

type ZoneMessage string

type ZoneStatus added in v0.3.6

type ZoneStatus string

Jump to

Keyboard shortcuts

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