Skip to main content

Node commands

Overview

Node commands are commands for interacting with a node through the command line. In this article, you'll find a brief overview of commands for interacting with the Warden node, wardend.

These commands allow you to do the following:

  • Query the node
  • Initiate transactions
  • Manage your key
  • Edit the genesis file
  • and much more

Prerequisites

To interact with the node, you need to install the Warden binary, wardend.

Execute wardend commands

To execute a node command, just run wardend, followed by the command. If you need to specify a node to interact with, include the --node flag with the node endpoint.

For example, to check the node status, run the example below using the preferred endpoint:

wardend status \
--node https://rpc.buenavista.wardenprotocol.org:443
tip

You can exclude the --node flag if you're running a chain on the same machine at moment when you're executing wardend commands. If not specified, --node defaults to the localhost.

Get a list of commands

To get a full list of available wardend commands and flags, run wardend with the --help flag:

wardend --help

Get details of a command

To learn more about a command, run wardend, followed by the command name and the --help flag.

For example, you can execute this to learn more about querying the node with the query command:

wardend query --help

In the output, you'll see a list of available subcommands and flags. You can query subcommands the same way.

Examples

This section contains useful examples of wardend commands. You'll learn how to query the node, manage keys, and initiate transactions. However, note that there are many more commands available.

query: Query the node

To get a full list of commands for querying a node, run this:

wardend query --help

For example, the warden command allows you to query the Warden module.

Here are some of the available wardend query warden subcommands with examples:

  • keychains: This command returns a list of your Keychains.

    wardend query warden keychains \
    --node https://rpc.buenavista.wardenprotocol.org:443
  • spaces: This command returns a list of your Spaces.

    wardend query warden spaces\
    --node https://rpc.buenavista.wardenprotocol.org:443

keys: Manage keys

To get a full list of commands for managing your keys, run this:

wardend keys --help

Here are some examples of wardend keys commands:

  • list: This command returns a list of your keys.

    wardend keys list
  • add: This command adds a key, either newly generated or recovered.

    To create a new key, you need to specify its name:

    wardend keys add my-key-name

    To restore a key from its seed phrase, add the --recover flag:

    wardend keys add my-key-name --recover
  • delete: This command deletes a key, identified by its name.

    wardend keys delete my-key-name
  • show: This command returns key information. For example, you can get the key address by its name:

    wardend keys show my-key-name --address

tx: Initiate transactions

To get a full list of commands for initiating transactions, run this:

wardend tx --help

For example, the warden command allows you to initiate Warden transactions. Here are some of the available wardend tx warden subcommands with examples:

  • new-keychain: This command creates a new Keychain. It requires specifying an arbitrary Keychain description, your key name, and the chain ID.

    wardend tx warden new-keychain \
    --description 'my-description' \
    --from my-key-name \
    --chain-id buenavista-1 \
    --node https://rpc.buenavista.wardenprotocol.org:443
  • new-space: This command creates a new Space. It requires specifying your key name and the chain ID.

    wardend tx warden new-space \
    --from my-key-name \
    --chain-id buenavista-1 \
    --node https://rpc.buenavista.wardenprotocol.org:443