   (add-channel-end cli "mychannel" (map->PeerOpts {:name "peer" :grpc-url "grpc://localhost:7051"}))
 
   ;; FIXME: need a way to get a peer ...
-  (client/query-installed-chaincodes cli (first (get-channel-ends (map->PeerOpts {:grpc-url "grpc://localhost:7051"})
-                                                                  (get-or-make-channel cli "mychannel"))))
-
-  (channel/query-by-chaincode cli (request/query-by))
+  (hf-client/query-installed-chaincodes cli (first (get-channel-ends (map->PeerOpts {:name "peer" :grpc-url "grpc://localhost:7051"})
+                                                                     (get-or-make-channel cli "mychannel"))))
+
+  ;; FIXME: init for query-by-chaincode
+  (channel/initialize (get-or-make-channel cli "mychannel"))
+
+  (let [proposal-req (hf-client/new-query-proposal-request)]
+    (transaction-request/set-args req (java.util.ArrayList. ["CAR10" "Chevy" "Volt" "Red" "Nick"]))
+    (query-by-chaincode-request/set))
+  (channel/query-by-chaincode (get-or-make-channel cli "mychannel")
+                              (query-by-chaincode-request/new-instance (hf-client/get-user-context cli)))
+  
   
   ;; 3. Tx
   (let [tx-future (->> (map->TransactionOpts {:fcn "createCar"

   (propose-transaction client channel-id chaincode-opts transaction-opts nil))
  ([client channel-id chaincode-opts {:keys [fcn args proposal-wait-time]} peers]
   (let [channel (get-or-make-channel client channel-id)
         req (client/new-transaction-proposal-request client)]
     (when-not (channel/is-initialized channel)
       (channel/initialize channel))
     (request/set-chaincode-id req (get-or-make-chaincode chaincode-opts))
     ;; Transaction options
     ;; FIXME: what about chaincode-language, chaincode-endorsement-policy ?
     (when fcn
       (request/set-fcn req fcn))
     (when args
       (request/set-args req args))
     (when proposal-wait-time
       (request/set-proposal-wait-time req proposal-wait-time))
     ;; Send Tx proposal to peers
     (apply channel/send-transaction-proposal channel req peers))))


  (atom (cache/lru-cache-factory {} :threshold 64)))

(defn make-client [msp-id name priv-key cert {:keys [roles account affiliation]}]
  (let [new-client (hf-client/create-new-instance)]
    (hf-client/set-crypto-suite new-client (crypto-suite/get-crypto-suite))
    (hf-client/set-user-context new-client 
                             (reify User
                               (getName [this] name)
                               ;; Set<String>
