Liking cljdoc? Tell your friends :D

IPFS API wrapper in Clojure

A simple wrapper for interacting with IPFS API

Get it

[clj-ipfs-api "1.2.3"]

;; In your ns statement:
(ns my.ns
  (:require [clj-ipfs-api.core :as ipfs]))


Launch the IPFS Daemon.

;; for default daemon settings use just like cli
;; commands are joined with dashes
;; arguments are strings
;; flags go in a map
(ipfs/swarm-peers {:type "indirect"}) 

Custom API server address has to be set up.

(ipfs/set-api-url! "")

Everything is decoded from json, except cat. To change request options use a map under :request key.

;; different API server
(ipfs/swarm-peers {:request {:url ""}})

;; for big files use a stream, no json parsing is done in this case
(ipfs/swarm-peers {:request {:as :stream}})

For more options that are taken by the :request map, look at the second argument of request function in clj-http.


Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Copyright © 201 keorn

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close