Skip to main content
Last updated

kadena network

Use kadena network to set up and manage network settings for your development environment. The kadena config init command creates default network settings for the Kadena development, test, and main networks. You can use the kadena network subcommands to view and modify the network settings to suit your needs.

Basic usage

The basic syntax for the kadena network command is:

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

Actions

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

Use this actionTo do this
addAdd a new network.
set-defaultSet a network to be the default choice in selection prompts.
listList all available networks.
updateUpdate properties for an existing network.
deleteDelete an existing network.

Flags

You can use the following optional flags with kadena network 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 network add

Use kadena network add to add a new set of network settings to your development environment.

Basic usage

The basic syntax for the kadena network add command is:

bash
kadena network add [arguments] [flags]
bash
kadena network add [arguments] [flags]

Arguments

You can use the following command-line arguments with the kadena network add command:

Use this argumentTo do this
-a, --network-name networkNameSet the name of the network. The valid values are devnet, testnet, and mainnet.
-i, --network-id networkIdSet the identifier for the network. The network identifier is a similar to the network name but uniquely identifies the network. For example, valid values include development, testnet04, and mainnet01.
-s, --network-host networkHostSet the host for the network.
-e, --network-explorer-url networkExplorerUrlSet the block explorer URL for the network.
-o, --network-overwriteConfirm that you want to overwrite existing network configuration settings.

Examples

To add network information interactively, run the following command:

bash
kadena network add
bash
kadena network add

To add network settings for the Kadena test network, run a command similar to the following:

bash
kadena network add --network-name="testnet" --network-id="testnet08" --network-host="https://api.testnet.chainweb.com" --network-explorer-url="https://explorer.chainweb.com/testnet/tx/ --network-overwrite="yes"
bash
kadena network add --network-name="testnet" --network-id="testnet08" --network-host="https://api.testnet.chainweb.com" --network-explorer-url="https://explorer.chainweb.com/testnet/tx/ --network-overwrite="yes"

kadena network set-default

Use kadena network set-default to specify the network to use as your default network in your development environment. You can specify the network as none to remove a previously-set default network.

Basic usage

The basic syntax for the kadena network set-default command is:

bash
kadena network set-default [arguments] [flags]
bash
kadena network set-default [arguments] [flags]

Arguments

You can use the following command-line arguments with the kadena network set-default command:

Use this argumentTo do this
-n, --network networkNameSpecify the name of network you want to set as the default. The valid values are devnet, testnet, and mainnet.
--confirmConfirm the change you are making to set or remove the default network.

Examples

To add network information interactively, run the following command:

bash
kadena network set-default
bash
kadena network set-default

To set testnet as the default network for your development environment, run the following command:

bash
kadena network set-default --network="testnet" --confirm
bash
kadena network set-default --network="testnet" --confirm

To remove the default network setting, run the following command:

bash
kadena network set-default --network="none" --confirm
bash
kadena network set-default --network="none" --confirm

kadena network update

Use kadena network update to update properties for an existing network.

Basic usage

The basic syntax for the kadena network update command is:

bash
kadena network update [arguments] [flags]
bash
kadena network update [arguments] [flags]

Arguments

You can use the following command-line arguments with the kadena network update command:

Use this argumentTo do this\
-n, --network networkNameSpecify the network you want to update. The valid values are devnet, testnet, and mainnet.
-a, --network-name networkNameUpdate the name of the specified network.
-i, --network-id networkIdUpdate the identifier for the network. The network identifier is a similar to the network name but uniquely identifies the network. For example, valid values include development, testnet04, and mainnet01.
-s, --network-host networkHostUpdate the host for the specified network.
-e, --network-explorer-url networkExplorerUrlUpdate the block explorer URL for the specified network

Examples

To update network information interactively, run the following command:

bash
kadena network update
bash
kadena network update

To update the network name and identifier for the development network, run a command similar to the following:

bash
kadena network update --network="devnet" --network-id="devnet03" --network-name="my-devnet"
bash
kadena network update --network="devnet" --network-id="devnet03" --network-name="my-devnet"

To update network settings for the Kadena main network, run a command similar to the following:

bash
kadena network update --network="mainnet" --network-id="mainnet01" --network-host="https://api.chainweb.com" --network-explorer-url="https://explorer.chainweb.com/mainnet/tx/
bash
kadena network update --network="mainnet" --network-id="mainnet01" --network-host="https://api.chainweb.com" --network-explorer-url="https://explorer.chainweb.com/mainnet/tx/

kadena network list

Use kadena network list to list all available networks.

Basic usage

The basic syntax for the kadena network list command is:

bash
kadena network list [flags]
bash
kadena network list [flags]

Examples

To display information about all available networks, run the following command:

bash
kadena network list
bash
kadena network list

The command displays network information similar to the following:

bash
Network Network ID  Network Host                     Network Explorer URL                           Default Networkdevnet  development http://localhost:8080            http://localhost:8080/explorer/development/tx/ No             mainnet mainnet01   https://api.chainweb.com         https://explorer.chainweb.com/mainnet/tx/      No             testnet testnet04   https://api.testnet.chainweb.com https://explorer.chainweb.com/testnet/tx/      No  
bash
Network Network ID  Network Host                     Network Explorer URL                           Default Networkdevnet  development http://localhost:8080            http://localhost:8080/explorer/development/tx/ No             mainnet mainnet01   https://api.chainweb.com         https://explorer.chainweb.com/mainnet/tx/      No             testnet testnet04   https://api.testnet.chainweb.com https://explorer.chainweb.com/testnet/tx/      No  

To display the output for this command using YAML format, you can run the following command:

bash
kadena network list --yaml
bash
kadena network list --yaml

The command displays network information in YAML format similar to the following:

bash
networks:  - network: devnet    networkId: development    networkHost: http://localhost:8080    networkExplorerUrl: http://localhost:8080/explorer/development/tx/  - network: mainnet    networkId: mainnet01    networkHost: https://api.chainweb.com    networkExplorerUrl: https://explorer.chainweb.com/mainnet/tx/  - network: testnet    networkId: testnet04    networkHost: https://api.testnet.chainweb.com    networkExplorerUrl: https://explorer.chainweb.com/testnet/tx/ 
bash
networks:  - network: devnet    networkId: development    networkHost: http://localhost:8080    networkExplorerUrl: http://localhost:8080/explorer/development/tx/  - network: mainnet    networkId: mainnet01    networkHost: https://api.chainweb.com    networkExplorerUrl: https://explorer.chainweb.com/mainnet/tx/  - network: testnet    networkId: testnet04    networkHost: https://api.testnet.chainweb.com    networkExplorerUrl: https://explorer.chainweb.com/testnet/tx/ 

kadena network delete

Use kadena network delete to remove a network and its configuration settings from your development environment.

Basic usage

The basic syntax for the kadena network delete command is:

bash
kadena network delete [arguments] [flags]
bash
kadena network delete [arguments] [flags]

Arguments

You can use the following command-line arguments with the kadena network delete command:

Use this argumentTo do this
-n, --network networkNameSpecify the name of the network you want to delete. The valid values are devnet, testnet, and mainnet.
-d, --network-deleteConfirm that you want to delete the network.

Examples

To delete network information interactively, run the following command:

bash
kadena network delete
bash
kadena network delete

To delete the mainnet network information from your development environment, run the following command:

bash
kadena network delete --network="mainnet" --network-delete="yes"
bash
kadena network delete --network="mainnet" --network-delete="yes"