Unified JSON-RPC 2.0 interface over HTTP[S], WebSocket and UNIX socket for Clojure(Script).
[com.github.hindol/json-rpc.core "${version}"]
com.github.hindol/json-rpc.core {:mvn/version "${version}"}
(ns example.core
(:require [json-rpc.core :as rpc]))
;; Choose from HTTP[S], WebSocket and UNIX socket
(def url "http://localhost:8545")
(def url "ws://localhost:8546")
(def url "unix:///var/run/geth.ipc")
(def connection (rpc/connect url))
;; Receive a future
(rpc/send! connection "eth_blockNumber" ["latest"])
;; Deref to get the response
@(rpc/send! connection "eth_blockNumber" ["latest"])
;; Like send! but accepts a variable number of arguments
@(rpc/send!* connection "eth_blockNumber" "latest")
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close