          (proto/make-config-signature :signature-header signature-header
                                       :signature))))
 
-(defn create-or-update-channel-from-nodes
-  [user channel-id orderer nodes config-update]
-  ;; participants = orderers + peers
-  (create-or-update-channel user
-                            channel-id
-                            orderer
-                            config-update
-                            (mapv (fn [node]
-                                    (make-config-signature node config-update {}))
-                                  nodes)))
-
-(defonce max-tx-file-size 1024)
-(defn tx-file->config-update
-    [tx-filename]
-    (let [tx-file (io/as-file tx-filename)]
-      (assert (<= (.length tx-file) max-tx-file-size))
-      (let [envelope (->> (with-open [in (io/input-stream tx-file)
-                                      out (java.io.ByteArrayOutputStream.)]
-                            (io/copy in out)
-                            (Common$Envelope/parseFrom (.toByteArray out))))]
-        (-> (proto/proto->clj envelope
-                              (proto/parse-trees :block-config-update-envelope))
-            (get-in [:payload :data :config-update])
-            (proto/clj->proto)
-            (.toByteArray)))))
-
-;;(def cu (tx-file->config-update "/home/jc/Work/clojure-fabric/resources/fixture/balance-transfer/artifacts/channel/mychannel.tx"))
-;;
-;; (create-or-update-channel-from-nodes (core/get-user "Org1MSP" "user1") "testchan14"
-;;                                      (merge (first (core/get-nodes (core/get-user "Org1MSP" "user1") :orderers))
-;;                                             (get @core/users  ["Orderer" "admin"]))
-;;                                      [(get @core/users  ["Org1MSP" "admin"]) (get @core/users  ["Org2MSP" "admin"])
-;;                                       (get @core/users  ["Orderer" "admin"])]
-;;                                      cu2)
-;;; set_name
-;;; Immutable
-
-;;; set_roles
-;;; Immutable
-
-;;; set_enrollment_certificate
-;;; Immutable
-
-
-;;; generate_tcerts
-;; Not required any more(?) - https://jira.hyperledger.org/browse/FAB-5740
-;; (defn generate-tcerts
-;;   "Gets a batch of TCerts to use for transaction. there is a 1-to-1 relationship between TCert
-;;   and Transaction. The TCert can be generated locally by the SDK using the user’s crypto materials.
-;;   Params:
-;;         count (number): how many in the batch to obtain?
-;;         Attributes (string[]): list of attributes to include in the TCert
-;;   Returns (TCert[]): 
-;;         An array of TCerts"
-;;   ([count attributes]
-;;    (generate-tcerts core/*user*))
-;;   ([user count attributes])
-;;   ;; TBD
-;;   ;; Not sure if this is required now (couldn't find any usage in Java code)
-;;   )
-
+;;;
+;;; Utility functions
+;;;
 (defonce default-tgz-size 500000)       ;500kb, from Java SDK
 
 (defonce type->file-extensions {:golang #{"go"} :java #{"java"} :node #{"js"}})

(defn new-crypto-suite!
  ([crypto-opts]
   (new-crypto-suite! core/*user* crypto-opts))
  ([{:keys [msp-id name]} user crypto-opts]
   (swap! core/users assoc-in [[msp-id name] crypto-opts]
          (core/make-crypto-suite crypto-opts))))

;; Params:
;;   Suite (object): an instance of a crypto suite implementation"
;;   
;; Immutable

;;; get_crypto_suite 
(defn get-crypto-suite
  "A convenience method for obtaining the CryptoSuite object in use for this client.
  Params:
        None
  Returns:
        (CryptoSuite instance): The CryptoSuite implementation object set within this Client, 
        or null if it does not exist"
  ([]
   (get-crypto-suite core/*user*))
  ([user]
   (:crypto-suite user)))

;;; set_user_context
;; "Sets an instance of the User class as the security context of this client instance.

  ([user]
   (:certificate user)))


;;(def cu (tx-file->config-update "/home/jc/Work/clojure-fabric/resources/fixture/balance-transfer/artifacts/channel/mychannel.tx"))
;;
;; (create-or-update-channel-from-nodes (core/get-user "Org1MSP" "user1") "testchan14"
;;                                      (merge (first (core/get-nodes (core/get-user "Org1MSP" "user1") :orderers))
;;                                             (get @core/users  ["Orderer" "admin"]))
;;                                      [(get @core/users  ["Org1MSP" "admin"]) (get @core/users  ["Org2MSP" "admin"])
;;                                       (get @core/users  ["Orderer" "admin"])]
;;                                      cu2)
;;; set_name
;;; Immutable

;;; set_roles
;;; Immutable

;;; set_enrollment_certificate
;;; Immutable


;;; generate_tcerts
;; Not required any more(?) - https://jira.hyperledger.org/browse/FAB-5740
;; (defn generate-tcerts
;;   "Gets a batch of TCerts to use for transaction. there is a 1-to-1 relationship between TCert
;;   and Transaction. The TCert can be generated locally by the SDK using the user’s crypto materials.
;;   Params:
;;         count (number): how many in the batch to obtain?
;;         Attributes (string[]): list of attributes to include in the TCert
;;   Returns (TCert[]): 
;;         An array of TCerts"
;;   ([count attributes]
;;    (generate-tcerts core/*user*))
;;   ([user count attributes])
;;   ;; TBD
;;   ;; Not sure if this is required now (couldn't find any usage in Java code)
;;   )

(defn make-config-signature
  [user config-update {:keys [header-version] :or {header-version 1}}]
