ipfs

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 18 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) Add

func (n *Node) Add(path string, onlyHash bool) (cid string, err error)

Add imports a file to IPFS and returns the file identifier to ait.

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) Get

func (n *Node) Get(hash string) (files.File, error)

Get reads a file from IPFS without pinning it.

func (*Node) Pin

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

Pin a file to local storage.

type NodeConfArgs

type NodeConfArgs struct {
	SwarmKey       string
	BootstrapPeers []string
}

Jump to

Keyboard shortcuts

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