World all

Import interface hermes:ipfs/api

Interface to local IPFS instance.


Types

type dht-key

dht-key

A DHT key.

type dht-value

dht-value

A DHT value.

type ipfs-file

ipfs-file

The binary contents of an IPFS file.

type ipfs-path

string

A path to an IPFS file.

type message-data

message-data

PubSub Message Data

type message-id

message-id

PubSub Message ID

type peer-id

string

The ID of a peer.

type pubsub-topic

string

A PubSub topic.

variant ipfs-content

This is content that can be validated.

Variant Cases

record pubsub-message

A PubSub message from a topic subscription.

Record Fields
  • topic: pubsub-topic

    The topic that the message was received on.

  • message: message-data

    The contents of the message.

  • publisher: option<peer-id>

    Optional Peer ID that published the message.

enum errno

Errors that occur in IPFS networking.

Enum Cases
  • dht-get-error

    Unable to get DHT value.

  • dht-put-error

    Unable to put DHT value.

  • file-add-error

    Unable to publish file to IPFS.

  • file-get-error

    Unable to get file from IPFS.

  • file-pin-error

    Unable to pin file.

  • invalid-cid

    Invalid CID.

  • invalid-dht-key

    Invalid DHT key.

  • invalid-dht-value

    Invalid DHT value.

  • invalid-ipfs-path

    Unable to parse a valid IPFS path.

  • invalid-peer-id

    Invalid Peer ID.

  • invalid-pubsub-message

    Invalid PubSub message.

  • peer-eviction-error

    Unable to evict peer.

  • pubsub-publish-error

    Unable to publish to IPFS topic.

  • pubsub-subscribe-error

    Unable to subscribe to IPFS topic.

  • service-unavailable

    IPFS service is unavailable.


Functions

dht-put: func

Puts a DHT key-value into IPFS.

Params
Return values

dht-get: func

Gets a DHT key-value from IPFS.

Params
Return values

ipfs-content-validate: func

Validates IPFS content from DHT or PubSub.

Params
Return values

file-add: func

Uploads a file to IPFS.

Params
Return values

file-get: func

Retrieves a file from IPFS.

Params
Return values

file-pin: func

Pins an IPFS file by path.

Params
Return values

file-unpin: func

Un-pins an IPFS file by path.

Params
Return values

peer-evict: func

Evict peer from network.

Params
Return values

pubsub-publish: func

Publish a message to a topic.

Params
Return values

pubsub-subscribe: func

Subscribes to a PubSub topic.

Params
Return values

Export interface hermes:ipfs/event


Types

type pubsub-message

pubsub-message

----

Functions

on-topic: func

Triggers when a message is received on a topic.

Params
Return values
  • bool