district0x / cljs-ipfs-api

ClojureScript IPFS-API wrapper lib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cljs IPFS-API (DEPRECATED)

Build Status

ClojureScript wrapper for JavaScript HTTP IPFS client library

Installation

;; Add to dependencies
[district0x/cljs-ipfs-api "0.0.13-SNAPSHOT"]
(ns my.app
  (:require 
  [cljs-ipfs-api.core :as icore :refer [init-ipfs-node]] ;;Or init-ipfs-web for web
  [cljs-ipfs-api.files :as ifiles]))

Usage

So basically, stick with the js-ipfs-api docs, all methods there have their kebab-cased version in this library. Also, return values and responses in callbacks are automatically kebab-cased and keywordized. You can provide IPFS instance as an additional first argument to each function, in case you'd need more than one connection:

Example call

(init-ipfs-node "/ip4/127.0.0.1/tcp/5001")
;;fls to avoid clashes with ls from files.ls
(ifiles/fls "/ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG/" (fn [err files]
                                                                      (info [err "ERROR"])
                                                                      (info [files "FILES"])))

cljs.core.async integration

You can also provide an async channel instead of the callback function

About

ClojureScript IPFS-API wrapper lib


Languages

Language:Clojure 100.0%