<commit_before># Grin - Basic Wallet

## Wallet Files

A Grin wallet maintains its state in an LMDB database, with the master seed stored in a separate file.
When creating a new wallet, the file structure should be:

```
~/[Wallet Directory]
   -wallet_data/
      -db/
         -/lmdb
      wallet.seed
   grin-wallet.toml
   grin-wallet.log
```

* `grin-wallet.toml` contains configuration information for the wallet. You can modify values within
  to change ports, the address of your grin node, or logging values.

* `wallet_data/wallet.seed` is your master seed file. Its contents are encrypted with your password (required).
  You should back this file up somewhere in order to be able to recover or restore your wallet. Your seed file
  can also be recovered using a seed phrase if you lose this file or forget your password.

### Data Directory

By default grin will create all wallet files in the hidden directory `.grin` under your home directory (i.e. `~/.grin`).
You can also create and use a wallet with data files in the current directory, as explained in the `grin wallet init`
command below.

#### Logging + Output

Logging configuration for the wallet is read from `grin-wallet.toml`.

#### Switches common to all wallet commands

### Wallet Account

The wallet supports multiple accounts. To set the active account for a wallet command, use the '-a' switch, e.g:

```sh
grin wallet -a account_1 info
```

All output creation, transaction building, and querying is done against a particular account in the wallet.
If the '-a' switch is not provided for a command, the account named 'default' is used.

##### Grin Node Address

The wallet generally needs to talk to a running grin node in order to remain up-to-date and verify its contents. By default, the wallet
tries to contact a node at `127.0.0.1:13413`. To change this, modify the value in the wallet's `grin_wallet.toml` file. Alternatively,
you can provide the `-r` (seRver) switch to the wallet command, e.g.:

```sh
grin wallet -a "http://192.168.0.2:1341" info
```

If commands that need to update from a grin node can't find one, they will generally inform you that the node couldn't be reached
and the results verified against the latest chain information.

##### Password

Your wallet.seed file, which contains your wallet's unique master seed, is encrypted with your password. Your password is specified
at wallet creation time, and must be provided for any wallet operation. You will be prompted for your password when required, but
you can also specify it on the command line by providing the `-p`argument.

```sh
grin wallet -p mypass info
```

## Basic Wallet Commands

`grin wallet --help` will display usage info and all flags.
`grin wallet help [command]` will display flags specific to the command, e.g `grin wallet help listen`

### init

Before using a wallet a new `grin-wallet.toml` configuration file, master seed contained in `wallet.seed` and storage database need
to be generated via the init command as follows:
<commit_msg>fix grin wallet flag -r (#2252)<commit_after># Grin - Basic Wallet

## Wallet Files

A Grin wallet maintains its state in an LMDB database, with the master seed stored in a separate file.
When creating a new wallet, the file structure should be:

```
~/[Wallet Directory]
   -wallet_data/
      -db/
         -/lmdb
      wallet.seed
   grin-wallet.toml
   grin-wallet.log
```

* `grin-wallet.toml` contains configuration information for the wallet. You can modify values within
  to change ports, the address of your grin node, or logging values.

* `wallet_data/wallet.seed` is your master seed file. Its contents are encrypted with your password (required).
  You should back this file up somewhere in order to be able to recover or restore your wallet. Your seed file
  can also be recovered using a seed phrase if you lose this file or forget your password.

### Data Directory

By default grin will create all wallet files in the hidden directory `.grin` under your home directory (i.e. `~/.grin`).
You can also create and use a wallet with data files in the current directory, as explained in the `grin wallet init`
command below.

#### Logging + Output

Logging configuration for the wallet is read from `grin-wallet.toml`.

#### Switches common to all wallet commands

### Wallet Account

The wallet supports multiple accounts. To set the active account for a wallet command, use the '-a' switch, e.g:

```sh
grin wallet -a account_1 info
```

All output creation, transaction building, and querying is done against a particular account in the wallet.
If the '-a' switch is not provided for a command, the account named 'default' is used.

##### Grin Node Address

The wallet generally needs to talk to a running grin node in order to remain up-to-date and verify its contents. By default, the wallet
tries to contact a node at `127.0.0.1:13413`. To change this, modify the value in the wallet's `grin_wallet.toml` file. Alternatively,
you can provide the `-r` (seRver) switch to the wallet command, e.g.:

```sh
grin wallet -r "http://192.168.0.2:1341" info
```

If commands that need to update from a grin node can't find one, they will generally inform you that the node couldn't be reached
and the results verified against the latest chain information.

##### Password

Your wallet.seed file, which contains your wallet's unique master seed, is encrypted with your password. Your password is specified
at wallet creation time, and must be provided for any wallet operation. You will be prompted for your password when required, but
you can also specify it on the command line by providing the `-p`argument.

```sh
grin wallet -p mypass info
```

## Basic Wallet Commands

`grin wallet --help` will display usage info and all flags.
`grin wallet help [command]` will display flags specific to the command, e.g `grin wallet help listen`

### init

Before using a wallet a new `grin-wallet.toml` configuration file, master seed contained in `wallet.seed` and storage database need
to be generated via the init command as follows:

{'fraction_non_alphanumeric': 0.0722533817222039, 'fraction_numerical': 0.008578027053777632, 'mean_word_length': 3.9656019656019654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5480998', 'n_tokens_mistral': 1669, 'n_tokens_neox': 1622, 'n_words': 915}