# Setup and Installation

## enid CLI

enid is a command-line tool for interacting with the ENI blockchain. This page will guide you through setting up Enid and introduce some basic commands to help you get started.

### Prerequisites

* Go 1.24+: Installation instructions can be found [here](https://go.dev/doc/install).

### Installation

To install enid, first find the version you wish to use [here](https://github.com/eni-chain/go-eni/releases), then run the following commands:

```bash
git clone https://github.com/eni-chain/go-eni.git
cd go-eni
git checkout main
make install
```

You can verify that enid is installed correctly by running:

```bash
enid version
```

If you encounter an error like `command not found: enid`, you may need to set the `GOPATH` environment variable.

1. Use `go env GOPATH` to find your `GOPATH`
2. Add the following lines to your `~/.bashrc` or `~/.zshrc`:

   ```bash
   export GOPATH=[GOPATH obtained from step 1]
   export PATH=$PATH:$GOPATH/bin
   ```

More information can be found [here](https://pkg.go.dev/cmd/go#hdr-GOPATH_environment_variable).

### Commands

enid supports all the commands necessary for interacting with the chain. To see a list of available commands and their descriptions, run `enid`:

```plaintext
Start goeni node

Usage:
  enid [command]

Available Commands:
  blocktest             run EF blocktest
  comet                 CometBFT subcommands
  completion            Generate the autocompletion script for the specified shell
  config                Utilities for managing application configuration
  debug                 Tool for helping with debugging your application
  export                Export state to JSON
  genesis               Application's genesis-related subcommands
  help                  Help about any command
  in-place-testnet      Updates chain's application and consensus state with provided validator info and starts the node
  init                  Initialize private validator, p2p, genesis, and application configuration files
  keys                  Manage your application's keys
  module-hash-by-height Get module hashes at a given height
  multi-node            Initialize config directories & files for a multi-validator testnet running locally via separate processes (e.g. Docker Compose or similar)
  prune                 Prune app history states by keeping the recent heights and deleting old heights
  query                 Querying subcommands
  rollback              rollback Cosmos SDK and CometBFT state by one height
  snapshots             Manage local snapshots
  start                 Run the full node
  status                Query remote node for status
  tx                    Transactions subcommands
  version               Print the application binary version information

Flags:
  -h, --help                help for enid
      --home string         directory for config and data (default "/Users/moses/.eni")
      --log_format string   The logging format (json|plain) (default "plain")
      --log_level string    The logging level (trace|debug|info|warn|error|fatal|panic|disabled or '*:<level>,<key>:<level>') (default "info")
      --log_no_color        Disable colored logs
      --trace               print out full stack trace on errors

Use "enid [command] --help" for more information about a command.

```

#### Adding a Wallet

You can create a new wallet using the `enid keys` command:

```bash
enid keys add $NAME
```

Replace `$NAME` with the name you want to use for this key. This will generate a mnemonic phrase and store the account in the CLI for use. Write down this mnemonic phrase and store it securely.

Alternatively, if you want to import an existing mnemonic phrase, you can add the `--recover` flag:

```bash
enid keys add $NAME --recover
```

You will then be prompted to enter the mnemonic phrase.

If importing from an EVM wallet like MetaMask, you may need to specify the coin type. Ethereum-based (EVM) wallets use coin type `60`, while Eni defaults to `118`. For example,

```bash
enid keys add $NAME --coin-type=60
```

This will generate an address different from the default coin type `118`.

To view your local wallets, you can run

```bash
enid keys list
```

to see a list of all added wallets, or run

```bash
enid keys show $NAME
```

to view details of a specific wallet.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eniac.network/build/setup-and-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
