Coder Social home page Coder Social logo

iota.lib.clj's Introduction

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 Command Clota Function Status Test Coverage
getNodeInfo (get-node-info ...) Implemented Complete
getNeighbors (get-neighbors ...) Implemented Complete
removeNeighbors (remove-neighbors ...) Implemented Complete
getTips (get-tips ...) Implemented Complete
findTransactions (find-transactions ...) Implemented None
getTrytes (get-trytes ...) Implemented None
getInclusionStates (get-inclusion-states ...) Implemented None
getBalances (get-balances ...) Implemented None
getTransactionsToApprove (get-transactions-to-approve ...) Implemented None
attachToTangle (attach-to-tangle ...) Implemented None
interruptAttachingToTangle (interrupt-attaching-to-tangle ...) Implemented None
broadcastTransactions (broadcast-transactions ...) Implemented None
storeTransactions (store-transactions ...) Implemented None

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.

iota.lib.clj's People

Contributors

tuddman avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.