Skip to content

Commit

Permalink
Translators readme (stratum-mining#805)
Browse files Browse the repository at this point in the history
  • Loading branch information
ikeogu authored and lorbax committed May 2, 2024
1 parent c3960f0 commit ea71ce0
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions roles/translator/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

# SV1 to SV2 Translator Proxy

This proxy is designed to sit in between a SV1 Downstream role (most typically Mining Device(s)
running SV1 firmware) and a SV2 Upstream role (most typically a SV2 Pool Server with Extended
Channel support).
Expand All @@ -20,36 +22,37 @@ The most typical high level configuration is:
```

## Setup

### Configuration File
The `proxy-config-example.toml` is a configuration example which can be copy/paste into `/conf` directory by the party that is running the Translator Proxy (most
typically the mining farm/miner hobbyist) to address the most preferred customization.

`tproxy-config-local-jdc-example.toml` and `tproxy-config-local-pool-example.toml` are examples of configuration files for the Translator Proxy.

The configuration file contains the following information:

1. The SV2 Upstream connection information which includes the SV2 Pool authority public key
(`upstream_authority_pubkey`) and the SV2 Pool connection address (`upstream_address`) and port
(`upstream_port`).
1. The SV1 Downstream connection information which includes the SV1 Mining Device address
2. The SV1 Downstream socket information which includes the listening IP address
(`downstream_address`) and port (`downstream_port`).
1. The maximum and minimum SV2 versions (`max_supported_version` and `min_supported_version`) that
3. The maximum and minimum SRI versions (`max_supported_version` and `min_supported_version`) that
the Translator Proxy implementer wants to support. Currently the only available version is `2`.
1. The desired minimum `extranonce2` size that the Translator Proxy implementer wants to use
4. The desired minimum `extranonce2` size that the Translator Proxy implementer wants to use
(`min_extranonce2_size`). The `extranonce2` size is ultimately decided by the SV2 Upstream role,
but if the specified size meets the SV2 Upstream role's requirements, the size specified in this
configuration file should be favored.
1. The Job Declarator information which includes the Pool JD connection address (`jd_address`) and the Template Provider connection address to which to connect (`tp_address`).
1. The difficulty params such as the hashrate (hashes/s) of the weakest Mining Device that will be connecting to the Translator Proxy (`min_individual_miner_hashrate`), the number of shares needed before a mining.set_difficulty update (`miner_num_submits_before_update`) and the number of shares per minute that Mining Devices should be sending to the Translator Proxy (`shares_per_minute`). Ultimately, the estimated aggregate hashrate of all SV1 Downstream roles (Mining
Devices) (`channel_nominal_hashrate`), which is communicated to the SV2 Upstream to help it decide a proper difficulty target.
5. The downstream difficulty params such as:
- the hashrate (hashes/s) of the weakest Mining Device that will be connecting to the Translator Proxy (`min_individual_miner_hashrate`)
- the number of shares per minute that Mining Devices should be sending to the Translator Proxy (`shares_per_minute`).
6. The upstream difficulty params such as:
- the interval in seconds to elapse before updating channel hashrate with the pool (`channel_diff_update_interval`)
- the estimated aggregate hashrate of all SV1 Downstream roles (`channel_nominal_hashrate`)

### Run
1. Copy the `proxy-config-example.toml` into `conf/` directory.
2. Edit it with custom desired configuration and rename it `proxy-config.toml`
3. Point the SV1 Downstream Mining Device(s) to the Translator Proxy IP address and port.
4. Run the Translator Proxy:

```
cd roles/translator
```
```
cargo run -p translator_sv2 -- -c conf/proxy-config.toml
```

There are two files in `roles/translator/config-examples`:
- `tproxy-config-local-jdc-example.toml` which assumes the Job Declaration protocol is used and a JD Client is deployed locally
- `tproxy-config-local-pool-example.toml` which assumes Job Declaration protocol is NOT used, and a Pool is deployed locally

```bash
cd roles/translator/config-examples/
cargo run -- -c tproxy-config-local-jdc-example.toml

0 comments on commit ea71ce0

Please sign in to comment.