Skip to content

Commit d9fd4df

Browse files
dariaagDaria Agadzhanova
andauthored
Daria/cli ref clean (#208)
* create clean branch w new color scheme * overview * rm duplicate overview * rm guide --------- Co-authored-by: Daria Agadzhanova <dariaagadzhanova@Darias-MacBook-Air.local>
1 parent 1a656d1 commit d9fd4df

29 files changed

+6542
-13959
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"position": 2,
3+
"label": "Babylon CLI Reference",
4+
"collapsible": true,
5+
"collapsed": true
6+
}
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
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+
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
sidebar_class_name: node_operators_installation_guide_sidebar
3+
sidebar_label: collect-gentxs
4+
sidebar_position: 2
5+
---
6+
7+
# collect-gentxs
8+
9+
Collect genesis txs and output a genesis.json file. This command gathers all genesis transactions from the gentx directory and incorporates them into the final genesis.json file, completing the genesis file preparation process.
10+
11+
## Overview
12+
13+
The `collect-gentxs` command collects all genesis transactions (gentxs) created by validators and merges them into the genesis.json file. This is typically the final step in setting up a new blockchain network after all validators have generated their genesis transactions.
14+
15+
```bash
16+
babylond collect-gentxs [flags]
17+
```
18+
19+
## Arguments
20+
21+
This command takes no positional arguments. All configuration is done through flags.
22+
23+
## Flags
24+
25+
### Directory Configuration
26+
27+
| Flag | Type | Default | Description |
28+
|------|------|---------|-------------|
29+
| `--gentx-dir` | string | `[--home]/config/gentx/` | Override default "gentx" directory from which collect and execute genesis transactions |
30+
| `--home` | string | `~/.babylond` | The application home directory |
31+
| `-h, --help` | | | Help for collect-gentxs |
32+
33+
### Global Flags
34+
35+
| Flag | Type | Default | Description |
36+
|------|------|---------|-------------|
37+
| `--log_format` | string | `plain` | The logging format (`json`\|`plain`) |
38+
| `--log_level` | string | `info` | The logging level (`trace`\|`debug`\|`info`\|`warn`\|`error`\|`fatal`\|`panic`\|`disabled` or `'*:<level>,<key>:<level>'`) |
39+
| `--log_no_color` | | | Disable colored logs |
40+
| `--trace` | | | Print out full stack trace on errors |
41+
42+
## Examples
43+
44+
### Basic Collection
45+
46+
Collect all genesis transactions from the default directory:
47+
48+
```bash
49+
babylond collect-gentxs
50+
```
51+
52+
### Custom Gentx Directory
53+
54+
Collect genesis transactions from a custom directory:
55+
56+
```bash
57+
babylond collect-gentxs --gentx-dir /path/to/custom/gentx
58+
```
59+
60+
### Custom Home Directory
61+
62+
Collect gentxs with a custom home directory:
63+
64+
```bash
65+
babylond collect-gentxs --home /custom/babylon/home
66+
```
67+
68+
### Complete Network Setup Workflow
69+
70+
```bash
71+
# 1. Initialize the network
72+
babylond init my-node --chain-id babylon-testnet-1
73+
74+
# 2. Add genesis accounts
75+
babylond add-genesis-account validator1 100000000ubbn
76+
babylond add-genesis-account validator2 100000000ubbn
77+
78+
# 3. Generate genesis transactions (each validator does this)
79+
babylond gentx validator1 50000000ubbn --chain-id babylon-testnet-1
80+
81+
# 4. Collect all genesis transactions
82+
babylond collect-gentxs
83+
84+
# 5. Validate the final genesis file
85+
babylond validate-genesis
86+
```
87+
88+
### Multi-Validator Setup
89+
90+
```bash
91+
# Network coordinator collects gentxs from multiple validators
92+
mkdir -p ~/.babylond/config/gentx
93+
94+
# Copy gentx files from validators
95+
cp validator1-gentx.json ~/.babylond/config/gentx/
96+
cp validator2-gentx.json ~/.babylond/config/gentx/
97+
cp validator3-gentx.json ~/.babylond/config/gentx/
98+
99+
# Collect all transactions
100+
babylond collect-gentxs
101+
102+
# Verify collection was successful
103+
babylond validate-genesis
104+
```
105+
106+
## Usage Notes
107+
108+
:::info Genesis File
109+
This command modifies the `genesis.json` file to include all collected genesis transactions. The original genesis.json is updated with validator information and initial delegations.
110+
:::
111+
112+
:::warning Prerequisites
113+
Before running this command, ensure all validators have generated their gentx files using `babylond gentx` and the files are present in the gentx directory.
114+
:::
115+
116+
:::tip Validation
117+
Always run `babylond validate-genesis` after collecting gentxs to ensure the genesis file is valid and the network can start successfully.
118+
:::
119+

0 commit comments

Comments
 (0)