         ;; finally, construct a new CCI object
         (vector name (->CCI name data))))))
 
-(defn buildccis [ipath interfaces]
+(defn- buildccis [ipath interfaces]
   (into {} (map (fn [interface] (buildcci ipath interface)) interfaces)))
 
-(defn buildfacts [config]
+(defn- buildfacts [config]
   (let [facts [["Application Name" (:Name config)]
                ["Application Version" (:Version config)]
                ["Platform" (str (-> config :Platform :Name) " version " (-> config :Platform :Version))]

;; structures suitable for surfacing via the
;; org.hyperledger.chaintool.meta interface
;;-----------------------------------------------------------------
(defn render-metadata [config ipath]
  (let [facts (buildfacts config)
        provides (buildccis ipath (intf/getprovides config))]
    (render-golang "metadata" [["facts" facts]

;; write golang source to the filesystem, using gofmt to clean
;; up the generated code
;;-----------------------------------------------------------------
(defn- emit-golang [outputfile content]
  (util/truncate-file outputfile content)
  (gofmt "-w" (.getCanonicalPath outputfile)))

;;-----------------------------------------------------------------
;; emit-stub
;;-----------------------------------------------------------------
(defn- emit-stub [base name functions template srcdir filename]
  (let [[_ interface] (buildinterface base name functions)
        content (render-golang template [["base" base]["intf" interface]])
        output (io/file srcdir (package-path base name) filename)]

    (emit-golang output content)))

(defn- emit-server-stub [base name functions srcdir]
  (emit-stub base name functions "server" srcdir "server-stub.go"))

;;-----------------------------------------------------------------
;; emit-proto
;;-----------------------------------------------------------------
(defn- emit-proto [base srcdir [name ast :as interface]]
  (let [outputdir (io/file srcdir (package-path base name))
        output (io/file outputdir "interface.proto")]

