{"id":32195980,"url":"https://github.com/serge-medvedev/tonos-client-clojure","last_synced_at":"2026-02-23T05:02:10.488Z","repository":{"id":41240639,"uuid":"305524925","full_name":"serge-medvedev/tonos-client-clojure","owner":"serge-medvedev","description":"Clojure bindings to EVER SDK's Core Client Library","archived":false,"fork":false,"pushed_at":"2023-11-29T10:47:13.000Z","size":219,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-22T02:39:25.153Z","etag":null,"topics":["ever-sdk","everscale","freeton","freeton-sdk"],"latest_commit_sha":null,"homepage":"","language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"epl-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/serge-medvedev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-19T22:10:42.000Z","updated_at":"2023-08-02T08:22:10.000Z","dependencies_parsed_at":"2023-02-09T13:16:00.526Z","dependency_job_id":null,"html_url":"https://github.com/serge-medvedev/tonos-client-clojure","commit_stats":null,"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/serge-medvedev/tonos-client-clojure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serge-medvedev%2Ftonos-client-clojure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serge-medvedev%2Ftonos-client-clojure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serge-medvedev%2Ftonos-client-clojure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serge-medvedev%2Ftonos-client-clojure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/serge-medvedev","download_url":"https://codeload.github.com/serge-medvedev/tonos-client-clojure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/serge-medvedev%2Ftonos-client-clojure/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29738083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T04:51:08.365Z","status":"ssl_error","status_checked_at":"2026-02-23T04:49:15.865Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ever-sdk","everscale","freeton","freeton-sdk"],"created_at":"2025-10-22T02:24:19.709Z","updated_at":"2026-02-23T05:02:10.470Z","avatar_url":"https://github.com/serge-medvedev.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Clojars Project](https://img.shields.io/clojars/vpre/tonos-client.svg)](https://clojars.org/tonos-client)\n![Testing](https://github.com/serge-medvedev/tonos-client-clojure/workflows/tests/badge.svg)\n\n# Clojure bindings to EVER SDK's Core Client Library\n\n## Why Clojure?\n\nClojure is a modern and powerful functional programming language. A few great products use it for configuration and a whole lot more are written in it. The former case was the primary motivation to create this bindings library: to provide a native way to interact with the Everscale blockchain from within configuration pipelines of such event processing systems as [Riemann](https://riemann.io/) (written and configurable via Clojure) and [Apache Storm](https://storm.apache.org/) (supports Clojure-based DSL for configuration).\n\nHaving that in place, one can, for example, alter the behavior of his/her event processing pipelines depending on the blockchain state or change that state based on event patterns analysis. Since both Riemann and Apache Storm fit for arbitrary computations, the number of possible use cases is huge.\n\n## Usage\n### Prerequisites\n- _libton_client.so_ is accessible somewhere at well-known locations\n  ```console\n  # wget http://sdkbinaries-ws.tonlabs.io/tonclient_1_45_0_linux.gz -O /usr/lib/libton_client.so.gz \\\n    \u0026\u0026 gunzip /usr/lib/libton_client.so.gz\n  ```\n### Example\n```clojure\n[tonos-client \"1.45.0\"]\n\n; In the ns statement:\n(ns my.ns\n  (:require [tonos.client.core :as core]\n            [tonos.client.client :as client]))\n\n; In the code:\n(let [config \"{\\\"network\\\":{\\\"endpoints\\\":[\\\"eri01.net.everos.dev\\\"]}}\"\n      context (core/create-context config)]\n  (println (client/version! context))\n  (core/destroy-context context))\n```\n\n## Features\n\nAt its heart this bindings library utilizes JNA and Clojure's async channels to harness the power of the EVER OS SDK's Core Client Library.\nThe whole asynchronisity is abstracted away from the user via such a powerful construct of Clojure as __lazy sequences__, which leads to uniformity and consistency of user experience, being the main focus since the bindings code itself is completely auto-generated.\n\nLet's see how it looks like.\n\nThere's what we do to subscribe to events, related to a particular _collection_, process them somehow and unsubscribe when ready:\n```clojure\n(let [events (net/subscribe-collection context params)\n      handle (-\u003e events first :params-json :handle)]\n  (doseq [e (rest events)]\n    (println e)\n    (when (it-is-time-to-unsubscribe)\n      (net/unsubscribe context {:handle handle}))))\n```\n\nLet's suppose that we're interested in the last event only:\n```clojure\n(-\u003e (processing/process-message context params)\n    doall\n    last\n    :params-json\n    println)\n```\n\nKinda verbose, isn't it? In fact, the pattern above is so common that there's a shortcut version for almost every function in the library. Note the exclamation mark at the end of a function name:\n```clojure\n(-\u003e (processing/process-message! context params)\n    println)\n```\nIn such case, the function blocks until the underlying call is finished. Both versions might have their uses (see `process-message-test` and how `process-message` is being called in `fund-account`, for example).\n\nOne might point out that usage of lazy sequences comes with a bit of boilerplate code but when you realize the full potential of the approach, you gladly ignore that little drawback. __Higher order functions__ applicability worths a lot by itself. Just think: when blockchain events are represented by a lazy sequence, they become a subject for mapping, reducing, filtering and other useful functional techniques.\n\nFor example, let's retrieve a _shard block id_ while sending a message, using filtering:\n```clojure\n(let [shard-block-id (-\u003e\u003e (processing/send-message context params)\n                          (filter #(and (-\u003e % :params-json (contains? :shard_block_id))\n                                        (-\u003e % :response-type (= 0))))\n                          first\n                          :params-json\n                          :shard_block_id)]\n  (println shard-block-id))\n```\n\n__Although this library is useful by itself, various wrappers and DSLs are expected to be built on top of it.__\n\n## Building\n\nThe simplest way to build the library and run the tests is by having Docker installed.\n\nWhen ready, build the image:\n```console\n$ docker build -t tonos-client-clojure .\n```\n\n## Testing\n\nThe library has over 50 tests.\n\nThere are four categories of them:\n- fast \u0026 slow\n- free \u0026 paid\n\nAnd it's also good to know that:\n- all __fast__ tests are __free__ and all __paid__ tests are __slow__\n- all __free__ tests are being run automatically as a Docker image build step\n- some tests depend on either DevNet or MainNet accessibility\n\nThe __paid__ tests are those which require account funding, e.g. for successful contract deployment. To run them, you need to:\n- have a wallet on the [DevNet](https://net.ton.dev) with some tokens in it\n- create a file called _funding-wallet.json_ under the _dev-rc_ directory based on [funding-wallet.json.example](dev-rc/funding-wallet.json.example)\n\nWhen ready, do the following:\n```shell\n$ docker run --rm tonos-client-clojure lein test :paid\n```\n\u003e NOTE: replace \"paid\" with another name to run specific category of tests. Get rid of any test selectors to run the whole test suite.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserge-medvedev%2Ftonos-client-clojure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fserge-medvedev%2Ftonos-client-clojure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fserge-medvedev%2Ftonos-client-clojure/lists"}