Skip to content

Commit b172dca

Browse files
committed
add InitialBalanceFile docs
1 parent 0daf342 commit b172dca

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

stackslib/src/config/mod.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,27 @@ pub struct ConfigFile {
170170
pub __path: Option<String>, // Only used for config file reloads
171171
pub burnchain: Option<BurnchainConfigFile>,
172172
pub node: Option<NodeConfigFile>,
173+
/// Represents an initial STX balance allocation for an address at genesis
174+
/// for testing purposes.
175+
///
176+
/// This struct is used to define pre-allocated STX balances that are credited to
177+
/// specific addresses when the Stacks node first initializes its chainstate. These balances
178+
/// are included in the genesis block and are immediately available for spending.
179+
///
180+
/// **Configuration:**
181+
/// Configured as a list `[[ustx_balance]]` in TOML.
182+
///
183+
/// Example TOML entry:
184+
/// ```toml
185+
/// [[ustx_balance]]
186+
/// address = "ST2QKZ4FKHAH1NQKYKYAYZPY440FEPK7GZ1R5HBP2"
187+
/// amount = 10000000000000000
188+
/// ```
189+
///
190+
/// This is intended strictly for testing purposes.
191+
/// Attempting to specify initial balances if [`BurnchainConfig::mode`] is "mainnet" will result in an error.
192+
///
193+
/// Default: `None`
173194
pub ustx_balance: Option<Vec<InitialBalanceFile>>,
174195
/// Deprecated: use `ustx_balance` instead
175196
pub mstx_balance: Option<Vec<InitialBalanceFile>>,
@@ -4152,7 +4173,15 @@ pub struct InitialBalance {
41524173
#[derive(Clone, Deserialize, Default, Debug)]
41534174
#[serde(deny_unknown_fields)]
41544175
pub struct InitialBalanceFile {
4176+
/// The Stacks address to receive the initial STX balance.
4177+
/// Must be a valid Stacks address string (e.g., "ST2QKZ4FKHAH1NQKYKYAYZPY440FEPK7GZ1R5HBP2").
4178+
///
4179+
/// Default: `""`
41554180
pub address: String,
4181+
/// The amount of microSTX to allocate to the address at node startup.
4182+
/// 1 STX = 1_000_000 microSTX.
4183+
///
4184+
/// Default: `0`
41564185
pub amount: u64,
41574186
}
41584187

0 commit comments

Comments
 (0)