modules

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2023 License: Apache-2.0, MIT Imports: 142 Imported by: 1

Documentation

Index

Constants

View Source
const (
	JWTSecretName   = "auth-jwt-private" //nolint:gosec
	KTJwtHmacSecret = "jwt-hmac-secret"  //nolint:gosec
)
View Source
const (
	// EnvWatchdogDisabled is an escape hatch to disable the watchdog explicitly
	// in case an OS/kernel appears to report incorrect information. The
	// watchdog will be disabled if the value of this env variable is 1.
	EnvWatchdogDisabled = "LOTUS_DISABLE_WATCHDOG"
)

Variables

View Source
var (
	StorageCounterDSPrefix = "/storage/nextid"
)
View Source
var UserAgent = simpleOpt(libp2p.UserAgent("boost-" + build.UserVersion()))

Functions

func APISecret

func APISecret(keystore types.KeyStore, lr lotus_repo.LockedRepo) (*dtypes.APIAlg, error)

func ClientBlockstore

func ClientBlockstore() dtypes.ClientBlockstore

TODO this should be removed.

func ConfigBootstrap

func ConfigBootstrap(peers []string) func() (dtypes.BootstrapPeers, error)

func ConnectSealingService

func ConnectSealingService(apiInfo string) func(mctx helpers.MetricsCtx, lc fx.Lifecycle) (MinerSealingService, error)

func ConnectStorageService

func ConnectStorageService(apiInfo string) func(mctx helpers.MetricsCtx, lc fx.Lifecycle) (MinerStorageService, error)

func CreateRetrievalTables added in v1.5.1

func CreateRetrievalTables(lc fx.Lifecycle, db *RetrievalSqlDB)

func Datastore

func Datastore(disableLog bool) func(lc fx.Lifecycle, mctx helpers.MetricsCtx, r lotus_repo.LockedRepo) (lotus_dtypes.MetadataDS, error)

func DealDeciderFn added in v1.7.0

func Graphsync

func Graphsync(parallelTransfersForStorage uint64, parallelTransfersForStoragePerPeer uint64, parallelTransfersForRetrieval uint64) func(mctx helpers.MetricsCtx, lc fx.Lifecycle, ibs dtypes.StagingBlockstore, h host.Host) dtypes.StagingGraphsync

func HandleBoostLibp2pDeals added in v1.6.0

func HandleBoostLibp2pDeals(lc fx.Lifecycle, h host.Host, prov *storagemarket.Provider, a v1api.FullNode, legacySP gfm_storagemarket.StorageProvider, idxProv *indexprovider.Wrapper, plDB *db.ProposalLogsDB, spApi sealingpipeline.API)

func HandleContractDeals added in v1.6.0

func HandleMigrateClientFunds

func HandleMigrateClientFunds(lc fx.Lifecycle, ds lotus_dtypes.MetadataDS, wallet full.WalletAPI, fundMgr *market.FundManager)

func HandleProposalLogCleaner

func HandleProposalLogCleaner(duration time.Duration) func(lc fx.Lifecycle, plDB *db.ProposalLogsDB)

Boost inserts a row into the DB for each deal proposal accepted or rejected. This method periodically cleans up the rows.

func HandleProtocolProxy added in v1.5.0

func HandleProtocolProxy(lc fx.Lifecycle, pp *protocolproxy.ProtocolProxy)

func HandleRetrieval added in v1.7.0

func HandleRetrieval(host host.Host, lc fx.Lifecycle, m retrievalmarket.RetrievalProvider)

func HandleRetrievalGraphsyncUpdates added in v1.5.1

func HandleRetrievalGraphsyncUpdates(duration time.Duration, stalledDuration time.Duration) func(lc fx.Lifecycle, db *rtvllog.RetrievalLogDB, m lotus_retrievalmarket.RetrievalProvider, dt dtypes.ProviderDataTransfer, gsur *server.GraphsyncUnpaidRetrieval)

Write graphsync retrieval updates to the database

func HandleRetrievalTransports added in v1.4.0

func HandleRetrievalTransports(lc fx.Lifecycle, l *lp2pimpl.TransportsListener)

func KeyStore

func KeyStore(lr lotus_repo.LockedRepo) (types.KeyStore, error)

func LockedRepo

func LockedRepo(lr lotus_repo.LockedRepo) func(lc fx.Lifecycle) lotus_repo.LockedRepo

func MemoryConstraints

func MemoryConstraints() system.MemoryConstraints

MemoryConstraints returns the memory constraints configured for this system.

