# Configuration File

A client side configuration file can be used for specifying various settings which are useful while making request calls to Miyabi nodes. This file can be used with a Miyabi client created using Miyabi SDK as well as with miyabi-cli tool. It is a JSON format configuration file. An example is shown below:

{
  "blockchainConfigCacheExpiryInterval": "00:30:00",
  "clientCert": "cert.p12",
  "clientCertPwd": "password",
  "extensions": [
    {
      "name": "Miyabi.BLS"
    },
    {
      "name": "Miyabi.Binary"
    },
    {
      "name": "Miyabi.Asset"
    },
    {
      "name": "Miyabi.Entity"
    },
    {
      "name": "Miyabi.Contract"
    },
    {
      "name": "Miyabi.NFT"
    },
    {
      "name": "Miyabi.PrivateData"
    }
  ],
  "fallback": true,
  "hosts": [
    "https://127.0.0.1:9010/",
    "https://127.0.0.1:9011/",
    "https://127.0.0.1:9012/",
    "https://127.0.0.1:9013/",
    "https://127.0.0.1:9014/"
  ],
  "loadBalancerHostIndexes": [0, 1],
  "members": [
    "026beca06739461a20249fd4b24cf27542013624d18710bc418e8de10d6ef68568",
    "02fce59e2dd0015bbb34da445f6c3a4ac2254a1b90ffa9c66fbd8621bf0c1a6deb"
  ],
  "privateChannel": {
    "pdoMembers": [
      {
        "admin": "026beca06739461a20249fd4b24cf27542013624d18710bc418e8de10d6ef68568",
        "host": "https://127.0.0.1:7000/"
      },
      {
        "admin": "02fce59e2dd0015bbb34da445f6c3a4ac2254a1b90ffa9c66fbd8621bf0c1a6deb",
        "host": "https://127.0.0.1:7001/"
      }
    ]
  },
  "retryPerHost": 3,
  "timeoutPerHost": "00:00:10"
} 

The following table describes each configuration field:

Field Description
blockchainConfigCacheExpiryInterval Config MetaData Expiry Interval (default=30 minutes). This interval determines the time interval after which the Cli will try to refresh the metadata cache stored locally. The minimum and maximum allowed values for this parameter are 10 minutes and 1 day respectively.
clientCert A path to a client certificate file to authenticate https requests or to provide Client Credentials related to permissioned Miyabi operations.
clientCertPwd A path to a file containing the password for the client certificate clientCert if the certificate file is password protected.
extensions List of extension modules to load.
fallback Flag indicating whether to fallback to the next host in the host list when the host is not reachable, an error occurs, or timeout per host is elapsed.
hosts List of hosts to communicate with.
loadBalancerHostIndexes 0-based indexes of the hosts to allow load balancing of requests in a round-robin manner
members The credentials of the nodes taking part in the consensus process
privateChannel Host and credential details of the PDO members present in the private channel.
retryperhost Retry per host (default=3). Maximum number of retries a host can have before TimeoutPerHost is elapsed. In case of fallback=true, retries are done in "round-robin" way until total retries limit [RetryPerHost * n(hosts)] is reached or global timeout [TimeoutPerHost * n(hosts)] is elapsed.
timeoutperhost Timeout per host (default=10 seconds). Maximum time for a request to wait from the host, after which the request will be timed-out. In case of fallback=true, once host is timed-out, the request will be forwarded to next host(s) until global timeout [TimeoutPerHost * n(hosts)] is elapsed or total retries limit [RetryPerHost * n(hosts)] is reached.