ipfs

package
v0.0.0-...-e093297 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 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) Cat

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

Read a file from IPFS without pinning

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

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

GetSize returns the size of the specified file.

type NodeConfArgs

type NodeConfArgs struct {
	Addr           string
	PeerID         string
	PrivKey        string
	SwarmKey       string
	BootstrapPeers []string
}

Jump to

Keyboard shortcuts

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