 
 (def out-chan (chan 1000))
 
-(def query '[:find ?a :where
-             [?e :user/name ?a]
-             [(count ?a) ?x]
-             [(<= ?x 5)]])
-
-(defn my-test-query [{:keys [datoms] :as segment}]
-  {:names (d/q query datoms)})
-
 (def workflow
-  [[:read-datoms :query]
-   [:query :persist]])
+  [[:read-log :persist]])
 
 (def catalog
-  [{:onyx/name :read-datoms
-    :onyx/plugin :onyx.plugin.datomic/read-datoms
+  [{:onyx/name :read-log
+    :onyx/plugin :onyx.plugin.datomic/read-log
     :onyx/type :input
     :onyx/medium :datomic
     :datomic/uri db-uri
-    :datomic/t t
-    :datomic/datoms-index :eavt
-    :datomic/datoms-per-segment 20
     :onyx/max-peers 1
+    :datomic/log-end-tx 1006
     :onyx/batch-size batch-size
-    :onyx/doc "Reads a sequence of datoms from the d/datoms API"}
-
-   {:onyx/name :query
-    :onyx/fn ::my-test-query
-    :onyx/type :function
-    :onyx/consumption :concurrent
-    :onyx/batch-size batch-size
-    :onyx/doc "Queries for names of 5 characters or fewer"}
+    :onyx/doc "Reads a sequence of datoms from the d/tx-range API"}
 
    {:onyx/name :persist
     :onyx/plugin :onyx.plugin.core-async/output

(def persist-calls
  {:lifecycle/before-task-start inject-persist-ch})


(def lifecycles
  [{:lifecycle/task :read-datoms
    :lifecycle/calls :onyx.plugin.datomic/read-datoms-calls}
   {:lifecycle/task :persist
    :lifecycle/calls ::persist-calls}
   {:lifecycle/task :persist

(def peer-group (onyx.api/start-peer-group peer-config))

(def db-uri (str "datomic:free://" 
                 ;"127.0.0.1"
                 (apply str (butlast (slurp "eth0.ip"))) 
                 ":4334/" 
                 (java.util.UUID/randomUUID)))
