-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into ImproveCpuMiner
- Loading branch information
Showing
5 changed files
with
146 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/bin/bash | ||
|
||
git fetch origin main | ||
git fetch origin dev | ||
|
||
crates=( | ||
"utils/buffer" | ||
"protocols/v2/binary-sv2/no-serde-sv2/derive_codec" | ||
"protocols/v2/binary-sv2/no-serde-sv2/codec" | ||
"protocols/v2/binary-sv2/serde-sv2" | ||
"protocols/v2/binary-sv2/binary-sv2" | ||
"protocols/v2/const-sv2" | ||
"protocols/v2/framing-sv2" | ||
"protocols/v2/noise-sv2" | ||
"protocols/v2/codec-sv2" | ||
"protocols/v2/subprotocols/common-messages" | ||
"protocols/v2/subprotocols/job-declaration" | ||
"protocols/v2/subprotocols/mining" | ||
"protocols/v2/subprotocols/template-distribution" | ||
"protocols/v2/sv2-ffi" | ||
"protocols/v2/roles-logic-sv2" | ||
"protocols/v1" | ||
"utils/bip32-key-derivation" | ||
"utils/error-handling" | ||
"utils/key-utils" | ||
"roles/roles-utils/network-helpers" | ||
"roles/roles-utils/rpc" | ||
"roles/jd-client" | ||
"roles/jd-server" | ||
"roles/mining-proxy" | ||
"roles/pool" | ||
"roles/translator" | ||
) | ||
|
||
# Loop through each crate | ||
for crate in "${crates[@]}"; do | ||
cd "$crate" | ||
|
||
# Check if there were any changes between dev and main | ||
git diff --quiet "origin/dev" "origin/main" -- . | ||
if [ $? -ne 0 ]; then | ||
|
||
# Check if crate versions on dev and main are identical | ||
version_dev=$(git show origin/dev:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') | ||
version_main=$(git show origin/main:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') | ||
if [ "$version_dev" = "$version_main" ]; then | ||
echo "Changes detected in crate $crate between dev and main branches! Versions on dev and main branches are identical ($version_dev), so you should bump the crate version on dev before merging into main." | ||
exit 1 | ||
fi | ||
fi | ||
|
||
cd - >/dev/null | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,34 @@ | ||
# JD Client | ||
The JD Client is a Sv2 proxy that support one extended channel upstream and one extended channel | ||
dowstream, and do job declaration. On start it will: | ||
|
||
* connect to the jd-server | ||
* connect to the template-provider | ||
* listen for and `OpenExtendedChannel` from downstream | ||
The JD Client receives custom block templates from a Template Provider and declares use of the template with the pool using the Job Declaration Protocol. Further distributes the jobs to Mining Proxy (or Proxies) using the Job Distribution Protocol. ``` | ||
* transparently relay the `OpenExtendedChannel` to upstream | ||
After the setup phase it will start to negotiate jobs with upstream and send the negotiated job | ||
downstream, so that everything that is dowstream do not need to know that job is negotiated. | ||
|
||
## Setup | ||
|
||
### Configuration File | ||
The `proxy-config-example.toml` is a configuration example. | ||
|
||
The configuration file contains the following information: | ||
|
||
1. The 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`). | ||
2. The maximum and minimum SV2 versions (`max_supported_version` and `min_supported_version`) | ||
3. 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`). | ||
4. Optionally, you may want to verify that your TP connection is authentic. You may get `tp_authority_public_key` from the logs of your TP, for example: | ||
``` | ||
1. The downstream socket information, which includes the listening IP address (`downstream_address`) and port (`downstream_port`). | ||
2. The maximum and minimum SRI versions (`max_supported_version` and `min_supported_version`) with size as (`min_extranonce2_size`) | ||
3. The authentication keys for the downstream connection (`authority_public_key`, `authority_secret_key`) | ||
4. A `retry` parameter which tells JDC the number of times to reinitialize itself after a failure. | ||
6. The Template Provider address (`tp_address`). | ||
7. Optionally, you may want to verify that your TP connection is authentic. You may get `tp_authority_public_key` from the logs of your TP, for example: | ||
|
||
# 2024-02-13T14:59:24Z Template Provider authority key: EguTM8URcZDQVeEBsM4B5vg9weqEUnufA8pm85fG4bZd | ||
``` | ||
|
||
### Run | ||
1. Copy the `jdc-config-example.toml` into `conf/` directory. | ||
2. Edit it with custom desired configuration and rename it `jdc-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/jdc-config.toml | ||
``` | ||
|
||
Run the Job Declarator Client (JDC): | ||
There are two files when you cd into roles/jd-client/config-examples/ | ||
|
||
1. `jdc-config-hosted-example.toml` connects to the community-hosted roles. | ||
2. `jdc-config-local-example.toml` connects to self-hosted Job Declarator Client (JDC) and Translator Proxy | ||
|
||
``` bash | ||
cd roles/jd-client/config-examples/ | ||
cargo run -- -c jdc-config-hosted-example.toml | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters