Skip to content

Commit e4e040a

Browse files
average-garyTest User
authored andcommitted
docs: add coinbase rotation documentation to config examples
Document the new coinbase rotation configuration options in testnet4 config examples for both pool and JD-client.
1 parent c83a766 commit e4e040a

File tree

7 files changed

+281
-14
lines changed

7 files changed

+281
-14
lines changed

miner-apps/jd-client/config-examples/testnet4/jdc-config-local-infra-example.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,18 @@ jdc_signature = "Sv2MinerSignature"
3535
# https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki#appendix-b-index-of-script-expressions
3636
# Although the `musig` descriptor is not yet supported and the legacy `combo` descriptor never
3737
# will be. If you have an address, embed it in a descriptor like `addr(<address here>)`.
38+
#
39+
# For automatic address rotation (quantum-resistant payout hygiene), use a wildcard descriptor:
40+
# coinbase_reward_script = "wpkh(tpub.../0/*)"
41+
# This derives a fresh address for each block found. Requires coinbase_index_file.
3842
coinbase_reward_script = "addr(tb1qpusf5256yxv50qt0pm0tue8k952fsu5lzsphft)"
3943

44+
# Coinbase rotation settings (only used when coinbase_reward_script has a wildcard)
45+
# Path to persist the current derivation index (required for rotation)
46+
# coinbase_index_file = "/var/lib/jdc/coinbase_index.dat"
47+
# Starting index if no persistence file exists (default: 0)
48+
# coinbase_start_index = 0
49+
4050
# Enable this option to set a predefined log file path.
4151
# When enabled, logs will always be written to this file.
4252
# The CLI option --log-file (or -f) will override this setting if provided.

miner-apps/jd-client/src/lib/config.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ pub struct JobDeclaratorClientConfig {
8181
fn default_monitoring_cache_refresh_secs() -> u64 {
8282
15
8383
}
84-
}
8584

8685
impl JobDeclaratorClientConfig {
8786
#[allow(clippy::too_many_arguments)]

miner-apps/jd-client/src/lib/mod.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ impl JobDeclaratorClient {
132132
monitoring_addr,
133133
Some(Arc::new(channel_manager.clone())), // SV2 channels opened with servers
134134
Some(Arc::new(channel_manager.clone())), // SV2 channels opened with clients
135-
std::time::Duration::from_secs(
136-
self.config.monitoring_cache_refresh_secs().unwrap_or(15),
137-
),
135+
std::time::Duration::from_secs(self.config.monitoring_cache_refresh_secs()),
138136
)
139137
.expect("Failed to initialize monitoring server");
140138

@@ -504,7 +502,7 @@ impl JobDeclaratorClient {
504502
monitoring_addr,
505503
Some(Arc::new(channel_manager_clone.clone())),
506504
Some(Arc::new(channel_manager_clone.clone())),
507-
std::time::Duration::from_secs(self.config.monitoring_cache_refresh_secs().unwrap_or(15)),
505+
std::time::Duration::from_secs(self.config.monitoring_cache_refresh_secs()),
508506
)
509507
.expect("Failed to initialize monitoring server");
510508

pool-apps/pool/config-examples/testnet4/pool-config-local-sv2-tp-example.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,18 @@ listen_address = "0.0.0.0:43333"
88
# https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki#appendix-b-index-of-script-expressions
99
# Although the `musig` descriptor is not yet supported and the legacy `combo` descriptor never
1010
# will be. If you have an address, embed it in a descriptor like `addr(<address here>)`.
11+
#
12+
# For automatic address rotation (quantum-resistant payout hygiene), use a wildcard descriptor:
13+
# coinbase_reward_script = "wpkh(tpub.../0/*)"
14+
# This derives a fresh address for each block found. Requires coinbase_index_file.
1115
coinbase_reward_script = "addr(tb1qa0sm0hxzj0x25rh8gw5xlzwlsfvvyz8u96w3p8)"
1216

17+
# Coinbase rotation settings (only used when coinbase_reward_script has a wildcard)
18+
# Path to persist the current derivation index (required for rotation)
19+
# coinbase_index_file = "/var/lib/pool/coinbase_index.dat"
20+
# Starting index if no persistence file exists (default: 0)
21+
# coinbase_start_index = 0
22+
1323
# Server Id (number to guarantee unique search space allocation across different Pool servers)
1424
server_id = 1
1525

pool-apps/pool/src/lib/config.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,14 @@ pub struct PoolConfig {
4848
monitoring_address: Option<SocketAddr>,
4949
#[serde(default = "default_monitoring_cache_refresh_secs")]
5050
monitoring_cache_refresh_secs: u64,
51+
#[serde(default)]
52+
jds: Option<JDSPartialConfig>,
5153

5254
/// Starting derivation index for coinbase rotation (default: 0).
5355
///
5456
/// Only used when `coinbase_reward_script` contains a wildcard descriptor
5557
/// (e.g., `wpkh(xpub.../0/*)`). Ignored for static addresses.
5658
#[serde(default)]
57-
jds: Option<JDSPartialConfig>,
58-
monitoring_cache_refresh_secs: Option<u64>,
5959
coinbase_start_index: u32,
6060

6161
/// Path to persist the current coinbase derivation index.
@@ -72,7 +72,6 @@ pub struct PoolConfig {
7272
fn default_monitoring_cache_refresh_secs() -> u64 {
7373
15
7474
}
75-
}
7675

7776
impl PoolConfig {
7877
/// Creates a new instance of the [`PoolConfig`].

pool-apps/pool/src/lib/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,7 @@ impl PoolSv2 {
171171
monitoring_addr,
172172
None, // Pool doesn't have channels opened with servers
173173
Some(Arc::new(channel_manager.clone())), // channels opened with clients
174-
std::time::Duration::from_secs(
175-
self.config.monitoring_cache_refresh_secs().unwrap_or(15),
176-
),
174+
std::time::Duration::from_secs(self.config.monitoring_cache_refresh_secs()),
177175
)
178176
.expect("Failed to initialize monitoring server");
179177

0 commit comments

Comments
 (0)