core

package
v0.0.0-...-2963f48 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2015 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const IpnsValidatorTag = "ipns"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigOption

type ConfigOption func(ctx context.Context) (*IpfsNode, error)

func Offline

func Offline(cfg *config.Config) ConfigOption

func Online

func Online(cfg *config.Config) ConfigOption

func Standard

func Standard(cfg *config.Config, online bool) ConfigOption

DEPRECATED: use Online, Offline functions

type IpfsNode

type IpfsNode struct {

	// Self
	Identity peer.ID // the local node's identity

	// TODO abstract as repo.Repo
	Config    *config.Config                // the node's configuration
	Datastore ds2.ThreadSafeDatastoreCloser // the local datastore

	// Local node
	Pinning pin.Pinner // the pinning manager
	Mounts  Mounts     // current mount state, if any.

	// Services
	Peerstore  peer.Peerstore       // storage for other Peer instances
	Blockstore bstore.Blockstore    // the block store (lower level)
	Blocks     *bserv.BlockService  // the block service, get/add blocks.
	DAG        merkledag.DAGService // the merkle dag service, get/add objects.
	Resolver   *path.Resolver       // the path resolution system

	// Online
	PrivateKey  ic.PrivKey          // the local node's private Key
	PeerHost    p2phost.Host        // the network host (server+client)
	Routing     routing.IpfsRouting // the routing system. recommend ipfs-dht
	Exchange    exchange.Interface  // the block exchange + strategy (bitswap)
	Namesys     namesys.NameSystem  // the name system, resolves paths to hashes
	Diagnostics *diag.Diagnostics   // the diagnostics service
	Reprovider  *rp.Reprovider      // the value reprovider system

	ctxgroup.ContextGroup

	// dht allows node to Bootstrap when dht is present
	// TODO privatize before merging. This is here temporarily during the
	// migration of the TestNet constructor
	DHT *dht.IpfsDHT
	// contains filtered or unexported fields
}

IpfsNode is IPFS Core module. It represents an IPFS instance.

func NewIPFSNode

func NewIPFSNode(ctx context.Context, option ConfigOption) (*IpfsNode, error)

func NewMockNode

func NewMockNode() (*IpfsNode, error)

NewMockNode constructs an IpfsNode for use in tests.

func (*IpfsNode) Bootstrap

func (n *IpfsNode) Bootstrap(ctx context.Context, peers []peer.PeerInfo) error

Bootstrap is undefined when node is not in OnlineMode

func (*IpfsNode) OnlineMode

func (n *IpfsNode) OnlineMode() bool

func (*IpfsNode) Resolve

func (n *IpfsNode) Resolve(k util.Key) (*merkledag.Node, error)

func (*IpfsNode) StartOnlineServices

func (n *IpfsNode) StartOnlineServices() error

type Mounts

type Mounts struct {
	Ipfs mount.Mount
	Ipns mount.Mount
}

Mounts defines what the node's mount state is. This should perhaps be moved to the daemon or mount. It's here because it needs to be accessible across daemon requests.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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