ipfs

package
v0.6.26-beta.10 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: GPL-3.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(c *nodeconfig.Config) (nodeconfig.IPFSNode, error)

Initialize creates a new local IPFS node

Types

type LocalIpfs

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

`LocalIpfs` is a struct that contains a `CoreAPI` and a `IpfsNode` and a `WalletShare` and a `NodeCallback` and a `Context` and a `[]string` and a `Peer_Type` and a `string`. @property - `icore.CoreAPI` is the interface that the node will use to communicate with the LocalIpfs daemon. @property node - The LocalIpfs node @property {string} repoPath - The path to the LocalIpfs repository. @property walletShare - This is the wallet share object that is used to share the wallet with other nodes. @property callback - This is a callback function that will be called when the node is ready. @property ctx - The context of the node. @property {[]string} bootstrappers - The list of bootstrap nodes to connect to. @property peerType - The type of peer, which can be either a bootstrap node or a normal node. @property {string} rendezvous - The rendezvous string is a unique identifier for the swarm. It is used to find other peers in the swarm.

func (*LocalIpfs) Add

func (n *LocalIpfs) Add(file []byte) (string, error)

Add adds a file to the network

func (*LocalIpfs) AddPath

func (n *LocalIpfs) AddPath(path string) (string, error)

AddPath adds all files/folders in a given path to the network

func (*LocalIpfs) Close

func (n *LocalIpfs) Close() error

Close closes the node

func (*LocalIpfs) Connect

func (n *LocalIpfs) Connect(peers ...string) error

Connect connects to a peer with a given multiaddress

func (*LocalIpfs) CoreAPI

func (n *LocalIpfs) CoreAPI() icore.CoreAPI

func (*LocalIpfs) Get

func (n *LocalIpfs) Get(cidStr string) ([]byte, error)

Get returns a file from the network given its CID

func (*LocalIpfs) GetPath

func (n *LocalIpfs) GetPath(cidStr string) (map[string]files.Node, error)

GetPath returns a file from the network given its CID

func (*LocalIpfs) LoadDocsStore

func (r *LocalIpfs) LoadDocsStore(username string, docsOpts *iface.CreateDocumentDBOptions) (iface.DocumentStore, error)

GetDocsStore creates or loads a document database from given name

func (*LocalIpfs) LoadEventLogStore

func (r *LocalIpfs) LoadEventLogStore(username string) (iface.EventLogStore, error)

GetEventLogStore creates or loads an event log database from given name

func (*LocalIpfs) LoadKeyValueStore

func (r *LocalIpfs) LoadKeyValueStore(username string) (iface.KeyValueStore, error)

GetKeyValueStore creates or loads a key value database from given name

func (*LocalIpfs) MultiAddrs

func (n *LocalIpfs) MultiAddrs() string

MultiAddr returns the node's multiaddress as a string

func (*LocalIpfs) Peer

func (n *LocalIpfs) Peer() *types.PeerInfo

Peer returns the node's peer info

func (*LocalIpfs) PeerID

func (n *LocalIpfs) PeerID() peer.ID

PeerID returns the node's PeerID

type TopicMessageHandler

type TopicMessageHandler func(topic string, msg icore.PubSubMessage) error

TopicMessageHandler is a function that handles a message received on a topic

Jump to

Keyboard shortcuts

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