Skip to content

wambat/cljs-ipfs-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cljs IPFS-API

ClojureScript wrapper for JavaScript HTTPL client library

Installation

;; Add to dependencies
[cljs-ipfs-api "0.0.12-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")
(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

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published