func MemoryWatchdog

func MemoryWatchdog(lr lotus_repo.LockedRepo, lc fx.Lifecycle, constraints system.MemoryConstraints)

MemoryWatchdog starts the memory watchdog, applying the computed resource constraints.

func NewBoostDB

func NewBoostDB(r lotus_repo.LockedRepo) (*sql.DB, error)

func NewBoostGFMDAGStoreWrapper added in v1.7.0

func NewBoostGFMDAGStoreWrapper(w *mdagstore.Wrapper) stores.DAGStoreWrapper

func NewClientDatastore

func NewClientDatastore(ds lotus_dtypes.MetadataDS) dtypes.ClientDatastore

NewClientDatastore creates a datastore for the client to store its deals

func NewDealsDB

func NewDealsDB(sqldb *sql.DB) *db.DealsDB

func NewFundsDB

func NewFundsDB(sqldb *sql.DB) *db.FundsDB

func NewIndexBackedBlockstore added in v1.5.0

func NewIndexBackedBlockstore(cfg *config.Boost) func(lc fx.Lifecycle, dagst dagstore.Interface, ss *ShardSelector) (dtypes.IndexBackedBlockstore, error)

func NewLegacyStorageProvider added in v1.5.0

NewLegacyStorageProvider wraps lotus's storage provider function but additionally sets up the metadata announcement for legacy deals based off of Boost's configured protocols

func NewLogsDB

func NewLogsDB(logsSqlDB *LogSqlDB) *db.LogsDB

func NewLotusGFMProviderPieceStore added in v1.7.0

func NewLotusGFMProviderPieceStore(ps dtypes.ProviderPieceStore) lotus_dtypes.ProviderPieceStore

func NewOnlineBackupMgr added in v1.6.1

func NewOnlineBackupMgr(cfg *config.Boost) func(lc fx.Lifecycle, r lotus_repo.LockedRepo, ds lotus_dtypes.MetadataDS, dealsDB *sql.DB) *backupmgr.BackupMgr

func NewProposalLogsDB

func NewProposalLogsDB(sqldb *sql.DB) *db.ProposalLogsDB

func NewProtocolProxy added in v1.5.0

func NewProtocolProxy(cfg *config.Boost) func(h host.Host) (*protocolproxy.ProtocolProxy, error)

func NewProviderDataTransfer

NewProviderDataTransfer returns a data transfer manager

func NewProviderPieceStore added in v1.7.0

func NewProviderPieceStore(lc fx.Lifecycle, ds lotus_dtypes.MetadataDS) (dtypes.ProviderPieceStore, error)

NewProviderPieceStore creates a statestore for storing metadata about pieces shared by the storage and retrieval providers

func NewProviderTransferNetwork added in v1.6.1

func NewProviderTransferNetwork(h host.Host) dtypes.ProviderTransferNetwork

NewProviderTransferNetwork sets up the libp2p protocol networking for data transfer

func NewProviderTransport added in v1.7.0

func NewProviderTransport(h host.Host, gs dtypes.StagingGraphsync) dtypes.ProviderTransport

NewProviderTransport sets up a data transfer transport over graphsync

func NewRetrievalLogDB added in v1.5.1

func NewRetrievalLogDB(db *RetrievalSqlDB) *rtvllog.RetrievalLogDB

func NewSectorAccessor added in v1.6.1

func NewSectorAccessor(cfg *config.Boost) sectoraccessor.SectorAccessorConstructor

Use a caching sector accessor

func NewSectorStateDB added in v1.7.0

func NewSectorStateDB(sqldb *sql.DB) *db.SectorStateDB

func NewTracing added in v1.4.0

func NewTracing(cfg *config.Boost) func(lc fx.Lifecycle) (*tracing.Tracing, error)

func NewTransportsListener added in v1.4.0

func NewTransportsListener(cfg *config.Boost) func(h host.Host) (*lp2pimpl.TransportsListener, error)

func RecordValidator

func RecordValidator(ps peerstore.Peerstore) record.Validator

RecordValidator provides namesys compatible routing record validator

func RegisterClientValidator

func RegisterClientValidator(crv dtypes.ClientRequestValidator, dtm dtypes.ClientDataTransfer)

RegisterClientValidator is an initialization hook that registers the client request validator with the data transfer module as the validator for StorageDataTransferVoucher types

func ResourceManager added in v1.2.0

func ResourceManager(connMgrHi uint) func(lc fx.Lifecycle, repo repo.LockedRepo) (network.ResourceManager, error)

