Market Cap: $2.219T -3.80%
Volume(24h): $129.2422B -1.59%
Fear & Greed Index:

23 - Extreme Fear

  • Market Cap: $2.219T -3.80%
  • Volume(24h): $129.2422B -1.59%
  • Fear & Greed Index:
  • Market Cap: $2.219T -3.80%
Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos
Top Cryptospedia

Select Language

Select Language

Select Currency

Cryptos
Topics
Cryptospedia
News
CryptosTopics
Videos

How to set up a proxy for mining farms? (Network Optimization)

cpuminer支持HTTP/SOCKS5代理(如`--proxy socks5://u:p@h:p`),可配CA证书(`--cert`)及TCP保活,确保Stratum连接安全稳定。

Apr 11, 2026 at 09:19 am

Proxy Configuration for Mining Farm Infrastructure

1. Identify the mining software in use across the farm—common tools include cpuminer, xmrig, and ccminer. Each supports distinct proxy syntax and protocol handling.

2. Deploy a centralized proxy server using xmrig-proxy when managing large-scale CPU/GPU rigs. This tool accepts upstream connections from individual miners and forwards authenticated work to the target pool.

3. Configure the config.json file inside xmrig-proxy to define upstream pool address, port, and worker naming conventions. The “donate-level” parameter must be set to zero if donation mining is disallowed per local policy.

4. Assign static internal IP addresses to all proxy nodes to prevent DHCP-induced routing inconsistencies during long-running sessions.

5. Enforce TLS 1.2+ encryption between miners and proxy by enabling SSL termination at the proxy layer—this requires valid certificates issued by trusted CAs or self-signed certs imported into each miner’s trust store.

SOCKS5 vs HTTP Proxy Selection

1. Use SOCKS5 when routing traffic through Tor-based infrastructure or anonymized relay chains where DNS resolution must occur on the remote side.

2. Prefer HTTP proxies when connecting to pools that enforce strict origin headers or require cookie-based session persistence.

3. Avoid transparent HTTP proxies unless explicitly whitelisted by the mining pool—many pools reject requests lacking proper User-Agent or Host fields.

4. Confirm proxy compatibility with Stratum v1/v2 protocols by checking whether the proxy preserves binary frame boundaries and does not alter JSON-RPC payload encoding.

5. Test latency differentials using curl -w “@speed.txt” -o /dev/null -s http://pool.example.com before full deployment to isolate bottlenecks introduced by intermediate layers.

TCP Keepalive and Connection Stability Tuning

1. Set SO_KEEPALIVE on all outbound sockets used by mining daemons to detect dead peers without relying solely on pool-side ping timeouts.

2. Adjust kernel-level keepalive parameters: net.ipv4.tcp_keepalive_time=600, net.ipv4.tcp_keepalive_intvl=60, net.ipv4.tcp_keepalive_probes=3 to maintain persistent Stratum channels under fluctuating network conditions.

3. Disable Nagle’s algorithm via TCP_NODELAY on mining client sockets to eliminate artificial delays caused by small-packet coalescing.

4. Monitor socket state distribution using ss -s and filter for TIME-WAIT accumulation—excessive counts indicate insufficient ephemeral port reuse or premature connection closure.

5. Apply iptables rate limiting only on inbound health-check endpoints, never on Stratum data ports, to avoid disrupting job distribution cycles.

Certificate Validation and Pool Authentication

1. Load custom CA certificate bundles into cpuminer via the --cert flag pointing to PEM-formatted trust stores containing root and intermediate certificates required by the pool’s TLS chain.

2. Verify certificate pinning compliance by comparing SHA-256 fingerprints of pool server certificates against pre-approved values stored in secure configuration vaults.

3. Reject connections when curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L) returns failure—do not override this check even during debugging phases.

4. Rotate certificates annually and synchronize renewal timelines across all proxy gateways and miner instances to prevent cascading authentication failures.

5. Log all SSL handshake errors with full OpenSSL error codes to enable precise root-cause analysis without decrypting live traffic.

Bandwidth Allocation and QoS Enforcement

1. Classify Stratum traffic as high-priority using tc qdisc add dev eth0 root handle 1: htb default 30 and assign minimum guaranteed bandwidth to prevent starvation during concurrent SSH or monitoring activity.

2. Cap upload bandwidth per rig to match upstream pool requirements—most pools expect less than 10 KB/s sustained upload; excess usage triggers rate-limiting or blacklisting.

3. Block non-mining UDP traffic above port 3333 using iptables -A OUTPUT -p udp --dport :65535 -j DROP to reduce noise in packet inspection logs.

4. Tag packets with DSCP value EF (46) for expedited forwarding when traversing enterprise-grade switches supporting DiffServ-aware queuing.

5. Audit interface statistics daily using cat /proc/net/dev to detect abnormal spikes in tx_dropped or rx_missed counters indicating buffer exhaustion or NIC misconfiguration.

Frequently Asked Questions

Q: Can I run multiple xmrig-proxy instances behind a single public IP?A: Yes—if each instance binds to a unique local port and routes to separate upstream pools or worker groups. Port forwarding rules must map distinct external ports to corresponding internal listeners.

Q: Does cpuminer support SOCKS5 authentication with username/password?A: Yes—use the format socks5://user:pass@host:port with the --proxy flag. Credentials are transmitted in base64-encoded form within the SOCKS5 handshake.

Q: Why do some pools reject connections through certain HTTP proxies?A: Because those proxies rewrite Connection, Transfer-Encoding, or Content-Length headers, breaking Stratum’s streaming semantics and causing job parsing failures on the pool side.

Q: How do I verify that my proxy is not altering Stratum payloads?A: Capture traffic between proxy and pool using tcpdump -i any port 3333 -w stratum.pcap, then inspect JSON-RPC method names and params in Wireshark to confirm exact byte-for-byte fidelity.

Disclaimer:info@kdj.com

The information provided is not trading advice. kdj.com does not assume any responsibility for any investments made based on the information provided in this article. Cryptocurrencies are highly volatile and it is highly recommended that you invest with caution after thorough research!

If you believe that the content used on this website infringes your copyright, please contact us immediately (info@kdj.com) and we will delete it promptly.

Related knowledge

See all articles

User not found or password invalid

Your input is correct