modules

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2021 License: Apache-2.0, MIT Imports: 120 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 = "EPIK_DISABLE_WATCHDOG"
)

Variables

View Source
var ManagerWorkPrefix = datastore.NewKey("/stmgr/calls")
View Source
var StorageCounterDSPrefix = "/storage/nextid"
View Source
var WorkerCallsPrefix = datastore.NewKey("/worker/calls")

Functions

func APISecret

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

func AddressSelector

func AddressSelector(addrConf *config.MinerAddressConfig) func() (*storage.AddressSelector, error)

func BadgerColdBlockstore

func BadgerColdBlockstore(lc fx.Lifecycle, r repo.LockedRepo) (dtypes.ColdBlockstore, error)

func BadgerHotBlockstore

func BadgerHotBlockstore(lc fx.Lifecycle, r repo.LockedRepo) (dtypes.HotBlockstore, error)

func BuiltinBootstrap

func BuiltinBootstrap() (dtypes.BootstrapPeers, error)

func BuiltinDrandConfig

func BuiltinDrandConfig() dtypes.DrandSchedule

func ChainBitswap

ChainBitswap uses a blockstore that bypasses all caches.

func ClientBlockstoreRetrievalStoreManager

func ClientBlockstoreRetrievalStoreManager(bs dtypes.ClientBlockstore) dtypes.ClientRetrievalStoreManager

ClientBlockstoreRetrievalStoreManager is the default version of the RetrievalStoreManager that runs on multistore

func ClientRetrievalStoreManager

func ClientRetrievalStoreManager(imgr dtypes.ClientImportMgr) dtypes.ClientRetrievalStoreManager

ClientRetrievalStoreManager is the default version of the RetrievalStoreManager that runs on multistore

func ConfigBootstrap

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

func Datastore

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

func DoSetGenesis

func DoSetGenesis(_ dtypes.AfterGenesisSet)

func DrandBootstrap

func DrandBootstrap(ds dtypes.DrandSchedule) (dtypes.DrandBootstrap, error)

func FallbackChainBlockstore

func FallbackChainBlockstore(cbs dtypes.ChainBlockstore) dtypes.ChainBlockstore

func FallbackStateBlockstore

func FallbackStateBlockstore(sbs dtypes.StateBlockstore) dtypes.StateBlockstore

func GetParams

func GetParams(spt abi.RegisteredSealProof) error

func Graphsync

func Graphsync(parallelTransfers uint64) func(mctx helpers.MetricsCtx, lc fx.Lifecycle, r repo.LockedRepo, clientBs dtypes.ClientBlockstore, chainBs dtypes.ExposedBlockstore, h host.Host) (dtypes.Graphsync, error)

Graphsync creates a graphsync instance from the given loader and storer

func HandleIncomingMessages

func HandleIncomingMessages(mctx helpers.MetricsCtx, lc fx.Lifecycle, ps *pubsub.PubSub, stmgr *stmgr.StateManager, mpool *messagepool.MessagePool, h host.Host, nn dtypes.NetworkName, bootstrapper dtypes.Bootstrapper)

func IpfsClientBlockstore

func IpfsClientBlockstore(ipfsMaddr string, onlineMode bool) func(helpers.MetricsCtx, fx.Lifecycle, dtypes.ClientImportMgr) (dtypes.ClientBlockstore, error)

IpfsClientBlockstore returns a ClientBlockstore implementation backed by an IPFS node. If ipfsMaddr is empty, a local IPFS node is assumed considering IPFS_PATH configuration. If ipfsMaddr is not empty, it will connect to the remote IPFS node with the provided multiaddress. The flag useForRetrieval indicates if the IPFS node will also be used for storing retrieving deals.

func KeyStore

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

func LoadGenesis

func LoadGenesis(genBytes []byte) func(dtypes.ChainBlockstore) Genesis

func LockedRepo

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

func MemoryConstraints

func MemoryConstraints() system.MemoryConstraints

