# zend Yaml and Configuration options

### zeknd.yaml <a href="#loom-yaml" id="loom-yaml"></a>

Here's how a sample `zeknd.yaml` looks like:

```
RPCBindAddress: "tcp://0.0.0.0:46658"
EventDispatcherURI: ""
BFTLogLevel: "debug"
zekndLogLevel: "info"
RootDir: "."
DBName: "app"
GenesisFile: "genesis.json"
PluginsDir: "contracts"
ContractLogLevel: "debug"
ChainID: "awesomechain"
# Peers: ""
# SessionMaxAccessCount: "0"
# SessionDuration: "600"
PlasmaCashEnabled: false
# EthereumURI: ws://127.0.0.1:8545"
```

Remove the # from lines you want to change.

### #RPCBindAddress <a href="#rpcbindaddress" id="rpcbindaddress"></a>

Options: "tcp\://0.0.0.0:46658"

This is the primary interface for binding RPC interface

### #`zeknd`LogLevel <a href="#loomloglevel" id="loomloglevel"></a>

Options: debug, info, warn, error

General logging for the `zeknd` Blockchain

### #ContractLogLevel <a href="#contractloglevel" id="contractloglevel"></a>

Options: debug, info, warn, error

General logging for the Go Based Smart contracts.

### #BFTLogLevel <a href="#bftloglevel" id="bftloglevel"></a>

Options: debug, info, warn, error

General logging for the BFT Layer Blockchain. This may change based on which BFT engine you are using.

### #EthereumURI <a href="#ethereumuri" id="ethereumuri"></a>

Options: "ws\://127.0.0.1:8545"

This is the URL of the Ethereum Blockchain to read data for Basechain and Transfer Gateway. In future, we will have support for Infura also.

### #ChainID <a href="#chainid" id="chainid"></a>

Options: "awesomechain"

This is the name of your chain, for example "eth", "zombiechain", "test-zombiechain", "delegatecall".

## #config.toml <a href="#config-toml" id="config-toml"></a>

If you are using tendermint BFT engine, you can modify this file, otherwise leave it alone.

### #ABCIAddress <a href="#abciaddress" id="abciaddress"></a>

Options: "<http://127.0.0.1:45667>"

Port for tendermint BFT engine

### #ReceiptsVersion <a href="#receiptsversion" id="receiptsversion"></a>

Options: 1,2

Most users should set this to 1, and the EVM receipts will be stored in the application store. If the number is set to 2, EVM receipts are stored in a seperate database. This is better for disk usage. However, it affects the AppHashes, so the entire cluster must be initialized with the same version, and it must not be changed after initialization.

### #RegistryVersion <a href="#registryversion" id="registryversion"></a>

Options: 1,2

Most users should set this to 2. This is the latest version of the smart contract registry. The entire cluster needs to be initialized with the same version, and it must not be changed after initialization.

### #POWVersion <a href="#dposversion" id="dposversion"></a>

Options: 1,2,3

The entire cluster needs to be on same version, and it must not be changed after initialization.

### #CreateEmptyBlocks <a href="#createemptyblocks" id="createemptyblocks"></a>

Boolean: true, false

Most clusters will want to disable empty blocks to save disk space.

### #AppStore <a href="#appstore" id="appstore"></a>

```
AppStore:
  CompactOnLoad: true
  MaxVersions: 50
```

Configures how much history is retained in `app.db`. It should be enabled on production clusters, and dev clusters that don't get wiped often. A new `app.db` version is created with each block, so without these settings nodes will consume significantly more disk space.

#### #CompactOnLoad <a href="#compactonload" id="compactonload"></a>

Will compact `app.db` when the node starts. This affects node start times, but ensures disk space that's taken up by old `app.db` versions is freed.

#### #MaxVersions <a href="#maxversions" id="maxversions"></a>

Max versions stored in the app store. Each time a block is committed a new version of the app state is stored in the store. This doesn't affect how many blocks/transactions are stored in the blockchain store.

### #HSM <a href="#hsm" id="hsm"></a>

