|
| 1 | +--- |
| 2 | +title: "Install and Configure" |
| 3 | +lead: "This guide covers everything you need to get up and running with the Entropy CLI. We'll walk you through installation, configuration, and even log management." |
| 4 | +weight: 5 |
| 5 | +--- |
| 6 | + |
| 7 | +## Install |
| 8 | + |
| 9 | +Follow these steps to install Entropy globally using NPM: |
| 10 | + |
| 11 | +1. The CLI requires Node version 20 or higher to run: |
| 12 | + |
| 13 | + ```shell |
| 14 | + node --version |
| 15 | + ``` |
| 16 | + |
| 17 | + ```output |
| 18 | + v23.1.0 |
| 19 | + ``` |
| 20 | + |
| 21 | + {{< callout type="info" >}} |
| 22 | + Consider using [Node Version Manager (NVM)](https://github.com/nvm-sh/nvm) to keep your Node installation organized. NVM also makes it trivial to switch between Node versions when necessary. |
| 23 | + {{< /callout >}} |
| 24 | + |
| 25 | +1. Install the Entropy CLI globally using NPM: |
| 26 | + |
| 27 | + ```shell |
| 28 | + npm install --global @entropyxyz/cli |
| 29 | + ``` |
| 30 | + |
| 31 | +1. You can now run the CLI from anywhere using `entropy`: |
| 32 | + |
| 33 | + ```shell |
| 34 | + entropy |
| 35 | + ``` |
| 36 | + |
| 37 | + ```output |
| 38 | + Usage: entropy [options] [command] |
| 39 | +
|
| 40 | + CLI interface for interacting with entropy.xyz. Running without commands starts an interactive ui |
| 41 | +
|
| 42 | + Options: |
| 43 | + -e, --endpoint <endpoint> Runs entropy with the given endpoint and ignores |
| 44 | + network endpoints in config. Can also be given a |
| 45 | + stored endpoint name from config eg: `entropy |
| 46 | + |
| 47 | + --endpoint test-net`. (default: |
| 48 | + "ws://testnet.entropy.xyz:9944/", env: ENDPOINT) |
| 49 | + -h, --help display help for command |
| 50 | +
|
| 51 | + Commands: |
| 52 | + list|ls List all accounts. Output is JSON of form [{ name, |
| 53 | + address, data }] |
| 54 | +
|
| 55 | + balance [options] <address> Get the balance of an Entropy account. Output is a |
| 56 | +
|
| 57 | + number |
| 58 | + transfer [options] <source> <destination> <amount> Transfer funds between two Entropy accounts. |
| 59 | + sign [options] <address> <message> Sign a message using the Entropy network. Output is |
| 60 | + a signature (string) |
| 61 | + ``` |
| 62 | + |
| 63 | + |
| 64 | +1. You can also interact with the CLI through the TUI by adding `tui`: |
| 65 | + |
| 66 | + ```shell |
| 67 | + entropy tui |
| 68 | + ``` |
| 69 | + |
| 70 | + ```output |
| 71 | + ? Select Action (Use arrow keys) |
| 72 | +
|
| 73 | + ❯ Manage Accounts |
| 74 | + Balance |
| 75 | + Register |
| 76 | + Sign |
| 77 | + Transfer |
| 78 | + Deploy Program |
| 79 | + User Programs |
| 80 | + Exit |
| 81 | + ``` |
| 82 | + |
| 83 | +## Configuration |
| 84 | + |
| 85 | +The CLI uses a configuration file to set and store basic information. This CLI uses [env-paths](https://www.npmjs.com/package/env-paths) to determine where configurations files should be stored: |
| 86 | + |
| 87 | +- **Arch**: `~/.config/entropy-cryptography/entropy-cli.json` |
| 88 | +- **MacOS**: `/Library/Preferences/entropy-cryptography/entropy-cli.json` |
| 89 | +- **Ubuntu**: `~/.config/entropy-cryptography/entropy-cli.json` |
| 90 | +- **Windows**: `C:\Users\<USERNAME>\AppData\Roaming\entropy-cryptography\Config\entropy-cli.json` |
| 91 | + |
| 92 | +### Config file contents |
| 93 | + |
| 94 | +This configuration file contains: |
| 95 | + |
| 96 | +| Description | Name in configuration file | |
| 97 | +| ----------- | -------------------------- | |
| 98 | +| Account information | `accounts: [...]` | |
| 99 | +| Which account is currently selected | `selectAccount` | |
| 100 | +| Endpoints that you are connected to | `endpoints: {...}` | |
| 101 | +| Configuration version | `migration-version` | |
| 102 | + |
| 103 | +{{< callout type="danger" >}} |
| 104 | +The config file contains your unencrypted private key. |
| 105 | +{{< /callout >}} |
| 106 | + |
| 107 | +### Deleting your config |
| 108 | + |
| 109 | +The config file gets generated the first time that you start the CLI. If you somehow _break_ your config, you can delete your existing config and start the CLI -- it will generate a new base config. |
| 110 | + |
| 111 | +## Logs |
| 112 | + |
| 113 | +Similar to the configuration file, log files for this CLI can be found in the default [env-paths](https://www.npmjs.com/package/env-paths) locations: |
| 114 | + |
| 115 | +- **Arch**: `~/.local/state/entropy-cryptography/` |
| 116 | +- **MacOS**: `/Library/Logs/entropy-cryptography/` |
| 117 | +- **Ubuntu**: `~/.local/state/entropy-cryptography/` |
| 118 | +- **Windows**: `C:\Users\<USERNAME>\AppData\Local\entropy-cryptography\Log` |
0 commit comments