MemoryConstraints returns the memory constraints configured for this system.

func MemoryWatchdog

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

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

func MinerAddress

func MinerAddress(ds dtypes.MetadataDS) (dtypes.MinerAddress, error)

func MinerID

func MinerID(ma dtypes.MinerAddress) (dtypes.MinerID, error)

func NewClientDatastore

func NewClientDatastore(ds dtypes.MetadataDS) dtypes.ClientDatastore

NewClientDatastore creates a datastore for the client to store its deals

func NewClientGraphsyncDataTransfer

func NewClientGraphsyncDataTransfer(lc fx.Lifecycle, h host.Host, gs dtypes.Graphsync, ds dtypes.MetadataDS, r repo.LockedRepo) (dtypes.ClientDataTransfer, error)

NewClientGraphsyncDataTransfer returns a data transfer manager that just uses the clients's Client DAG service for transfers

func NewDefaultMaxFeeFunc

func NewDefaultMaxFeeFunc(r repo.LockedRepo) dtypes.DefaultMaxFeeFunc

func NewGetSealConfigFunc

func NewGetSealConfigFunc(r repo.LockedRepo) (dtypes.GetSealingConfigFunc, error)

func NewLocalDiscovery

func NewLocalDiscovery(lc fx.Lifecycle, ds dtypes.MetadataDS) (*discoveryimpl.Local, error)

func NewProviderDAGServiceDataTransfer

func NewProviderDAGServiceDataTransfer(lc fx.Lifecycle, h host.Host, gs dtypes.StagingGraphsync, ds dtypes.MetadataDS, r repo.LockedRepo) (dtypes.ProviderDataTransfer, error)

NewProviderDAGServiceDataTransfer returns a data transfer manager that just uses the provider's Staging DAG service for transfers

func NewProviderPieceStore

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

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

func NewSetSealConfigFunc

func NewSetSealConfigFunc(r repo.LockedRepo) (dtypes.SetSealingConfigFunc, error)

func NewSlashFilter

func NewSlashFilter(ds dtypes.MetadataDS) *slashfilter.SlashFilter

func NewSyncer

func NewSyncer(params SyncerParams) (*chain.Syncer, error)

func OpenFilesystemJournal

