 
 (defn split-help 
   ([]
-    (split (btc-rpc-fn "help" @config)))
+    (split (btc-rpc-fn "help")))
   ([cmd]
-    (split (btc-rpc-fn "help" @config cmd))))
+    (split (btc-rpc-fn "help" cmd))))
 
 (defn get-description [name]
   (loop [r (rest (split-help name))]

            [clojure.main :as m]
            [clojure.set :as set]
            ;[com.gfredericks.debug-repl :refer [break! unbreak!]]
            ))


(defmacro dbg [body]


(def ^:private id (atom 0))

(defn connect []
  (let [socket (Socket. "10.0.1.18" 8579)
        out (.getOutputStream socket)
        in  (.getInputStream socket)]
    {:in in, :out out, :socket socket}))


(def server (connect))

(defn btc-rpc-fn [method & args]
  (let [json-str (str (json/json-str {:cmd "rpc" :payload {:method method, :params args}}) "\n")
        in (:in server)
        out (:out server)]
    (.write out (.getBytes (dbg json-str)))
    (.flush out)
    (let [ba (byte-array (.available in))]
      (.read in ba)
      (String. ba))))

(defn sys-prop-of [name default-value]
  (System/getProperty name default-value))



(def hex-string? (partial re-matches #"[0-9a-fA-F]+"))

