lotus

package
v0.2.38 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 13 Imported by: 2

Documentation

Index

Constants

View Source
const (
	LOTUS_CLIENT_MINER_QUERY     = "Filecoin.ClientMinerQueryOffer"
	LOTUS_CLIENT_QUERY_ASK       = "Filecoin.ClientQueryAsk"
	LOTUS_CLIENT_GET_DEAL_INFO   = "Filecoin.ClientGetDealInfo"
	LOTUS_CLIENT_GET_DEAL_STATUS = "Filecoin.ClientGetDealStatus"
	LOTUS_CHAIN_HEAD             = "Filecoin.ChainHead"
	LOTUS_CLIENT_CALC_COMM_P     = "Filecoin.ClientCalcCommP"
	LOTUS_CLIENT_IMPORT          = "Filecoin.ClientImport"
	LOTUS_CLIENT_GEN_CAR         = "Filecoin.ClientGenCar"
	LOTUS_CLIENT_START_DEAL      = "Filecoin.ClientStartDeal"
)
View Source
const (
	LOTUS_JSON_RPC_ID      = 7878
	LOTUS_JSON_RPC_VERSION = "2.0"
)
View Source
const (
	LOTUS_MARKET_GET_ASK               = "Filecoin.MarketGetAsk"
	LOTUS_MARKET_IMPORT_DATA           = "Filecoin.MarketImportDealData"
	LOTUS_MARKET_LIST_INCOMPLETE_DEALS = "Filecoin.MarketListIncompleteDeals"
)
View Source
const (
	LOTUS_VERSION = "Filecoin.Version"
)

Variables

This section is empty.

Functions

func LotusProposeOfflineDeal

func LotusProposeOfflineDeal(carFile model.FileDesc, cost decimal.Decimal, pieceSize int64, dealConfig model.DealConfig, relativeEpoch int) (*string, *int, error)

func LotusVersion

func LotusVersion(apiUrl string) (*string, error)

when using lotus node api url it returns version of lotus node when using lotus miner api url it returns version of lotus miner

Types

type Cid

type Cid struct {
	Cid string `json:"/"`
}

type ClientCalcCommP

type ClientCalcCommP struct {
	LotusJsonRpcResult
	Result *ClientCalcCommPResult `json:"result"`
}

type ClientCalcCommPResult

type ClientCalcCommPResult struct {
	Root Cid
	Size int
}

type ClientDealInfo added in v0.2.38

type ClientDealInfo struct {
	LotusJsonRpcResult
	Result ClientDealResult `json:"result"`
}

type ClientDealResult added in v0.2.38

type ClientDealResult struct {
	Message    string
	DealStages ClientDealStages
}

type ClientDealStage added in v0.2.38

type ClientDealStage struct {
	Name             string
	Description      string
	ExpectedDuration string
	CreatedTime      string
	UpdatedTime      string
	Logs             []ClientDealStageLog
}

type ClientDealStageLog added in v0.2.38

type ClientDealStageLog struct {
	Log         string
	UpdatedTime string
}

type ClientDealStages added in v0.2.38

type ClientDealStages struct {
	Stages []ClientDealStage
}

type ClientFileParam

type ClientFileParam struct {
	Path  string
	IsCAR bool
}

type ClientImport

type ClientImport struct {
	LotusJsonRpcResult
	Result *ClientImportResult `json:"result"`
}

type ClientImportResult

type ClientImportResult struct {
	Root     Cid
	ImportID int64
}

type ClientMinerQuery added in v0.2.29

type ClientMinerQuery struct {
	LotusJsonRpcResult
	Result ClientMinerQueryResult `json:"result"`
}

type ClientMinerQueryResult added in v0.2.29

type ClientMinerQueryResult struct {
	MinerPeer ClientMinerQueryResultPeer
}

type ClientMinerQueryResultPeer added in v0.2.29

type ClientMinerQueryResultPeer struct {
	Address string
	ID      string
}

type ClientQueryAsk added in v0.2.29

type ClientQueryAsk struct {
	LotusJsonRpcResult
	Result ClientQueryAskResult `json:"result"`
}

type ClientQueryAskResult added in v0.2.29

type ClientQueryAskResult struct {
	Price         string
	VerifiedPrice string
	MinPieceSize  int
	MaxPieceSize  int
}

type ClientStartDeal

type ClientStartDeal struct {
	LotusJsonRpcResult
	Result Cid `json:"result"`
}

type ClientStartDealParam

type ClientStartDealParam struct {
	Data              ClientStartDealParamData
	Wallet            string
	Miner             string
	EpochPrice        string
	MinBlocksDuration int
	DealStartEpoch    int
	FastRetrieval     bool
	VerifiedDeal      bool
}

type ClientStartDealParamData

type ClientStartDealParamData struct {
	TransferType string
	Root         Cid
	PieceCid     Cid
	PieceSize    int
}

type Deal

type Deal struct {
	State       int     `json:"State"`
	Message     string  `json:"Message"`
	ProposalCid DealCid `json:"ProposalCid"`
}

type DealCid

type DealCid struct {
	DealCid string `json:"/"`
}

type JsonRpcError

