{"id":30011871,"url":"https://github.com/datopia/abci-host","last_synced_at":"2025-08-05T13:05:41.658Z","repository":{"id":45879300,"uuid":"160831179","full_name":"datopia/abci-host","owner":"datopia","description":"Clojure host/server for Tendermint's ABCI protocol.","archived":false,"fork":false,"pushed_at":"2025-05-31T06:58:43.000Z","size":117,"stargazers_count":25,"open_issues_count":1,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-03T06:42:27.850Z","etag":null,"topics":["abci","blockchain","clojure","consensus","distributed-systems","tendermint"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/datopia.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-12-07T14:03:43.000Z","updated_at":"2025-05-31T06:58:16.000Z","dependencies_parsed_at":"2024-01-02T02:42:25.792Z","dependency_job_id":"d91d8c7e-8393-4ddd-b805-833a088a372d","html_url":"https://github.com/datopia/abci-host","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":0.25,"last_synced_commit":"b948f5ad375b16e37197b70b520074874294628c"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/datopia/abci-host","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datopia%2Fabci-host","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datopia%2Fabci-host/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datopia%2Fabci-host/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datopia%2Fabci-host/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/datopia","download_url":"https://codeload.github.com/datopia/abci-host/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/datopia%2Fabci-host/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268568822,"owners_count":24271458,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["abci","blockchain","clojure","consensus","distributed-systems","tendermint"],"created_at":"2025-08-05T13:02:15.912Z","updated_at":"2025-08-05T13:05:41.638Z","avatar_url":"https://github.com/datopia.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# org.datopia/abci\n\n[![Clojars\nProject](http://clojars.org/org.datopia/abci/latest-version.svg)](http://clojars.org/org.datopia/abci)\n\nA Clojure library which acts as an application host\nfor\n[Tendermint](https://tendermint.com)'s\n[ABCI](https://tendermint.com/docs/introduction/what-is-tendermint.html#abci-overview) ---\nallowing the exposure of plain functions as replicable state machines.\n\n`org.datopia/abci`\nuses [org.datopia/stickler](https://github.com/datopia/stickler) to provide\npure-data representations of\nthe [protobuf](https://developers.google.com/protocol-buffers/)-encoded messages\nreceived from the Tendermint node process --- maps in, maps out.\n\n## Documentation\n\n - [API docs](https://datopia.github.io/abci-host/).\n - [K/V store example project](example).\n\n### [Change Log](CHANGELOG.md).\n\n## Project -\u003e Tendermint Version Mapping\n\n\n| org.datopia/abci  | Tendermint        |\n| ----------------- | ----------------- |\n| 0.2.0             | 0.38.5 (CometBFT) |\n| 0.1.0             | 0.34.12           |\n\nThere's a previous, deprecated artifact:\n\n| io.datopia/abci   |               |\n| ----------------- | ------------- |\n| 0.1.*             | 0.26.0        |\n\n## Toy Example / Walkthrough\n\nThe simplest possible service looks something like:\n\n```clojure\n(ns my.abci\n  (:require [abci.host            :as host]\n            [abci.host.middleware :as mw]))\n\n(def service\n  (-\u003e (constantly ::mw/default)\n      ;; Wrap handler invocations w/ (manifold.deferred/future).\n      mw/wrap-synchronous\n      ;; Substitute ::mw/default for a default success response,\n      ;; appropriate to the incoming request.\n      mw/wrap-default\n      ;; Return a Closeable, per aleph.tcp/start-server.\n      host/start))\n```\n\nWhile this isn't a particularly dynamic application, we can successfully point a\nTendermint node process at it and indefinitely operate a no-op blockchain.\n\n## Requests \u0026 Responses\n\nLet's transform our handler from `(constantly ::mw/default)` to something\nslightly different:\n\n```clojure\n(fn [req]\n  (pprint req)\n  ::mw/default)\n```\n\nOnce the Tendermint node connects, our first message:\n\n```clojure\n{:stickler/msg          :abci/Request\n :info                  {:stickler/msg  :abci/RequestInfo\n                         :version       \"0.26.0-c086d0a3\"\n                         :block-version 7\n                         :p2p-version   4}\n :stickler.one-of/value :info\n ;; The node initiates 3 distinct connections: :info, :query, :consensus\n :abci.host/conn        :info}\n```\n\nThe minimal success response to the above:\n\n```clojure\n{:stickler/msg :abci/Response\n :info         {:stickler/msg :abci/ResponseInfo\n                :data         \"NO_INFO\"}}\n```\n\nLet's update our service to construct this response explictly, while\nusing middleware to strip incoming `:abci/Request` envelopes - and\nwrap responses in `:abci/Response` envelopes.  While this won't alter\nhow our service functions, it may make it a little clearer.\n\n```clojure\n(defn handler [{msg-type :stickler/msg :as req}]\n  (pprint req)\n  (case msg-type\n    :abci/RequestInfo {:stickler/msg :abci/ResponseInfo\n                       :data         \"NO_INFO\"}\n    ::mw/default))\n\n(def service\n  (-\u003e handler\n      mw/wrap-synchronous\n      mw/wrap-default\n      ;; Combines mw/wrap-request-envelope and mw/wrap-response-envelope\n      mw/wrap-envelope\n      host/start))\n```\n\nWithout the envelopes, our incoming request sequence:\n\n```clojure\n{:stickler/msg   :abci/RequestInfo\n :version        \"0.26.0-c086d0a3\"\n :block-version  7\n :p2p-version    4\n :abci.host/conn :info}\n\n{:stickler/msg   :abci/RequestFlush\n :abci.host/conn :info}\n\n{:stickler/msg   :abci/RequestInitChain\n :time           {:stickler/msg :google.protobuf/Timestamp\n                  :seconds      1544530118\n                  :nanos        776243100}\n :chain-id       \"test-chain-anZqUW\"\n :validators\n [{:stickler/msg :abci/ValidatorUpdate\n   :pub-key      {:stickler/msg :abci/PubKey\n                  :type         \"ed25519\"\n                  :data         \u003cbytes\u003e}\n   :power        10}]\n ...\n :abci.host/conn :consensus}\n\n...\n```\n\nThe\nproject's\n[abci.edn resource](https://github.com/datopia/abci-host/blob/master/resources/org.datopia.abci/abci.edn)\ndescribes the full complement of messages.  As Tendermint uses Go-specific\nextensions in its protobuf files, `abci.edn` is generated by\n[org.datopia/stickler](https://github.com/datopia/stickler) from\nthe [types.proto](https://github.com/jTendermint/jabci/blob/develop/src/main/proto/types.proto) maintained\nby [jabci](https://github.com/jTendermint/jabci).\n\n## Contributors\n\n- Moe Aboulkheir\n\n## License\n\n[MIT](https://github.com/datopia/abci-host/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatopia%2Fabci-host","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatopia%2Fabci-host","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatopia%2Fabci-host/lists"}