 
 ;;;
 ;;; 1. create clients for org1 and org2
-(let []
-  (reset-clients!)
-  (doseq [[name _] org-defs]
-    (new-client! name)))
+(do
+  (doseq [[name org-map] org-defs]
+    (doseq [[[user-name ] ]]
+     (new-user! org-map ))))
 
 
 ;;; 2. Add a channel

                                         "peer1.org2.example.com@grpc://localhost:8058"]
               :pem-file                nil
               :allow-all-host-names    false
               :ca-client               nil}])))

(defonce chaincode-id-v1 (grpc/make-chaincode-id (get-in chaincode-id-defs [:v1 :name])
                                                 (get chaincode-id-defs :v1)))

  {:foo {:name "foo"}
   :bar {:name "bar"}})

#_
(defonce org-defs
  (into {}
        (map #(vector (:msp-id %)
                      (merge % (domain-name->cert-map (:domain-name %))))
             [{:msp-id                  "OrdererMSP"
               :domain-name             "example.com"
               :ca-location             "???http://localhost:7054"
               :ca-name                 "???ca0"
               :peer-locations          ["???peer0.org1.example.com@grpc://localhost:7051"
                                         "???peer1.org1.example.com@grpc://localhost:7056"]
               :orderer-locations       ["???orderer.example.com@grpc://localhost:7050"]
               :eventhub-locations      ["???peer0.org1.example.com@grpc://localhost:7053"
                                         "???peer1.org1.example.com@grpc://localhost:7058"]
               :pem-file                nil
               :allow-all-host-names    false
               :ca-client               nil
               :users [{:name "admin" :type :admin :key "f1a9a940f57419a18a83a852884790d59b378281347dd3d4a88c2b820a0f70c9"}
                       {:name "orderer" :type :orderer :key "30652478a0678558e8573fa33246175b33997226b63fa40503290187e0f99144"}]}
              {:msp-id                  "Org1MSP"
               :domain-name             "org1.example.com"
               :ca-location             "http://localhost:7054"
               :ca-name                 "ca0"
