Skip to main content
Last updated

kadena config

Use kadena config to set up and manage configuration settings for the Kadena CLI environment. To get started with the CLI, use kadena config init to create a .kadena configuration folder. The configuration folder stores information about your development environment, including:

  • Default network settings for the Kadena development, test, and main networks.
  • Transaction templates for constructing transactions locally and sending transactions to the blockchain.
  • Local keys, wallets, and accounts that you create for the development environment.
  • Keys, wallets, and accounts you import from existing chains.

Basic usage

The basic syntax for the kadena config command is:

bash
kadena config <action> [arguments] [flags]
bash
kadena config <action> [arguments] [flags]

Actions

Use the following actions to specify the operation you want to perform.

Use this actionTo do this
initInitialize the kadena configuration folder with configuration settings for the Kadena CLI to use.
pathDisplay the path to the configuration folder currently in use.

Flags

You can use the following optional flags with kadena config commands.

Use this flagTo do this
-h, --helpDisplay usage information.
-q, --quietEliminate interactive prompts and confirmations to enable automation of tasks.
-V, --versionDisplay version information.
--jsonFormat command results sent to standard output (stdout) using JSON format.
--yamlFormat command results sent to standard output (stdout) using YAML format.

kadena config init

Use kadena config init to create a configuration folder in the directory of your choice. The command automatically initializes the configuration folder with default network settings for the Kadena development, test, and main networks and adds transaction templates to your development environment. You can also use this command to create your first wallet and account, so you can sign transactions locally for development and testing.

By default, the initial configuration settings are written to a .kadena folder in your current working directory and the settings can be used from anywhere within that directory. For example, if you run kadena config init in the /home/user/projects/my-kadena-project folder, the configuration settings are available from anywhere inside that project directory. By using a working directory for the configuration folder, you can use different configuration settings in different folders.

Alternatively, you can run kadena config init with the --global command-line option to add the configuration folder as a global directory inside of your home directory. This option enables you to use the same configuration settings from any folder on your computer.

Configuration settings that are defined in a local working directory take precedence over configuration settings defined in the home directory. If you add more than one configuration folder to your development environment, you can use the kadena config show command to see details about the development environment you have configured in your working or global directory.

Basic usage

The basic syntax for the kadena config command is:

bash
kadena config init [arguments] [flags]
bash
kadena config init [arguments] [flags]

Arguments

You can use the following command-line arguments with the kadena config init command:

Use this argumentTo do this
-g, --globalInitialize the configuration folder in the current user's home directory, so that it's available globally. For example, this option creates the ~/.config/kadena directory.
-c, --create‑walletCreate a new wallet. Set to true to generate keys and create a new wallet.
‑w, ‑‑wallet‑name walletNameSpecify a name for the new wallet.
‑‑password‑file passwordFileSpecify the path to a file containing the password for the wallet being created. Alternatively, you can specify the password from standard input (stdin).
-L, --legacyUse the ChainWeaver ED25519 signature scheme to generate keys when creating a wallet.
-a, --create‑accountCreate an account using the first wallet key. Set to true to use the first wallet key to create a new local account.
-l, --account‑alias aliasNameCreate an account alias to store your account details, if creating an account.

Examples

To create the Kadena CLI configuration folder and initial settings interactively, run the following command:

bash
kadena config init
bash
kadena config init

This command creates the .kadena configuration folder in your current working directory and prompts you to create a new wallet.

To make the Kadena CLI configuration folder and initial settings available globally from your home directory, run the following command:

bash
kadena config init --global
bash
kadena config init --global

This command creates a global kadena folder in your home directory—for example, as ~/.config/kadena—so you can use the configuration settings from any folder. The command then prompts you to create a new wallet.

To create the Kadena CLI configuration folder with a new wallet and account in the current working directory, run a command similar to the following:

bash
kadena config init --create-wallet="true" --wallet-name="my_first_wallet" --create-account="true" --account-alias="dev_account"
bash
kadena config init --create-wallet="true" --wallet-name="my_first_wallet" --create-account="true" --account-alias="dev_account"

To create the Kadena CLI configuration folder without creating a new wallet or account, run the following command:

bash
kadena config init --create-wallet="false"
bash
kadena config init --create-wallet="false"

kadena config show

Use kadena config show to display the location of the configuration folder currently being used and details about the development environment you have configured in your working or global directory. If you add more than one configuration folder to your development environment, you can use the kadena config show command to see the location of the configuration folder that's used for your current directory.

To display the location of the configuration folder currently being used, run the following command:

bash
kadena config show
bash
kadena config show

The command displays the path to the Kadena CLI configuration folder and additional details about your development environment. For example:

bash
Currently using the following config:Config path           /Users/pistolas/.kadena                      Wallet path           /Users/pistolas/.kadena/wallets              Number of wallets     3                                            Default template path /Users/pistolas/.kadena/transaction-templatesNumber of templates   6                                            Network path          /Users/pistolas/.kadena/networks             Number of networks    3                                            Default network       devnet                                          Account path          /Users/pistolas/.kadena/accounts             Number of accounts    6                                         
bash
Currently using the following config:Config path           /Users/pistolas/.kadena                      Wallet path           /Users/pistolas/.kadena/wallets              Number of wallets     3                                            Default template path /Users/pistolas/.kadena/transaction-templatesNumber of templates   6                                            Network path          /Users/pistolas/.kadena/networks             Number of networks    3                                            Default network       devnet                                          Account path          /Users/pistolas/.kadena/accounts             Number of accounts    6