client

package
v0.0.0-...-be0f657 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: MIT Imports: 24 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 {
	// contains filtered or unexported fields
}

Asks provides an API for viewing asks data

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
	Slashing   *Slashing
	Deals      *Deals
	Wallet     *Wallet
	Reputation *Reputation
	// contains filtered or unexported fields
}

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 {
	// contains filtered or unexported fields
}

Deals provides an API for managing deals and storing data

func (*Deals) Store

func (d *Deals) Store(ctx context.Context, addr string, data io.Reader, dealConfigs []deals.DealConfig, duration uint64) ([]cid.Cid, []deals.DealConfig, 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 WatchEvent, error)

Watch returnas a channel with state changes of indicated proposals

type Miners

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

Miners provides an API for viewing miner data

func (*Miners) Get

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

Get returns the current index of available asks

type Reputation

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

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 Slashing

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

Slashing provides an API for viewing slashing data

func (*Slashing) Get

func (s *Slashing) Get(ctx context.Context) (*slashing.Index, error)

Get returns the current index of miner slashes data

type Wallet

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

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

type WatchEvent

type WatchEvent struct {
	Deal deals.DealInfo
	Err  error
}

WatchEvent is used to send data or error values for Watch

Jump to

Keyboard shortcuts

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