lib

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2021 License: Apache-2.0, MIT Imports: 57 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 NewSqlFlag = cli.StringFlag{
	Name:  "annotatedSql",
	Usage: "Postgress connection for archivial lotus data source",
	Value: "",
}
View Source
var NoCacheFlag = cli.BoolFlag{
	Name:  "nocache",
	Usage: "disable datastore cache layer",
	Value: false,
}
View Source
var SqlFlag = cli.StringFlag{
	Name:  "sql",
	Usage: "sql connection string for data source",
	Value: "",
}
View Source
var VectorFlag = cli.StringFlag{
	Name:  "vector",
	Usage: "test-vector.json file location for data source",
	Value: "",
}

Functions

func DB added in v0.0.13

func DB(connStr string) *pgxpool.Pool

func GetAPI

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

func GetBlockstore added in v0.0.6

func GetBlockstore(c *cli.Context) (api.FullNode, statediff.StateRootFunc, blockstore.Blockstore, error)

func GetCar added in v0.0.6

func GetCar(c *cli.Context) (statediff.StateRootFunc, blockstore.Blockstore, error)

func GetHead added in v0.0.6

func GetHead(client api.FullNode) statediff.StateRootFunc

func GetNewSql added in v0.0.19

func GetNewSql(c *cli.Context) (statediff.StateRootFunc, blockstore.Blockstore, error)

func GetSql added in v0.0.13

func GetSql(c *cli.Context) (statediff.StateRootFunc, blockstore.Blockstore, error)

func GetVector added in v0.0.6

func GetVector(c *cli.Context) (statediff.StateRootFunc, blockstore.Blockstore, error)

func Lazy added in v0.0.8

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

func NewCachingStore added in v0.0.8

func NewCachingStore(backing blockstore.Blockstore) blockstore.Blockstore

NewCachingStore creates a store with a local map cache

func NewSqlBlockStore added in v0.0.13

func NewSqlBlockStore(connstr string) (blockstore.Blockstore, statediff.StateRootFunc, error)

Types

type CarAPI added in v0.0.8

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

func NewOpener added in v0.0.13

func NewOpener(c *cli.Context, roots statediff.StateRootFunc, db blockstore.Blockstore) (*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 imports.ID) 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 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 SqlBlockstore added in v0.0.13

type SqlBlockstore struct {
	// contains filtered or unexported fields
}

func (*SqlBlockstore) AllKeysChan added in v0.0.13

func (sbs *SqlBlockstore) AllKeysChan(ctx context.Context) (<-chan cid.Cid, error)

func (*SqlBlockstore) DeleteBlock added in v0.0.13

func (sbs *SqlBlockstore) DeleteBlock(cid.Cid) error

func (*SqlBlockstore) Get added in v0.0.13

func (sbs *SqlBlockstore) Get(c cid.Cid) (blocks.Block, error)

func (*SqlBlockstore) GetSize added in v0.0.13

func (sbs *SqlBlockstore) GetSize(c cid.Cid) (size int, err error)

func (*SqlBlockstore) Has added in v0.0.13

func (sbs *SqlBlockstore) Has(c cid.Cid) (has bool, err error)

func (*SqlBlockstore) HashOnRead added in v0.0.13

func (sbs *SqlBlockstore) HashOnRead(enabled bool)

HashOnRead specifies if every read block should be rehashed to make sure it matches its CID.

func (*SqlBlockstore) Put added in v0.0.13

func (sbs *SqlBlockstore) Put(b blocks.Block) (err error)

Put puts a given block to the underlying datastore

func (*SqlBlockstore) PutMany added in v0.0.13

func (sbs *SqlBlockstore) PutMany(blks []blocks.Block) error

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"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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