                                          user
                                          {:args [deployment-spec]
                                           :channel-header-type :endorser-transaction})))))
+
+
+;; (def e1 (Common$Envelope/parseFrom buf))
+;; (def p0 (.getPayload e1))
+;; (def p1 (Common$Payload/parseFrom p0))
+;; (def h1 (.getHeader p1))
+;; (def d1 (.getData p1))
+;; (def e2 (Configtx$ConfigUpdateEnvelope/parseFrom d1))
+;; (def c1 (.getConfigUpdate e2))
+;; (def s1 (.getSignatures e2))

(ns clojure-fabric.user
  (:require [clojure-fabric.chaincode :as chaincode]
            [clojure-fabric.core :as core]
            [clojure-fabric.proto :as proto]
            [clojure.java.io :as io])
  (:import [java.io ByteArrayOutputStream File FileInputStream]
           [org.apache.commons.compress.archivers.tar TarArchiveEntry TarArchiveOutputStream]
           org.apache.commons.compress.compressors.gzip.GzipCompressorOutputStream
           org.apache.commons.io.IOUtils
           org.hyperledger.fabric.protos.common.Common$Envelope))

(defn ca-user?
  [user]

  ([user]
   (:certificate user)))

#_
(defn create-or-update-channel
  ;; evelope - read from <channel-name>.tx file
  [user channel-name orderer {:keys [^bytes envelope config signatures]}]
  (cond envelope
        ;; envelope is byte array of Envelope, which is ready to be parsed in
