client

package
v0.0.0-...-e76b1b5 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package client - contains the client code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilecoinRetrievalClient

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

FilecoinRetrievalClient is an example implementation using the api, which holds information about the interaction of the Filecoin Retrieval Client with Filecoin Retrieval Gateways/Providers.

func NewFilecoinRetrievalClient

func NewFilecoinRetrievalClient(
	walletPrivKey string,
	lotusAPIAddr string,
	lotusAuthToken string,
	registerPrivKey string,
	registerAPIAddr string,
	registerAuthToken string,
) (*FilecoinRetrievalClient, error)

NewFilecoinRetrievalClient initialise the Filecoin Retrieval Client.

func (*FilecoinRetrievalClient) AddActivePeer

func (c *FilecoinRetrievalClient) AddActivePeer(targetID string) error

AddActivePeer adds an active peer by its ID

func (*FilecoinRetrievalClient) BlockPeer

func (c *FilecoinRetrievalClient) BlockPeer(targetID string)

BlockPeer blocks a peer

func (*FilecoinRetrievalClient) DHTDiscovery

func (c *FilecoinRetrievalClient) DHTDiscovery(cidStr string, targetID string) ([]cidoffer.SubCIDOffer, error)

DHTDiscovery performs a DHT discovery.

func (*FilecoinRetrievalClient) FastRetrieve

func (c *FilecoinRetrievalClient) FastRetrieve(cidStr string, location string, maxPrice *big.Int) error

func (*FilecoinRetrievalClient) GetPeerHistory

func (c *FilecoinRetrievalClient) GetPeerHistory(targetID string, from uint, to uint) []string

GetPeerRecentHistory gets the most recent history of a target peer ID.

func (*FilecoinRetrievalClient) GetPeerReputaion

func (c *FilecoinRetrievalClient) GetPeerReputaion(peerID string) (int64, bool, bool, error)

GetPeerReputaion gets the reputation of a target peer ID.

func (*FilecoinRetrievalClient) ListActivePeers

func (c *FilecoinRetrievalClient) ListActivePeers() []string

ListActivePeers lists all active peers

func (*FilecoinRetrievalClient) ListOffers

func (c *FilecoinRetrievalClient) ListOffers(cidStr string) ([]cidoffer.SubCIDOffer, error)

ListOffers lists offers by given cid

func (*FilecoinRetrievalClient) ResumePeer

func (c *FilecoinRetrievalClient) ResumePeer(targetID string)

ResumePeer resumes a peer

func (*FilecoinRetrievalClient) Retrieve

func (c *FilecoinRetrievalClient) Retrieve(digest string, location string) error

Retrieve retrieves a file to a given location

func (*FilecoinRetrievalClient) Search

func (c *FilecoinRetrievalClient) Search(location string) ([]string, error)

Search searches gateways that are in given location.

func (*FilecoinRetrievalClient) Shutdown

func (c *FilecoinRetrievalClient) Shutdown()

Shutdown shuts down the client's routine.

func (*FilecoinRetrievalClient) StandardDiscovery

func (c *FilecoinRetrievalClient) StandardDiscovery(cidStr string) ([]cidoffer.SubCIDOffer, error)

StandardDiscovery performs a standard discovery.

func (*FilecoinRetrievalClient) UnblockPeer

func (c *FilecoinRetrievalClient) UnblockPeer(targetID string)

UnblockPeer unblocks a peer

Jump to

Keyboard shortcuts

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