|
| 1 | +--- |
| 2 | +sidebar_class_name: node_operators_installation_guide_sidebar |
| 3 | +sidebar_label: add-genesis-account |
| 4 | +sidebar_position: 1 |
| 5 | +--- |
| 6 | +# add-genesis-account |
| 7 | + |
| 8 | +Add a genesis account to genesis.json. The provided account must specify |
| 9 | +the account address or key name and a list of initial coins. If a key name is given, |
| 10 | +the address will be looked up in the local Keybase. The list of initial tokens must |
| 11 | +contain valid denominations. Accounts may optionally be supplied with vesting parameters. |
| 12 | + |
| 13 | +## Overview |
| 14 | + |
| 15 | +The `add-genesis-account` command allows you to add an account with an initial balance to the genesis file. This is typically used during blockchain setup to configure initial token distributions and vesting schedules. |
| 16 | + |
| 17 | +```bash |
| 18 | +babylond add-genesis-account [address_or_key_name] [coin][,[coin]] [flags] |
| 19 | +``` |
| 20 | +
|
| 21 | +## Arguments |
| 22 | +
|
| 23 | +| Argument | Description | |
| 24 | +|----------|-------------| |
| 25 | +| `address_or_key_name` | The account address (e.g., `babylon1...`) or key name from your keyring | |
| 26 | +| `coin` | Token amount and denomination (e.g., `1000000ubbn`). Multiple coins can be specified separated by commas | |
| 27 | +
|
| 28 | +## Flags |
| 29 | +
|
| 30 | +### Account Configuration |
| 31 | +
|
| 32 | +| Flag | Type | Description | |
| 33 | +|------|------|-------------| |
| 34 | +| `--vesting-amount` | string | Amount of coins for vesting accounts | |
| 35 | +| `--vesting-start-time` | int | Schedule start time (unix epoch) for vesting accounts | |
| 36 | +| `--vesting-end-time` | int | Schedule end time (unix epoch) for vesting accounts | |
| 37 | +
|
| 38 | +### Network & Query Options |
| 39 | +
|
| 40 | +| Flag | Type | Default | Description | |
| 41 | +|------|------|---------|-------------| |
| 42 | +| `--grpc-addr` | string | | The gRPC endpoint to use for this chain | |
| 43 | +| `--grpc-insecure` | | | Allow gRPC over insecure channels, if not the server must use TLS | |
| 44 | +| `--height` | int | | Use a specific height to query state at (this can error if the node is pruning state) | |
| 45 | +| `--node` | string | `tcp://localhost:26657` | `<host>:<port>` to CometBFT RPC interface for this chain | |
| 46 | +
|
| 47 | +### Configuration & Output |
| 48 | +
|
| 49 | +| Flag | Type | Default | Description | |
| 50 | +|------|------|---------|-------------| |
| 51 | +| `--home` | string | `~/.babylond` | The application home directory | |
| 52 | +| `--keyring-backend` | string | `os` | Select keyring's backend (`os`\|`file`\|`kwallet`\|`pass`\|`test`) | |
| 53 | +| `-o, --output` | string | `text` | Output format (`text`\|`json`) | |
| 54 | +| `-h, --help` | | | Help for add-genesis-account | |
| 55 | +
|
| 56 | +### Global Flags |
| 57 | +
|
| 58 | +| Flag | Type | Default | Description | |
| 59 | +|------|------|---------|-------------| |
| 60 | +| `--log_format` | string | `plain` | The logging format (`json`\|`plain`) | |
| 61 | +| `--log_level` | string | `info` | The logging level (`trace`\|`debug`\|`info`\|`warn`\|`error`\|`fatal`\|`panic`\|`disabled` or `'*:<level>,<key>:<level>'`) | |
| 62 | +| `--log_no_color` | | | Disable colored logs | |
| 63 | +| `--trace` | | | Print out full stack trace on errors | |
| 64 | +
|
| 65 | +## Examples |
| 66 | +
|
| 67 | +### Basic Account Addition |
| 68 | +
|
| 69 | +Add a simple account with initial balance: |
| 70 | +
|
| 71 | +```bash |
| 72 | +babylond add-genesis-account babylon1abc123... 1000000ubbn |
| 73 | +``` |
| 74 | +
|
| 75 | +### Using Key Name |
| 76 | +
|
| 77 | +Add an account using a key name from your keyring: |
| 78 | +
|
| 79 | +```bash |
| 80 | +babylond add-genesis-account validator-key 1000000ubbn |
| 81 | +``` |
| 82 | +
|
| 83 | +### Multiple Token Types |
| 84 | +
|
| 85 | +Add an account with multiple token denominations: |
| 86 | +
|
| 87 | +```bash |
| 88 | +babylond add-genesis-account babylon1abc123... 1000000ubbn,500000ustake |
| 89 | +``` |
| 90 | +
|
| 91 | +### Vesting Account |
| 92 | +
|
| 93 | +Create a vesting account with a 1-year vesting period: |
| 94 | +
|
| 95 | +```bash |
| 96 | +babylond add-genesis-account babylon1abc123... 1000000ubbn \ |
| 97 | + --vesting-amount 800000ubbn \ |
| 98 | + --vesting-start-time 1672531200 \ |
| 99 | + --vesting-end-time 1704067200 |
| 100 | +``` |
| 101 | +
|
| 102 | +### Custom Configuration |
| 103 | +
|
| 104 | +Add account with custom home directory and keyring backend: |
| 105 | +
|
| 106 | +```bash |
| 107 | +babylond add-genesis-account validator-key 1000000ubbn \ |
| 108 | + --home /custom/babylon/home \ |
| 109 | + --keyring-backend file |
| 110 | +``` |
| 111 | +
|
| 112 | +## Usage Notes |
| 113 | +
|
| 114 | +:::info |
| 115 | +This command modifies the `genesis.json` file in your node's configuration directory. Make sure to back up your genesis file before making changes. |
| 116 | +::: |
| 117 | +
|
| 118 | +:::warning |
| 119 | +Vesting accounts require all three vesting parameters to be specified: `--vesting-amount`, `--vesting-start-time`, and `--vesting-end-time`. |
| 120 | +::: |
| 121 | +
|
| 122 | +:::tip |
| 123 | +Use the `--output json` flag to get machine-readable output that can be processed by scripts or other tools. |
| 124 | +::: |
| 125 | +
|
0 commit comments