How to run client node via your kubernetes cluster

Minimum required kubernetes version > 1.18.0

Helm required

Fullnode configuration

Network ID

To connect your node to a specific network, set the network ID in the global configuration. Use 35443 for the testnet:

global:
  network: "35441"
Interfaces Configuration

Customize the interfaces your node will use by updating the following section in the fullnode.yaml file:

api: "net,web3,eth,shh,txpool,debug,clique,govPub,indexer"
Q-Client Version

To use a specific version of the Q-client, modify the image tag as shown below:

image:
  tag: v1.3.9
Deploy to cluster

Once you have made the necessary modifications, deploy the fullnode to your cluster using the following command. Be sure to replace with the name of the namespace you wish to use:

helm upgrade -i "fullnode" ./q-client --values="./q-client/values.yaml" --values="./fullnode.yaml" --create-namespace --namespace="<your_prefered_namespace_name>"

Rootnode and validator configuration

Private key configuration

Creating a keyfile for a fullnode follows the same process as for a validator. Use the following command to generate a new account:

docker run --entrypoint="" --rm -v $PWD:/data -it qblockchain/q-client:v1.3.9 geth account new --datadir=/data --password=/data/keystore/pwd.txt

After generating the keyfile, incorporate it into your rootnode.yaml or validator.yaml configuration as required:

account: <your miner account without leading 0x>
keystore:
  # Generated keystore data
  name: <keystore file name>
  #data: <keystore data>                    # mutual exclusive with filePath
  filePath: <local keystore file path>    # mutual exclusive with data
  # Keystore password
  password: <password of keystore>       # mutual exclusive with passwordPath
  #passwordPath: <local password file path> # mutual exclusive with password
Network ID

To connect your node to a specific network, set the network ID in the global configuration. Use 35443 for the testnet:

global:
  network: "35441"

To use a specific version of the Q-client, modify the image tag as shown below:

image:
  tag: v1.3.9
Deploy to cluster

Once you have made the necessary modifications, deploy the rootnode to your cluster using the following command change rootnode. Be sure to replace with the name of the namespace you wish to use:

helm upgrade -i "rootnode" ./q-client --values="./q-client/values.yaml" --values="./rootnode.yaml" --create-namespace --namespace="<your_prefered_namespace_name>"

Explorer configuration

Domain

Set the domain for your explorer in values.yaml in the following blocks:

global:
  # Change YOUR_DOMAIN with your domain
  # It will create ingresses for explorer.YOUR_DOMAIN, stats-explorer.YOUR_DOMAIN and visualizer-explorer.YOUR_DOMAIN
  IngressDomain: "YOUR_DOMAIN"

frontend:
  env:
    enabled: true
    data:
      # Change YOUR_DOMAIN with your domain
      NEXT_PUBLIC_API_HOST: "explorer.YOUR_DOMAIN"
      NEXT_PUBLIC_STATS_API_HOST: "https://stats-explorer.YOUR_DOMAIN"
      NEXT_PUBLIC_APP_HOST: "explorer.YOUR_DOMAIN"

ingress:
  hosts:
    # Change YOUR_DOMAIN with your domain
    - host: explorer.YOUR_DOMAIN
  tls:
    - secretName: explorer-tls
      hosts:
        # Change YOUR_DOMAIN with your domain
        - explorer.YOUR_DOMAIN

Chart will create ingress for the following domains:

  • explorer.YOUR_DOMAIN
  • stats-explorer.YOUR_DOMAIN
  • visualizer-explorer.YOUR_DOMAIN

Environment variables

Set ENV for the services specified below

  • Backend

Set the url of the archive node. If you are deploying Explorer on the same cluster as the archive node, you can use the Kubernetes DNS service in the format: NODE_SVC_NAME.NAMESPACE.svc.cluster.local. Also set the network and coin name.

backend:
  env:
    enabled: true
    data:
      # Set the url to archive node in cluster with next enabled APIs (net,web3,eth,shh,txpool,debug,clique,govPub,indexer,trace)
      ETHEREUM_JSONRPC_HTTP_URL: "http://NODE_SVC_NAME.NAMESPACE.svc.cluster.local:8545" 
      ETHEREUM_JSONRPC_TRACE_URL: "http://NODE_SVC_NAME.NAMESPACE.svc.cluster.local:8545"
      ETHEREUM_JSONRPC_WS_URL: "ws://NODE_SVC_NAME.NAMESPACE.svc.cluster.local:8546"
      # Set the network name, for example "Q"
      NETWORK: ""
      # Set the coin name, for example "Q"
      COIN_NAME: ""
      # Set the coin, for example "Q"
      COIN: ""
  • Frontend

Set the network short name, currency name and symbol. Change YOUR_DOMAIN if you didn't do it in the previous step. Set the network rpc url and chain ID.

frontend:
  env:
    enabled: true
    data:
      # Set network short name, currency name and symbol, for example "Q"
      NEXT_PUBLIC_NETWORK_SHORT_NAME: ""
      NEXT_PUBLIC_NETWORK_CURRENCY_NAME: ""
      NEXT_PUBLIC_NETWORK_CURRENCY_SYMBOL: ""
      # Change YOUR_DOMAIN with your domain
      NEXT_PUBLIC_API_HOST: "explorer.YOUR_DOMAIN"
      NEXT_PUBLIC_STATS_API_HOST: "https://stats-explorer.YOUR_DOMAIN"
      NEXT_PUBLIC_APP_HOST: "explorer.YOUR_DOMAIN"
      # Set the network name, for example "Q Mainnet"
      NEXT_PUBLIC_NETWORK_NAME: ""
      # Set the network RPC url. Mainnet: "https://rpc.q.org", Testnet: "https://rpc.qtestnet.org"
      NEXT_PUBLIC_NETWORK_RPC_URL: ""
      # Set the network(chain) ID. Mainnet: 35441, Testnet: 35443
      NEXT_PUBLIC_NETWORK_ID: ""
      # Set false if run on Mainnet
      NEXT_PUBLIC_IS_TESTNET: "true"

Deploy to cluster

Once you have made the necessary modifications, you have to download depending packages for the release.

helm package -u ./q-explorer-new/charts/backend ./q-explorer-new/charts/stats

Deploy the explorer to your cluster using the following command. Be sure to replace with the name of the namespace you wish to use:

helm upgrade -i "q-explorer" ./q-explorer-new --values="./q-explorer-new/values.yaml" --create-namespace --namespace="<your_prefered_namespace_name>"