                                                ;;(js/console.log "me")
                                                (doto app-db
                                                  (db/setup-listener! :global-listener))
-                                               (d/listen! app-db :server-tx-report
-                                                          (fn [tx-report]
-                                                            (let [datoms (tx-report->transaction tx-report)]
-                                                              (js/console.log "Listened TX: " tx-report)
-                                                              (when (or (get-in tx-report [:tx-meta :tx/broadcast?])
-                                                                        (get-in tx-report [:tx-meta :tx/persist?]))
-                                                                (let [prepped (db/prep-broadcastable-tx-report tx-report)]
-                                                                  (when @network-enabled?
-                                                                    (dato-send! :ss/tx-requested prepped)))))))
+                                               (let [request-transaction! (get-in @ss-api [:tx-requested])]
+                                                 (d/listen! app-db :server-tx-report
+                                                            (fn [tx-report]
+                                                              (let [datoms (tx-report->transaction tx-report)]
+                                                                ;;(js/console.log "Listened TX: " tx-report)
+                                                                (when (or (get-in tx-report [:tx-meta :tx/broadcast?])
+                                                                          (get-in tx-report [:tx-meta :tx/persist?]))
+                                                                  (let [prepped (db/prep-broadcastable-tx-report tx-report)]
+                                                                    (when @network-enabled?
+                                                                      (request-transaction! prepped))))))))
                                                (let [local-session-id (d/tempid :db.part/user)]
                                                  (d/transact! app-db (vals schema))
                                                  (d/transact! app-db [{:db/id                 (d/tempid :db.part/user)

                                    (recur)))
                                (dato-send! :ss/bootstrap {})
                                (js/console.log "1. Bootstrap")
                                (let [{:keys [data] :as -bootstrap} (loop [msg (<! ws-ch)]
                                                                      (if (= :ss/bootstrap-succeeded (:event msg))
                                                                        msg
                                                                        ;; Not the
                                                                        ;; message
                                                                        ;; we're
                                                                        ;; looking for
                                                                        ;; (could be
                                                                        ;; something
                                                                        ;; during
                                                                        ;; refreshing
                                                                        ;; with
                                                                        ;; figwheel. Put
                                                                        ;; the message
                                                                        ;; back on,
                                                                        ;; wait a few
                                                                        ;; ms, and try
                                                                        ;; again. Still very racy.
                                                                        (do
                                                                          (put! ws-ch msg)
                                                                          (<! (async/timeout 16))
                                                                          (recur (<! ws-ch)))))
                                      _ (js/console.log "2. Bootstrap; " data)
                                      {:keys [session-id schema]}      data]
                                  (swap! ss-data merge (:ss data))
                                  (reset! ss-api (->> (:ss data)

  (get-in dato [:api :r-transact]) data)

(defn transact! [dato & args]
  (apply (get-in dato [:api :transact!]) args))

(defn cast! [dato event-data]
