World all
- Imports:
- interface
hermes:binary/api - interface
hermes:ipfs/api
- interface
- Exports:
- interface
hermes:ipfs/event
- interface
Import interface hermes:binary/api
Binary Data API
Binary Data types and functions.
Permissions
This API is ALWAYS available. cspell: words Binary API Interface - Imports ONLY
Types
type bstr
Binary String (bstr) is a list of bytes. This type is used to indicate the data is an arbitrary array of bytes.
tuple b128
128 bit value
Tuple Fields
tuple b256
256 bit value
Tuple Fields
tuple b512
512 bit value
Tuple Fields
Import interface hermes:ipfs/api
Interface to local IPFS instance.
Types
type bstr
#### `type dht-key` [`dht-key`](#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 ipfs-cid
A CID.
record file-add-result
Record Fields
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.
-
Failed to get CID.
-
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.
-
Unable to unsubscribe from IPFS topic.
-
IPFS service is unavailable.
-
DHT provide call failed.
-
DHT get providers call failed.
-
Unable to read peer id.
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
dht-provide: func
Marks a node as a provider for the content under the given key.
Params
key:dht-key
Return values
- result<_,
errno>
dht-get-providers: func
Gets providers of the content under the given key.
Params
key:dht-key
Return values
get-peer-id: func
Returns the peer id of the node.
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
- result<
file-add-result,errno>
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
Evicts peer from network.
Params
peer:peer-id
Return values
- result<
bool,errno>
pubsub-publish: func
Publishes 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>
pubsub-unsubscribe: func
Unsubscribes from 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