fcrgatewayadmin

package
v0.0.0-...-561f640 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package fcrgatewayadmin - is a Gateway Admin library for FileCoin Secondary Retrieval.

It's designed to be imported by an application which requires to communicate with and administer Retrieval Gateways in FileCoin blockchain network.

Index

Constants

View Source
const (
	// DefaultTCPInactivityTimeout is the default TCP timeout
	DefaultTCPInactivityTimeout = 100 * time.Millisecond
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FilecoinRetrievalGatewayAdmin

type FilecoinRetrievalGatewayAdmin struct {
	Settings GatewayAdminSettings

	// List of gateways this admin is in use
	ActiveGateways     map[string]register.GatewayRegistrar
	ActiveGatewaysLock sync.RWMutex

	AdminApiCaller adminapi.AdminApi
}

FilecoinRetrievalGatewayAdmin is an example implementation using the api, which holds information about the interaction of the Filecoin Retrieval Gateway Admin with Filecoin Retrieval Gateways.

func NewFilecoinRetrievalGatewayAdmin

func NewFilecoinRetrievalGatewayAdmin(settings GatewayAdminSettings) *FilecoinRetrievalGatewayAdmin

NewFilecoinRetrievalGatewayAdmin initialise the Filecoin Retreival Gateway Admin library

func (*FilecoinRetrievalGatewayAdmin) ForceUpdate

func (c *FilecoinRetrievalGatewayAdmin) ForceUpdate(gatewayID *nodeid.NodeID) error

ForceUpdate forces the provider to update its internal register

func (*FilecoinRetrievalGatewayAdmin) GetCIDOffersList

func (c *FilecoinRetrievalGatewayAdmin) GetCIDOffersList() ([]cidoffer.CIDOffer, error)

GetCIDOffersList requests a Gateway's current list of CID Offers.

func (*FilecoinRetrievalGatewayAdmin) InitialiseGateway

func (c *FilecoinRetrievalGatewayAdmin) InitialiseGateway(gatewayRegistrar register.GatewayRegistrar, gatewayPrivKey *fcrcrypto.KeyPair, gatewayPrivKeyVer *fcrcrypto.KeyVersion) error

InitialiseGateway initialise a given gateway

func (*FilecoinRetrievalGatewayAdmin) InitialiseGatewayV2

func (c *FilecoinRetrievalGatewayAdmin) InitialiseGatewayV2(
	gatewayRegistrar register.GatewayRegistrar,
	gatewayPrivKey *fcrcrypto.KeyPair,
	gatewayPrivKeyVer *fcrcrypto.KeyVersion,
	lotusWalletPrivateKey string,
	lotusAP string,
	lotusAuthToken string,
) error

InitialiseGatewayV2 initialise a given v2 gateway

func (*FilecoinRetrievalGatewayAdmin) ListDHTOffer

func (c *FilecoinRetrievalGatewayAdmin) ListDHTOffer(gatewayID *nodeid.NodeID) error

ListDHTOffer asks the gateway to list dht offer from providers

func (*FilecoinRetrievalGatewayAdmin) ResetClientReputation

func (c *FilecoinRetrievalGatewayAdmin) ResetClientReputation(_ *nodeid.NodeID) error

ResetClientReputation requests a Gateway to initialise a client's reputation to the default value.

func (*FilecoinRetrievalGatewayAdmin) SetClientReputation

func (c *FilecoinRetrievalGatewayAdmin) SetClientReputation(_ *nodeid.NodeID, _ int64) error

SetClientReputation requests a Gateway to set a client's reputation to a specified value.

func (*FilecoinRetrievalGatewayAdmin) UpdateGatewaySupportedFeatures

func (c *FilecoinRetrievalGatewayAdmin) UpdateGatewaySupportedFeatures(gatewayRegistrar register.GatewayRegistrar, providers []nodeid.NodeID) error

type GatewayAdminSettings

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

GatewayAdminSettings holds the library configuration

func (GatewayAdminSettings) BlockchainPrivateKey

func (c GatewayAdminSettings) BlockchainPrivateKey() *fcrcrypto.KeyPair

BlockchainPrivateKey returns the BlockchainPrivateKey

func (GatewayAdminSettings) EstablishmentTTL

func (c GatewayAdminSettings) EstablishmentTTL() int64

EstablishmentTTL returns the establishmentTTL

func (GatewayAdminSettings) GatewayAdminPrivateKey

func (c GatewayAdminSettings) GatewayAdminPrivateKey() *fcrcrypto.KeyPair

GatewayAdminPrivateKey returns the GatewayAdminPrivateKey

func (GatewayAdminSettings) GatewayAdminPrivateKeyVer

func (c GatewayAdminSettings) GatewayAdminPrivateKeyVer() *fcrcrypto.KeyVersion

GatewayAdminPrivateKeyVer returns the GatewayAdminKeyVer

func (GatewayAdminSettings) RegisterURL

func (c GatewayAdminSettings) RegisterURL() string

RegisterURL is the URL to the register service

type SettingsBuilder

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

SettingsBuilder holds the library configuration

func CreateSettings

func CreateSettings() *SettingsBuilder

CreateSettings creates an object with the default settings.

func (*SettingsBuilder) Build

Build creates a settings object and initialises the logging system.

func (*SettingsBuilder) SetBlockchainPrivateKey

func (f *SettingsBuilder) SetBlockchainPrivateKey(bcPkey *fcrcrypto.KeyPair)

SetBlockchainPrivateKey sets the blockchain private key.

func (*SettingsBuilder) SetGatewayAdminPrivateKey

func (f *SettingsBuilder) SetGatewayAdminPrivateKey(rPkey *fcrcrypto.KeyPair, ver *fcrcrypto.KeyVersion)

SetGatewayAdminPrivateKey sets the private key used for authenticating to the gateway

func (*SettingsBuilder) SetLogging

func (f *SettingsBuilder) SetLogging(logLevel string, logTarget string, logServiceName string)

SetLogging sets the log level and target.

func (*SettingsBuilder) SetRegisterURL

func (f *SettingsBuilder) SetRegisterURL(regURL string)

SetRegisterURL sets the URL of the register service

type VersionInfo

type VersionInfo struct {
	Version   string
	BuildDate string
}

VersionInfo holds the version information for the Filecoin Retrieval Client library.

func GetVersion

func GetVersion() VersionInfo

GetVersion returns the static build information.

Jump to

Keyboard shortcuts

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