Liking cljdoc? Tell your friends :D

clota: aka iota.lib.clj

An IOTA Client Library Implemented in Clojure

This library aims to be an idiomatic, feature-complete, client implementation of the full IOTA API Command Set.

Getting Started

Get Clota from clojars:

Clojars Project

or download and install directly:

git clone https://github.com/tuddman/iota.lib.clj
cd iota.lib.clj
lein clean && lein install

Usage

;; Include Clota Library in your project

> (require '[clota.client :as iota])

;; Commands - from a REPL

> (def node-uri "http://0.0.0.0:14625")

;; OPTIONAL - if you have REMOTE_AUTH set for the node. If so, you will need to send the token along with every command.

> (def token (iota/make-auth-token "user:password")

> (iota/get-node-info node-uri token)

> (iota/get-neighbors node-uri token)

> (iota/add-neighbors node-uri ["udp://good.neighbor:14265" ...] token)

> (iota/remove-neighbors node-uri ["udp://bad.neighbor:14265" ...] token)

> (iota/get-tips node-uri token)

> (iota/find-transactions node-uri {:addresses ["SOMEIOTAHASHADDRESS..." ...]} token)

> (iota/get-trytes node-uri ["SOMEIOTATRYTES...999"] token)

> (iota/get-inclusion-states node-uri {:transactions ["..." ...] :tips ["..." ...]} token)

> (iota/get-balances node-uri {:addresses ["..." ...] :threshold 100} token)

> (iota/get-transactions-to-approve node-uri {:depth 27} token)

> (iota/attach-to-tangle node-uri {:trunkTransaction "..." :branchTransaction "..." :min-weight-magnitude 18 :trytes ["..." ...]} token)

> (iota/interrupt-attaching-to-tangle node-uri token)

> (iota/broadcast-transactions node-uri ["SOMETXHASH..." ...] token)

> (iota/store-transactions node-uri ["SOMETXHASH..." ...] token)

read the API Docs

API CommandClota FunctionStatusTest Coverage
getNodeInfo(get-node-info ...)ImplementedComplete
getNeighbors(get-neighbors ...)ImplementedComplete
removeNeighbors(remove-neighbors ...)ImplementedComplete
getTips(get-tips ...)ImplementedComplete
findTransactions(find-transactions ...)ImplementedNone
getTrytes(get-trytes ...)ImplementedNone
getInclusionStates(get-inclusion-states ...)ImplementedNone
getBalances(get-balances ...)ImplementedNone
getTransactionsToApprove(get-transactions-to-approve ...)ImplementedNone
attachToTangle(attach-to-tangle ...)ImplementedNone
interruptAttachingToTangle(interrupt-attaching-to-tangle ...)ImplementedNone
broadcastTransactions(broadcast-transactions ...)ImplementedNone
storeTransactions(store-transactions ...)ImplementedNone

for more, look in src/clota/client.clj

Generate a Secure Random Seed

;; PLEASE BE ADVISED : DO NOT SHARE YOUR PRIVATE SEED WITH ANYONE. EVER!
;; To Generate a Secure Random Seed:

> (clota.crypto/generate-seed)

 =>  "9KHKESVOHBOMHCL9ADINALYVHSBKRHITKMOJJJHFKOHWBZDFQDVLKQMTVZTUTWHIWXISBRIFXPZEEZTUU" 

;; Or, if that's not good enough for 'ya, 
;; and you want to do some more randomized matrix math to generate your seed:

> (clota.crypto/generate-paranoid-seed)

 =>  "IKAGOIVHXAR9XRJMC9LIXHMFAXYAAXKSAXJE99ODVRMISXWNJIIGGVCQIKLVHMRQRQKESJDESRSQOUZTA"

Testing

Continuous Integration Tests are provided by Travis CI.

Build Status

To run the tests yourself:

$ lein test

Pull Requests Welcome.

Donate: F99IWXVIZPSXTDT9YUMHRAIGKXDQAUZCXWQJZWM9SIIOOFDHGEGCJVZOJJHMAZISPKVUYNUJQLANFXOMWNHNFJKPOB


Copyright © 2018 - now tuddman

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

Can you improve this documentation?Edit on GitHub

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

× close