Skip to content

Commit

Permalink
produce jobs at minimum rate (#20)
Browse files Browse the repository at this point in the history
* produce jobs at minimum rate

* set default thread count to 2

* update build

* add related resources to README.md

* make rate configurable

* update README.md

* version 0.5

* update some default values
  • Loading branch information
larskuhtz authored Nov 23, 2022
1 parent 85b9f78 commit 04ba308
Show file tree
Hide file tree
Showing 11 changed files with 271 additions and 141 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/build-application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Build and publish application binaries
on: [push]

jobs:


# ########################################################################## #
build:
Expand All @@ -12,9 +11,9 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['8.8.4', '8.10.7', '9.0.1']
cabal: ['3.6']
os: ['ubuntu-18.04', 'ubuntu-20.04', 'macOS-latest']
ghc: ['8.10.7', '9.0.2', '9.2']
cabal: ['3.8']
os: ['ubuntu-20.04', 'ubuntu-22.04', 'macOS-latest']

steps:
- name: Set Variables
Expand All @@ -30,17 +29,17 @@ jobs:
# Setup
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Install GHC and Cabal
uses: haskell/actions/setup@v1.2.7
uses: haskell/actions/setup@v2.0.2
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}
- name: Confirm GHC and Cabal installation
run: |
ghc --version
cabal --version
- uses: pat-s/always-upload-cache@v2.1.5
- uses: actions/cache@v3
name: Cache dist-newstyle
with:
path: |
Expand Down Expand Up @@ -71,8 +70,7 @@ jobs:
run: |
echo "ARTIFACTS_ARCHIVE: $ARTIFACTS_ARCHIVE"
mkdir -p $ARTIFACTS_DIR
# cp $(cabal list-bin chainweb-mining-client) $ARTIFACTS_DIR -- cf. https://github.com/haskell/cabal/pull/7791
cp dist-newstyle/build/*/ghc-*/chainweb-mining-client-*/build/chainweb-mining-client/chainweb-mining-client $ARTIFACTS_DIR
cp $(cabal list-bin chainweb-mining-client) $ARTIFACTS_DIR
cp README.md $ARTIFACTS_DIR
cp CHANGELOG.md $ARTIFACTS_DIR
cp LICENSE $ARTIFACTS_DIR
Expand All @@ -81,7 +79,7 @@ jobs:
cp cabal.project.freeze $ARTIFACTS_DIR
tar -C ./artifacts/ -czf "$ARTIFACTS_ARCHIVE" chainweb-mining-client
- name: Safe artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACTS_NAME }}
path: ${{ env.ARTIFACTS_ARCHIVE }}
Expand All @@ -95,8 +93,8 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ["8.10.7"]
os: ["ubuntu-20.04"]
ghc: ["9.2"]
os: ["ubuntu-22.04"]
env:
GHC_VERSION: ${{ matrix.ghc }}
OS: ${{ matrix.os }}
Expand All @@ -114,7 +112,7 @@ jobs:
EOF
- name: Get build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACTS_NAME }}
path: .
Expand All @@ -136,14 +134,14 @@ jobs:
COPY chainweb-mining-client/chainweb-mining-client.cabal .
COPY chainweb-mining-client/cabal.project .
COPY chainweb-mining-client/cabal.project.freeze .
ENTRYPOINT /chainweb-mining-client/chainweb-mining-client
ENTRYPOINT [ "/chainweb-mining-client/chainweb-mining-client" ]
EOF
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Docker meta
id: meta
Expand All @@ -157,7 +155,7 @@ jobs:
type=ref,event=pr
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Revision history for chainweb-mining-client

## 0.5 -- 2022-11-23

* Add `--stratum-rate` option, which specifies the mining rate (in
milliseconds) at which each worker thread emits new mining jobs to the
client.

* Change default value for thread count to 2.
* Change default to connect to chainweb-node over an unsecure connection.
* Change default to require valid certificates when TLS is enabled.
* Change default chainweb-node host address to use port 1848.

## 0.4 -- 2021-11-29

* Add `--account` command line option for specifying the mining account. The
default value is public miner key prefix with `:k` (k-account).

## 0.3 -- 2021-11-10

* Add stratum server (#9)
Expand Down
Loading

0 comments on commit 04ba308

Please sign in to comment.