        (.build))))
 
 (defn make-chaincode-invocation-spec
-  ([^Chaincode$ChaincodeSpec chaincode-spec]
-   (-> (Chaincode$ChaincodeInvocationSpec/newBuilder)
-       (.setChaincodeSpec chaincode-spec)
-       (.build)))
+  ([chaincode-spec]
+   (-> (proto/new-builder Chaincode$ChaincodeInvocationSpec)
+       (proto/set-chaincode-spec chaincode-spec)
+       (proto/build)))
   ;; FIXME: setIdGenerationAlg
   #_
   ([^Chaincode$ChaincodeSpec chaincode-spec id-generation-alg]

           org.bouncycastle.util.encoders.Hex
           [org.hyperledger.fabric.protos.common Common$ChannelHeader Common$Header Common$HeaderType Common$SignatureHeader]
           org.hyperledger.fabric.protos.msp.Identities$SerializedIdentity
           [org.hyperledger.fabric.protos.peer Chaincode$ChaincodeID Chaincode$ChaincodeInput Chaincode$ChaincodeInvocationSpec Chaincode$ChaincodeSpec Chaincode$ChaincodeSpec$Type EndorserGrpc ProposalPackage$ChaincodeHeaderExtension ProposalPackage$ChaincodeProposalPayload ProposalPackage$Proposal ProposalPackage$SignedProposal]))

(defonce ^:dynamic *grpc-configuration*
  ;; From Java SDK

(defn make-chaincode-header-extention
  ([chaincode-id]
   (make-chaincode-header-extention chaincode-id ByteString/EMPTY))
  ([chaincode-id payload-visibility]
   (-> (proto/new-builder ProposalPackage$ChaincodeHeaderExtension)
       (proto/set-chaincode-id chaincode-id)
       ;; NOTE: payload-visibility is ByteString
       ;; Currently only full visibility
       (proto/set-payload-visibility payload-visibility)
       (proto/build))))

;; FIXME: Timestamp is primitive of com.google.protobuf
;;      No idea yet how to make it nice
(defn make-current-grpc-timestamp
  []
  (let [now (System/currentTimeMillis)]