func OpenFilesystemJournal(lr repo.LockedRepo, lc fx.Lifecycle, disabled journal.DisabledEvents) (journal.Journal, 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 RetrievalClient

RetrievalClient creates a new retrieval client attached to the client blockstore

func RetrievalProvider

RetrievalProvider creates a new retrieval provider attached to the provider blockstore

func RetrievalResolver

func RetrievalResolver(l *discoveryimpl.Local) discovery.PeerResolver

func RunChainExchange

func RunChainExchange(h host.Host, svc exchange.Server)

func RunChainSysMetrics

func RunChainSysMetrics(mctx helpers.MetricsCtx, lc fx.Lifecycle, reporter metrics2.Reporter)

func RunHello

func RunHello(mctx helpers.MetricsCtx, lc fx.Lifecycle, h host.Host, svc *hello.Service) error

func RunMinerMetrics

func RunMinerMetrics(mctx helpers.MetricsCtx, lc fx.Lifecycle, node api.FullNode, st *storage.Miner, minerAddress dtypes.MinerAddress, reporter metrics2.Reporter)

func RunMinerSysMetrics

func RunMinerSysMetrics(mctx helpers.MetricsCtx, lc fx.Lifecycle, reporter metrics2.Reporter)

func RunPeerMgr

func RunPeerMgr(mctx helpers.MetricsCtx, lc fx.Lifecycle, pmgr *peermgr.PeerMgr)

func SealProofType

func SealProofType(maddr dtypes.MinerAddress, fnapi lapi.FullNode) (abi.RegisteredSealProof, error)

func SectorIDCounter

func SectorIDCounter(ds dtypes.MetadataDS) sealing.SectorIDCounter

func SetGenesis

func SetGenesis(cs *store.ChainStore, g Genesis) (dtypes.AfterGenesisSet, error)

func StagingBlockstore

func StagingBlockstore(lc fx.Lifecycle, mctx helpers.MetricsCtx, r repo.LockedRepo) (dtypes.StagingBlockstore, error)

StagingBlockstore creates a blockstore for staging blocks for a miner in a storage deal, prior to sealing

func StagingDAG

StagingDAG is a DAGService for the StagingBlockstore

func StagingGraphsync

StagingGraphsync creates a graphsync instance which reads and writes blocks to the StagingBlockstore

func StorageMiner

func StorageMiner(fc config.MinerFeeConfig) func(params StorageMinerParams) (*storage.Miner, error)

func StorageNetworkName

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

func UniversalBlockstore

func UniversalBlockstore(lc fx.Lifecycle, mctx helpers.MetricsCtx, r repo.LockedRepo) (dtypes.UniversalBlockstore, error)

UniversalBlockstore returns a single universal blockstore that stores both chain data and state data. It can be backed by a blockstore directly (e.g. Badger), or by a Splitstore.

Types

type Genesis

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

func ErrorGenesis

func ErrorGenesis() Genesis

type JwtPayload

type JwtPayload struct {
	Allow []auth.Permission
}

type MpoolNonceAPI

type MpoolNonceAPI struct {
	fx.In

	StateAPI full.StateAPI
}

MpoolNonceAPI substitutes the mpool nonce with an implementation that doesn't rely on the mpool - it just gets the nonce from actor state

func (*MpoolNonceAPI) GetNonce

func (a *MpoolNonceAPI) GetNonce(addr address.Address) (uint64, error)

GetNonce gets the nonce from current chain head.

type RPCStateManager

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

func NewRPCStateManager

func NewRPCStateManager(api api.GatewayAPI) *RPCStateManager

func (*RPCStateManager) Call

func (*RPCStateManager) GetFlowchState

func (s *RPCStateManager) GetFlowchState(ctx context.Context, addr address.Address, ts *types.TipSet) (*types.Actor, flowch.State, error)

func (*RPCStateManager) GetPaychState

func (s *RPCStateManager) GetPaychState(ctx context.Context, addr address.Address, ts *types.TipSet) (*types.Actor, paych.State, error)

func (*RPCStateManager) LoadActorTsk

func (s *RPCStateManager) LoadActorTsk(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*types.Actor, error)

func (*RPCStateManager) LookupID

func (s *RPCStateManager) LookupID(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error)

func (*RPCStateManager) ResolveToKeyAddress

func (s *RPCStateManager) ResolveToKeyAddress(ctx context.Context, addr address.Address, ts *types.TipSet) (address.Address, error)

type RandomBeaconParams

type RandomBeaconParams struct {
	fx.In

	PubSub      *pubsub.PubSub `optional:"true"`
	Cs          *store.ChainStore
	DrandConfig dtypes.DrandSchedule
}

type StorageMinerParams

type StorageMinerParams struct {
	fx.In

	Lifecycle          fx.Lifecycle
	MetricsCtx         helpers.MetricsCtx
	API                lapi.FullNode
	Host               host.Host
	MetadataDS         dtypes.MetadataDS
	Sealer             sectorstorage.SectorManager
	SectorIDCounter    sealing.SectorIDCounter
	Verifier           ffiwrapper.Verifier
	GetSealingConfigFn dtypes.GetSealingConfigFunc
	Journal            journal.Journal
	AddrSel            *storage.AddressSelector
}

type SyncerParams

type SyncerParams struct {
	fx.In

	Lifecycle    fx.Lifecycle
	MetadataDS   dtypes.MetadataDS
	StateManager *stmgr.StateManager
	ChainXchg    exchange.Client
	SyncMgrCtor  chain.SyncManagerCtor
	Host         host.Host
	Beacon       beacon.Schedule
	Verifier     ffiwrapper.Verifier
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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