lib

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: Apache-2.0, MIT Imports: 47 Imported by: 0

Documentation

Overview

establish connection to a 'FullNode' filecoin API with cli configuration. Mostly with an eye towards ease of use for lotus users.

Index

Constants

This section is empty.

Variables

View Source
var ApiFlag = cli.StringFlag{
	Name:    "api",
	Usage:   "api endpoint, formatted as token:multiaddr",
	Value:   "",
	EnvVars: []string{"FULLNODE_API_INFO"},
}
View Source
var CarFlag = cli.StringFlag{
	Name:  "car",
	Usage: "car file location for data source",
	Value: "",
}
View Source
var VectorFlag = cli.StringFlag{
	Name:  "vector",
	Usage: "test-vector.json file location for data source",
	Value: "",
}

Functions

func GetAPI

func GetAPI(c *cli.Context) (api.FullNode, error)

func GetBlockstore added in v0.0.6

func GetCar added in v0.0.6

func GetHead added in v0.0.6

func GetHead(client api.FullNode) statediff.StateRootFunc

func GetVector added in v0.0.6

func NewCachingStore added in v0.0.8

func NewCachingStore(backing blockstore.Blockstore) blockstore.Blockstore

NewCachingStore creates a store with a local map cache

Types

type CarAPI added in v0.0.8

type CarAPI struct {
	impl.FullNodeAPI
	context.Context
	// contains filtered or unexported fields
}

func NewCarOpener added in v0.0.8

func NewCarOpener(c *cli.Context) (*CarAPI, error)

func (*CarAPI) ClientCalcCommP added in v0.0.8

func (ra *CarAPI) ClientCalcCommP(ctx context.Context, inpath string) (*api.CommPRet, error)

func (*CarAPI) ClientDataTransferUpdates added in v0.0.8

func (ra *CarAPI) ClientDataTransferUpdates(ctx context.Context) (<-chan api.DataTransferChannel, error)

func (*CarAPI) ClientDealSize added in v0.0.8

func (ra *CarAPI) ClientDealSize(ctx context.Context, root cid.Cid) (api.DataSize, error)

func (*CarAPI) ClientFindData added in v0.0.8

func (ra *CarAPI) ClientFindData(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error)

func (*CarAPI) ClientGenCar added in v0.0.8

func (ra *CarAPI) ClientGenCar(ctx context.Context, ref api.FileRef, outputPath string) error

func (*CarAPI) ClientGetDealInfo added in v0.0.8

func (ra *CarAPI) ClientGetDealInfo(ctx context.Context, d cid.Cid) (*api.DealInfo, error)

func (*CarAPI) ClientGetDealUpdates added in v0.0.8

func (ra *CarAPI) ClientGetDealUpdates(ctx context.Context) (<-chan api.DealInfo, error)

func (*CarAPI) ClientHasLocal added in v0.0.8

func (ra *CarAPI) ClientHasLocal(ctx context.Context, root cid.Cid) (bool, error)

func (*CarAPI) ClientImport added in v0.0.8

func (ra *CarAPI) ClientImport(ctx context.Context, ref api.FileRef) (*api.ImportRes, error)

func (*CarAPI) ClientImportLocal added in v0.0.8

func (ra *CarAPI) ClientImportLocal(ctx context.Context, f io.Reader) (cid.Cid, error)

func (*CarAPI) ClientListDataTransfers added in v0.0.8

func (ra *CarAPI) ClientListDataTransfers(ctx context.Context) ([]api.DataTransferChannel, error)

func (*CarAPI) ClientListDeals added in v0.0.8

func (ra *CarAPI) ClientListDeals(ctx context.Context) ([]api.DealInfo, error)

func (*CarAPI) ClientListImports added in v0.0.8

func (ra *CarAPI) ClientListImports(ctx context.Context) ([]api.Import, error)

func (*CarAPI) ClientMinerQueryOffer added in v0.0.8

func (ra *CarAPI) ClientMinerQueryOffer(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error)

func (*CarAPI) ClientQueryAsk added in v0.0.8

func (ra *CarAPI) ClientQueryAsk(ctx context.Context, p peer.ID, miner address.Address) (*storagemarket.StorageAsk, error)

func (*CarAPI) ClientRemoveImport added in v0.0.8

func (ra *CarAPI) ClientRemoveImport(ctx context.Context, importID multistore.StoreID) error

func (*CarAPI) ClientRetrieve added in v0.0.8

func (ra *CarAPI) ClientRetrieve(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error

func (*CarAPI) ClientRetrieveTryRestartInsufficientFunds added in v0.0.8

func (ra *CarAPI) ClientRetrieveTryRestartInsufficientFunds(ctx context.Context, paymentChannel address.Address) error

func (*CarAPI) ClientRetrieveWithEvents added in v0.0.8

func (ra *CarAPI) ClientRetrieveWithEvents(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) (<-chan marketevents.RetrievalEvent, error)

func (*CarAPI) ClientStartDeal added in v0.0.8

func (ra *CarAPI) ClientStartDeal(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error)

func (*CarAPI) ComputeGasOutputs added in v0.0.8

func (ra *CarAPI) ComputeGasOutputs(gasUsed, gasLimit int64, baseFee, feeCap, gasPremium abi.TokenAmount) vm.GasOutputs

func (*CarAPI) Store added in v0.0.8

func (ra *CarAPI) Store() adt.Store

type Datasource added in v0.0.8

type Datasource interface {
	Store() blockstore.Blockstore
	Head(ctx context.Context) cid.Cid
	CidAtHeight(ctx context.Context, h int) (cid.Cid, error)
	Reload() error
}

Datasource is the interface for loading data to share with stateexplorer when needed.

func Lazy added in v0.0.8

func Lazy(c *cli.Context) (Datasource, error)

type Postconditions added in v0.0.6

type Postconditions struct {
	StateTree *StateTree `json:"state_tree"`
}

Postconditions contain a representation of VM state at th end of the test

type Preconditions added in v0.0.6

type Preconditions struct {
	StateTree *StateTree `json:"state_tree"`
}

type StateTree added in v0.0.6

type StateTree struct {
	RootCID cid.Cid `json:"root_cid"`
}

type TestVector added in v0.0.6

type TestVector struct {
	CAR string `json:"car"`

	Pre  *Preconditions  `json:"preconditions"`
	Post *Postconditions `json:"postconditions"`
}

Jump to

Keyboard shortcuts

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