Skip to content

Commit a2a0e77

Browse files
committed
improve documentation of parameters
1 parent e4bb6ad commit a2a0e77

File tree

1 file changed

+25
-18
lines changed

1 file changed

+25
-18
lines changed

stackslib/src/config/mod.rs

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,6 +1672,8 @@ pub struct NodeConfig {
16721672
/// All persistent data, including chainstate, burnchain databases, and potentially other stores,
16731673
/// will be located within this directory.
16741674
/// This path can be overridden by setting the `STACKS_WORKING_DIR` environment variable.
1675+
/// Note: For persistent mainnet or testnet nodes, this path must be explicitly
1676+
/// configured to a non-temporary location in the configuration file.
16751677
///
16761678
/// Default: `/tmp/stacks-node-{current_timestamp}`.
16771679
pub working_dir: String,
@@ -1688,13 +1690,13 @@ pub struct NodeConfig {
16881690
/// The publicly accessible URL that this node advertises to peers during the P2P handshake
16891691
/// as its HTTP RPC endpoint. Other nodes or services might use this URL to query the node's API.
16901692
///
1691-
/// Default: `http://{rpc_bind}` (e.g., "http://127.0.0.1:20443" if rpc_bind is default and resolves locally).
1693+
/// Default: `http://{rpc_bind}` (e.g., "http://0.0.0.0:20443" if rpc_bind is default).
16921694
pub data_url: String,
16931695
/// The publicly accessible IPv4 address and port that this node advertises to peers for P2P connections.
16941696
/// This might differ from `p2p_bind` if the node is behind NAT or a proxy.
16951697
/// Note: The default value derivation might be unexpected, potentially using the `rpc_bind` address; explicit configuration is recommended if needed.
16961698
///
1697-
/// Default: Derived from `rpc_bind` (e.g., "127.0.0.1:20443" with default settings).
1699+
/// Default: Derived from `rpc_bind` (e.g., "0.0.0.0:20443" if rpc_bind is default).
16981700
pub p2p_address: String,
16991701
/// The private key seed, provided as a hex string in the config file, used specifically for the
17001702
/// node's identity and message signing within the P2P networking layer.
@@ -1703,11 +1705,14 @@ pub struct NodeConfig {
17031705
/// Default: Randomly generated 32 bytes.
17041706
pub local_peer_seed: Vec<u8>,
17051707
/// A list of initial peer nodes used to bootstrap connections into the Stacks P2P network.
1706-
/// Peers are specified as comma-separated strings in the format "PUBKEY@IP:PORT" or "PUBKEY@HOSTNAME:PORT"
1707-
/// in the configuration file. DNS hostnames are resolved during configuration loading.
1708-
/// If empty on mainnet, default Hiro and Stacks seed nodes are used.
1708+
/// Peers are specified in a configuration file as comma-separated strings in the
1709+
/// format `"PUBKEY@IP:PORT"` or `"PUBKEY@HOSTNAME:PORT"`. DNS hostnames are resolved
1710+
/// during configuration loading.
17091711
///
1710-
/// Default: Empty vector `[]`.
1712+
/// Default: The effective initial list depends on how the node is started:
1713+
/// - `mainnet` subcommand: Uses the default Hiro and Stacks mainnet seed nodes
1714+
/// - `testnet` subcommand: Uses the default Hiro testnet seed node
1715+
/// - Other subcommands (`start`, `mocknet`, `helium`, etc.): Empty vector `[]`.
17111716
pub bootstrap_node: Vec<Neighbor>,
17121717
/// A list of peer addresses that this node should explicitly deny connections from.
17131718
/// Peers are specified as comma-separated strings in the format "IP:PORT" or "HOSTNAME:PORT"
@@ -1792,8 +1797,8 @@ pub struct NodeConfig {
17921797
/// Default: `None` (effectively `"noop"`).
17931798
pub marf_cache_strategy: Option<String>,
17941799
/// Controls the timing of hash calculations for MARF trie nodes.
1795-
/// If `true`, hashes are calculated only when the MARF is flushed to disk (deferred hashing).
1796-
/// If `false`, hashes are calculated immediately as leaf nodes are inserted or updated (immediate hashing).
1800+
/// - If `true`, hashes are calculated only when the MARF is flushed to disk (deferred hashing).
1801+
/// - If `false`, hashes are calculated immediately as leaf nodes are inserted or updated (immediate hashing).
17971802
/// Deferred hashing might improve write performance.
17981803
///
17991804
/// Default: `true`
@@ -1811,22 +1816,22 @@ pub struct NodeConfig {
18111816
/// Default: `None` (uses standard network genesis).
18121817
pub use_test_genesis_chainstate: Option<bool>,
18131818
/// Controls if Stacks Epoch 2.1+ affirmation map logic should be applied even before Epoch 2.1.
1814-
/// If `true` (default), the node consistently uses the newer (Epoch 2.1) rules for PoX anchor block
1815-
/// validation and affirmation-based reorg handling, even in earlier epochs.
1816-
/// If `false`, the node strictly follows the rules defined for the specific epoch it is currently
1817-
/// processing, only applying 2.1+ logic from Epoch 2.1 onwards.
1819+
/// - If `true` (default), the node consistently uses the newer (Epoch 2.1) rules for PoX anchor block
1820+
/// validation and affirmation-based reorg handling, even in earlier epochs.
1821+
/// - If `false`, the node strictly follows the rules defined for the specific epoch it is currently
1822+
/// processing, only applying 2.1+ logic from Epoch 2.1 onwards.
18181823
/// Differences in this setting between nodes prior to Epoch 2.1 could lead to consensus forks.
18191824
///
18201825
/// Default: `true`
18211826
pub always_use_affirmation_maps: bool,
18221827
/// Controls if the node must wait for locally missing but burnchain-affirmed PoX anchor blocks.
18231828
/// If an anchor block is confirmed by the affirmation map but not yet processed by this node:
18241829
/// - If `true`: Burnchain processing halts until the affirmed block is acquired. Ensures strict
1825-
/// adherence to the affirmed canonical chain, typical for followers.
1830+
/// adherence to the affirmed canonical chain, typical for followers.
18261831
/// - If `false`: Burnchain processing continues without waiting. Allows miners to operate optimistically
1827-
/// but may necessitate unwinding later if the affirmed block alters the chain state.
1832+
/// but may necessitate unwinding later if the affirmed block alters the chain state.
18281833
///
1829-
/// Default: default is `true` for followers and `false` for miners (when not explicitly configured).
1834+
/// Default: `true` for followers, `false` for miners (when not explicitly configured).
18301835
pub require_affirmed_anchor_blocks: bool,
18311836
/// Controls if the node must strictly wait for any PoX anchor block selected by the core consensus mechanism.
18321837
/// - If `true`: Halts burnchain processing immediately whenever a selected anchor block is missing locally
@@ -1860,10 +1865,12 @@ pub struct NodeConfig {
18601865
pub chain_liveness_poll_time_secs: u64,
18611866
/// A list of specific StackerDB contracts (identified by their qualified contract identifiers,
18621867
/// e.g., "SP000000000000000000002Q6VF78.pox-3") that this node should actively replicate.
1863-
/// If the node is configured as a miner (`node.miner = true`) or stacker (`node.stacker = true`),
1864-
/// relevant system contracts (like `.miners` and `.signers-*`) are typically added automatically.
18651868
///
1866-
/// Default: Empty vector `[]`.
1869+
/// Default: The initial list depends on the `node.miner` and `node.stacker` settings:
1870+
/// - If `miner = true` or `stacker = true`: Relevant system contracts (like `.miners`
1871+
/// and `.signers-*`) are automatically added during configuration loading, in addition
1872+
/// to any contracts specified in the configuration file.
1873+
/// - If `miner = false` and `stacker = false`: Empty vector `[]`.
18671874
pub stacker_dbs: Vec<QualifiedContractIdentifier>,
18681875
/// Enables the transaction index, which maps transaction IDs to the blocks containing them.
18691876
/// Setting this to `true` allows the use of RPC endpoints that look up transactions by ID

0 commit comments

Comments
 (0)