deal

package
v0.2.47 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0, MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListHandler

func ListHandler(db *gorm.DB, request ListDealRequest) ([]model.Deal, error)

func SendManualHandler

func SendManualHandler(
	db *gorm.DB,
	ctx context.Context,
	request Proposal,
	dealMaker replication.DealMaker,
) (*model.Deal, error)

Types

type ListDealRequest

type ListDealRequest struct {
	Datasets  []string `json:"datasets"`  // dataset name filter
	Schedules []uint32 `json:"schedules"` // schedule id filter
	Providers []string `json:"providers"` // provider filter
	States    []string `json:"states"`    // state filter
}

type Proposal

type Proposal struct {
	HTTPHeaders     []string `json:"httpHeaders"`                          // http headers to be passed with the request (i.e. key=value)
	URLTemplate     string   `json:"urlTemplate"`                          // URL template with PIECE_CID placeholder for boost to fetch the CAR file, i.e. http://127.0.0.1/piece/{PIECE_CID}.car
	PricePerGBEpoch float64  `default:"0"          json:"pricePerGbEpoch"` // Price in FIL per GiB per epoch
	PricePerGB      float64  `default:"0"          json:"pricePerGb"`      // Price in FIL  per GiB
	PricePerDeal    float64  `default:"0"          json:"pricePerDeal"`    // Price in FIL per deal
	RootCID         string   `default:"bafkqaaa"   json:"rootCid"`         // Root CID that is required as part of the deal proposal, if empty, will be set to empty CID
	Verified        bool     `default:"true"       json:"verified"`        // Whether the deal should be verified
	IPNI            bool     `default:"true"       json:"ipni"`            // Whether the deal should be IPNI
	KeepUnsealed    bool     `default:"true"       json:"keepUnsealed"`    // Whether the deal should be kept unsealed
	StartDelay      string   `default:"72h"        json:"startDelay"`      // Deal start delay in epoch or in duration format, i.e. 1000, 72h
	Duration        string   `default:"12740h"     json:"duration"`        // Duration in epoch or in duration format, i.e. 1500000, 2400h
	ClientAddress   string   `json:"clientAddress"`                        // Client address
	ProviderID      string   `json:"providerId"`                           // Provider ID
	PieceCID        string   `json:"pieceCid"`                             // Piece CID
	PieceSize       string   `json:"pieceSize"`                            // Piece size
	FileSize        uint64   `json:"fileSize"`                             // File size in bytes for boost to fetch the CAR file
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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