World all
- Imports:
- interface
hermes:ipfs/api
- interface
- Exports:
- interface
hermes:ipfs/event
- interface
Import interface hermes:ipfs/api
Interface to local IPFS instance.
Types
type dht-key
A DHT key.
type dht-value
A DHT value.
type ipfs-file
The binary contents of an IPFS file.
type ipfs-path
string
A path to an IPFS file.
type message-data
PubSub Message Data
type 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
-
DHT value
-
pubsub: (pubsub-topic,message-data)
record pubsub-message
A PubSub message from a topic subscription.
Record Fields
-
topic:pubsub-topicThe topic that the message was received on.
-
message:message-dataThe 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
-
Unable to get DHT value.
-
Unable to put DHT value.
-
Unable to publish file to IPFS.
-
Unable to get file from IPFS.
-
Unable to pin file.
-
Invalid CID.
-
Invalid DHT key.
-
Invalid DHT value.
-
Unable to parse a valid IPFS path.
-
Invalid Peer ID.
-
Invalid PubSub message.
-
Unable to evict peer.
-
Unable to publish to IPFS topic.
-
Unable to subscribe to IPFS topic.
-
IPFS service is unavailable.
Functions
dht-put: func
Puts a DHT key-value into IPFS.
Params
Return values
- result<
bool,errno>
dht-get: func
Gets a DHT key-value from IPFS.
Params
key:dht-key
Return values
ipfs-content-validate: func
Validates IPFS content from DHT or PubSub.
Params
content:ipfs-content
Return values
- result<
bool,errno>
file-add: func
Uploads a file to IPFS.
Params
contents:ipfs-file
Return values
file-get: func
Retrieves a file from IPFS.
Params
path:ipfs-path
Return values
file-pin: func
Pins an IPFS file by path.
Params
path:ipfs-path
Return values
- result<
bool,errno>
file-unpin: func
Un-pins an IPFS file by path.
Params
path:ipfs-path
Return values
- result<
bool,errno>
peer-evict: func
Evict peer from network.
Params
peer:peer-id
Return values
- result<
bool,errno>
pubsub-publish: func
Publish a message to a topic.
Params
topic:pubsub-topicmessage:message-data
Return values
- result<_,
errno>
pubsub-subscribe: func
Subscribes to a PubSub topic.
Params
topic:pubsub-topic
Return values
- result<
bool,errno>
Export interface hermes:ipfs/event
Types
type pubsub-message
----
Functions
on-topic: func
Triggers when a message is received on a topic.
Params
message:pubsub-message