项目作者: tuddman

项目描述 :
IOTA Clojure Client
高级语言: Clojure
项目地址: git://github.com/tuddman/iota.lib.clj.git
创建时间: 2017-08-17T22:58:04Z
项目社区:https://github.com/tuddman/iota.lib.clj

开源协议:Eclipse Public License 1.0

下载


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:

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

Usage

  1. ;; Include Clota Library in your project
  2. > (require '[clota.client :as iota])
  3. ;; Commands - from a REPL
  4. > (def node-uri "http://0.0.0.0:14625")
  5. ;; OPTIONAL - if you have REMOTE_AUTH set for the node. If so, you will need to send the token along with every command.
  6. > (def token (iota/make-auth-token "user:password")
  7. > (iota/get-node-info node-uri token)
  8. > (iota/get-neighbors node-uri token)
  9. > (iota/add-neighbors node-uri ["udp://good.neighbor:14265" ...] token)
  10. > (iota/remove-neighbors node-uri ["udp://bad.neighbor:14265" ...] token)
  11. > (iota/get-tips node-uri token)
  12. > (iota/find-transactions node-uri {:addresses ["SOMEIOTAHASHADDRESS..." ...]} token)
  13. > (iota/get-trytes node-uri ["SOMEIOTATRYTES...999"] token)
  14. > (iota/get-inclusion-states node-uri {:transactions ["..." ...] :tips ["..." ...]} token)
  15. > (iota/get-balances node-uri {:addresses ["..." ...] :threshold 100} token)
  16. > (iota/get-transactions-to-approve node-uri {:depth 27} token)
  17. > (iota/attach-to-tangle node-uri {:trunkTransaction "..." :branchTransaction "..." :min-weight-magnitude 18 :trytes ["..." ...]} token)
  18. > (iota/interrupt-attaching-to-tangle node-uri token)
  19. > (iota/broadcast-transactions node-uri ["SOMETXHASH..." ...] token)
  20. > (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

  1. ;; PLEASE BE ADVISED : DO NOT SHARE YOUR PRIVATE SEED WITH ANYONE. EVER!
  2. ;; To Generate a Secure Random Seed:
  3. > (clota.crypto/generate-seed)
  4. => "9KHKESVOHBOMHCL9ADINALYVHSBKRHITKMOJJJHFKOHWBZDFQDVLKQMTVZTUTWHIWXISBRIFXPZEEZTUU"
  5. ;; Or, if that's not good enough for 'ya,
  6. ;; and you want to do some more randomized matrix math to generate your seed:
  7. > (clota.crypto/generate-paranoid-seed)
  8. => "IKAGOIVHXAR9XRJMC9LIXHMFAXYAAXKSAXJE99ODVRMISXWNJIIGGVCQIKLVHMRQRQKESJDESRSQOUZTA"

Testing

Continuous Integration Tests are provided by Travis CI.

Build Status

To run the tests yourself:

  1. $ 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.