             sub-ch (chan)
             fetch-ch (chan)]
         (async/sub p :new-meta sub-ch false)
-        (subscribe sub-ch bus-out (print-chan "SUBSOUT" out))
+        (subscribe sub-ch bus-out out #_(print-chan "SUBSOUT" out))
 
         (async/sub p :meta-up pub-ch false)
         (async/sub p :fetched fetch-ch false)


(defn subscribe [sub-ch bus-out out]
  (go-loop [{:keys [user repo] :as s} (<! sub-ch)]
             (async/sub bus-out [user repo] out)
             (println "subscribed: " [user repo])
             (recur (<! sub-ch))))


(defn publish [pub-ch fetch-ch store bus-in out]
  (go-loop [{:keys [user meta] :as ps} (<! pub-ch)]
           (let [repo (:id meta)
                 nc (<! (new-commits! store meta (<! (-get-in store [user repo]))))]
             (println "fetching" nc)
             (>! out {:type :fetch
                      :ids nc})
             (doseq [[repo-id val] (:fetched (<! fetch-ch))]
               (<! (-assoc-in store [repo-id] val)))
             (<! (-update-in store [user repo] #(if % (update % meta) meta)))
             (>! bus-in ps)
             (println "published:" [user repo])
             (recur (<! pub-ch)))))



(defn stop [state]
  ((get-in @state [:volatile :server])))


#_(stop peer-a)

