             [compojure.handler :refer [site api]]
             [compojure.route :refer [resources]]
             [kabel.middleware.block-detector :refer [block-detector]]
-            [kabel.middleware.log :refer [logger]]
-            [kabel.platform :refer [create-http-kit-handler!]]
             [konserve.core :as k]
             [konserve.filestore :refer [new-fs-store]]
             [konserve.memory :refer [new-mem-store]]

(defn create-store
  "Creates a konserve store"
  [state]
  (swap! state assoc :store (<!! (new-mem-store) #_(new-fs-store "store")))
  state)

(def hooks (atom {[#".*"
                   #uuid "26558dfe-59bb-4de4-95c3-4028c56eb5b5"
                   "master"]
                  [["eve@topiq.es"
                    #uuid "26558dfe-59bb-4de4-95c3-4028c56eb5b5"
                    "master"]]}))

(def err-ch (chan))



  (<?? (k/get-in (:store @server-state) [:peer-config]))

  (def commit-eval {'(fn [_ new] new) (fn replace [old params] [params])
                    '(fn [old params] (d/db-with old params)) (fn [old params] (conj old params))})

  (require '[replikativ.crdt.cdvcs.realize :refer [commit-value commit-history-values]])


  (<?? (commit-history-values (:store @server-state)
                              (:commit-graph (:state (<?? (k/get-in (:store @server-state) [["eve@topiq.es" #uuid "26558dfe-59bb-4de4-95c3-4028c56eb5b5"]]))))
                              #uuid "1699bb60-2ba4-5be1-908f-e00a03cfeef4"))


  (require '[replikativ.crdt.materialize :refer [key->crdt]])

