ipfs

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

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

func CreateNode

func CreateNode(repoPath string, args NodeConfArgs) (node *Node, err error)

CreateNode creates an IPFS node and returns its coreAPI

func (*Node) FindProvs

func (n *Node) FindProvs(hash string, maxPeers int) (replications int, err error)

FindProvs queries the IPFS network for the number of providers hosting a given file

func (*Node) GC

func (n *Node) GC() error

GC runs a garbage collection scan on the IPFS node.

func (*Node) GetSize

func (n *Node) GetSize(hash string) (size int64, err error)

GetSize returns the size of the specified file.

func (*Node) LsPin

func (n *Node) LsPin() (<-chan string, error)

LsPin returns a list of files IDs that are pinned on the IPFS instance.

func (*Node) Pin

func (n *Node) Pin(hash string) error

Pin a file to local storage.

func (*Node) RepoSize

func (n *Node) RepoSize() (int64, error)

func (*Node) ReportStats

func (n *Node) ReportStats(peerID string, protocolID string, msg []byte) (err error)

func (*Node) Unpin

func (n *Node) Unpin(hash string) error

Unpin removes a file from local storage.

func (*Node) Verify

func (n *Node) Verify() (<-chan string, error)

Verify checks the local file store in order to look for corruption.

type NodeConfArgs

type NodeConfArgs struct {
	SwarmKey       string
	StorageMax     string
	BootstrapPeers []string
}

Jump to

Keyboard shortcuts

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