The code in this file is a direct copy from lotus. Unfortunately the lotus modules ResourceManager checks repo.RepoType().Type() == "FullNode", but the Boost node reports "Boost" as its type rather then "FullNode" so we need to change this one line

func RetrievalBlockstoreAccessor

func RetrievalBlockstoreAccessor(r repo.LockedRepo) (retrievalmarket.BlockstoreAccessor, error)

RetrievalBlockstoreAccessor returns the default retrieval blockstore accessor using the subdirectory `retrievals` under the repo.

func RetrievalClient

RetrievalClient creates a new retrieval client attached to the client blockstore

func RetrievalGraphsync added in v1.7.0

func RetrievalGraphsync(parallelTransfersForStorage uint64, parallelTransfersForStoragePerPeer uint64, parallelTransfersForRetrieval uint64) func(mctx lotus_helpers.MetricsCtx, lc fx.Lifecycle, ibs dtypes.IndexBackedBlockstore, h host.Host, net dtypes.ProviderTransferNetwork, dealDecider dtypes.RetrievalDealFilter, dagStore stores.DAGStoreWrapper, pstore dtypes.ProviderPieceStore, sa retrievalmarket.SectorAccessor, askGetter server.AskGetter) (*server.GraphsyncUnpaidRetrieval, error)

RetrievalGraphsync creates a graphsync instance used to serve retrievals.

func RetrievalNetwork added in v1.7.0

func RetrievalNetwork(h host.Host) rmnet.RetrievalMarketNetwork

func RetrievalPricingFunc added in v1.7.0

RetrievalPricingFunc configures the pricing function to use for retrieval deals.

func RetrievalProvider added in v1.6.0

RetrievalProvider creates a new retrieval provider attached to the provider blockstore

func SetAskGetter added in v1.6.1

func SetAskGetter(proxy *ProxyAskGetter, rp retrievalmarket.RetrievalProvider)

func SetShardSelectorFunc added in v1.6.1

func StorageBlockstoreAccessor

func StorageBlockstoreAccessor(importmgr dtypes.ClientImportMgr) storagemarket.BlockstoreAccessor

StorageBlockstoreAccessor returns the default storage blockstore accessor from the import manager.

func StorageNetworkName

func StorageNetworkName(ctx helpers.MetricsCtx, a v1api.FullNode) (dtypes.NetworkName, error)

Types

type Genesis

type Genesis func() (*types.BlockHeader, error)

type IdxProv added in v1.5.1

type IdxProv struct {
	fx.In

	fx.Lifecycle
	Datastore lotus_dtypes.MetadataDS
}

type JwtPayload

type JwtPayload struct {
	Allow []auth.Permission
}

type LogSqlDB

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

func NewLogsSqlDB

func NewLogsSqlDB(r repo.LockedRepo) (*LogSqlDB, error)

type MinerSealingService

type MinerSealingService lapi.StorageMiner

type MinerStorageService

type MinerStorageService lapi.StorageMiner

type ProxyAskGetter added in v1.6.1

type ProxyAskGetter struct {
	server.AskGetter
}

ProxyAskGetter is used to avoid circular dependencies: RetrievalProvider depends on RetrievalGraphsync, which depends on RetrievalProvider's GetAsk method. We create an AskGetter that returns zero-priced asks by default. Then we set the AskGetter to the RetrievalProvider after it's been created.

func NewAskGetter added in v1.6.1

func NewAskGetter() *ProxyAskGetter

func (*ProxyAskGetter) GetAsk added in v1.6.1

func (ag *ProxyAskGetter) GetAsk() *retrievalmarket.Ask

type RetrievalSqlDB added in v1.5.1

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

func NewRetrievalSqlDB added in v1.5.1

func NewRetrievalSqlDB(r repo.LockedRepo) (*RetrievalSqlDB, error)

type ShardSelector added in v1.6.1

type ShardSelector struct {
	Proxy  indexbs.ShardSelectorF
	Target indexbs.ShardSelectorF
}

ShardSelector helps to resolve a circular dependency: The IndexBackedBlockstore has a shard selector, which needs to query the RetrievalProviderNode's ask to find out if it's free to retrieve a particular piece. However the RetrievalProviderNode depends on the DAGStore which depends on IndexBackedBlockstore. So we

  • create a ShardSelector that has no dependencies with a default shard selection function that just selects no shards
  • later call SetShardSelectorFunc to create a real shard selector function with all its dependencies, and set it on the ShardSelector object.

func NewShardSelector added in v1.6.1

func NewShardSelector() *ShardSelector

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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