IpfsApi

The module is a client to call into IPFS REST endpoint.

Summary

Functions

Add an object to ipfs

Get a raw IPFS block

Stores input as an IPFS block

Print information of a raw IPFS block

Gets the list of bootstrap peers

Add peers to the bootstrap list

Remoes peers from the bootstrap list

Show ipfs object data

Gets the content of the config file

Run a FindPeer query through the DHT

Run a FundProviders quest through the DHT

Run a GetValue query through the DHT

Run a PutValue query through the DHT

Run a FindClosesPeers query through the DHT

Resolve the DNS link TODO: Add ability to resolve recursively

List directory content for path

Get an ipfs object

Gets the information about the specified peer_id

List links from an object

Publish the ipfs_path to your identity name

Resolve the value of name

The raw bytes in an IPFS object

Get and serialize the DAG node name by multihash

The links pointed to by the specified object

Create a new merkledag object base on an existing one

Stores content as a DAG object

Get stats for the DAG node name by key

Pins objects to local storage

List objects pinned to local storage

Remove the pinned object from local storage TODO: Add ability to resolve recursively

Send echo request packets to IPFS hosts TODO: Add ability to give number of count

List hashes of links from an object

Perform a grabage collection sweep on the repo

Resolve the value of the name TODO: Add ability to resolve recursively

List known addresses

Open connection to given address

Close connection to give address

Remove an address filter

List peers with open connections

Gets the IPFS version

Types

request_ret :: {:ok, Dict.t} | {:error, String.t}

Functions

add(connection, content)

Specs

add(IpfsConnection.t, binary) :: request_ret
add(IpfsConnection.t, binary) :: request_ret

Add an object to ipfs

Examples

IpfsApi.add(%IpfsConnection{}, "Hello World")
block_get(connection, multihash)

Specs

Get a raw IPFS block

block_put(connection, content)

Specs

block_put(IpfsConnection.t, binary) :: request_ret

Stores input as an IPFS block

block_stat(connection, multihash)

Specs

Print information of a raw IPFS block

bootstrap(connection)

Specs

Gets the list of bootstrap peers

bootstrap_add(connection, peer)

Specs

Add peers to the bootstrap list

bootstrap_rm(connection, peer)

Specs

Remoes peers from the bootstrap list

cat(connection, multihash)

Show ipfs object data

config_show(connection)

Specs

config_show(IpfsConnection.t) :: request_ret

Gets the content of the config file

dht_findpeer(connection, peer_id)

Specs

Run a FindPeer query through the DHT

dht_findprovs(connection, key)

Specs

Run a FundProviders quest through the DHT

dht_get(connection, key)

Run a GetValue query through the DHT

dht_put(connection, key, value)

Run a PutValue query through the DHT

dht_query(connection, peer_id)

Specs

Run a FindClosesPeers query through the DHT

dns(connection, domain_name)

Resolve the DNS link TODO: Add ability to resolve recursively

file_ls(connection, path)

List directory content for path

get(connection, multihash)

Specs

get(IpfsConnection.t, String.t) ::
  {:ok, binary} |
  {:error, String.t}

Get an ipfs object

Examples

IpfsApi.get(%IpfsConnection{}, "QmUXTtySmd7LD4p6RG6rZW6RuUuPZXTtNMmRQ6DSQo3aMw")
id(connection, peer_id \\ "")

Gets the information about the specified peer_id

ls(connection, multihash)

List links from an object

name_publish(connection, ipfs_path)

Specs

Publish the ipfs_path to your identity name

name_resolve(connection, name \\ "")

Specs

Resolve the value of name

object_data(connection, multihash)

Specs

The raw bytes in an IPFS object

object_get(connection, multihash)

Specs

Get and serialize the DAG node name by multihash

object_links(connection, multihash)

Specs

The links pointed to by the specified object

object_patch(connection, key)

Specs

Create a new merkledag object base on an existing one

object_put(connection, content)

Specs

object_put(IpfsConnection.t, binary) :: request_ret

Stores content as a DAG object

object_stat(connection, key)

Specs

Get stats for the DAG node name by key

pin_add(connection, ipfs_path)

Pins objects to local storage

pin_ls(connection)

Specs

List objects pinned to local storage

pin_rm(connection, ipfs_path)

Remove the pinned object from local storage TODO: Add ability to resolve recursively

ping(connection, peer_id)

Send echo request packets to IPFS hosts TODO: Add ability to give number of count

refs(connection, multihash)

List hashes of links from an object

repo_gc(connection)

Specs

Perform a grabage collection sweep on the repo

resolve(connection, name)

Resolve the value of the name TODO: Add ability to resolve recursively

swarm_addr(connection)

Specs

swarm_addr(IpfsConnection.t) :: request_ret

List known addresses

swarm_connect(connection, address)

Specs

Open connection to given address

swarm_disconnect(connection, address)

Specs

swarm_disconnect(IpfsConnection.t, String.t) :: request_ret

Close connection to give address

swarm_filters_add(connection, address)

Specs

swarm_filters_add(IpfsConnection.t, String.t) :: request_ret

Add an address filter

swarm_filters_rm(connection, address)

Specs

swarm_filters_rm(IpfsConnection.t, String.t) :: request_ret

Remove an address filter

swarm_peers(connection)

Specs

swarm_peers(IpfsConnection.t) :: request_ret

List peers with open connections

version(connection)

Specs

Gets the IPFS version