> ## Documentation Index
> Fetch the complete documentation index at: https://sidiorresearchlabs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Command-line tools and node operation guides.

# HyperPaxeer CLI

`hyperpaxd` is the all-in-one command-line interface (CLI). It allows you to run an HyperPaxeer node, manage wallets and interact
with the HyperPaxeer network through queries and transactions. This introduction will explain how to install the `hyperpaxd`
binary onto your system and guide you through some simple examples how to use hyperpaxd.

## Prerequisites

#### Go

HyperPaxeer is built using [Go](https://golang.org/dl/) version `1.20+`. Check your version with:

```bash theme={null}
go version
```

Once you have installed the right version, confirm that your [`GOPATH`](https://golang.org/doc/gopath_code#GOPATH)
is correctly configured by running the following command and adding it to your shell startup script:

```bash theme={null}
export PATH=$PATH:$(go env GOPATH)/bin
```

#### jq

HyperPaxeer scripts are using [jq](https://stedolan.github.io/jq/download/) version `1.6+`. Check your version with:

```
jq --version
```

## Installation

You can download the latest binaries from the repo and install them, or
you can build and install the `hyperpaxd` binaries from source or using Docker.

### Download the binaries

* Go to the [releases section of the repository](https://github.com/Paxeer-Network/Paxeer-Network/releases)
* Choose the desired release or pre-release you want to install on your machine
* Select and download from the `Assets` dropdown the corresponding tar or zip file for your OS
* Extract the files. The `hyperpaxd` binaries is located in the `bin` directory of the extrated files
* Add the `hyperpaxd` binaries to your path, e.g. you can move it to `$(go env GOPATH)/bin`

After installation is done, check that the `hyperpaxd` binaries have been successfully installed:

```bash theme={null}
hyperpaxd version
```

### Build From Source

Clone and build the HyperPaxeer from source using `git`. The `<tag>` refers to a release tag on Github. Check the latest HyperPaxeer
version on the [releases section of the repository](https://github.com/Paxeer-Network/Paxeer-Network/releases):

```bash theme={null}
git clone https://github.com/Paxeer-Network/Paxeer-Network.git
cd HyperPaxeer
git fetch
git checkout <tag>
make install
```

After installation is done, check that the hyperpaxd binaries have been successfully installed:

```bash theme={null}
hyperpaxd version
```

:::info
If the `hyperpaxd: command not found` error message is returned, confirm that you have configured [Go](#go) correctly.
:::

### Docker

When it comes to using Docker with HyperPaxeer, there are two options available:
Build a binary of the HyperPaxeer daemon inside a dockerized build environment
or build a Docker image, that can be used to spin up individual containers running the HyperPaxeer binary.
For information on how to achieve this,
proceed to the dedicated page on [working with Docker](./docker-build.md).

## Run an HyperPaxeer node

To become familiar with HyperPaxeer, you can run a local blockchain node that produces blocks and exposes EVM and Cosmos
endpoints. This allows you to deploy and interact with smart contracts locally or test core protocol functionality.

Run the local node by executing the `local_node.sh` script in the base directory of the repository:

```bash theme={null}
./local_node.sh
```

The script stores the node configuration including the local default endpoints under `~/.tmp-hyperpaxd/config/config.toml`.
If you have previously run the script, the script allows you to overwrite the existing configuration and start a new
local node.

Once your node is running you will see it validating and producing blocks in your local HyperPaxeer blockchain:

```bash theme={null}
12:59PM INF executed block height=1 module=state num_invalid_txs=0 num_valid_txs=0 server=node
# ...
1:00PM INF indexed block exents height=7 module=txindex server=node
```

For more information on how to customize a local node,
head over to the [Single Node](./Paxeer-Network-cli/single-node) page.

## Using `hyperpaxd`

After installing the `hyperpaxd` binary, you can run commands using:

```bash theme={null}
hyperpaxd [command]
```

There is also a `-h`, `--help` command available

```bash theme={null}
hyperpaxd -h
```

It is possible to maintain multiple node configurations at the same time. To specify a configuration use the `--home`
flag. In the following examples we will be using the default config for a local node, located at `~/.tmp-hyperpaxd`.

### Manage wallets

You can manage your wallets using the hyperpaxd binary to store private keys and sign transactions over CLI. To view all
keys use:

```bash theme={null}
hyperpaxd keys list \
--home ~/.tmp-hyperpaxd \
--keyring-backend test

# Example Output:
# - address: HyperPaxeer19xnmslvl0pcmydu4m52h2gf0std5ee5pfgpyuf
#   name: dev0
#   pubkey: '{"@type":"/hyperpaxeer.crypto.v1.ethsecp256k1.PubKey","key":"AzKouyoUL0UUS1qRUZdqyVsTPkCAFWwxx3+BTOw36nKp"}'
#   type: local
```

You can generate a new key/mnemonic with a `$NAME` with:

```bash theme={null}
hyperpaxd keys add [name] \
--home ~/.tmp-hyperpaxd \
--keyring-backend test
```

To export your HyperPaxeer key as an Ethereum private key (for use with [Metamask](https://academy.evmosd.org/articles/beginner/connect-your-wallet/metamask)
for example):

```bash theme={null}
hyperpaxd keys unsafe-export-eth-key [name] \
--home ~/.tmp-hyperpaxd \
--keyring-backend test
```

For more about the available key commands, use the `--help` flag

```bash theme={null}
hyperpaxd keys -h
```

:::tip
For more information about the Keyring and its backend options, click [here](../concepts/keyring.md).
:::

### Interact with a Network

You can use hyperpaxd to query information or submit transactions on the blockchain. Queries and transactions are requests
that you send to an HyperPaxeer node through the Tendermint RPC.

:::tip
👉 To use the CLI, you will need to provide a Tendermint RPC address for the `--node` flag.
Look for a publicly available addresses for testnet and mainnet in the [Networks](./../../develop/api/networks) page.
:::

#### Set Network Config

In the local setup the node is set to `tcp://localhost:26657`. You can view your node configuration with:

```bash theme={null}
hyperpaxd config \
--home ~/.tmp-hyperpaxd
# Example Output
# {
# 	"chain-id": "hyperpax_125-1",
# 	"keyring-backend": "test",
# 	"output": "text",
# 	"node": "tcp://localhost:26657",
# 	"broadcast-mode": "sync"
# }
```

You can set your node configuration to send requests to a different network by changing the endpoint with:

```bash theme={null}
hyperpaxd config node [tendermint-rpc-endpoint] \
--home ~/.tmp-hyperpaxd
```

Learn about more node configurations [here](configuration.mdx).

#### Queries

You can query information on the blockchain using `hyperpaxd query` (short `hyperpaxd q`). To view the account balances by its
address stored in the bank module, use:

```bash theme={null}
hyperpaxd q bank balances [adress] \
--home ~/.tmp-hyperpaxd
# # Example Output:
# balances:
# - amount: "99999000000000000000002500"
#   denom: ahpx
```

To view other available query commands, use:

```bash theme={null}
# for all Queries
hyperpaxd q

# for querying commands in the bank module
hyperpaxd q bank
```

#### Transactions

You can submit transactions to the network using `hyperpaxd tx`. This creates, signs and broadcasts a tx in one command. To
send tokens from an account in the keyring to another address with the bank module, use:

```bash theme={null}
hyperpaxd tx bank send [from_key_or_address] [to_address] [amount] \
--home ~/.tmp-hyperpaxd \
--fees 50000000000ahpx \
-b block

# Example Output:
# ...
# txhash: 7BA2618295B789CC24BB13E654D9187CDD264F61FC446EB756EAC07AF3E7C40A
```

To view other available transaction commands, use:

```bash theme={null}
# for all transaction commands
hyperpaxd tx

# for Bank transaction subcommands
hyperpaxd tx bank
```

Now that you've learned the basics of how to run and interact with an HyperPaxeer network,
head over to [configurations](configuration.mdx) for futher customization.
