[][src]Struct ipfs::IpfsOptions

pub struct IpfsOptions {
    pub ipfs_path: PathBuf,
    pub keypair: Keypair,
    pub bootstrap: Vec<(Multiaddr, PeerId)>,
    pub mdns: bool,
    pub kad_protocol: Option<String>,
    pub listening_addrs: Vec<Multiaddr>,
    pub span: Option<Span>,

Ipfs node options used to configure the node to be created with UninitializedIpfs.


ipfs_path: PathBuf

The path of the ipfs repo (blockstore and datastore).

This is always required but can be any path with in-memory backends. The filesystem backend creates a directory structure alike but not compatible to other ipfs implementations.

Incompatiblity and interop warning

It is not recommended to set this to IPFS_PATH without first at least backing up your existing repository.

keypair: Keypair

The keypair used with libp2p, the identity of the node.

bootstrap: Vec<(Multiaddr, PeerId)>

Nodes used as bootstrap peers.

mdns: bool

Enables mdns for peer discovery and announcement when true.

kad_protocol: Option<String>

Custom Kademlia protocol name. When set to None, the global DHT name is used instead of the LAN dht name.

The name given here is passed to libp2p_kad::KademliaConfig::set_protocol_name.

listening_addrs: Vec<Multiaddr>

Bound listening addresses; by default the node will not listen on any address.

span: Option<Span>

The span for tracing purposes, None value is converted to tracing::trace_span!("ipfs").

All futures returned by Ipfs, background task actions and swarm actions are instrumented with this span or spans referring to this as their parent. Setting this other than None default is useful when running multiple nodes.


impl IpfsOptions[src]

pub fn inmemory_with_generated_keys() -> Self[src]

Creates an in-memory store backed configuration useful for any testing purposes.

Also used from examples.

Trait Implementations

impl Clone for IpfsOptions[src]

impl Debug for IpfsOptions[src]

impl<'_> From<&'_ IpfsOptions> for SwarmOptions[src]

impl<'_> From<&'_ IpfsOptions> for RepoOptions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]