Struct ipfs_embed::Ipfs

source ·
pub struct Ipfs<P: StoreParams> { /* private fields */ }
Expand description

Ipfs node.

Implementations§

Creates a new Ipfs from a Config.

This starts three background tasks. The swarm, garbage collector and the dht cleanup tasks run in the background.

Returns the local PublicKey.

Returns the local PeerId.

Returns the local node name.

Listens on a new Multiaddr.

Returns the currently active listener addresses.

Adds an external address.

Returns the currently used external addresses.

Adds a known Multiaddr for a PeerId.

Removes a Multiaddr for a PeerId.

Removes all unconnected peers without addresses which have been in this state for at least the given duration

Dials a PeerId using a known address.

Dials a PeerId using Multiaddr.

Bans a PeerId from the swarm, dropping all existing connections and preventing new connections from the peer.

Unbans a previously banned PeerId.

Returns the known peers.

Returns a list of connected peers.

Returns true if there is a connection to peer.

Returns the PeerInfo of a peer.

Bootstraps the dht using a set of bootstrap nodes. After bootstrap completes it provides all blocks in the block store.

Returns true if the dht was bootstrapped.

Gets the closest peer to a key. Useful for finding the Multiaddr of a PeerId. Gets providers of a key from the dht.

Provides a key in the dht.

Stops providing a key in the dht.

Gets a record from the dht.

Puts a new record in the dht.

Removes a record from the dht.

Subscribes to a topic returning a Stream of messages. If all Streams for a topic are dropped it unsubscribes from the topic.

Publishes a new message in a topic, sending the message to all subscribed peers.

Publishes a new message in a topic, sending the message to all subscribed connected peers.

Creates a temporary pin in the block store. A temporary pin is not persisted to disk and is released once it is dropped.

Adds a new root to a temporary pin.

Returns an Iterator of Cids stored in the block store.

Checks if the block is in the block store.

Returns a block from the block store.

Either returns a block if it’s in the block store or tries to retrieve it from a peer.

Inserts a block in to the block store.

Manually runs garbage collection to completion. This is mainly useful for testing and administrative interfaces. During normal operation, the garbage collector automatically runs in the background.

Creates, updates or removes an alias with a new root Cid.

List all known aliases.

Returns the root of an alias.

Returns a list of aliases preventing a Cid from being garbage collected.

Flushes the block store. After flush completes successfully it is guaranteed that all writes have been persisted to disk.

Perform a set of storage operations in a batch

The batching concerns only the CacheTracker, it implies no atomicity guarantees!

Registers prometheus metrics in a registry.

Subscribes to the swarm event stream.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Store parameters.
Temp pin.
Creates a new temporary pin.
Adds a block to a temp pin.
Returns true if the store contains the block.
Returns a block from the store. If the block wasn’t found it returns a BlockNotFound error. Read more
Inserts a block into the store and publishes the block on the network.
Creates an alias for a Cid.
Resolves an alias for a Cid.
Returns all the aliases that are keeping the block around.
Flushes the store.
Returns a block from the store. If the store supports networking and the block is not in the store it fetches it from the network and inserts it into the store. Dropping the future cancels the request. Read more
Fetches all missing blocks recursively from the network. If a block isn’t found it returns a BlockNotFound error. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Scrape the references from an impl Read. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more