```
HsmConfig:
  HsmEnabled: "true"
  HsmDevType: "yubihsm"
  HsmConnUrl: "localhost:12345"
  HsmDevLogCred: "password"
  HsmAuthKeyId: 1
  HsmSignKeyId: 100
```

Please see HSM Page for more details

### #Plasma <a href="#plasma" id="plasma"></a>

```
PlasmaCash:
  ContractEnabled: true
  OracleEnabled: true
```

### #Karma <a href="#karma" id="karma"></a>

Data Types

```
type KarmaConfig struct {
	Enabled         bool  // Activate karma module
	ContractEnabled bool  // Allows you to deploy karma contract to collect data even if chain doesn't use it
	UpkeepEnabled   bool  // Adds an upkeep cost to deployed and active contracts for each user
	MaxCallCount    int64 // Maximum number call transactions per session duration
	SessionDuration int64 // Session length in seconds
}
```

Example

```
Karma:
  Enabled: {{ .Karma.Enabled }}
  ContractEnabled: {{ .Karma.ContractEnabled }}
  UpkeepEnabled: {{ .Karma.UpkeepEnabled }}
  MaxCallCount: {{ .Karma.MaxCallCount }}
  SessionDuration: {{ .Karma.SessionDuration }}
```

### #Caching Store <a href="#caching-store" id="caching-store"></a>

```
CachingStoreConfig:
  CachingEnabled: {{ .CachingStoreConfig.CachingEnabled }}
  # Number of cache shards, value must be a power of two
  Shards: {{ .CachingStoreConfig.Shards }}
  # Time after we need to evict the key
  EvictionTimeInSeconds: {{ .CachingStoreConfig.EvictionTimeInSeconds }}
  # interval at which clean up of expired keys will occur
  CleaningIntervalInSeconds: {{ .CachingStoreConfig.CleaningIntervalInSeconds }}
  # Total size of cache would be: MaxKeys*MaxSizeOfValueInBytes
  MaxKeys: {{ .CachingStoreConfig.MaxKeys }}
  MaxSizeOfValueInBytes: {{ .CachingStoreConfig.MaxSizeOfValueInBytes }}
  # Logs operations
  Verbose: {{ .CachingStoreConfig.Verbose }}
  LogLevel: "{{ .CachingStoreConfig.LogLevel }}"
  LogDestination: "{{ .CachingStoreConfig.LogDestination }}"
```

### #Event Store <a href="#event-store" id="event-store"></a>

```
EventDispatcher:
  # Available dispatcher: "db_indexer" | "log" | "redis"
  Dispatcher: "db_indexer"
  # Redis will be use when Dispatcher is "redis"
  Redis:
  	URI: "{{.EventDispatcher.Redis.URI}}"
```

### #App store <a href="#app-store" id="app-store"></a>

```
AppStore:
  # Version is default to 1, if you want higher perfromant evm.db split store use 3 
  Version: 3
  # If true the app store will be compacted before it's loaded to reclaim disk space.
  CompactOnLoad: {{ .AppStore.CompactOnLoad }}
  # Maximum number of app store versions to keep, if zero old versions will never be deleted.
  MaxVersions: {{ .AppStore.MaxVersions }}
  # Number of seconds to wait after pruning a batch of old versions from the app store.
  # If this is set to zero the app store will only be pruned after a new version is saved.
  PruneInterval: {{ .AppStore.PruneInterval }}
  # Number of versions to prune at a time.
  PruneBatchSize: {{ .AppStore.PruneBatchSize }}
```

### #Universal Signing <a href="#universal-signing" id="universal-signing"></a>

Universal signing medium

```
Auth:
  Chains:
    default:
      TxType: "zeknd"
    eth:
      TxType: "eth"
      AccountType: 1
    tron:
      TxType: "tron"
      AccountType: 1
```

### #Leveldb Tweaks <a href="#leveldb-tweaks" id="leveldb-tweaks"></a>

```
DBBackendConfig:
   # Caching size in memory before data is written to disk
   CacheSizeMegs: 500
```

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.opzeknd.xyz/advanced-and-internal/zend-yaml-and-configuration-options.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
