diff --git a/docs/developer-docs/docs/build-an-app/test/run-a-local-chain.md b/docs/developer-docs/docs/build-an-app/test/run-a-local-chain.md index fc2e0be48..fc957704f 100644 --- a/docs/developer-docs/docs/build-an-app/test/run-a-local-chain.md +++ b/docs/developer-docs/docs/build-an-app/test/run-a-local-chain.md @@ -8,9 +8,20 @@ sidebar_position: 1 This guide explains how to run a local chain for development and testing purposes. +There are three ways to run a node: + +- **Option 1: Run a `just` script** +It's the simplest way to run a local chain. Initiate a `just` script that builds the chain binary and then creates, configures, and runs a new chain. + +- **Option 2: Use a devnet snapshot** +You can use a devnet snapshot with prebuilt node settings. + +- **Option 3. Configure manually** +We recommend this option if you wish to run a node with custom settings and learn the basics of interacting with a node. + ## Prerequisites -Before you start, complete following prerequisites: +Before you start, complete the following prerequisites: - [Install Go](https://golang.org/doc/install) 1.22.3 or later. - Install [just](https://just.systems/man/en/chapter_4.html). @@ -111,6 +122,8 @@ You can check the settings of your node in the genesis file: `$HOME/.warden/conf ## Option 3. Configure manually +We recommend this option if you wish to run a node with custom settings and learn the basics of interacting with a node. + ### 1. Clone the repository Clone the Warden Protocol repository and navigate to the root directory: @@ -335,7 +348,7 @@ The output should contain status information about your node: ``` :::tip -You can use other `wardend` commands to interact with the node. Just run `wardend` to see a list of available commands. +To learn more about `wardend` commands for interacting with the node, see [Node commands](/operate-a-node/node-commands). ::: :::tip diff --git a/docs/developer-docs/docs/operate-a-node/introduction.md b/docs/developer-docs/docs/operate-a-node/introduction.md index 708d9df10..c537e983b 100644 --- a/docs/developer-docs/docs/operate-a-node/introduction.md +++ b/docs/developer-docs/docs/operate-a-node/introduction.md @@ -20,9 +20,9 @@ This section explains how to run a node and become a validator. These are the basic steps to get started: -- Download the [wardend binary](https://github.com/warden-protocol/wardenprotocol/releases) or run it in a container and [join Buenavista](buenavista-testnet/join-buenavista). +- Download the [wardend binary](https://github.com/warden-protocol/wardenprotocol/releases) or run it in a container and [join Buenavista](buenavista-testnet/join-buenavista). - To become a validator, follow this guide: [Create a validator](create-a-validator). -- To interact with a node, use the [Node API](node-api-reference). +- To interact with a node, use the [Node API](node-api-reference) and [node commands](node-commands). :::tip We recommend using [Cosmovisor](https://docs.archway.io/validators/running-a-node/cosmovisor) – a utility for managing binary versions of Cosmos SDK-based chains. Its primary function is to enable binary upgrades without manual intervention. diff --git a/docs/developer-docs/docs/operate-a-node/node-commands.md b/docs/developer-docs/docs/operate-a-node/node-commands.md new file mode 100644 index 000000000..0660dd5b7 --- /dev/null +++ b/docs/developer-docs/docs/operate-a-node/node-commands.md @@ -0,0 +1,146 @@ +--- +sidebar_position: 7 +--- + +# 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](https://github.com/warden-protocol/wardenprotocol/releases), `wardend`. + +## Execute `wardend` commands + +To execute a node command, just run `wardend`, followed by the command. Include the `--node` flag with the node endpoint. + +For example, to check the node status, run the example below, using the preferred endpoint. + +```bash +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: + +```bash +wardend --help --node https://rpc.buenavista.wardenprotocol.org:443 +``` + +## 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: + +```bash +wardend query --help --node https://rpc.buenavista.wardenprotocol.org:443 +``` + +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: + +```bash +wardend query --help --node https://rpc.buenavista.wardenprotocol.org:443 +``` + +For example, the `warden` command allows you to query the [Warden](/learn/warden-protocol-modules/x-warden) module. + +Here are some of the available `wardend query warden` subcommands with examples: + +- `keychains`: This command returns a list of your [Keychains](/learn/glossary#keychain). + + ```bash + wardend query warden keychains --node https://rpc.buenavista.wardenprotocol.org:443 + ``` + +- `spaces`: This command returns a list of your [Spaces](/learn/glossary#space). + + ```bash + 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: + +```bash +wardend keys --help --node https://rpc.buenavista.wardenprotocol.org:443 +``` + +Here are some examples of `wardend keys` commands: + +- `list`: This command returns a list of your keys. + + ```bash + wardend keys list --node https://rpc.buenavista.wardenprotocol.org:443 + ``` + +- `add`: This command adds a key – you executed it when setting up your node. It requires specifying an arbitrary key name. + + ```bash + wardend keys add my-key-name --node https://rpc.buenavista.wardenprotocol.org:443 + ``` + +- `delete`: This command deletes a key, identified by its name. + + ```bash + wardend keys delete my-key-name --node https://rpc.buenavista.wardenprotocol.org:443 + ``` + +- `add-keychain-writer`: This command adds a new [Keychain Writer](/learn/glossary#keychain-writer). It requires specifying an arbitrary Keychain Writer name. + + ```bash + wardend keys add my-keychain-writer-name --node https://rpc.buenavista.wardenprotocol.org:443 + ``` + +### `tx`: Initiate transactions + +To get a full list of commands for initiating transactions, run this: + +```bash +wardend tx --help --node https://rpc.buenavista.wardenprotocol.org:443 +``` + +For example, the `warden` command allows you to initiate [Warden](/learn/warden-protocol-modules/x-warden) transactions. Here are some of the available `wardend tx warden` subcommands with examples: + +- `new-keychain`: This command creates a new [Keychain](/learn/glossary#keychain). It requires specifying an arbitrary Keychain description, your key name, and the chain ID. + + ```bash + wardend tx warden new-keychain \ + --description 'my-description' \ + --from my-key-name \ + --chain-id my-chain-id \ + --node https://rpc.buenavista.wardenprotocol.org:443 + ``` + +- `new-space`: This command creates a new [Space](/learn/glossary#space). It requires specifying your key name and the chain ID. + + ```bash + wardend tx warden new-space \ + --from my-key-name \ + --chain-id my-chain-id \ + --node https://rpc.buenavista.wardenprotocol.org:443 + ``` \ No newline at end of file