   [^Common$Block proto-block]
   (let [clj-block (proto/proto->clj proto-block (proto/parse-trees :block-configuration))]
     ;; 1. Block Event on all channels
-    (async/put! block-event-channel clj-block)
+    (async/put! block-event-chan clj-block)
     (doseq [[data code] (map list
                              (:data clj-block)
                              (-> (:metadata clj-block)

;;      - Java: part of the Java SDK for Hyperledger Fabric. Source code can be found here
;;      - Golang: an example event listener client can be found here
;;
(defrecord EventHub [peer-address peer-tls-certificate peer-tls-certificate-override
                     tx-registrants
                     connected
                     mtx chaincode-registrants block-registrants  
                     grpc-client
                     interested-events
                     event-client-factory client])

(defn make-event-hub [m]
  (map->EventHub m))

(def ^:dynamic *event-hub* nil)

(defn connect
  ([]
   (connect event-hub))
  ([event-hub]
   (when-not (:connected event-hub)
     (if-not (:peer-address event-hub)
       (throw (Exception. "Peer address is missing!"))
       ))))


;; connect
;; disconnect
;; get-peer-address
;; connected?
;; set-peer-address
;; unregister-block-event
;; unregister-chaincode-event
;; unregister-tx-event

;; set-interests
;; add-chaincode-interest
;; remove-chaincode-interest
;; get-interested-events
;; receive (i/f - block or chaincode)

(defonce block-metadata-index-map
  (zipmap [:signatures :last-config :transactions-filter :orderer]

  (letfn [(%get-all-chans [ref]
            (map :ch (vals (deref ref))))]
    `[~command-ch
      ~block-event-chan
      ~@(%get-all-chans tx-id->chan-fn-map)
      ~@(%get-all-chans chaincode-id->chan-fn-map)]))

;; Block event is proto/Block
;; Chaincode event is proto/ChaincodeEvent
(defrecord TxEvent [tx-id status])
(defn make-TxEvent
  [tx-id code]
  (->TxEvent tx-id code))

(defonce event-go-loop
  (async/go-loop []
