node

package
v0.4.21-rc1 Latest Latest
Warning

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

Go to latest
Published: May 20, 2019 License: Apache-2.0, MIT Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultIpnsCacheSize = 128

Variables

Core groups basic IPFS services

IPNS groups namesys related units

Offline groups offline alternatives to Online 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 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 Dag

func Dag(bs blockservice.BlockService) format.DAGService

Dag creates new DAGService

func Datastore

func Datastore(repo repo.Repo) datastore.Datastore

Datastore provides the datastore

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 IPFS

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

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

func Identity

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

Identity groups units providing cryptographic identity

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 LibP2P

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

func Namesys

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

Namesys creates new name system

func Networked

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

func Online

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

Online groups online-only units

func OnlineExchange

func OnlineExchange(mctx helpers.MetricsCtx, lc fx.Lifecycle, host host.Host, rt routing.IpfsRouting, bs blockstore.GCBlockstore) exchange.Interface

OnlineExchange creates new LibP2P backed block exchange (BitSwap)

func PeerID

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

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

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

PrivateKey loads the private key from config

func ProviderCtor

func ProviderCtor(mctx helpers.MetricsCtx, lc fx.Lifecycle, queue *provider.Queue, rt routing.IpfsRouting) provider.Provider

ProviderCtor creates new record provider

func ProviderQueue

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

ProviderQueue creates new datastore backed provider queue

func Providers

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

Providers groups units managing provider routing records

func RecordValidator

func RecordValidator(ps peerstore.Peerstore) record.Validator

RecordValidator provides namesys compatible routing record validator

func RepoConfig

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

RepoConfig loads configuration from the repo

func Reprovider

func Reprovider(lp lcProcess, reprovider *reprovide.Reprovider) error

Reprovider runs the reprovider service

func ReproviderCtor

func ReproviderCtor(reproviderInterval time.Duration) func(helpers.MetricsCtx, fx.Lifecycle, routing.IpfsRouting, reprovide.KeyChanFunc) (*reprovide.Reprovider, error)

ReproviderCtor creates new reprovider

func Storage

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

Storage groups units which setup datastore based persistence and blockstore layers

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
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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