Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



    The Kubechain CLI has been created to ease the deployment of blockchains onto a Kubernetes cluster. At the time of writing most blockchains do not support kubernetes deployments or the deployment process is arduous.


    Kubechain consists of the following components.

    • A CLI
    • Blockchain Adapters
    • A minimal Kubernetes SDK


    The CLI is responsible for handling user commands and calling the the corresponding BlockchainAdapter. At the moment of writing the CLI's commands are tightly coupled with the adapters. I'm working towards decoupling the CLI and the commands BlockchainAdapters expose. However, this will take some time.

    Blockchain Adapters

    A blockchain adapter provides an API for the creation and deletion of Blockchain and Kubernetes configuration. At its core an adapter transforms Blockchain configuration to configuration for a Kubernetes cluster.

    Kubernetes SDK

    The SDK provided by Kubechain is intended solely to ease the creation of Kubernetes configuration. As of right now the only output type it supports is JSON. YAML is not supported.


    Interaction between the components is as follows.

    • The CLI provides a UI for a user to interact with a BlockchainAdapter.
    • BlockchainAdapters in turn provide CommandExecutors for the CLI to call.
    • A BlockchainAdapter 'may' use the Kubernetes SDK to create the necessary resources.



    As of right now Kubechain is intented to be used via the CLI. Blockchain adapters should support at least the following commands:

    • create chain-config <chain>
      • Creates the blockchain configuration.
    • create kubernetes-config [blockchain-target:b] [kubernetes-target:k]
      • Creates the kubernetes resources.
    • create config [blockchain-target:b] [kubernetes-target:k]
      • Creates all the configuration necessary to create a Kubernetes resources.
    • create cluster <chain>
      • Creates a Kubernetes cluster from previously created Kubernetes resources.
    • delete chain-config <chain>
      • Deletes existing blockchain configuration from the CLI host.
    • delete kubernetes-config <chain>
      • Deletes existing Kubernetes resources from the CLI host.
    • delete config <chain>
      • Deletes all existing configuration from the CLI host.
    • delete cluster <chain>
      • Deletes the [running] Kubernetes cluster using previously created Kubernetes resources.

    In the above <chain> is the name of the blockchain you wish to target. See the Targets section for a list of supported blockchain targets.



    Currently supported blockchain targets for the chain argument are:

    Hyperledger Burrow (burrow) support is in the works.


    Currently supported Kubernetes targets are:

    • Minikube

    Target configuration

    Release 0.3.0 introduced an abstraction enabling other kubernetes-targets. AWS support will be available in release 0.4.0.


    Kubechains code supports targeting a specific cluster URL. However, each Kubernetes target supports different Kubernetes resources. For example, AWS and Minikube both limit PersistentVolumes in their own way.

    Supporting all possible Kubernetes targets requires BlockchainAdapters to have configurable components. This is something I'm working towards.


    Below you can find some useful information about the paths Kubechain creates or requires.

    Running kubechain create config <chain> will result in the creation of several directories. The directories:

    • <cwd>/blockchains/<chain>
    • <cwd>/kubernetes/<chain>

    Currently any configuration for a blockchain needs to be added manually to:

    • <cwd>/configuration/<chain>
    Fabric Example

    Below you find an example of a directory tree for Hyperledger Fabric and the corresponding Kubernetes configuration generated by Kubechain.

    • cwd
      • configuration <- input for blockchains
        • fabric
          • configtx.yaml
          • crypto-config.yaml
      • blockchains <- input for Kubernetes
        • fabric
          • bin
            • configtxgen
            • cryptogen
          • crypto-config
            • ...
          • intermediate <- intermediate representations for organizations
            • orgN.json...
      • kubernetes <- final result
        • fabric


    For all available tutorials check out the tutorial documentation.

    Creating a Hyperledger Fabric cluster on Minikube


    • You've installed NodeJS (version 8 and higher) and NPM.
    • You've installed Minikube and added it to the PATH variable on your system.
    • You've installed Kubectl and added it to the PATH variable on your system.

    Setup the environment

    1. Open a terminal/console.
    2. Run: npm install -g kubechain
    3. Run: minikube start
    4. Run: kubectl proxy
      • Do not forget to proxy. Kubechain does not support picking a Kubernetes cluster.

    Hyperledger Fabric configuration

    1. At a preferred hostpath create a new directory named configuration.
    2. Create sub-directory named fabric in the configuration directory.
    3. Add the standard Hyperledger Fabric configuration files to the fabric directory.
      • These are configtx.yaml and crypto-config.yaml.

    Create the Kubernetes Cluster

    1. Open a new terminal/console.
    2. Change your current directory to the hostpath where you created the configuration directory.
      • i.e. Run: cd hostpath, not cd hostpath/configuration
    3. Run: kubechain create config -b fabric -k minikube
    4. Run: kubechain create cluster fabric
    5. Verify that the cluster is operational by your preferred means.


    An alternative to this project would be using Helm Charts. You could have a look at Burrow's helm charts and see if they fit your needs. Hyperledger Fabric does not have any helm charts available as far as I'm aware.


    As of right now I'm doing this project on my own as it is part of my Master Thesis. Currently I do not have the time to elaborately answer questions about Kubechain nor provide full support. I'll try to answer as quickly as I can but don't count on instant replies.




    npm i kubechain

    Downloadslast 7 days







    last publish


    • avatar
    • avatar