The cl-ipfs-api2 Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The cl-ipfs-api2 Reference Manual

This is the cl-ipfs-api2 Reference Manual, version 0.5, generated automatically by Declt version 2.4 patchlevel 1 "Will Decker" on Mon Jul 29 14:57:10 2019 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

===============================================================================
CL-IPFS-API²                                                                   
===============================================================================

:cl-ipfs-api² is a pretty simple set of IPFS bindings for Common Lisp, using
the HTTP API for (almost) everything, except for pubsub (which uses the locally
installed go-ipfs program).
It uses Dexador, YASON, and UIOP.


————————————————————————————————————————
USAGE
————————————————————————————————————————
Just use `quicklisp` (pop this in your "~/quicklisp/local-projects/",
and you're good).

Then you can do things like:
	> (ipfs:add #p"~/.bashrc")
	"QmZweanA1JRNio6DKnPN6yECWCrxmWqqG7WWUNtyuji9hZ"

	> (ipfs:cat "/ipns/ipfs.io/index.html")
	"
	……"

Most commands available are one-to-one with their API/cli counter-parts,
with a few notable exceptions:
	* #'dl	(counter-part to the /get call. the name is different, so
	         as to not conflict with #'common-lisp:get)

The calls implemented so far:
	* root (cat, add, id, ls, resolve, etc)
	* bitswap, block, bootstrap
	* cid, config (config, config/show)
	* dag, dht, diag
	* file, files, filestore
	* key, name, object
	* p2p, pin, pubsub
	* refs, repo, stats
	* swarm, urlstore
	* version (version, version/deps)

Some calls were skipped over, but wouldn't be hard to add:
	* object/put, object/set-data object/patch/append-data
	* tar calls were deliberately ignored (useless)

Functions return either strings, lists, or associative lists, depending on
context. All errors return two values— nil and an error message (string).

Make sure to read docstrings for specific information, and keeping the API
reference handy is a good idea (/ipns/docs.ipfs.io/reference/api/http/).

————————————————————
USEFUL VARIABLES
————————————————————
There are three exported variables:
	ipfs:*api-host*    →   "http://127.0.0.1:5001"
	ipfs:*api-root*    →   "/api/v0/"
	ipfs:*ipfs-root*   →   NIL

*api-host* is the protocol, host, and port of the API server— unless you're
using a custom port or remote server, this probably won't need to change.
*api-root* is the URL root of all API calls on the server— only changes under
very strange circumstances.
*ipfs-root* is the “root” of the local IPFS daemon. This is only used with
the pubsub commands, since they actually invoke the local `ipfs` program.
You only need to change this variable if your $IPFS_PATH is irregular, like
"/var/ipfs/" or something weird like that.

————————————————————
PUBSUB USAGE
————————————————————
Pubsub usage here is such an abberation that it warrants its own section.
Since there isn't a (functional) HTTP API for pubsub yet, we're using the
actual go-ipfs program from your computer.

If you don't have go-ipfs locally installed, it won't work.
If you are using Windows, or anything but *nix, it probably won't work.
If you haven't enabled pubsub (--enable-pubsub-experiment argument to daemon),
it won't work.

You can sub to a topic with, ofc, #'pubsub-sub, which will return a
UIOP-originated process-info stream— while the `ipfs pubsub sub` command runs
in the background.

This stream can't be directly #'read-char or #'listen with, which is exactly
what you wanna do— instead, running #'uiop/launch-program:process-info-output
on it is necessary to expose a usable stream.

To make all that easier, there's a little abstraction I added which obfuscates
UIOP use and is adequate shorthand:
	* #'pubsub-sub-read-char
	* #'pubsub-sub-listen
	* #'pubsub-sub-process
	* #'pubsub-sub-close

All of those operate on the original UIOP-originated process-info stream, and
work exactly like you'd expect.
The only weird, non-obvious one is probably #'pubsub-sub-process, which applies
#'uiop/launch-program:process-info-output— just in case you need the raw,
usable stream.

Anyway, with this, you can get a continuous read on what's going on with the
topic you're subbed to. To publish to a topic, run #'pubsub-pub with the topic
and data as arguments. Pretty simple.

Both #'pubsub-sub and #'pubsub-pub, being the only functions that run a shell
command, include an :env argument. If you supply a string as the :env argument,
that string will prefix the "ipfs" command— basically only useful for changing
something with the "env" command (like $IPFS_PATH).

Also, if you change the ipfs:*ipfs-root* variable (to the correct value of
$IPFS_PATH), the :env arguments (unless otherwise specified) will default to
"env IPFS_PATH=" + ipfs:*ipfs-root* + " > /dev/null;"


————————————————————————————————————————
BORING STUFF
————————————————————————————————————————
License is the GNU GPLv3:
       check COPYING.txt (/ipfs/QmTBpqbvJLZaq3hTMUhxX5hyJaSCeWe6Q5FRctQbsD6EsE)
Author is Jaidyn Ann 
Sauce is at https://git.eunichx.us/cl-ipfs-api2.git


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 cl-ipfs-api2

Author

Jaidyn Ann <jadedctrl@teknik.io>

License

GPLv3

Description

Bindings for the IPFS HTTP API.

Version

0.5

Dependencies
Source

cl-ipfs-api2.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 cl-ipfs-api2.asd

Location

cl-ipfs-api2.asd

Systems

cl-ipfs-api2 (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 cl-ipfs-api2/package.lisp

Parent

cl-ipfs-api2 (system)

Location

package.lisp

Packages

cl-ipfs-api2


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 cl-ipfs-api2/main.lisp

Parent

cl-ipfs-api2 (system)

Location

main.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 cl-ipfs-api2

Source

package.lisp (file)

Nicknames
Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *api-host*
Package

cl-ipfs-api2

Source

main.lisp (file)

Special Variable: *api-root*
Package

cl-ipfs-api2

Source

main.lisp (file)

Special Variable: *ipfs-root*
Package

cl-ipfs-api2

Source

main.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: add PATHNAME &key PIN ONLY-HASH

Add a file to IPFS, return it’s hash. /ipns/docs.ipfs.io/reference/api/http/#api-v0-add

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: bitswap-ledger PEER-ID

Show the current ledger for a peer. /ipns/docs.ipfs.io/reference/api/http/#api-v0-bitswap-ledger

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: bitswap-reprovide ()

Trigger the reprovider. /ipns/docs.ipfs.io/reference/api/http/#api-v0-bitswap-reprovide

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: bitswap-stat ()

Show diagnostic info on the bitswap agent. /ipns/docs.ipfs.io/reference/api/http/#api-v0-bitswap-stat

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: bitswap-wantlist &optional PEER-ID

Show blocks currently on the wantlist. /ipns/docs.ipfs.io/reference/api/http/#api-v0-bitswap-wantlist

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: block-get HASH

Get a raw IPFS block. /ipns/docs.ipfs.io/reference/api/http/#api-v0-block-get

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: block-put PATHNAME &key FORMAT MHTYPE MHLEN PIN

Store input as an IPFS block. /ipns/docs.ipfs.io/reference/api/http/#api-v0-block-put

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: block-rm HASH &key FORCE

Delete an IPFS block(s). /ipns/docs.ipfs.io/reference/api/http/#api-v0-block-rm

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: block-stat HASH

Print info about a raw IPFS block /ipns/docs.ipfs.io/reference/api/http/#api-v0-block-stat

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: bootstrap ()

Return a list of bootstrap peers /ipns/docs.ipfs.io/reference/api/http/#api-v0-bootstrap

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: bootstrap-add PEER

Add a peer to the bootstrap list /ipns/docs.ipfs.io/reference/api/http/#api-v0-bootstrap-add

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: bootstrap-add-default ()

Add default peers to the bootstrap list /ipns/docs.ipfs.io/reference/api/http/#api-v0-bootstrap-add-default

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: bootstrap-list ()

Return a list of bootstrap peers /ipns/docs.ipfs.io/reference/api/http/#api-v0-bootstrap-list

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: bootstrap-rm PEER

Remove a peer from the bootstrap list /ipns/docs.ipfs.io/reference/api/http/#api-v0-bootstrap-rm

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: bootstrap-rm-all ()

Remove a peer from the bootstrap list /ipns/docs.ipfs.io/reference/api/http/#api-v0-bootstrap-rm

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: cat IPFS-PATH &key OFFSET LENGTH

Return a string of the data at the given IPFS path. /ipns/docs.ipfs.io/reference/api/http/#api-v0-cat

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: cid-base32 CID

Convert a CID into Base32 CIDv1 /ipns/docs.ipfs.io/reference/api/http/#api-v0-cid-base32

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: cid-bases ()

Return a associative list of available bases in plist format; each base’s name is a assigned a given code-number.
((CODE-A . NAME-A) (CODE-B . NAME-B) … (CODE-N . NAME-N)) /ipns/docs.ipfs.io/reference/api/http/#api-v0-cid-bases

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: config KEY &key VALUE BOOL JSON

Get/set a config key’s value. /ipns/docs.ipfs.io/reference/api/http/#api-v0-config

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: config-show ()

Return the config file’s contents, in alist-format… y’know, with several sub-alists.
Doesn’t quite line up with #api-v0-config-show /ipns/docs.ipfs.io/reference/api/http/#api-v0-config-show

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dag-get DAG-NODE

Get a dag node from IPFS. /ipns/docs.ipfs.io/reference/api/http/#api-v0-dag-get

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dag-put DAG-NODE &key FORMAT INPUT-ENC PIN

Add a dag node to IPFS. Returns CID string. /ipns/docs.ipfs.io/reference/api/http/#api-v0-dag-put

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dag-resolve PATH

Resolve an IPLD block. /ipns/docs.ipfs.io/reference/api/http/#api-v0-dag-resolve

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dht-findpeer PEER-ID

Find the multiaddresses associated with a peer ID. /ipns/docs.ipfs.io/reference/api/http/#api-v0-dht-findpeer

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dht-findprovs KEY &key PROVIDER-QUANTITY

Find peers that can provide a specific value, given a key. /ipns/docs.ipfs.io/reference/api/http/#api-v0-dht-findprovs

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dht-get KEY

Query the routing system for a key’s best value. /ipns/docs.ipfs.io/reference/api/http/#api-v0-dht-get

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dht-provide KEY &key RECURSIVE

Announce to the network that you’re providing the given values. /ipns/docs.ipfs.io/reference/api/http/#api-v0-dht-provide

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dht-put KEY VALUE

Write a key-value pair to the routing system. /ipns/docs.ipfs.io/reference/api/http/#api-v0-dht-put

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dht-query PEER-ID

Find the closest peer IDs to the given one by querying the DHT. /ipns/docs.ipfs.io/reference/api/http/#api-v0-dht-query

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: diag-cmds ()

List commands run on this IPFS node. /ipns/docs.ipfs.io/reference/api/http/#api-v0-diag-cmds

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: diag-cmds-clear ()

Clear inactive requests from the log. /ipns/docs.ipfs.io/reference/api/http/#api-v0-diag-cmds-clear

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: diag-cmds-set-time TIME

Set how long to keep inactive requests in the log. /ipns/docs.ipfs.io/reference/api/http/#api-v0-diag-cmds-set-time

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: diag-sys ()

Print system diagnostic info. /ipns/docs.ipfs.io/reference/api/http/#api-v0-diag-sys

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dl IPFS-PATH OUT-FILE

Write an IPFS file directly to a file on the local file-system. Non-recursive, in the case of directories… for now.
(Thanks to this thread ♥: https://stackoverflow.com/a/12607423)
Is a general replacement for the ’get’ API call, but actually just uses the ’cat’ call, due to some issues with using ’get’.
Will not actually return NIL when an error is reached (like other functions) with an error-message, it’lll just write the error JSON to the file. Whoops.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: dns DOMAIN &key RECURSIVE

Resolve a domain into a path (usually /ipfs/). /ipns/docs.ipfs.io/reference/api/http/#api-v0-dns

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: file-ls PATH

List directory contents for UNIX filesystem objects. /ipns/docs.ipfs.io/reference/api/http/#api-v0-file-ls

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: files-chcid PATH &key CID-VERSION HASH

Change the cid version or hash function of the root node of a given path. /ipns/docs.ipfs.io/reference/api/http/#api-v0-files-chcid

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: files-cp SOURCE DESTINATION

Copy files into mfs. /ipns/docs.ipfs.io/reference/api/http/#api-v0-files-cp

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: files-flush &optional PATH

Flush a given path’s data to disk. Returns CID. /ipns/docs.ipfs.io/reference/api/http/#api-v0-files-flush

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: files-ls &optional PATH

List directories in local mutable namespace. /ipns/docs.ipfs.io/reference/api/http/#api-v0-files-ls

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: files-mkdir PATH &key PARENTS CID-VERSION HASH

Make a directory. /ipns/docs.ipfs.io/reference/api/http/#api-v0-files-mkdir

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: files-mv SOURCE DESTINATION

Move a file. /ipns/docs.ipfs.io/reference/api/http/#api-v0-files-mv

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: files-read PATH &key OFFSET MAX

Read a file in given mfs. /ipns/docs.ipfs.io/reference/api/http/#api-v0-files-read

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: files-rm PATH &key RECURSIVE FORCE

Remove a given file. /ipns/docs.ipfs.io/reference/api/http/#api-v0-files-rm

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: files-stat PATH

Remove a given file. /ipns/docs.ipfs.io/reference/api/http/#api-v0-files-rm

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: files-write PATHNAME DEST-PATH &key OFFSET CREATE PARENTS TRUNCATE COUNT RAW-LEAVES CID-VERSION HASH

Remove a given file. /ipns/docs.ipfs.io/reference/api/http/#api-v0-files-rm

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: filestore-dups ()

List blocks that’re both in the filestore and standard block storage. /ipns/docs.ipfs.io/reference/api/http/#api-v0-filestore-dups

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: filestore-ls &optional CID

List objects in filestore. /ipns/docs.ipfs.io/reference/api/http/#api-v0-filestore-ls

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: filestore-verify &optional CID

Verify objects in filestore. /ipns/docs.ipfs.io/reference/api/http/#api-v0-filestore-verify

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: id &optional PEER-ID

Return info on a node by ID. Returns as an associative list, the public key, agent version, etc. If no node ID is specified, then your own is assumed. /ipns/docs.ipfs.io/reference/api/http/#api-v0-id

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: key-gen NAME &key TYPE SIZE

Create a new keypair. /ipns/docs.ipfs.io/reference/api/http/#api-v0-key-gen

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: key-list ()

List all local keypairs. /ipns/docs.ipfs.io/reference/api/http/#api-v0-key-list

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: key-remove NAME

Remove a keypair, based on name. /ipns/docs.ipfs.io/reference/api/http/#api-v0-key-remove

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: key-rename OLD-NAME NEW-NAME &key FORCE

Rename a local keypair. /ipns/docs.ipfs.io/reference/api/http/#api-v0-key-rename

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: log-level SUBSYSTEM LEVEL

Change the logging level of a subsystem. /ipns/docs.ipfs.io/reference/api/http/#api-v0-log-level

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: log-ls ()

List the logging subsystems. /ipns/docs.ipfs.io/reference/api/http/#api-v0-log-ls

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: log-tail ()

Read the event log. /ipns/docs.ipfs.io/reference/api/http/#api-v0-log-tail

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: ls IPFS-PATH &key RESOLVE-TYPE SIZE

Returns all sub-objects (IPFS hashes) under a given IPFS/IPNS directory path. Returns as an associative list. /ipns/docs.ipfs.io/reference/api/http/#api-v0-ls

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: name-publish IPFS-PATH &key RESOLVE LIFETIME ALLOW-OFFLINE TTL

Publish an IPNS name– associate it with an IPFS path. /ipns/docs.ipfs.io/reference/api/http/#api-v0-name-publish

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: name-pubsub-cancel NAME

Cancel subscription to a name. /ipns/docs.ipfs.io/reference/api/http/#api-v0-name-pubsub-cancel

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: name-pubsub-state ()

Query the state of IPNS pubsub. /ipns/docs.ipfs.io/reference/api/http/#api-v0-name-pubsub-state

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: name-pubsub-subs ()

Show current name subscriptions. /ipns/docs.ipfs.io/reference/api/http/#api-v0-name-pubsub-subs

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: name-resolve NAME &key RECURSIVE NOCACHE DHT-RECORD-COUNT DHT-TIMEOUT

Resolve a given IPNS name. /ipns/docs.ipfs.io/reference/api/http/#api-v0-name-resolve

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: object-data KEY

Output the raw data of an IPFS object. /ipns/docs.ipfs.io/reference/api/http/#api-v0-object-data

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: object-diff OBJECT-A OBJECT-B

Display the differences between two IPFS objects. /ipns/docs.ipfs.io/reference/api/http/#api-v0-object-diff

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: object-get KEY &key DATA-ENCODING

Get and serialize the named DAG node. /ipns/docs.ipfs.io/reference/api/http/#api-v0-object-get

Package

cl-ipfs-api2

Source

main.lisp (file)

Output the links pointed to by the specified object. /ipns/docs.ipfs.io/reference/api/http/#api-v0-object-links

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: object-new &key TEMPLATE

Create a new object from an IPFS template. /ipns/docs.ipfs.io/reference/api/http/#api-v0-object-new

Package

cl-ipfs-api2

Source

main.lisp (file)

Add a link to a given object. /ipns/docs.ipfs.io/reference/api/http/#api-v0-object-patch-add-link

Package

cl-ipfs-api2

Source

main.lisp (file)

Remove a link from a given object. /ipns/docs.ipfs.io/reference/api/http/#api-v0-object-patch-rm-link

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: object-stat KEY

Get stats for a DAG node. /ipns/docs.ipfs.io/reference/api/http/#api-v0-object-stat

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: p2p-close &key ALL PROTOCOL LISTEN-ADDRESS TARGET-ADDRESS

Stop listening for new connections to forward. /ipns/docs.ipfs.io/reference/api/http/#api-v0-p2p-close

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: p2p-listen PROTOCOL TARGET-ENDPOINT &key ALLOW-CUSTOM-PROTOCOL REPORT-PEER-ID

Create libp2p service. /ipns/docs.ipfs.io/reference/api/http/#api-v0-p2p-listen

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: p2p-ls ()

List active p2p listeners. /ipns/docs.ipfs.io/reference/api/http/#api-v0-p2p-ls

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: p2p-stream-close &key IDENTIFIER ALL

Close an active p2p stream. /ipns/docs.ipfs.io/reference/api/http/#api-v0-p2p-stream-close

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: p2p-stream-ls ()

List active p2p streams. /ipns/docs.ipfs.io/reference/api/http/#api-v0-p2p-stream-ls

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pin-add PATH &key RECURSIVE

Pin an object to local storage. /ipns/docs.ipfs.io/reference/api/http/#api-v0-pin-add

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pin-ls &key PATH TYPE

List objects pinned to local storage. /ipns/docs.ipfs.io/reference/api/http/#api-v0-pin-ls

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pin-rm PATH &key RECURSIVE

Remove pinned objects from local storage. /ipns/docs.ipfs.io/reference/api/http/#api-v0-pin-rm

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pin-update OLD-PATH NEW-PATH &key UNPIN

Update a recursive pin. /ipns/docs.ipfs.io/reference/api/http/#api-v0-pin-update

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pin-verify ()

Verify that recursive pins are complete. /ipns/docs.ipfs.io/reference/api/http/#api-v0-pin-verify

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pubsub-ls ()

Return a list of subscribed topics. /ipns/docs.ipfs.io/reference/api/http/#api-v0-pubsub-ls

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pubsub-peers &optional TOPIC

Return a list of peers with pubsub enabled. /ipns/docs.ipfs.io/reference/api/http/#api-v0-pubsub-peers

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pubsub-pub TOPIC STRING &key ENV

Publish a string to a given pubsub topic. /ipns/docs.ipfs.io/reference/api/http/#api-v0-pubsub-pub

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pubsub-sub TOPIC &key ENV

Subscribe to a given pubsub topic— this function requires go-ipfs to be installed on the current machine, and that ‘ipfs‘ is in the current $PATH. This probably will only work on *nix systems (sorry Windows nerds). Returns a uiop/launch-program::process-info socket– can be used in conjunction with the #’pubsub-sub-* functions, or with :uiop/launch-program’s functions.
A system-dependent replacement for /ipns/docs.ipfs.io/reference/api/http/#api-v0-pubsub-sub

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pubsub-sub-close PUBSUB-SOCKET

Close a ’pubsub stream’ (process-info-stream) and related processes.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pubsub-sub-listen PUBSUB-SOCKET

Process a ’pubsub stream’ (process-info-stream) and #’listen it.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pubsub-sub-process PUBSUB-SOCKET

Turn a uiop process-info-stream (’pubsub stream’) into a fd-stream that is #’read-char-able, etc.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pubsub-sub-read-char PUBSUB-SOCKET

Process a ’pubsub stream’ (process-info-stream) and #’readchar it.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: refs PATH &key UNIQUE RECURSIVE MAX-DEPTH

List links (references) from an object. /ipns/docs.ipfs.io/reference/api/http/#api-v0-refs

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: refs-local ()

List all local references. /ipns/docs.ipfs.io/reference/api/http/#api-v0-refs-local

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: repo-fsck ()

Remove repo lock-files. /ipns/docs.ipfs.io/reference/api/http/#api-v0-repo-fsck

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: repo-gc ()

Perform garbage collection on the repo. /ipns/docs.ipfs.io/reference/api/http/#api-v0-repo-gc

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: repo-stat ()

Get stats for the current repo. /ipns/docs.ipfs.io/reference/api/http/#api-v0-repo-stat

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: repo-verify ()

Verify that all repo blocks aren’t corrupted. /ipns/docs.ipfs.io/reference/api/http/#api-v0-repo-verify

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: repo-version ()

Show the repo version. /ipns/docs.ipfs.io/reference/api/http/#api-v0-repo-version

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: resolve IPFS-PATH &key RECURSIVE DHT-RECORD-COUNT DHT-TIMEOUT

Resolve a given name to an IPFS path.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: shutdown ()

Shut down the connected IPFS node. /ipns/docs.ipfs.io/reference/api/http/#api-v0-shutdown

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: stats-bitswap ()

Show diagnostics on bitswap. /ipns/docs.ipfs.io/reference/api/http/#api-v0-stats-bitswap

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: stats-bw &key PEER PROTO INTERVAL

Return bandwidth information. /ipns/docs.ipfs.io/reference/api/http/#api-v0-stats-bw

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: stats-repo ()

Show diagnostics on current repo. /ipns/docs.ipfs.io/reference/api/http/#api-v0-stats-repo

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: swarm-addrs ()

List known addresses. /ipns/docs.ipfs.io/reference/api/http/#api-v0-swarm-addrs

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: swarm-addrs-listen ()

List interface listening addresses. /ipns/docs.ipfs.io/reference/api/http/#api-v0-swarm-addrs-listen

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: swarm-addrs-local ()

List local addresses. /ipns/docs.ipfs.io/reference/api/http/#api-v0-swarm-addrs-local

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: swarm-connect ADDRESS

Open connection to a given address. /ipns/docs.ipfs.io/reference/api/http/#api-v0-swarm-connect

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: swarm-disconnect ADDRESS

Close connection to a given address. /ipns/docs.ipfs.io/reference/api/http/#api-v0-swarm-disconnect

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: swarm-filters ()

List address filters. /ipns/docs.ipfs.io/reference/api/http/#api-v0-swarm-filters

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: swarm-filters-add MULTIADDR

Add an address filter. /ipns/docs.ipfs.io/reference/api/http/#api-v0-swarm-filters-add

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: swarm-filters-rm MULTIADDR

Remove an address filter. /ipns/docs.ipfs.io/reference/api/http/#api-v0-swarm-filters-rm

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: swarm-peers ()

List peers with open connections. /ipns/docs.ipfs.io/reference/api/http/#api-v0-swarm-peers

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: urlstore-add URL &key PIN TRICKLE

Add a URL via urlstore. /ipns/docs.ipfs.io/reference/api/http/#api-v0-urlstore-add

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: version ()

Return the current IPFS version. /ipns/docs.ipfs.io/reference/api/http/#api-v0-version

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: version-deps ()

Return info about dependencies used for build; I.E., Go version, OS, etc. /ipns/docs.ipfs.io/reference/api/http/#api-v0-version

Package

cl-ipfs-api2

Source

main.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Macros

Macro: bind-api-alist CALL

Basically #’bind-api-result, but it assumes the final form is a hash-table, and maps it to an associative list.

Package

cl-ipfs-api2

Source

main.lisp (file)

Macro: bind-api-result CALL FORM

Wrap around an #’ipfs-call form; if #’call returns an error, then return NIL and the error message– (NIL STRING)– otherwise, execute #’form.
Binds the result of the API call to… you guessed it, the variable ’result’. The error message is assigned to ’message’, if such a thing exists.

Package

cl-ipfs-api2

Source

main.lisp (file)

Macro: error-p FORM

Return whether or not a given form errors out.

Package

cl-ipfs-api2

Source

main.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: config-get KEY

Get a config key’s value.
Doesn’t map with any existant API call; it’s just a convenience wrapper around #’config.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: config-set KEY VALUE &key BOOL JSON

Set a config key’s value.
Doesn’t map with any existant API call; it’s just a convenience wrapper around #’config.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: empty-string-p STRING

Return whether or not a given item is an empty string.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: ipfs-call CALL ARGUMENTS &key PARAMETERS WANT-STREAM METHOD

Make an IPFS HTTP API call. Quite commonly used.
Some calls return strings/raw data, and others return JSON.
When strings/arbitrary data are recieved, they’re returned verbatim. But, when JSON is returned, it is parsed into a hashtable.
If the JSON is ’error JSON’, I.E., it signals that an error has been recieved, two values are returned: NIL and the string-error-message.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: make-call-url HOST ROOT CALL ARGUMENTS

Create the URL of an API call, as per the given arguments.
Symbols are assumed to be something like ’T (so boolean), nil likewise. Arguments should look like this:
((’recursive’ nil)(’name’ ’xabbu’))

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: p2p-forward PROTOCOL LISTENING-ENDPOINT TARGET-ENDPOINT &key ALLOW-CUSTOM-PROTOCOL

Forward connections to libp2p service. /ipns/docs.ipfs.io/reference/api/http/#api-v0-p2p-forward

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: pure-cons-p ITEM

Return whether or not an item is ’purely’ a cons-pair; that is, it isn’t of a larger list. In these cases, #’consp passes, but #’length errors out.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: re-hash-table-alist HASH-TABLE

Turn a hash-table into an associative list, recursively– if any of the hash-table’s values are ther hash-tables, they too are turned into alists.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: string+ &rest STRINGS

Combine an arbitrary amount of strings into a single string.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: test-apply TEST FUNCTION DATA

Apply a given function to all items within a list that pass the given test, recursively. AKA, if the given function returns another list, the process is applied to that list as well. So on and so forth.

Package

cl-ipfs-api2

Source

main.lisp (file)

Function: url-encode STRING &rest IGNORED

Wrap around drakma’s url encoder, with a slight change– instead of using plus-signs for spaces, we want to use %20.

Package

cl-ipfs-api2

Source

main.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   C   F   L  
Index Entry  Section

C
cl-ipfs-api2.asd: The cl-ipfs-api2<dot>asd file
cl-ipfs-api2/main.lisp: The cl-ipfs-api2/main<dot>lisp file
cl-ipfs-api2/package.lisp: The cl-ipfs-api2/package<dot>lisp file

F
File, Lisp, cl-ipfs-api2.asd: The cl-ipfs-api2<dot>asd file
File, Lisp, cl-ipfs-api2/main.lisp: The cl-ipfs-api2/main<dot>lisp file
File, Lisp, cl-ipfs-api2/package.lisp: The cl-ipfs-api2/package<dot>lisp file

L
Lisp File, cl-ipfs-api2.asd: The cl-ipfs-api2<dot>asd file
Lisp File, cl-ipfs-api2/main.lisp: The cl-ipfs-api2/main<dot>lisp file
Lisp File, cl-ipfs-api2/package.lisp: The cl-ipfs-api2/package<dot>lisp file

Jump to:   C   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   A   B   C   D   E   F   I   K   L   M   N   O   P   R   S   T   U   V  
Index Entry  Section

A
add: Exported functions

B
bind-api-alist: Internal macros
bind-api-result: Internal macros
bitswap-ledger: Exported functions
bitswap-reprovide: Exported functions
bitswap-stat: Exported functions
bitswap-wantlist: Exported functions
block-get: Exported functions
block-put: Exported functions
block-rm: Exported functions
block-stat: Exported functions
bootstrap: Exported functions
bootstrap-add: Exported functions
bootstrap-add-default: Exported functions
bootstrap-list: Exported functions
bootstrap-rm: Exported functions
bootstrap-rm-all: Exported functions

C
cat: Exported functions
cid-base32: Exported functions
cid-bases: Exported functions
config: Exported functions
config-get: Internal functions
config-set: Internal functions
config-show: Exported functions

D
dag-get: Exported functions
dag-put: Exported functions
dag-resolve: Exported functions
dht-findpeer: Exported functions
dht-findprovs: Exported functions
dht-get: Exported functions
dht-provide: Exported functions
dht-put: Exported functions
dht-query: Exported functions
diag-cmds: Exported functions
diag-cmds-clear: Exported functions
diag-cmds-set-time: Exported functions
diag-sys: Exported functions
dl: Exported functions
dns: Exported functions

E
empty-string-p: Internal functions
error-p: Internal macros

F
file-ls: Exported functions
files-chcid: Exported functions
files-cp: Exported functions
files-flush: Exported functions
files-ls: Exported functions
files-mkdir: Exported functions
files-mv: Exported functions
files-read: Exported functions
files-rm: Exported functions
files-stat: Exported functions
files-write: Exported functions
filestore-dups: Exported functions
filestore-ls: Exported functions
filestore-verify: Exported functions
Function, add: Exported functions
Function, bitswap-ledger: Exported functions
Function, bitswap-reprovide: Exported functions
Function, bitswap-stat: Exported functions
Function, bitswap-wantlist: Exported functions
Function, block-get: Exported functions
Function, block-put: Exported functions
Function, block-rm: Exported functions
Function, block-stat: Exported functions
Function, bootstrap: Exported functions
Function, bootstrap-add: Exported functions
Function, bootstrap-add-default: Exported functions
Function, bootstrap-list: Exported functions
Function, bootstrap-rm: Exported functions
Function, bootstrap-rm-all: Exported functions
Function, cat: Exported functions
Function, cid-base32: Exported functions
Function, cid-bases: Exported functions
Function, config: Exported functions
Function, config-get: Internal functions
Function, config-set: Internal functions
Function, config-show: Exported functions
Function, dag-get: Exported functions
Function, dag-put: Exported functions
Function, dag-resolve: Exported functions
Function, dht-findpeer: Exported functions
Function, dht-findprovs: Exported functions
Function, dht-get: Exported functions
Function, dht-provide: Exported functions
Function, dht-put: Exported functions
Function, dht-query: Exported functions
Function, diag-cmds: Exported functions
Function, diag-cmds-clear: Exported functions
Function, diag-cmds-set-time: Exported functions
Function, diag-sys: Exported functions
Function, dl: Exported functions
Function, dns: Exported functions
Function, empty-string-p: Internal functions
Function, file-ls: Exported functions
Function, files-chcid: Exported functions
Function, files-cp: Exported functions
Function, files-flush: Exported functions
Function, files-ls: Exported functions
Function, files-mkdir: Exported functions
Function, files-mv: Exported functions
Function, files-read: Exported functions
Function, files-rm: Exported functions
Function, files-stat: Exported functions
Function, files-write: Exported functions
Function, filestore-dups: Exported functions
Function, filestore-ls: Exported functions
Function, filestore-verify: Exported functions
Function, id: Exported functions
Function, ipfs-call: Internal functions
Function, key-gen: Exported functions
Function, key-list: Exported functions
Function, key-remove: Exported functions
Function, key-rename: Exported functions
Function, log-level: Exported functions
Function, log-ls: Exported functions
Function, log-tail: Exported functions
Function, ls: Exported functions
Function, make-call-url: Internal functions
Function, name-publish: Exported functions
Function, name-pubsub-cancel: Exported functions
Function, name-pubsub-state: Exported functions
Function, name-pubsub-subs: Exported functions
Function, name-resolve: Exported functions
Function, object-data: Exported functions
Function, object-diff: Exported functions
Function, object-get: Exported functions
Function, object-links: Exported functions
Function, object-new: Exported functions
Function, object-patch-add-link: Exported functions
Function, object-patch-rm-link: Exported functions
Function, object-stat: Exported functions
Function, p2p-close: Exported functions
Function, p2p-forward: Internal functions
Function, p2p-listen: Exported functions
Function, p2p-ls: Exported functions
Function, p2p-stream-close: Exported functions
Function, p2p-stream-ls: Exported functions
Function, pin-add: Exported functions
Function, pin-ls: Exported functions
Function, pin-rm: Exported functions
Function, pin-update: Exported functions
Function, pin-verify: Exported functions
Function, pubsub-ls: Exported functions
Function, pubsub-peers: Exported functions
Function, pubsub-pub: Exported functions
Function, pubsub-sub: Exported functions
Function, pubsub-sub-close: Exported functions
Function, pubsub-sub-listen: Exported functions
Function, pubsub-sub-process: Exported functions
Function, pubsub-sub-read-char: Exported functions
Function, pure-cons-p: Internal functions
Function, re-hash-table-alist: Internal functions
Function, refs: Exported functions
Function, refs-local: Exported functions
Function, repo-fsck: Exported functions
Function, repo-gc: Exported functions
Function, repo-stat: Exported functions
Function, repo-verify: Exported functions
Function, repo-version: Exported functions
Function, resolve: Exported functions
Function, shutdown: Exported functions
Function, stats-bitswap: Exported functions
Function, stats-bw: Exported functions
Function, stats-repo: Exported functions
Function, string+: Internal functions
Function, swarm-addrs: Exported functions
Function, swarm-addrs-listen: Exported functions
Function, swarm-addrs-local: Exported functions
Function, swarm-connect: Exported functions
Function, swarm-disconnect: Exported functions
Function, swarm-filters: Exported functions
Function, swarm-filters-add: Exported functions
Function, swarm-filters-rm: Exported functions
Function, swarm-peers: Exported functions
Function, test-apply: Internal functions
Function, url-encode: Internal functions
Function, urlstore-add: Exported functions
Function, version: Exported functions
Function, version-deps: Exported functions

I
id: Exported functions
ipfs-call: Internal functions

K
key-gen: Exported functions
key-list: Exported functions
key-remove: Exported functions
key-rename: Exported functions

L
log-level: Exported functions
log-ls: Exported functions
log-tail: Exported functions
ls: Exported functions

M
Macro, bind-api-alist: Internal macros
Macro, bind-api-result: Internal macros
Macro, error-p: Internal macros
make-call-url: Internal functions

N
name-publish: Exported functions
name-pubsub-cancel: Exported functions
name-pubsub-state: Exported functions
name-pubsub-subs: Exported functions
name-resolve: Exported functions

O
object-data: Exported functions
object-diff: Exported functions
object-get: Exported functions
object-links: Exported functions
object-new: Exported functions
object-patch-add-link: Exported functions
object-patch-rm-link: Exported functions
object-stat: Exported functions

P
p2p-close: Exported functions
p2p-forward: Internal functions
p2p-listen: Exported functions
p2p-ls: Exported functions
p2p-stream-close: Exported functions
p2p-stream-ls: Exported functions
pin-add: Exported functions
pin-ls: Exported functions
pin-rm: Exported functions
pin-update: Exported functions
pin-verify: Exported functions
pubsub-ls: Exported functions
pubsub-peers: Exported functions
pubsub-pub: Exported functions
pubsub-sub: Exported functions
pubsub-sub-close: Exported functions
pubsub-sub-listen: Exported functions
pubsub-sub-process: Exported functions
pubsub-sub-read-char: Exported functions
pure-cons-p: Internal functions

R
re-hash-table-alist: Internal functions
refs: Exported functions
refs-local: Exported functions
repo-fsck: Exported functions
repo-gc: Exported functions
repo-stat: Exported functions
repo-verify: Exported functions
repo-version: Exported functions
resolve: Exported functions

S
shutdown: Exported functions
stats-bitswap: Exported functions
stats-bw: Exported functions
stats-repo: Exported functions
string+: Internal functions
swarm-addrs: Exported functions
swarm-addrs-listen: Exported functions
swarm-addrs-local: Exported functions
swarm-connect: Exported functions
swarm-disconnect: Exported functions
swarm-filters: Exported functions
swarm-filters-add: Exported functions
swarm-filters-rm: Exported functions
swarm-peers: Exported functions

T
test-apply: Internal functions

U
url-encode: Internal functions
urlstore-add: Exported functions

V
version: Exported functions
version-deps: Exported functions

Jump to:   A   B   C   D   E   F   I   K   L   M   N   O   P   R   S   T   U   V  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*api-host*: Exported special variables
*api-root*: Exported special variables
*ipfs-root*: Exported special variables

S
Special Variable, *api-host*: Exported special variables
Special Variable, *api-root*: Exported special variables
Special Variable, *ipfs-root*: Exported special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   P   S  
Index Entry  Section

C
cl-ipfs-api2: The cl-ipfs-api2 system
cl-ipfs-api2: The cl-ipfs-api2 package

P
Package, cl-ipfs-api2: The cl-ipfs-api2 package

S
System, cl-ipfs-api2: The cl-ipfs-api2 system

Jump to:   C   P   S