Documentation ¶
Index ¶
- Constants
- Variables
- func BaseBlockstoreCtor(cacheOpts blockstore.CacheOpts, nilRepo bool, hashOnRead bool) ...
- func BatchedProviderSys(isOnline bool, reprovideInterval string) interface{}
- func BlockService(lc fx.Lifecycle, bs blockstore.Blockstore, rem exchange.Interface) blockservice.BlockService
- func DNSResolver(cfg *config.Config) (*madns.Resolver, error)
- func Dag(bs blockservice.BlockService) format.DAGService
- func Datastore(repo repo.Repo) datastore.Datastore
- func FetcherConfig(bs blockservice.BlockService) fetchersOut
- func Files(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo, ...) (*mfs.Root, error)
- func FilestoreBlockstoreCtor(repo repo.Repo, bb BaseBlocks) (gclocker blockstore.GCLocker, gcbs blockstore.GCBlockstore, ...)
- func GcBlockstoreCtor(bb BaseBlocks) (gclocker blockstore.GCLocker, gcbs blockstore.GCBlockstore, ...)
- func Graphsync(lc fx.Lifecycle, mctx helpers.MetricsCtx, host libp2p.Host, ...) graphsync.GraphExchange
- func IPFS(ctx context.Context, bcfg *BuildCfg) fx.Option
- func Identity(cfg *config.Config) fx.Option
- func IpnsRepublisher(repubPeriod time.Duration, recordLifetime time.Duration) func(lcProcess, namesys.NameSystem, repo.Repo, crypto.PrivKey) error
- func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option
- func Namesys(cacheSize int) ...
- func Networked(bcfg *BuildCfg, cfg *config.Config) fx.Option
- func Offline(cfg *config.Config) fx.Option
- func OfflineProviders(useStrategicProviding bool, useBatchedProviding bool, reprovideStrategy string, ...) fx.Option
- func Online(bcfg *BuildCfg, cfg *config.Config) fx.Option
- func OnlineExchange(cfg *config.Config, provide bool) interface{}
- func OnlineProviders(useStrategicProviding bool, useBatchedProviding bool, reprovideStrategy string, ...) fx.Option
- func PeerID(id peer.ID) func() peer.ID
- func PeerWith(peers ...peer.AddrInfo) fx.Option
- func Peering(lc fx.Lifecycle, host host.Host) *peering.PeeringService
- func Pinning(bstore blockstore.Blockstore, ds format.DAGService, repo repo.Repo) (pin.Pinner, error)
- func PrivateKey(sk crypto.PrivKey) func(id peer.ID) (crypto.PrivKey, error)
- func ProviderQueue(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo) (*q.Queue, error)
- func RecordValidator(ps peerstore.Peerstore) record.Validator
- func RepoConfig(repo repo.Repo) (*config.Config, error)
- func SimpleProvider(mctx helpers.MetricsCtx, lc fx.Lifecycle, queue *q.Queue, rt routing.Routing) provider.Provider
- func SimpleProviderSys(isOnline bool) interface{}
- func SimpleProviders(reprovideStrategy string, reprovideInterval string) fx.Option
- func SimpleReprovider(reproviderInterval time.Duration) interface{}
- func Storage(bcfg *BuildCfg, cfg *config.Config) fx.Option
- type BaseBlocks
- type BuildCfg
Constants ¶
const ( // Docs: https://github.com/ipfs/go-ipfs/blob/master/docs/config.md#internalbitswap DefaultEngineBlockstoreWorkerCount = 128 DefaultTaskWorkerCount = 8 DefaultEngineTaskWorkerCount = 8 DefaultMaxOutstandingBytesPerPeer = 1 << 20 )
const DefaultIpnsCacheSize = 128
Variables ¶
var BaseLibP2P = fx.Options( fx.Provide(libp2p.UserAgent), fx.Provide(libp2p.PNet), fx.Provide(libp2p.ConnectionManager), fx.Provide(libp2p.Host), fx.Provide(libp2p.MultiaddrResolver), fx.Provide(libp2p.DiscoveryHandler), fx.Invoke(libp2p.PNetChecker), )
var Core = fx.Options( fx.Provide(BlockService), fx.Provide(Dag), fx.Provide(FetcherConfig), fx.Provide(Pinning), fx.Provide(Files), )
Core groups basic IPFS services
var IPNS = fx.Options( fx.Provide(RecordValidator), )
IPNS groups namesys related units
Functions ¶
func BaseBlockstoreCtor ¶
func BaseBlockstoreCtor(cacheOpts blockstore.CacheOpts, nilRepo bool, hashOnRead bool) func(mctx helpers.MetricsCtx, repo repo.Repo, lc fx.Lifecycle) (bs BaseBlocks, err error)
BaseBlockstoreCtor creates cached blockstore backed by the provided datastore
func BatchedProviderSys ¶ added in v0.9.0
BatchedProviderSys creates new provider system
func BlockService ¶
func BlockService(lc fx.Lifecycle, bs blockstore.Blockstore, rem exchange.Interface) blockservice.BlockService
BlockService creates new blockservice which provides an interface to fetch content-addressable blocks
func FetcherConfig ¶ added in v0.10.0
func FetcherConfig(bs blockservice.BlockService) fetchersOut
FetcherConfig returns a fetcher config that can build new fetcher instances
func Files ¶
func Files(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo, dag format.DAGService) (*mfs.Root, error)
Files loads persisted MFS root
func FilestoreBlockstoreCtor ¶
func FilestoreBlockstoreCtor(repo repo.Repo, bb BaseBlocks) (gclocker blockstore.GCLocker, gcbs blockstore.GCBlockstore, bs blockstore.Blockstore, fstore *filestore.Filestore)
GcBlockstoreCtor wraps GcBlockstore and adds Filestore support
func GcBlockstoreCtor ¶
func GcBlockstoreCtor(bb BaseBlocks) (gclocker blockstore.GCLocker, gcbs blockstore.GCBlockstore, bs blockstore.Blockstore)
GcBlockstoreCtor wraps the base blockstore with GC and Filestore layers
func Graphsync ¶ added in v0.5.0
func Graphsync(lc fx.Lifecycle, mctx helpers.MetricsCtx, host libp2p.Host, bs blockstore.GCBlockstore) graphsync.GraphExchange
Graphsync constructs a graphsync
func IpnsRepublisher ¶
func IpnsRepublisher(repubPeriod time.Duration, recordLifetime time.Duration) func(lcProcess, namesys.NameSystem, repo.Repo, crypto.PrivKey) error
IpnsRepublisher runs new IPNS republisher service
func Namesys ¶
func Namesys(cacheSize int) func(rt routing.Routing, rslv *madns.Resolver, repo repo.Repo) (namesys.NameSystem, error)
Namesys creates new name system
func OfflineProviders ¶ added in v0.5.0
func OfflineProviders(useStrategicProviding bool, useBatchedProviding bool, reprovideStrategy string, reprovideInterval string) fx.Option
OfflineProviders groups units managing provider routing records offline
func OnlineExchange ¶
OnlineExchange creates new LibP2P backed block exchange (BitSwap)
func OnlineProviders ¶ added in v0.5.0
func OnlineProviders(useStrategicProviding bool, useBatchedProviding bool, reprovideStrategy string, reprovideInterval string) fx.Option
OnlineProviders groups units managing provider routing records online
func PeerWith ¶ added in v0.6.0
PeerWith configures the peering service to peer with the specified peers.
func Peering ¶ added in v0.6.0
Peering constructs the peering service and hooks it into fx's lifetime management system.
func Pinning ¶
func Pinning(bstore blockstore.Blockstore, ds format.DAGService, repo repo.Repo) (pin.Pinner, error)
Pinning creates new pinner which tells GC which blocks should be kept
func PrivateKey ¶
PrivateKey loads the private key from config
func ProviderQueue ¶
ProviderQueue creates new datastore backed provider queue
func RecordValidator ¶
RecordValidator provides namesys compatible routing record validator
func RepoConfig ¶
RepoConfig loads configuration from the repo
func SimpleProvider ¶ added in v0.5.0
func SimpleProvider(mctx helpers.MetricsCtx, lc fx.Lifecycle, queue *q.Queue, rt routing.Routing) provider.Provider
SimpleProvider creates new record provider
func SimpleProviderSys ¶ added in v0.5.0
func SimpleProviderSys(isOnline bool) interface{}
SimpleProviderSys creates new provider system
func SimpleProviders ¶ added in v0.5.0
SimpleProviders creates the simple provider/reprovider dependencies
func SimpleReprovider ¶ added in v0.5.0
SimpleReprovider creates new reprovider
Types ¶
type BaseBlocks ¶
type BaseBlocks blockstore.Blockstore
BaseBlocks is the lower level blockstore without GC or Filestore layers
type BuildCfg ¶
type BuildCfg struct { // If online is set, the node will have networking enabled Online bool // ExtraOpts is a map of extra options used to configure the ipfs nodes creation ExtraOpts map[string]bool // If permanent then node should run more expensive processes // that will improve performance in long run Permanent bool // DisableEncryptedConnections disables connection encryption *entirely*. // DO NOT SET THIS UNLESS YOU'RE TESTING. DisableEncryptedConnections bool // If NilRepo is set, a Repo backed by a nil datastore will be constructed NilRepo bool Routing libp2p.RoutingOption Host libp2p.HostOption Repo repo.Repo }