stub

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Asks

type Asks struct {
}

Asks stub.

func (*Asks) Get

func (a *Asks) Get(ctx context.Context) (*ask.Index, error)

Get returns the current index of available asks.

func (*Asks) Query

func (a *Asks) Query(ctx context.Context, query ask.Query) ([]ask.StorageAsk, error)

Query executes a query to retrieve active Asks.

type Client

type Client struct {
	Asks       *Asks
	Miners     *Miners
	Faults     *Faults
	Deals      *Deals
	Wallet     *Wallet
	Reputation *Reputation
}

Client provides the client api.

func NewClient

func NewClient(target string, opts ...grpc.DialOption) (*Client, error)

NewClient starts the client.

func (*Client) Close

func (c *Client) Close() error

Close closes the client's grpc connection and cancels any active requests.

type Deals

type Deals struct {
}

Deals provides an API for managing deals and storing data.

func (*Deals) Retrieve

func (d *Deals) Retrieve(ctx context.Context, waddr string, cid cid.Cid) (io.Reader, error)

Retrieve is used to fetch data from filecoin.

func (*Deals) Store

func (d *Deals) Store(ctx context.Context, addr string, data io.Reader, dealConfigs []deals.StorageDealConfig, duration uint64) ([]cid.Cid, []deals.StorageDealConfig, error)

Store creates a proposal deal for data using wallet addr to all miners indicated by dealConfigs for duration epochs.

func (*Deals) Watch

func (d *Deals) Watch(ctx context.Context, proposals []cid.Cid) (<-chan client.WatchEvent, error)

Watch returnas a channel with state changes of indicated proposals.

type Faults

type Faults struct {
}

Faults provides an API for viewing faults data.

func (*Faults) Get

func (s *Faults) Get(ctx context.Context) (*faults.IndexSnapshot, error)

Get returns the current index of miner faults data.

type Miners

type Miners struct {
}

Miners provides an API for viewing miner data.

func (*Miners) Get

func (a *Miners) Get(ctx context.Context) (*miner.IndexSnapshot, error)

Get returns the current index of available asks.

type Reputation

type Reputation struct {
}

Reputation provides an API for viewing reputation data.

func (*Reputation) AddSource

func (r *Reputation) AddSource(ctx context.Context, id string, maddr ma.Multiaddr) error

AddSource adds a new external Source to be considered for reputation generation.

func (*Reputation) GetTopMiners

func (r *Reputation) GetTopMiners(ctx context.Context, limit int) ([]reputation.MinerScore, error)

GetTopMiners gets the top n miners with best score.

type Wallet

type Wallet struct {
}

Wallet provides an API for managing filecoin wallets.

func (*Wallet) NewWallet

func (w *Wallet) NewWallet(ctx context.Context, typ string) (string, error)

NewWallet creates a new filecoin wallet [bls|secp256k1].

func (*Wallet) WalletBalance

func (w *Wallet) WalletBalance(ctx context.Context, address string) (int64, error)

WalletBalance gets a filecoin wallet's balance.

Jump to

Keyboard shortcuts

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