World all

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

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
  • 0: u64
  • 1: u64

tuple b256

256 bit value

Tuple Fields
  • 0: u64
  • 1: u64
  • 2: u64
  • 3: u64

tuple b512

512 bit value

Tuple Fields
  • 0: u64
  • 1: u64
  • 2: u64
  • 3: u64
  • 4: u64
  • 5: u64
  • 6: u64
  • 7: u64

Import interface hermes:ipfs/api

Interface to local IPFS instance.


Types

type bstr

bstr

#### `type dht-key` [`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 ipfs-cid

bstr

A CID.

record file-add-result

Record Fields

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.

  • get-cid-error

    Failed to get CID.

  • 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.

  • pubsub-unsubscribe-error

    Unable to unsubscribe from IPFS topic.

  • service-unavailable

    IPFS service is unavailable.

  • dht-provide-error

    DHT provide call failed.

  • dht-get-providers-error

    DHT get providers call failed.

  • get-peer-id-error

    Unable to read peer id.


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

dht-provide: func

Marks a node as a provider for the content under the given key.

Params
Return values

dht-get-providers: func

Gets providers of the content under the given key.

Params
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
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

Evicts peer from network.

Params
Return values

pubsub-publish: func

Publishes a message to a topic.

Params
Return values

pubsub-subscribe: func

Subscribes to a PubSub topic.

Params
Return values

pubsub-unsubscribe: func

Unsubscribes from 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