From 968582ee155ab1a584e20cc11a2d7ace63ff1f84 Mon Sep 17 00:00:00 2001 From: plebhash Date: Thu, 29 Feb 2024 15:41:28 +0000 Subject: [PATCH 01/29] release-libs on push to main --- .github/workflows/release-libs.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index c31cfdde0..d21b54439 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -10,9 +10,10 @@ name: Release Libs -on: - # Manually run by going to "Actions/Release" in Github and running the workflow - workflow_dispatch: +on: + push: + branches: + - main jobs: libs_publish: From 26b9792fdec5920bc2d06dffaeea82461cd17e61 Mon Sep 17 00:00:00 2001 From: plebhash Date: Fri, 15 Mar 2024 18:34:50 -0300 Subject: [PATCH 02/29] add check-versioning-lib-release.sh --- check-versioning-lib-release.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 check-versioning-lib-release.sh diff --git a/check-versioning-lib-release.sh b/check-versioning-lib-release.sh new file mode 100755 index 000000000..a0a006375 --- /dev/null +++ b/check-versioning-lib-release.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Get the list of paths to `Cargo.toml` files +crates=$(find . -name Cargo.toml -exec dirname {} \; | sort) + +# Filter out crates that are not published to crates.io +filter=("benches" "examples" "test") +for f in "${filter[@]}"; do + crates=$(echo "$crates" | grep -v "$f") +done + +# Loop through each crate, while avoiding root workspace Cargo.toml +for crate in $crates; do + if [ "$crate" != "./protocols" ] && [ "$crate" != "./common" ] && [ "$crate" != "./roles" ] && [ "$crate" != "./utils" ]; then + cd "$crate" + + # Check if there were any changes between dev and main + git diff --quiet "dev" "main" -- . + if [ $? -ne 0 ]; then + + # Check if crate versions on dev and main are identical + version_dev=$(git show dev:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') + version_main=$(git show 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 + fi +done \ No newline at end of file From a3059852d0a1f70426b369bd74dde8cb60cb1089 Mon Sep 17 00:00:00 2001 From: plebhash Date: Thu, 21 Mar 2024 22:01:05 -0300 Subject: [PATCH 03/29] avoid files under target dir --- check-versioning-lib-release.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/check-versioning-lib-release.sh b/check-versioning-lib-release.sh index a0a006375..9937199f6 100755 --- a/check-versioning-lib-release.sh +++ b/check-versioning-lib-release.sh @@ -9,9 +9,14 @@ for f in "${filter[@]}"; do crates=$(echo "$crates" | grep -v "$f") done -# Loop through each crate, while avoiding root workspace Cargo.toml +# Loop through each crate, while avoiding root workspace Cargo.toml and files under `target` directory for crate in $crates; do - if [ "$crate" != "./protocols" ] && [ "$crate" != "./common" ] && [ "$crate" != "./roles" ] && [ "$crate" != "./utils" ]; then + if [ "$crate" != "./protocols" ] && \ + [ "$crate" != "./common" ] && \ + [ "$crate" != "./roles" ] && \ + [ "$crate" != "./utils" ] && \ + ! echo "$crate" | grep -q "target"; then + cd "$crate" # Check if there were any changes between dev and main From d6ac08942bd9574afbbc22bc4c5f75126e60260a Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 14:40:39 -0300 Subject: [PATCH 04/29] remove roles from release-libs.yaml --- .github/workflows/release-libs.yaml | 22 +--------------------- check-versioning-lib-release.sh | 2 +- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index d21b54439..21038ecf4 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -135,24 +135,4 @@ jobs: continue-on-error: true run: | cd roles/roles-utils/rpc - cargo publish - - name: Publish crate jd_client - continue-on-error: true - run: | - cargo publish --manifest-path=roles/jd-client/Cargo.toml - - name: Publish crate jd_server - continue-on-error: true - run: | - cargo publish --manifest-path=roles/jd-server/Cargo.toml - - name: Publish crate mining_proxy_sv2 - continue-on-error: true - run: | - cargo publish --manifest-path=roles/mining-proxy/Cargo.toml - - name: Publish crate pool_sv2 - continue-on-error: true - run: | - cargo publish --manifest-path=roles/pool/Cargo.toml - - name: Publish crate translator_sv2 - continue-on-error: true - run: | - cargo publish --manifest-path=roles/translator/Cargo.toml \ No newline at end of file + cargo publish \ No newline at end of file diff --git a/check-versioning-lib-release.sh b/check-versioning-lib-release.sh index 9937199f6..6b142d378 100755 --- a/check-versioning-lib-release.sh +++ b/check-versioning-lib-release.sh @@ -4,7 +4,7 @@ crates=$(find . -name Cargo.toml -exec dirname {} \; | sort) # Filter out crates that are not published to crates.io -filter=("benches" "examples" "test") +filter=("benches" "examples" "test" "roles") for f in "${filter[@]}"; do crates=$(echo "$crates" | grep -v "$f") done From 1f149dc7f1d5c1a0f6d37add34bb663584a24929 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 14:52:36 -0300 Subject: [PATCH 05/29] run check-versioning-lib-release.sh on CI --- .github/workflows/release-libs.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index 21038ecf4..20e593403 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -16,6 +16,18 @@ on: - main jobs: + check_versioning_lib_release: + runs-on: ubuntu-latest + steps: + - name: run check-versioning-lib-release.sh + - uses: actions/checkout@v3 + run: | + ./check-versioning-lib-release.sh + if [ $? -eq 1 ]; then + echo "Script returned exit code 1, halting the workflow" + exit 1 + fi + libs_publish: runs-on: ubuntu-latest steps: From abfc5da343ae2cad9249f0aa1ecdaa7fba8a9d53 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 15:15:27 -0300 Subject: [PATCH 06/29] fix release-libs.yaml --- .github/workflows/release-libs.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index 20e593403..9789608a5 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -19,8 +19,10 @@ jobs: check_versioning_lib_release: runs-on: ubuntu-latest steps: - - name: run check-versioning-lib-release.sh - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 + + - name: Run check-versioning-lib-release.sh run: | ./check-versioning-lib-release.sh if [ $? -eq 1 ]; then From e4f8db8475c4f0ef2dba24fac62ca39be5fd2ab9 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 15:52:16 -0300 Subject: [PATCH 07/29] use bash shebang on check-versioning-lib-release.sh --- check-versioning-lib-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check-versioning-lib-release.sh b/check-versioning-lib-release.sh index 6b142d378..0ef1d5800 100755 --- a/check-versioning-lib-release.sh +++ b/check-versioning-lib-release.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Get the list of paths to `Cargo.toml` files crates=$(find . -name Cargo.toml -exec dirname {} \; | sort) From b57352b283931528666594f1e03052ab21c54afb Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 17:14:29 -0300 Subject: [PATCH 08/29] unify jobs --- .github/workflows/release-libs.yaml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index 9789608a5..d94cc5e64 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -16,7 +16,7 @@ on: - main jobs: - check_versioning_lib_release: + libs_publish: runs-on: ubuntu-latest steps: - name: Checkout code @@ -30,14 +30,11 @@ jobs: exit 1 fi - libs_publish: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - toolchain: stable - override: true + toolchain: stable + override: true - name: Login run: cargo login ${{ secrets.CRATES_IO_DEPLOY_KEY }} - name: Publish crate common From 32f47eac38118c658b6c818e9a6bbab3da77c087 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 17:18:51 -0300 Subject: [PATCH 09/29] fix check-versioning-lib-release.sh --- check-versioning-lib-release.sh | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/check-versioning-lib-release.sh b/check-versioning-lib-release.sh index 0ef1d5800..b78c31412 100755 --- a/check-versioning-lib-release.sh +++ b/check-versioning-lib-release.sh @@ -5,27 +5,36 @@ crates=$(find . -name Cargo.toml -exec dirname {} \; | sort) # Filter out crates that are not published to crates.io filter=("benches" "examples" "test" "roles") -for f in "${filter[@]}"; do - crates=$(echo "$crates" | grep -v "$f") +for crate in $crates; do + filtered=false + for f in "${filter[@]}"; do + if [ "$crate" = "./$f" ]; then + filtered=true + break + fi + done + if [ "$filtered" = false ]; then + filtered_crates+=("$crate") + fi done +crates="${filtered_crates[@]}" + # Loop through each crate, while avoiding root workspace Cargo.toml and files under `target` directory for crate in $crates; do if [ "$crate" != "./protocols" ] && \ [ "$crate" != "./common" ] && \ - [ "$crate" != "./roles" ] && \ - [ "$crate" != "./utils" ] && \ ! echo "$crate" | grep -q "target"; then cd "$crate" # Check if there were any changes between dev and main - git diff --quiet "dev" "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 dev:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') - version_main=$(git show main:./Cargo.toml | awk -F' = ' '$1 == "version" {gsub(/[ "]+/, "", $2); print $2}') + 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 From 8d6e7f179a05e7ba08045225b8b64c1f2c9db396 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 17:47:16 -0300 Subject: [PATCH 10/29] trigger release-libs.yaml on pull_requests to main --- .github/workflows/release-libs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index d94cc5e64..b16908d47 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -11,7 +11,7 @@ name: Release Libs on: - push: + pull_request: branches: - main From 475cdd6367025072a67f94d570e0425d2fc41851 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 17:58:08 -0300 Subject: [PATCH 11/29] checkout main on release-libs.yaml --- .github/workflows/release-libs.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index b16908d47..53b258611 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -11,7 +11,7 @@ name: Release Libs on: - pull_request: + push: branches: - main @@ -21,6 +21,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 + with: + ref: 'main' - name: Run check-versioning-lib-release.sh run: | From f887e3d244c6bd7b18937ed6f25ea43153494c05 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 18:18:06 -0300 Subject: [PATCH 12/29] revert checkout main on release-libs.yaml --- .github/workflows/release-libs.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index 53b258611..d94cc5e64 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -21,8 +21,6 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - with: - ref: 'main' - name: Run check-versioning-lib-release.sh run: | From c5bf950d6057455c4df6dc00364c5920812f7607 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 18:18:23 -0300 Subject: [PATCH 13/29] fetch main and dev branches --- check-versioning-lib-release.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/check-versioning-lib-release.sh b/check-versioning-lib-release.sh index b78c31412..853f61996 100755 --- a/check-versioning-lib-release.sh +++ b/check-versioning-lib-release.sh @@ -1,5 +1,8 @@ #!/bin/bash +git fetch origin main +git fetch origin dev + # Get the list of paths to `Cargo.toml` files crates=$(find . -name Cargo.toml -exec dirname {} \; | sort) From 911115786fc9a11053672d615fdb80b9aa0bb75d Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 18:35:35 -0300 Subject: [PATCH 14/29] trigger release-libs.yaml on pull_requests to main --- .github/workflows/release-libs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index d94cc5e64..b16908d47 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -11,7 +11,7 @@ name: Release Libs on: - push: + pull_request: branches: - main From 86c7c10b204747530555aa53c27bb9a764f5318b Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 19:31:39 -0300 Subject: [PATCH 15/29] simplify check-versioning-lib-release.sh --- check-versioning-lib-release.sh | 88 +++++++++++++++++---------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/check-versioning-lib-release.sh b/check-versioning-lib-release.sh index 853f61996..ff5c7db0d 100755 --- a/check-versioning-lib-release.sh +++ b/check-versioning-lib-release.sh @@ -3,47 +3,49 @@ git fetch origin main git fetch origin dev -# Get the list of paths to `Cargo.toml` files -crates=$(find . -name Cargo.toml -exec dirname {} \; | sort) - -# Filter out crates that are not published to crates.io -filter=("benches" "examples" "test" "roles") -for crate in $crates; do - filtered=false - for f in "${filter[@]}"; do - if [ "$crate" = "./$f" ]; then - filtered=true - break - fi - done - if [ "$filtered" = false ]; then - filtered_crates+=("$crate") - fi -done - -crates="${filtered_crates[@]}" - -# Loop through each crate, while avoiding root workspace Cargo.toml and files under `target` directory -for crate in $crates; do - if [ "$crate" != "./protocols" ] && \ - [ "$crate" != "./common" ] && \ - ! echo "$crate" | grep -q "target"; then - - 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 - fi +# this list was taken from `.github/workflows/release-libs.yaml`. +# if anything changes there (crates added/removed to publishing pipeline) +# those changes should be reflected here +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" +) + +# 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 \ No newline at end of file From 2ca3bf0a51a7699771120c38a23397005916f713 Mon Sep 17 00:00:00 2001 From: plebhash Date: Tue, 2 Apr 2024 19:39:44 -0300 Subject: [PATCH 16/29] lint release-libs.yaml --- .github/workflows/release-libs.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index b16908d47..41c46aa86 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -33,8 +33,8 @@ jobs: - uses: actions/checkout@v3 - uses: actions-rs/toolchain@v1 with: - toolchain: stable - override: true + toolchain: stable + override: true - name: Login run: cargo login ${{ secrets.CRATES_IO_DEPLOY_KEY }} - name: Publish crate common From 52098db554d5fe6b0d8db93c53bdc276f9a064b2 Mon Sep 17 00:00:00 2001 From: plebhash Date: Wed, 3 Apr 2024 12:35:19 -0300 Subject: [PATCH 17/29] Revert "remove roles from release-libs.yaml" This reverts commit d6ac08942bd9574afbbc22bc4c5f75126e60260a. --- .github/workflows/release-libs.yaml | 25 +++++++++++++++++++++++++ check-versioning-lib-release.sh | 8 +++++--- 2 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-libs.yaml b/.github/workflows/release-libs.yaml index 41c46aa86..9ab285ef4 100644 --- a/.github/workflows/release-libs.yaml +++ b/.github/workflows/release-libs.yaml @@ -146,4 +146,29 @@ jobs: continue-on-error: true run: | cd roles/roles-utils/rpc + cargo publish + - name: Publish crate jd_client + continue-on-error: true + run: | + cd roles/jd-client + cargo publish + - name: Publish crate jd_server + continue-on-error: true + run: | + cd roles/jd-server + cargo publish + - name: Publish crate mining_proxy_sv2 + continue-on-error: true + run: | + cd roles/mining-proxy + cargo publish + - name: Publish crate pool_sv2 + continue-on-error: true + run: | + cd roles/pool + cargo publish + - name: Publish crate translator_sv2 + continue-on-error: true + run: | + cd roles/translator cargo publish \ No newline at end of file diff --git a/check-versioning-lib-release.sh b/check-versioning-lib-release.sh index ff5c7db0d..6d2bcc794 100755 --- a/check-versioning-lib-release.sh +++ b/check-versioning-lib-release.sh @@ -3,9 +3,6 @@ git fetch origin main git fetch origin dev -# this list was taken from `.github/workflows/release-libs.yaml`. -# if anything changes there (crates added/removed to publishing pipeline) -# those changes should be reflected here crates=( "utils/buffer" "protocols/v2/binary-sv2/no-serde-sv2/derive_codec" @@ -28,6 +25,11 @@ crates=( "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 From 3b80c5a270f64c9d0931fc0bbf63bdd4979d3e65 Mon Sep 17 00:00:00 2001 From: ikeogu Date: Wed, 20 Mar 2024 19:07:20 +0100 Subject: [PATCH 18/29] modified the README in roles/translator dir --- roles/translator/README.md | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index ce8a07582..6f8de9f4c 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -1,4 +1,5 @@ # 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). @@ -20,8 +21,10 @@ 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 + +The `tproxy-config-local-jdc-example.toml` is a configuration example directory by the party that is running the Translator Proxy (most typically the mining farm/miner hobbyist) to address the most preferred customization. The configuration file contains the following information: @@ -29,27 +32,23 @@ 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 connection information which includes the SV1 Mining Device 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 SV2 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 +5. 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`). +6. 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. ### 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 - ``` + +Run the Translator Proxy: + +```bash +cd roles/translator/config-examples/ +cargo run -- -c tproxy-config-local-jdc-example.toml +``` From 3d76098b08fac2a74a168ceb6b34d8c2f884d193 Mon Sep 17 00:00:00 2001 From: ikeogu Date: Wed, 20 Mar 2024 19:32:18 +0100 Subject: [PATCH 19/29] Revert "modified the README in roles/translator dir" This reverts commit 5a91c0c5e4f51f9b9b55a8a4e61c6f949772132a. --- roles/translator/README.md | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index 6f8de9f4c..ce8a07582 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -1,5 +1,4 @@ # 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). @@ -21,10 +20,8 @@ The most typical high level configuration is: ``` ## Setup - ### Configuration File - -The `tproxy-config-local-jdc-example.toml` is a configuration example directory by the party that is running the Translator Proxy (most +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. The configuration file contains the following information: @@ -32,23 +29,27 @@ 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`). -2. The SV1 Downstream connection information which includes the SV1 Mining Device address +1. The SV1 Downstream connection information which includes the SV1 Mining Device address (`downstream_address`) and port (`downstream_port`). -3. The maximum and minimum SV2 versions (`max_supported_version` and `min_supported_version`) that +1. The maximum and minimum SV2 versions (`max_supported_version` and `min_supported_version`) that the Translator Proxy implementer wants to support. Currently the only available version is `2`. -4. The desired minimum `extranonce2` size that the Translator Proxy implementer wants to use +1. 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. -5. 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`). -6. 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 +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. ### Run - -Run the Translator Proxy: - -```bash -cd roles/translator/config-examples/ -cargo run -- -c tproxy-config-local-jdc-example.toml -``` +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 + ``` From 371b8d0805b2f1936231fc8efc3be153c310317c Mon Sep 17 00:00:00 2001 From: ikeogu Date: Wed, 20 Mar 2024 19:39:36 +0100 Subject: [PATCH 20/29] modified roles/translator/readme file --- roles/translator/README.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index ce8a07582..90577c03a 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -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). @@ -20,8 +22,10 @@ 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 + +The `tproxy-config-local-jdc-example.toml` is a configuration example directory by the party that is running the Translator Proxy (most typically the mining farm/miner hobbyist) to address the most preferred customization. The configuration file contains the following information: @@ -29,27 +33,23 @@ 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 connection information which includes the SV1 Mining Device 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 SV2 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 +5. 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`). +6. 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. ### 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 - ``` + +Run the Translator Proxy: + +```bash +cd roles/translator/config-examples/ +cargo run -- -c tproxy-config-local-jdc-example.toml +``` \ No newline at end of file From 158b0acdf749a38618b60a0336251b9eafd767d9 Mon Sep 17 00:00:00 2001 From: plebhash <147345153+plebhash@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:57:34 -0300 Subject: [PATCH 21/29] Update roles/translator/README.md --- roles/translator/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index 90577c03a..e1ee2f868 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -25,8 +25,7 @@ The most typical high level configuration is: ### Configuration File -The `tproxy-config-local-jdc-example.toml` is a configuration example 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: From 792651c245af352540706041a019e291aa62e5a3 Mon Sep 17 00:00:00 2001 From: plebhash <147345153+plebhash@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:58:01 -0300 Subject: [PATCH 22/29] Update roles/translator/README.md --- roles/translator/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index e1ee2f868..356deaf9f 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -25,7 +25,7 @@ The most typical high level configuration is: ### Configuration File -`tproxy-config-local-jdc-example.toml` and `tproxy-config-local-pool-example.toml` are examples of configuration files for the Translator Proxy +`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: From c339703959abe8b786538129944bd1e6e9bf0ef3 Mon Sep 17 00:00:00 2001 From: plebhash <147345153+plebhash@users.noreply.github.com> Date: Wed, 27 Mar 2024 15:58:41 -0300 Subject: [PATCH 23/29] Update roles/translator/README.md --- roles/translator/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index 356deaf9f..834f9c81f 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -32,7 +32,7 @@ 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`). -2. 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`). 3. The maximum and minimum SV2 versions (`max_supported_version` and `min_supported_version`) that the Translator Proxy implementer wants to support. Currently the only available version is `2`. From c4724cb387b518ceedab44a4e9f765491203fcd5 Mon Sep 17 00:00:00 2001 From: plebhash <147345153+plebhash@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:00:02 -0300 Subject: [PATCH 24/29] Update roles/translator/README.md --- roles/translator/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index 834f9c81f..ce9853f0d 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -40,7 +40,6 @@ The configuration file contains the following information: (`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. -5. 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`). 6. 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. From b931f9a3ccab07b5c3d52c0c9749f3564103a77a Mon Sep 17 00:00:00 2001 From: plebhash <147345153+plebhash@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:03:06 -0300 Subject: [PATCH 25/29] Update roles/translator/README.md --- roles/translator/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index ce9853f0d..c7773eb2b 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -40,7 +40,9 @@ The configuration file contains the following information: (`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. -6. 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 +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`). Devices) (`channel_nominal_hashrate`), which is communicated to the SV2 Upstream to help it decide a proper difficulty target. ### Run From 4172998b09220ae28778087162f28a326fb7df95 Mon Sep 17 00:00:00 2001 From: plebhash <147345153+plebhash@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:04:09 -0300 Subject: [PATCH 26/29] Update roles/translator/README.md --- roles/translator/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index c7773eb2b..2198dca50 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -43,7 +43,9 @@ The configuration file contains the following information: 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`). - Devices) (`channel_nominal_hashrate`), which is communicated to the SV2 Upstream to help it decide a proper difficulty target. +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 From ad2cb2bb12a2774b8dc9a3127dfcbd2cdf7dfd9e Mon Sep 17 00:00:00 2001 From: plebhash <147345153+plebhash@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:05:37 -0300 Subject: [PATCH 27/29] Update roles/translator/README.md --- roles/translator/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roles/translator/README.md b/roles/translator/README.md index 2198dca50..fb544c9c5 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -54,4 +54,6 @@ Run the Translator Proxy: ```bash cd roles/translator/config-examples/ cargo run -- -c tproxy-config-local-jdc-example.toml +# or +cargo run -- -c tproxy-config-local-pool-example.toml ``` \ No newline at end of file From 800096980ce036f383848cea9c80d4d1f06c9787 Mon Sep 17 00:00:00 2001 From: plebhash <147345153+plebhash@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:31:17 -0300 Subject: [PATCH 28/29] Update roles/translator/README.md --- roles/translator/README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index fb544c9c5..160ff5bd4 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -49,11 +49,10 @@ The configuration file contains the following information: ### Run -Run the Translator Proxy: +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 -# or -cargo run -- -c tproxy-config-local-pool-example.toml -``` \ No newline at end of file +cargo run -- -c tproxy-config-local-jdc-example.toml \ No newline at end of file From 363e8ab86609a5d38f953672466c42c931e56f19 Mon Sep 17 00:00:00 2001 From: plebhash <147345153+plebhash@users.noreply.github.com> Date: Wed, 27 Mar 2024 16:56:11 -0300 Subject: [PATCH 29/29] Update roles/translator/README.md --- roles/translator/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/translator/README.md b/roles/translator/README.md index 160ff5bd4..e09e4fd30 100644 --- a/roles/translator/README.md +++ b/roles/translator/README.md @@ -34,7 +34,7 @@ The configuration file contains the following information: (`upstream_port`). 2. The SV1 Downstream socket information which includes the listening IP address (`downstream_address`) and port (`downstream_port`). -3. 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`. 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,