go-ipfs: github.com/ipfs/go-ipfs/core/node Index | Files | Directories

package node

import "github.com/ipfs/go-ipfs/core/node"

Index

Package Files

builder.go core.go groups.go helpers.go identity.go ipns.go provider.go storage.go

Constants

const DefaultIpnsCacheSize = 128

Variables

var BaseLibP2P = fx.Options(
    fx.Provide(libp2p.UserAgent),
    fx.Provide(libp2p.PNet),
    fx.Provide(libp2p.ConnectionManager),
    fx.Provide(libp2p.DefaultTransports),

    fx.Provide(libp2p.Host),

    fx.Provide(libp2p.DiscoveryHandler),

    fx.Invoke(libp2p.PNetChecker),
)
var Core = fx.Options(
    fx.Provide(BlockService),
    fx.Provide(Dag),
    fx.Provide(resolver.NewBasicResolver),
    fx.Provide(Pinning),
    fx.Provide(Files),
)

Core groups basic IPFS services

var IPNS = fx.Options(
    fx.Provide(RecordValidator),
)

IPNS groups namesys related units

func BaseBlockstoreCtor Uses

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 BlockService Uses

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 Dag Uses

func Dag(bs blockservice.BlockService) format.DAGService

Dag creates new DAGService

func Datastore Uses

func Datastore(repo repo.Repo) datastore.Datastore

Datastore provides the datastore

func Files Uses

func Files(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo, dag format.DAGService) (*mfs.Root, error)

Files loads persisted MFS root

func FilestoreBlockstoreCtor Uses

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 Uses

func GcBlockstoreCtor(bb BaseBlocks) (gclocker blockstore.GCLocker, gcbs blockstore.GCBlockstore, bs blockstore.Blockstore)

GcBlockstoreCtor wraps the base blockstore with GC and Filestore layers

func IPFS Uses

func IPFS(ctx context.Context, bcfg *BuildCfg) fx.Option

IPFS builds a group of fx Options based on the passed BuildCfg

func Identity Uses

func Identity(cfg *config.Config) fx.Option

Identity groups units providing cryptographic identity

func IpnsRepublisher Uses

func IpnsRepublisher(repubPeriod time.Duration, recordLifetime time.Duration) func(lcProcess, namesys.NameSystem, repo.Repo, crypto.PrivKey) error

IpnsRepublisher runs new IPNS republisher service

func LibP2P Uses

func LibP2P(bcfg *BuildCfg, cfg *config.Config) fx.Option

func Namesys Uses

func Namesys(cacheSize int) func(rt routing.Routing, repo repo.Repo) (namesys.NameSystem, error)

Namesys creates new name system

func Networked Uses

func Networked(bcfg *BuildCfg, cfg *config.Config) fx.Option

func Offline Uses

func Offline(cfg *config.Config) fx.Option

Offline groups offline alternatives to Online units

func OfflineProviders Uses

func OfflineProviders(useStrategicProviding bool, reprovideStrategy string, reprovideInterval string) fx.Option

OfflineProviders groups units managing provider routing records offline

func Online Uses

func Online(bcfg *BuildCfg, cfg *config.Config) fx.Option

Online groups online-only units

func OnlineExchange Uses

func OnlineExchange(provide bool) interface{}

OnlineExchange creates new LibP2P backed block exchange (BitSwap)

func OnlineProviders Uses

func OnlineProviders(useStrategicProviding bool, reprovideStrategy string, reprovideInterval string) fx.Option

OnlineProviders groups units managing provider routing records online

func PeerID Uses

func PeerID(id peer.ID) func() peer.ID

func Pinning Uses

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 Uses

func PrivateKey(sk crypto.PrivKey) func(id peer.ID) (crypto.PrivKey, error)

PrivateKey loads the private key from config

func ProviderQueue Uses

func ProviderQueue(mctx helpers.MetricsCtx, lc fx.Lifecycle, repo repo.Repo) (*q.Queue, error)

ProviderQueue creates new datastore backed provider queue

func RecordValidator Uses

func RecordValidator(ps peerstore.Peerstore) record.Validator

RecordValidator provides namesys compatible routing record validator

func RepoConfig Uses

func RepoConfig(repo repo.Repo) (*config.Config, error)

RepoConfig loads configuration from the repo

func SimpleProvider Uses

func SimpleProvider(mctx helpers.MetricsCtx, lc fx.Lifecycle, queue *q.Queue, rt routing.Routing) provider.Provider

SimpleProvider creates new record provider

func SimpleProviderSys Uses

func SimpleProviderSys(isOnline bool) interface{}

SimpleProviderSys creates new provider system

func SimpleProviders Uses

func SimpleProviders(reprovideStrategy string, reprovideInterval string) fx.Option

SimpleProviders creates the simple provider/reprovider dependencies

func SimpleReprovider Uses

func SimpleReprovider(reproviderInterval time.Duration) interface{}

SimpleReprovider creates new reprovider

func Storage Uses

func Storage(bcfg *BuildCfg, cfg *config.Config) fx.Option

Storage groups units which setup datastore based persistence and blockstore layers

type BaseBlocks Uses

type BaseBlocks blockstore.Blockstore

BaseBlocks is the lower level blockstore without GC or Filestore layers

type BuildCfg Uses

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
}

Directories

PathSynopsis
helpers
libp2p

Package node imports 51 packages (graph) and is imported by 9 packages. Updated 2019-10-04. Refresh now. Tools for package owners.