type JsonRpcError struct {
	Code    int    `json:"code"`
	Message string `json:"message"`
}

type LotusClient

type LotusClient struct {
	ApiUrl      string
	AccessToken string
}

func LotusGetClient

func LotusGetClient(apiUrl, accessToken string) (*LotusClient, error)

func (*LotusClient) LotusClientCalcCommP

func (lotusClient *LotusClient) LotusClientCalcCommP(filepath string) *string

"lotus client commP " + carFilePath

func (*LotusClient) LotusClientGenCar

func (lotusClient *LotusClient) LotusClientGenCar(srcFilePath, destCarFilePath string, srcFilePathIsCar bool) error

"lotus client generate-car " + srcFilePath + " " + destCarFilePath

func (*LotusClient) LotusClientGetDealInfo added in v0.2.38

func (lotusClient *LotusClient) LotusClientGetDealInfo(dealCid string) (string, error)

func (*LotusClient) LotusClientImport

func (lotusClient *LotusClient) LotusClientImport(filepath string, isCar bool) (*string, error)

"lotus client import --car " + carFilePath

func (*LotusClient) LotusClientMinerQuery added in v0.2.29

func (lotusClient *LotusClient) LotusClientMinerQuery(minerFid string) (string, error)

func (*LotusClient) LotusClientQueryAsk added in v0.2.29

func (lotusClient *LotusClient) LotusClientQueryAsk(minerFid string) (*MinerConfig, error)

func (*LotusClient) LotusClientStartDeal

func (lotusClient *LotusClient) LotusClientStartDeal(carFile model.FileDesc, cost decimal.Decimal, pieceSize int64, dealConfig model.DealConfig, relativeEpoch int) (*string, *int, error)

func (*LotusClient) LotusGetCurrentEpoch

func (lotusClient *LotusClient) LotusGetCurrentEpoch() int

func (*LotusClient) LotusGetDealStatus

func (lotusClient *LotusClient) LotusGetDealStatus(state int) string

"lotus-miner storage-deals list -v | grep -a " + dealCid

func (*LotusClient) LotusGetMinerConfig added in v0.2.29

func (lotusClient *LotusClient) LotusGetMinerConfig(minerFid string) (*decimal.Decimal, *decimal.Decimal, *int, *int)

type LotusJsonRpcParams

type LotusJsonRpcParams struct {
	JsonRpc string        `json:"jsonrpc"`
	Method  string        `json:"method"`
	Params  []interface{} `json:"params"`
	Id      int           `json:"id"`
}

type LotusJsonRpcResult

type LotusJsonRpcResult struct {
	Id      int           `json:"id"`
	JsonRpc string        `json:"jsonrpc"`
	Error   *JsonRpcError `json:"error"`
}

type LotusMarket

type LotusMarket struct {
	ApiUrl       string
	AccessToken  string
	ClientApiUrl string
}

func GetLotusMarket

func GetLotusMarket(apiUrl, accessToken, clientApiUrl string) (*LotusMarket, error)

func (*LotusMarket) LotusGetDealOnChainStatus

func (lotusMarket *LotusMarket) LotusGetDealOnChainStatus(dealCid string) (string, string)

"lotus-miner storage-deals list -v | grep -a " + dealCid

func (*LotusMarket) LotusGetDealOnChainStatusFromDeals

func (lotusMarket *LotusMarket) LotusGetDealOnChainStatusFromDeals(deals []Deal, dealCid string) (string, string)

func (*LotusMarket) LotusGetDeals

func (lotusMarket *LotusMarket) LotusGetDeals() []Deal

func (*LotusMarket) LotusImportData

func (lotusMarket *LotusMarket) LotusImportData(dealCid string, filepath string) error

func (*LotusMarket) LotusMarketGetAsk

func (lotusMarket *LotusMarket) LotusMarketGetAsk() *MarketGetAskResultAsk

"lotus client query-ask " + minerFid

type LotusVersionResponse

type LotusVersionResponse struct {
	LotusJsonRpcResult
	Result LotusVersionResult `json:"result"`
}

type LotusVersionResult

type LotusVersionResult struct {
	Version    string
	APIVersion int
	BlockDelay int
}

type MarketGetAsk

type MarketGetAsk struct {
	LotusJsonRpcResult
	Result *MarketGetAskResult `json:"result"`
}

type MarketGetAskResult

type MarketGetAskResult struct {
	Ask MarketGetAskResultAsk
}

type MarketGetAskResultAsk

type MarketGetAskResultAsk struct {
	Price         string
	VerifiedPrice string
	MinPieceSize  int
	MaxPieceSize  int
	Miner         string
	Timestamp     int
	Expiry        int
	SeqNo         int
}

type MarketListIncompleteDeals

type MarketListIncompleteDeals struct {
	Id      int           `json:"id"`
	JsonRpc string        `json:"jsonrpc"`
	Result  []Deal        `json:"result"`
	Error   *JsonRpcError `json:"error"`
}

type MinerConfig added in v0.2.29

type MinerConfig struct {
	Price         decimal.Decimal
	VerifiedPrice decimal.Decimal
	MinPieceSize  int
	MaxPieceSize  int
}

Jump to

Keyboard shortcuts

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