           (println "Press RETURN to exit")
           (flush)
           (read-line)))
-      (when-not @success?
-        (System/exit 1)))))
+      (System/exit (if @success? 0 1)))))

(defn- store-constructor
  "Initialize a MerkleDAG graph store from the given config."
  [cfg]
  (fn init
    []
    (require 'blocks.store.s3)
    (require 'merkle-db.graph)
    (require 'riemann.client)
    (mdag/init-store
      :encoding [:mdag :gzip :cbor]
      :store (-> (block/->store (:blocks-url cfg))
                 (assoc :riemann/client (when-let [host (:riemann-host cfg)]
                                          (riemann/tcp-client
                                            :host host
                                            :port (:riemann-port cfg 5555)))
                        :blocks.meter/recorder block-recorder
                        :blocks.meter/label "s3")
                 (component/start))
      :cache {:total-size-limit (:cache-size cfg (* 32 1024 1024))}
      :types merkle-db.graph/codec-types)))


(defn- load-db


(defn- block-recorder
  [store event]
  (let [client (:riemann/client store)
        evt (case (:type event)
              :blocks.meter/method-time
