Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ If you're looking for the low-level protocol libraries, check out the [`stratum`
- `stratum-apps/` - Shared application utilities
- Configuration helpers (TOML, coinbase outputs, logging)
- Network connection utilities (Noise protocol, plain TCP, SV1 connections)
- Payout identity parsing and coinbase output construction/verification helpers
- Runtime fallback coordination helpers
- RPC client implementation
- Key management utilities
- Custom synchronization primitives
Expand Down Expand Up @@ -102,4 +104,4 @@ Minimum Supported Rust Version: 1.85.0

> Website [stratumprotocol.org](https://www.stratumprotocol.org)  · 
> Discord [SV2 Discord](https://discord.gg/fsEW23wFYs)  · 
> Twitter [@Stratumv2](https://twitter.com/StratumV2)  · 
> Twitter [@Stratumv2](https://twitter.com/StratumV2)  · 
2 changes: 2 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ If something behaves weirdly, 99% of the time your `docker_env` is the culprit.

* Port **34255**
* Upstream target (JDC or pool) is fully controlled via `docker_env` variables
* `TPROXY_VERIFY_PAYOUT=false` is the standard pool-mining default; set it to `true` only for
solo/donation identities where `TPROXY_USER_IDENTITY` encodes the expected on-chain payout

---

Expand Down
6 changes: 6 additions & 0 deletions docker/config/translator-proxy-config.toml.template
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ downstream_extranonce2_size = 4
# This will be appended with a counter for each mining client (e.g., username.miner1, username.miner2)
user_identity = "${TPROXY_USER_IDENTITY}"

# If true, tProxy verifies upstream coinbase outputs against the payout encoded by user_identity.
# Keep false for standard pool mining, including pools that use a Bitcoin address as the username.
# Enable for solo/donation identities: sri/solo/<address>/<worker>,
# sri/donate/<percentage>/<address>/<worker>, or legacy <address>[.worker].
verify_payout = ${TPROXY_VERIFY_PAYOUT}

# Aggregate channels: if true, all miners share one upstream channel; if false, each miner gets its own channel
aggregate_channels = ${TPROXY_AGGREGATE_CHANNELS}

Expand Down
2 changes: 1 addition & 1 deletion docker/docker_env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ JDC_UPSTREAM_JDS_PORT=3334

#Tproxy Settings
TPROXY_USER_IDENTITY=your_username_here
TPROXY_VERIFY_PAYOUT=false
TPROXY_AGGREGATE_CHANNELS=false
TPROXY_MIN_INDIVIDUAL_MINER_HASHRATE=10_000_000_000_000.0
TPROXY_SHARES_PER_MINUTE=6.0
TPROXY_ENABLE_VARDIFF=true
TPROXY_UPSTREAM_ADDRESS=jd_client_sv2 # Use jd_client_sv2 for pool_and_miner_apps, pool_sv2 for pool_and_miner_apps_no_jd
TPROXY_UPSTREAM_PORT=34265 # Use 34265 for pool_and_miner_apps, 3333 for pool_and_miner_apps_no_jd
TPROXY_UPSTREAM_AUTHORITY_PUBKEY=9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72

2 changes: 1 addition & 1 deletion integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"]
exclude = ["resources/high_diff_chain.tar.gz"]

[dependencies]
stratum-apps = { version = "0.5.0", path = "../stratum-apps", features = ["network", "config"] }
stratum-apps = { version = "0.5.0", path = "../stratum-apps", features = ["network", "config", "payout"] }
jd_client_sv2 = { version = "0.3.0", path = "../miner-apps/jd-client" }
pool_sv2 = { version = "0.4.0", path = "../pool-apps/pool" }
translator_sv2 = { version = "0.3.0", path = "../miner-apps/translator" }
Expand Down
27 changes: 26 additions & 1 deletion integration-tests/lib/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,30 @@ pub async fn start_sv2_translator(
required_extensions: Vec<u16>,
job_keepalive_interval_secs: Option<u16>,
enable_monitoring: bool,
) -> (TranslatorSv2, SocketAddr, Option<SocketAddr>) {
start_sv2_translator_with_user_identity(
upstreams,
aggregate_channels,
supported_extensions,
required_extensions,
job_keepalive_interval_secs,
"user_identity".to_string(),
false,
enable_monitoring,
)
.await
}

#[allow(clippy::too_many_arguments)]
pub async fn start_sv2_translator_with_user_identity(
upstreams: &[SocketAddr],
aggregate_channels: bool,
supported_extensions: Vec<u16>,
required_extensions: Vec<u16>,
job_keepalive_interval_secs: Option<u16>,
user_identity: String,
verify_payout: bool,
enable_monitoring: bool,
) -> (TranslatorSv2, SocketAddr, Option<SocketAddr>) {
let job_keepalive_interval_secs = job_keepalive_interval_secs.unwrap_or(60);
let upstreams = upstreams
Expand Down Expand Up @@ -399,7 +423,8 @@ pub async fn start_sv2_translator(
2,
2,
downstream_extranonce2_size,
"user_identity".to_string(),
user_identity,
verify_payout,
aggregate_channels,
supported_extensions,
required_extensions,
Expand Down
Loading
Loading