- Notifications
You must be signed in to change notification settings - Fork4
Simple Clojure wrapper for IPFS API
License
NotificationsYou must be signed in to change notification settings
keorn/clj-ipfs-http-client
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A simple wrapper for interacting withIPFS API
[clj-ipfs-api"1.2.3"];; In your ns statement:(nsmy.ns (:require [clj-ipfs-api.core:as ipfs]))
Launch theIPFS Daemon.
;; for default daemon settings use just like cli;; commands are joined with dashes(ipfs/swarm-peers);; arguments are strings(ipfs/cat"QmShWPeTZL5px2YGvgJD99C4SuHEqry1u1RoNu1bAVDkM1""QmbRdyLXiFWrKc5hW1NbvpUxF9tLovWCPgiz4BDhjD9k3j");; flags go in a map(ipfs/swarm-peers {:type"indirect"})
Custom API server address has to be set up.
(ipfs/set-api-url!"http://127.0.0.1:55555")
Everything is decoded from json, exceptcat
.To change request options use a map under:request
key.
;; different API server(ipfs/swarm-peers {:request {:url"http://127.0.0.1:55555"}});; 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 inclj-http.