diff --git a/.github/workflows/develop-apple.yaml b/.github/workflows/develop-apple.yaml index 661ea9a02..01e9fa34c 100644 --- a/.github/workflows/develop-apple.yaml +++ b/.github/workflows/develop-apple.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-ballcoin.yaml b/.github/workflows/develop-ballcoin.yaml new file mode 100644 index 000000000..2cfb8ba7f --- /dev/null +++ b/.github/workflows/develop-ballcoin.yaml @@ -0,0 +1,51 @@ +name: develop-ballcoin + +on: + push: + branches: + - 'develop' + +jobs: + docker: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=focal" + "MACHINARIS_STREAM=develop" + "CHIADOG_BRANCH=dev" + "FDCLI_BRANCH=dev" + "BALLCOIN_BRANCH=main" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-ballcoin:develop + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-ballcoin:develop diff --git a/.github/workflows/develop-base.yaml b/.github/workflows/develop-base.yaml index 0b5b65155..4168ebd2f 100644 --- a/.github/workflows/develop-base.yaml +++ b/.github/workflows/develop-base.yaml @@ -30,11 +30,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile-jammy.base context: . platforms: linux/amd64 + provenance: false push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-base-jammy:develop @@ -67,11 +68,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile-focal.base context: . platforms: linux/amd64 + provenance: false push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-base-focal:develop diff --git a/.github/workflows/develop-bpx.yaml b/.github/workflows/develop-bpx.yaml index afc1e2932..668c09fc4 100644 --- a/.github/workflows/develop-bpx.yaml +++ b/.github/workflows/develop-bpx.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-btcgreen.yaml b/.github/workflows/develop-btcgreen.yaml index f7f39214e..8c75e8e2f 100644 --- a/.github/workflows/develop-btcgreen.yaml +++ b/.github/workflows/develop-btcgreen.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-cactus.yaml b/.github/workflows/develop-cactus.yaml index dd906b79e..21ed2a54e 100644 --- a/.github/workflows/develop-cactus.yaml +++ b/.github/workflows/develop-cactus.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-chia.yaml b/.github/workflows/develop-chia.yaml index c9ba01d59..9cd6321ef 100644 --- a/.github/workflows/develop-chia.yaml +++ b/.github/workflows/develop-chia.yaml @@ -6,7 +6,7 @@ on: - 'develop' jobs: - docker: + chia: runs-on: ubuntu-22.04 steps: - @@ -33,19 +33,67 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" "MACHINARIS_STREAM=develop" "CHIADOG_BRANCH=dev" - "CHIA_BRANCH=release/1.6.2" - "BLADEBIT_BRANCH=master" - "PLOTMAN_BRANCH=development" + "CHIA_BRANCH=release/1.7.0" + "BLADEBIT_BRANCH=cuda-compression" + "MADMAX_BRANCH=master" + "PLOTMAN_BRANCH=compress" tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris:develop ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris:develop + + gigahorse: + runs-on: ubuntu-22.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v4 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=jammy" + "MACHINARIS_STREAM=develop" + "CHIADOG_BRANCH=dev" + "GIGAHORSE_BRANCH=v1.6.2.giga4" + "CHIA_BRANCH=release/1.7.0" + "PLOTMAN_BRANCH=development" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-gigahorse:develop + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-gigahorse:develop + diff --git a/.github/workflows/develop-chinilla.yaml b/.github/workflows/develop-chinilla.yaml index 1538b8b9e..8dd5ffe3f 100644 --- a/.github/workflows/develop-chinilla.yaml +++ b/.github/workflows/develop-chinilla.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-chives.yaml b/.github/workflows/develop-chives.yaml index 6989dd7b4..aad9777d9 100644 --- a/.github/workflows/develop-chives.yaml +++ b/.github/workflows/develop-chives.yaml @@ -6,7 +6,8 @@ on: - 'develop' jobs: - docker: + + chives: runs-on: ubuntu-20.04 steps: - @@ -33,7 +34,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . @@ -43,8 +44,55 @@ jobs: "UBUNTU_VER=focal" "MACHINARIS_STREAM=develop" "CHIADOG_BRANCH=dev" - "CHIVES_BRANCH=1.5.1" + "CHIVES_REPO=https://github.com/HiveProject2021/chives-blockchain.git" + "CHIVES_BRANCH=1.5.4" + "MADMAX_BRANCH=master" "PLOTMAN_BRANCH=development" tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chives:develop ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chives:develop + + chivesfoxy: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=focal" + "MACHINARIS_STREAM=develop" + "CHIADOG_BRANCH=dev" + "CHIVES_REPO=https://github.com/foxypool/chives-blockchain.git" + "CHIVES_BRANCH=main" + "PLOTMAN_BRANCH=development" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chivesfoxy:develop + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chivesfoxy:develop diff --git a/.github/workflows/develop-coffee.yaml b/.github/workflows/develop-coffee.yaml index 2877fe8c8..42ad87e7c 100644 --- a/.github/workflows/develop-coffee.yaml +++ b/.github/workflows/develop-coffee.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-cryptodoge.yaml b/.github/workflows/develop-cryptodoge.yaml index 235a65dea..7757162e4 100644 --- a/.github/workflows/develop-cryptodoge.yaml +++ b/.github/workflows/develop-cryptodoge.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-ecostake.yaml b/.github/workflows/develop-ecostake.yaml index f2ecd3f70..5e6a53a55 100644 --- a/.github/workflows/develop-ecostake.yaml +++ b/.github/workflows/develop-ecostake.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-flax.yaml b/.github/workflows/develop-flax.yaml index 22034ea60..69f5a0b5f 100644 --- a/.github/workflows/develop-flax.yaml +++ b/.github/workflows/develop-flax.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-flora.yaml b/.github/workflows/develop-flora.yaml index ff8bdeac0..2c609d81a 100644 --- a/.github/workflows/develop-flora.yaml +++ b/.github/workflows/develop-flora.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-gold.yaml b/.github/workflows/develop-gold.yaml index 7f66ee56e..977bf648a 100644 --- a/.github/workflows/develop-gold.yaml +++ b/.github/workflows/develop-gold.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-greenbtc.yaml b/.github/workflows/develop-greenbtc.yaml index fb006deea..52fb7438e 100644 --- a/.github/workflows/develop-greenbtc.yaml +++ b/.github/workflows/develop-greenbtc.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-hddcoin.yaml b/.github/workflows/develop-hddcoin.yaml index c67caac57..67b85d86e 100644 --- a/.github/workflows/develop-hddcoin.yaml +++ b/.github/workflows/develop-hddcoin.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-littlelambocoin.yaml b/.github/workflows/develop-littlelambocoin.yaml index 2bc9e76ff..41a80c34d 100644 --- a/.github/workflows/develop-littlelambocoin.yaml +++ b/.github/workflows/develop-littlelambocoin.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-maize.yaml b/.github/workflows/develop-maize.yaml index b928392b6..689df0774 100644 --- a/.github/workflows/develop-maize.yaml +++ b/.github/workflows/develop-maize.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-mint.yaml b/.github/workflows/develop-mint.yaml index c82008386..d4bfe504d 100644 --- a/.github/workflows/develop-mint.yaml +++ b/.github/workflows/develop-mint.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-mmx.yaml b/.github/workflows/develop-mmx.yaml index 489bae37f..c4f20240a 100644 --- a/.github/workflows/develop-mmx.yaml +++ b/.github/workflows/develop-mmx.yaml @@ -33,17 +33,19 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" "MACHINARIS_STREAM=develop" - "MMX_BRANCH=v0.9.3" + "MMX_BRANCH=master" "CHIA_BRANCH=latest" + "MADMAX_BRANCH=master" "PLOTMAN_BRANCH=development" tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-mmx:develop diff --git a/.github/workflows/develop-moon.yaml b/.github/workflows/develop-moon.yaml index 6cb9bc7fb..67c4cc077 100644 --- a/.github/workflows/develop-moon.yaml +++ b/.github/workflows/develop-moon.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-nchain.yaml b/.github/workflows/develop-nchain.yaml index 5299e4e9a..fe1b54a37 100644 --- a/.github/workflows/develop-nchain.yaml +++ b/.github/workflows/develop-nchain.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-one.yaml b/.github/workflows/develop-one.yaml index 8743c00f0..e274a29fe 100644 --- a/.github/workflows/develop-one.yaml +++ b/.github/workflows/develop-one.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-petroleum.yaml b/.github/workflows/develop-petroleum.yaml index a59ffd7c5..b5baa5f90 100644 --- a/.github/workflows/develop-petroleum.yaml +++ b/.github/workflows/develop-petroleum.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-pipscoin.yaml b/.github/workflows/develop-pipscoin.yaml new file mode 100644 index 000000000..b5b5257a9 --- /dev/null +++ b/.github/workflows/develop-pipscoin.yaml @@ -0,0 +1,51 @@ +name: develop-pipscoin + +on: + push: + branches: + - 'develop' + +jobs: + docker: + runs-on: ubuntu-22.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=jammy" + "MACHINARIS_STREAM=develop" + "CHIADOG_BRANCH=dev" + "FDCLI_BRANCH=dev" + "PIPSCOIN_BRANCH=main" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-pipscoin:develop + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-pipscoin:develop diff --git a/.github/workflows/develop-profit.yaml b/.github/workflows/develop-profit.yaml index 20f05eb8b..ed42692a8 100644 --- a/.github/workflows/develop-profit.yaml +++ b/.github/workflows/develop-profit.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-shibgreen.yaml b/.github/workflows/develop-shibgreen.yaml index 0931ac114..6e2774435 100644 --- a/.github/workflows/develop-shibgreen.yaml +++ b/.github/workflows/develop-shibgreen.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-silicoin.yaml b/.github/workflows/develop-silicoin.yaml index 16e113f2b..fe4e57c62 100644 --- a/.github/workflows/develop-silicoin.yaml +++ b/.github/workflows/develop-silicoin.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-staicoin.yaml b/.github/workflows/develop-staicoin.yaml index f8a20ea9a..9b093b93c 100644 --- a/.github/workflows/develop-staicoin.yaml +++ b/.github/workflows/develop-staicoin.yaml @@ -7,7 +7,7 @@ on: jobs: docker: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout @@ -33,14 +33,15 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | - "UBUNTU_VER=focal" + "UBUNTU_VER=jammy" "MACHINARIS_STREAM=develop" "CHIADOG_BRANCH=dev" "FDCLI_BRANCH=dev" diff --git a/.github/workflows/develop-stor.yaml b/.github/workflows/develop-stor.yaml index addd6b0cd..b5d778c67 100644 --- a/.github/workflows/develop-stor.yaml +++ b/.github/workflows/develop-stor.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/develop-tad.yaml b/.github/workflows/develop-tad.yaml index a90a6cfea..f65c88b14 100644 --- a/.github/workflows/develop-tad.yaml +++ b/.github/workflows/develop-tad.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/develop-wheat.yaml b/.github/workflows/develop-wheat.yaml index 5860dd1a1..faefe05be 100644 --- a/.github/workflows/develop-wheat.yaml +++ b/.github/workflows/develop-wheat.yaml @@ -32,11 +32,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-apple.yaml b/.github/workflows/main-apple.yaml index 0b480deb5..4e3aea4b8 100644 --- a/.github/workflows/main-apple.yaml +++ b/.github/workflows/main-apple.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-ballcoin.yaml b/.github/workflows/main-ballcoin.yaml new file mode 100644 index 000000000..a0ff905c3 --- /dev/null +++ b/.github/workflows/main-ballcoin.yaml @@ -0,0 +1,52 @@ +name: release-ballcoin + +on: + workflow_dispatch: + inputs: + version: + description: 'Release Version' + +jobs: + docker: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64,linux/arm64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=focal" + "MACHINARIS_STREAM=latest" + "BALLCOIN_BRANCH=main" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-ballcoin:latest + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-ballcoin:v${{ github.event.inputs.version }} + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-ballcoin:latest + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-ballcoin:v${{ github.event.inputs.version }} diff --git a/.github/workflows/main-base.yaml b/.github/workflows/main-base.yaml index 080f1acd6..840f29bb6 100644 --- a/.github/workflows/main-base.yaml +++ b/.github/workflows/main-base.yaml @@ -30,11 +30,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile-jammy.base context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-base-jammy:latest @@ -67,11 +68,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile-focal.base context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-base-focal:latest diff --git a/.github/workflows/main-bpx.yaml b/.github/workflows/main-bpx.yaml index 38747738a..f22f18579 100644 --- a/.github/workflows/main-bpx.yaml +++ b/.github/workflows/main-bpx.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-btcgreen.yaml b/.github/workflows/main-btcgreen.yaml index d41a9a42f..e567adc60 100644 --- a/.github/workflows/main-btcgreen.yaml +++ b/.github/workflows/main-btcgreen.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-cactus.yaml b/.github/workflows/main-cactus.yaml index 5f09607f8..46344be1b 100644 --- a/.github/workflows/main-cactus.yaml +++ b/.github/workflows/main-cactus.yaml @@ -34,11 +34,13 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-chia.yaml b/.github/workflows/main-chia.yaml index 7ed8bf78d..d71b86157 100644 --- a/.github/workflows/main-chia.yaml +++ b/.github/workflows/main-chia.yaml @@ -7,7 +7,7 @@ on: description: 'Release Version' jobs: - docker: + chia: runs-on: ubuntu-22.04 steps: - @@ -34,18 +34,66 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" "MACHINARIS_STREAM=latest" - "CHIA_BRANCH=release/1.6.2" + "CHIA_BRANCH=release/1.7.0" + "MADMAX_BRANCH=v1.6.2-1" tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris:latest ${{ secrets.DOCKERHUB_USERNAME }}/machinaris:v${{ github.event.inputs.version }} ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris:latest ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris:v${{ github.event.inputs.version }} + + gigahorse: + runs-on: ubuntu-22.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v4 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64,linux/arm64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=jammy" + "MACHINARIS_STREAM=latest" + "GIGAHORSE_BRANCH=v1.6.2.giga4" + "CHIA_BRANCH=release/1.7.0" + "MADMAX_BRANCH=v1.6.2-1" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-gigahorse:latest + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-gigahorse:v${{ github.event.inputs.version }} + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-gigahorse:latest + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-gigahorse:v${{ github.event.inputs.version }} diff --git a/.github/workflows/main-chinilla.yaml b/.github/workflows/main-chinilla.yaml index c31c042b9..aef1e6b1f 100644 --- a/.github/workflows/main-chinilla.yaml +++ b/.github/workflows/main-chinilla.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-chives.yaml b/.github/workflows/main-chives.yaml index 81bd249f4..c164e8241 100644 --- a/.github/workflows/main-chives.yaml +++ b/.github/workflows/main-chives.yaml @@ -7,7 +7,7 @@ on: description: 'Release Version' jobs: - docker: + chives: runs-on: ubuntu-20.04 steps: - @@ -34,7 +34,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . @@ -43,9 +43,56 @@ jobs: build-args: | "UBUNTU_VER=focal" "MACHINARIS_STREAM=latest" - "CHIVES_BRANCH=1.5.1" + "CHIVES_REPO=https://github.com/HiveProject2021/chives-blockchain.git" + "CHIVES_BRANCH=1.5.4" + "MADMAX_BRANCH=v1.6.2-1" tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chives:latest ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chives:v${{ github.event.inputs.version }} ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chives:latest ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chives:v${{ github.event.inputs.version }} + + chivesfoxy: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64,linux/arm64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=focal" + "MACHINARIS_STREAM=latest" + "CHIVES_REPO=https://github.com/foxypool/chives-blockchain.git" + "CHIVES_BRANCH=main" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chivesfoxy:latest + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chivesfoxy:v${{ github.event.inputs.version }} + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chivesfoxy:latest + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chivesfoxy:v${{ github.event.inputs.version }} diff --git a/.github/workflows/main-coffee.yaml b/.github/workflows/main-coffee.yaml index f711fd291..4ace3f69e 100644 --- a/.github/workflows/main-coffee.yaml +++ b/.github/workflows/main-coffee.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-cryptodoge.yaml b/.github/workflows/main-cryptodoge.yaml index 79536f109..1f9c7eda2 100644 --- a/.github/workflows/main-cryptodoge.yaml +++ b/.github/workflows/main-cryptodoge.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-ecostake.yaml b/.github/workflows/main-ecostake.yaml index 57fe86143..9bc63c6fa 100644 --- a/.github/workflows/main-ecostake.yaml +++ b/.github/workflows/main-ecostake.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-flax.yaml b/.github/workflows/main-flax.yaml index 0096d7f4c..f242d01fc 100644 --- a/.github/workflows/main-flax.yaml +++ b/.github/workflows/main-flax.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-flora.yaml b/.github/workflows/main-flora.yaml index 75ccb6678..813d7b9ea 100644 --- a/.github/workflows/main-flora.yaml +++ b/.github/workflows/main-flora.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-gold.yaml b/.github/workflows/main-gold.yaml index 3a5c2693a..6bd7ce8ed 100644 --- a/.github/workflows/main-gold.yaml +++ b/.github/workflows/main-gold.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-greenbtc.yaml b/.github/workflows/main-greenbtc.yaml index 4a55cfd31..3a5c1e39c 100644 --- a/.github/workflows/main-greenbtc.yaml +++ b/.github/workflows/main-greenbtc.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-hddcoin.yaml b/.github/workflows/main-hddcoin.yaml index 045e0ee47..4787c818a 100644 --- a/.github/workflows/main-hddcoin.yaml +++ b/.github/workflows/main-hddcoin.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-littlelambocoin.yaml b/.github/workflows/main-littlelambocoin.yaml index 764e578e6..ddefe0f1d 100644 --- a/.github/workflows/main-littlelambocoin.yaml +++ b/.github/workflows/main-littlelambocoin.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-maize.yaml b/.github/workflows/main-maize.yaml index ef31e7427..49e082986 100644 --- a/.github/workflows/main-maize.yaml +++ b/.github/workflows/main-maize.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-mint.yaml b/.github/workflows/main-mint.yaml index 92211dd8e..3fb6cfbba 100644 --- a/.github/workflows/main-mint.yaml +++ b/.github/workflows/main-mint.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-mmx.yaml b/.github/workflows/main-mmx.yaml index 513581349..ba3ec1ece 100644 --- a/.github/workflows/main-mmx.yaml +++ b/.github/workflows/main-mmx.yaml @@ -34,17 +34,19 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" "MACHINARIS_STREAM=latest" - "MMX_BRANCH=v0.9.3" "CHIA_BRANCH=latest" + "MMX_BRANCH=v0.9.9" + "MADMAX_BRANCH=v1.6.2-1" tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-mmx:latest ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-mmx:v${{ github.event.inputs.version }} diff --git a/.github/workflows/main-moon.yaml b/.github/workflows/main-moon.yaml index 270cffda5..459e741fd 100644 --- a/.github/workflows/main-moon.yaml +++ b/.github/workflows/main-moon.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-nchain.yaml b/.github/workflows/main-nchain.yaml index 5412e05ff..18b0e3dc3 100644 --- a/.github/workflows/main-nchain.yaml +++ b/.github/workflows/main-nchain.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-one.yaml b/.github/workflows/main-one.yaml index e7c6d0197..7aa3c1dd8 100644 --- a/.github/workflows/main-one.yaml +++ b/.github/workflows/main-one.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-petroleum.yaml b/.github/workflows/main-petroleum.yaml index f4d1d274e..cb5e54982 100644 --- a/.github/workflows/main-petroleum.yaml +++ b/.github/workflows/main-petroleum.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-pipscoin.yaml b/.github/workflows/main-pipscoin.yaml new file mode 100644 index 000000000..cfb9483fa --- /dev/null +++ b/.github/workflows/main-pipscoin.yaml @@ -0,0 +1,52 @@ +name: release-pipscoin + +on: + workflow_dispatch: + inputs: + version: + description: 'Release Version' + +jobs: + docker: + runs-on: ubuntu-22.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64,linux/arm64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=jammy" + "MACHINARIS_STREAM=latest" + "PIPSCOIN_BRANCH=main" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-pipscoin:latest + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-pipscoin:v${{ github.event.inputs.version }} + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-pipscoin:latest + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-pipscoin:v${{ github.event.inputs.version }} diff --git a/.github/workflows/main-profit.yaml b/.github/workflows/main-profit.yaml index 72109e69a..9d1a63abf 100644 --- a/.github/workflows/main-profit.yaml +++ b/.github/workflows/main-profit.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-shibgreen.yaml b/.github/workflows/main-shibgreen.yaml index c629c8ee3..bbe3e7c5b 100644 --- a/.github/workflows/main-shibgreen.yaml +++ b/.github/workflows/main-shibgreen.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-silicoin.yaml b/.github/workflows/main-silicoin.yaml index ec39655e6..287ce0a82 100644 --- a/.github/workflows/main-silicoin.yaml +++ b/.github/workflows/main-silicoin.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-staicoin.yaml b/.github/workflows/main-staicoin.yaml index 7df7e485a..2c2b74fdc 100644 --- a/.github/workflows/main-staicoin.yaml +++ b/.github/workflows/main-staicoin.yaml @@ -8,7 +8,7 @@ on: jobs: docker: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout @@ -34,14 +34,15 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | - "UBUNTU_VER=focal" + "UBUNTU_VER=jammy" "MACHINARIS_STREAM=latest" "STAICOIN_BRANCH=main" tags: | diff --git a/.github/workflows/main-stor.yaml b/.github/workflows/main-stor.yaml index ef142e9d1..d0c34f0e1 100644 --- a/.github/workflows/main-stor.yaml +++ b/.github/workflows/main-stor.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/main-tad.yaml b/.github/workflows/main-tad.yaml index 127bf2251..436f8e0d6 100644 --- a/.github/workflows/main-tad.yaml +++ b/.github/workflows/main-tad.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/main-wheat.yaml b/.github/workflows/main-wheat.yaml index 5778c95a1..be246f665 100644 --- a/.github/workflows/main-wheat.yaml +++ b/.github/workflows/main-wheat.yaml @@ -34,11 +34,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-apple.yaml b/.github/workflows/test-apple.yaml index 5cbd0e044..e2c6ac68d 100644 --- a/.github/workflows/test-apple.yaml +++ b/.github/workflows/test-apple.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-ballcoin.yaml b/.github/workflows/test-ballcoin.yaml new file mode 100644 index 000000000..68a67aaf8 --- /dev/null +++ b/.github/workflows/test-ballcoin.yaml @@ -0,0 +1,50 @@ +name: test-ballcoin + +on: + push: + branches: + - 'integration' + +jobs: + docker: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64,linux/arm64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=focal" + "MACHINARIS_STREAM=test" + "CHIADOG_BRANCH=dev" + "BALLCOIN_BRANCH=main" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-ballcoin:test + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-ballcoin:test diff --git a/.github/workflows/test-base.yaml b/.github/workflows/test-base.yaml index b8209c4e5..cf321cdeb 100644 --- a/.github/workflows/test-base.yaml +++ b/.github/workflows/test-base.yaml @@ -30,11 +30,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile-jammy.base context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-base-jammy:test @@ -67,7 +68,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile-focal.base context: . diff --git a/.github/workflows/test-bpx.yaml b/.github/workflows/test-bpx.yaml index decc34435..6e7656b50 100644 --- a/.github/workflows/test-bpx.yaml +++ b/.github/workflows/test-bpx.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-btcgreen.yaml b/.github/workflows/test-btcgreen.yaml index 88353d0f7..3f9df2c3b 100644 --- a/.github/workflows/test-btcgreen.yaml +++ b/.github/workflows/test-btcgreen.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-cactus.yaml b/.github/workflows/test-cactus.yaml index 0796aa797..764499ead 100644 --- a/.github/workflows/test-cactus.yaml +++ b/.github/workflows/test-cactus.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-chia.yaml b/.github/workflows/test-chia.yaml index 8faf25c93..2cf68ccfe 100644 --- a/.github/workflows/test-chia.yaml +++ b/.github/workflows/test-chia.yaml @@ -6,7 +6,7 @@ on: - 'integration' jobs: - docker: + chia: runs-on: ubuntu-22.04 steps: - @@ -33,17 +33,65 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" "MACHINARIS_STREAM=test" "CHIADOG_BRANCH=dev" - "CHIA_BRANCH=release/1.6.2" + "CHIA_BRANCH=release/1.7.0" + "PLOTMAN_BRANCH=development" + "MADMAX_BRANCH=v1.6.2-1" tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris:test ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris:test + + gigahorse: + runs-on: ubuntu-22.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v4 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=jammy" + "MACHINARIS_STREAM=test" + "CHIADOG_BRANCH=dev" + "GIGAHORSE_BRANCH=v1.6.2.giga4" + "CHIA_BRANCH=release/1.7.0" + "PLOTMAN_BRANCH=development" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-gigahorse:test + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-gigahorse:test diff --git a/.github/workflows/test-chinilla.yaml b/.github/workflows/test-chinilla.yaml index 3b5a890bf..6d8c80006 100644 --- a/.github/workflows/test-chinilla.yaml +++ b/.github/workflows/test-chinilla.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-chives.yaml b/.github/workflows/test-chives.yaml index cad8f20f6..5ee919833 100644 --- a/.github/workflows/test-chives.yaml +++ b/.github/workflows/test-chives.yaml @@ -6,7 +6,7 @@ on: - 'integration' jobs: - docker: + chives: runs-on: ubuntu-20.04 steps: - @@ -33,7 +33,7 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . @@ -43,7 +43,54 @@ jobs: "UBUNTU_VER=focal" "MACHINARIS_STREAM=test" "CHIADOG_BRANCH=dev" - "CHIVES_BRANCH=1.5.1" + "CHIVES_REPO=https://github.com/HiveProject2021/chives-blockchain.git" + "CHIVES_BRANCH=1.5.4" tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chives:test ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chives:test + + chivesfoxy: + runs-on: ubuntu-20.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64,linux/arm64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=focal" + "MACHINARIS_STREAM=test" + "CHIADOG_BRANCH=dev" + "CHIVES_REPO=https://github.com/foxypool/chives-blockchain.git" + "CHIVES_BRANCH=main" + "PLOTMAN_BRANCH=development" + "MADMAX_BRANCH=v1.6.2-1" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chivesfoxy:test + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chivesfoxy:test diff --git a/.github/workflows/test-coffee.yaml b/.github/workflows/test-coffee.yaml index 1319a5fdc..4fe7a101c 100644 --- a/.github/workflows/test-coffee.yaml +++ b/.github/workflows/test-coffee.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-cryptodoge.yaml b/.github/workflows/test-cryptodoge.yaml index 1dc575b5f..24867d3cf 100644 --- a/.github/workflows/test-cryptodoge.yaml +++ b/.github/workflows/test-cryptodoge.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-ecostake.yaml b/.github/workflows/test-ecostake.yaml index a82512d9d..37fc9d811 100644 --- a/.github/workflows/test-ecostake.yaml +++ b/.github/workflows/test-ecostake.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-flax.yaml b/.github/workflows/test-flax.yaml index d8aa4a45d..13bdd81de 100644 --- a/.github/workflows/test-flax.yaml +++ b/.github/workflows/test-flax.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-flora.yaml b/.github/workflows/test-flora.yaml index 938289552..d25f5bf88 100644 --- a/.github/workflows/test-flora.yaml +++ b/.github/workflows/test-flora.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-gold.yaml b/.github/workflows/test-gold.yaml index a6e0f4fc3..5e76e4a65 100644 --- a/.github/workflows/test-gold.yaml +++ b/.github/workflows/test-gold.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-greenbtc.yaml b/.github/workflows/test-greenbtc.yaml index 6e9cbbba0..b565463ae 100644 --- a/.github/workflows/test-greenbtc.yaml +++ b/.github/workflows/test-greenbtc.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-hddcoin.yaml b/.github/workflows/test-hddcoin.yaml index 2c42f949c..570a5ceee 100644 --- a/.github/workflows/test-hddcoin.yaml +++ b/.github/workflows/test-hddcoin.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-littlelambocoin.yaml b/.github/workflows/test-littlelambocoin.yaml index c3d86a597..d163b8fb9 100644 --- a/.github/workflows/test-littlelambocoin.yaml +++ b/.github/workflows/test-littlelambocoin.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-maize.yaml b/.github/workflows/test-maize.yaml index b0ab09b66..4d07c705d 100644 --- a/.github/workflows/test-maize.yaml +++ b/.github/workflows/test-maize.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-mint.yaml b/.github/workflows/test-mint.yaml index f106b5967..f05e4448d 100644 --- a/.github/workflows/test-mint.yaml +++ b/.github/workflows/test-mint.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-mmx.yaml b/.github/workflows/test-mmx.yaml index abf5d0ee7..da92bfcc3 100644 --- a/.github/workflows/test-mmx.yaml +++ b/.github/workflows/test-mmx.yaml @@ -33,17 +33,20 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" "MACHINARIS_STREAM=test" - "MMX_BRANCH=v0.9.3" "CHIA_BRANCH=latest" + "PLOTMAN_BRANCH=development" + "MMX_BRANCH=v0.9.9" + "MADMAX_BRANCH=v1.6.2-1" tags: | ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-mmx:test ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-mmx:test diff --git a/.github/workflows/test-moon.yaml b/.github/workflows/test-moon.yaml index f150d796c..9fcd55f89 100644 --- a/.github/workflows/test-moon.yaml +++ b/.github/workflows/test-moon.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-nchain.yaml b/.github/workflows/test-nchain.yaml index cd0348761..ea99df82a 100644 --- a/.github/workflows/test-nchain.yaml +++ b/.github/workflows/test-nchain.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-one.yaml b/.github/workflows/test-one.yaml index ca148779f..d132f4ec8 100644 --- a/.github/workflows/test-one.yaml +++ b/.github/workflows/test-one.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-petroleum.yaml b/.github/workflows/test-petroleum.yaml index 7f9a954e6..10dc8ce66 100644 --- a/.github/workflows/test-petroleum.yaml +++ b/.github/workflows/test-petroleum.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-pipscoin.yaml b/.github/workflows/test-pipscoin.yaml new file mode 100644 index 000000000..85c3df327 --- /dev/null +++ b/.github/workflows/test-pipscoin.yaml @@ -0,0 +1,50 @@ +name: test-pipscoin + +on: + push: + branches: + - 'integration' + +jobs: + docker: + runs-on: ubuntu-22.04 + steps: + - + name: Checkout + uses: actions/checkout@v3 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + file: docker/dockerfile + context: . + platforms: linux/amd64,linux/arm64 + provenance: false + push: true + build-args: | + "UBUNTU_VER=jammy" + "MACHINARIS_STREAM=test" + "CHIADOG_BRANCH=dev" + "PIPSCOIN_BRANCH=main" + tags: | + ${{ secrets.DOCKERHUB_USERNAME }}/machinaris-pipscoin:test + ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-pipscoin:test diff --git a/.github/workflows/test-profit.yaml b/.github/workflows/test-profit.yaml index 7dd758ab9..c9caa0356 100644 --- a/.github/workflows/test-profit.yaml +++ b/.github/workflows/test-profit.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-shibgreen.yaml b/.github/workflows/test-shibgreen.yaml index c725981b3..01e45bcb7 100644 --- a/.github/workflows/test-shibgreen.yaml +++ b/.github/workflows/test-shibgreen.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-silicoin.yaml b/.github/workflows/test-silicoin.yaml index cc9c0ae3d..2dd511421 100644 --- a/.github/workflows/test-silicoin.yaml +++ b/.github/workflows/test-silicoin.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-staicoin.yaml b/.github/workflows/test-staicoin.yaml index 7111e5552..7454f99d8 100644 --- a/.github/workflows/test-staicoin.yaml +++ b/.github/workflows/test-staicoin.yaml @@ -7,7 +7,7 @@ on: jobs: docker: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout @@ -33,14 +33,15 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | - "UBUNTU_VER=focal" + "UBUNTU_VER=jammy" "MACHINARIS_STREAM=test" "CHIADOG_BRANCH=dev" "STAICOIN_BRANCH=main" diff --git a/.github/workflows/test-stor.yaml b/.github/workflows/test-stor.yaml index cb88a255d..f813021e2 100644 --- a/.github/workflows/test-stor.yaml +++ b/.github/workflows/test-stor.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=focal" diff --git a/.github/workflows/test-tad.yaml b/.github/workflows/test-tad.yaml index 9a425c9cb..c5ee52d5c 100644 --- a/.github/workflows/test-tad.yaml +++ b/.github/workflows/test-tad.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/.github/workflows/test-wheat.yaml b/.github/workflows/test-wheat.yaml index 8afe34c78..22082a648 100644 --- a/.github/workflows/test-wheat.yaml +++ b/.github/workflows/test-wheat.yaml @@ -33,11 +33,12 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: file: docker/dockerfile context: . platforms: linux/amd64,linux/arm64 + provenance: false push: true build-args: | "UBUNTU_VER=jammy" diff --git a/CHANGELOG.md b/CHANGELOG.md index 91a6d17d9..f2a819171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.8.7] - 2023-02-16 +### Added + - Schedule plotting on the "Settings | Plotting" page to take advantage of off-peak electricity, lower your fan noise, avoid backups, etc... + - [Bladebit](https://github.com/guydavis/machinaris/wiki/Bladebit) - alpha GPU plotting support in main Machinaris image. Set `mode: gpuplot` under `bladebit` on Settings | Plotting page. + - [Gigahorse](https://github.com/guydavis/machinaris/wiki/Gigahorse) - beta GPU plotting and farming support in new Machinaris-Gigahorse image. Set `mode: gpuplot` under `madmax` on Settings | Plotting page. + - [Ballcoin](https://github.com/ball-network/ballcoin-blockchain) blockchain at version 1.6.0, another slow Silicoin fork. + - [Pipscoin](https://github.com/Pipscoin-Network/pipscoin-blockchain) blockchain at version 1.7.0. +## Changed + - Fix missing Connections listing for Flax and MMX blockchains. Thanks @ekersey! + - Fix for Bladebit ramplot relaunching. Thanks @JoeZotacExperience! + - Multiple functionality & performance cleanups from excellent code review by @qoole. + - Display compression level for active plotting jobs, currently MMX only. +## Updated + - [BTCGreen](https://github.com/BTCgreen-Network/btcgreen-blockchain/releases/tag/1.7.0b) to v1.7.0b + - [Cactus](https://github.com/Cactus-Network/cactus-blockchain/releases/tag/1.6.2) to v1.6.2 + - [Chia](https://github.com/Chia-Network/chia-blockchain/releases/tag/1.7.0) to v1.7.0 + - [Chives](https://github.com/HiveProject2021/chives-blockchain/releases/tag/1.5.4) to v1.5.4, including staking. + - [SHIBGreen](https://github.com/BTCgreen-Network/shibgreen-blockchain/releases/tag/1.7.0.1) to v1.7.0.1 + - [Staicoin](https://github.com/STATION-I/stai-blockchain/releases/tag/1.3.0) to v1.3.0. Note, they require a fresh `config.yaml`. +## Notes + - Support for new blockchains and tools DOES NOT imply my endorsement for them. *Only run those you are comfortable with.* + ## [0.8.6] - 2023-01-03 ### Added - Re-plotting: **Optional** background deletion of a few old plots to free space for new plotting. See Farming page, Settings icon, top-right. @@ -18,7 +40,6 @@ All notable changes to this project will be documented in this file. The format - Improved "Settings | Pools" page with fee amount and `delete_unconfirmed_transactions` action. ### Updated - [Bladebit](https://github.com/Chia-Network/bladebit/releases/tag/v2.0.1) to v2.0.1 - - [Cactus](https://github.com/Cactus-Network/cactus-blockchain/releases/tag/1.7.0) to v1.7.0 - [Chia](https://github.com/Chia-Network/chia-blockchain/releases/tag/1.6.2) to v1.6.2 - [Chinilla](https://github.com/Chinilla/chinilla-blockchain/releases/tag/1.4.0) to v1.4.0 - [Chiadog](https://github.com/guydavis/chiadog/releases/tag/v0.7.5) to v0.7.5 diff --git a/CREDITS.md b/CREDITS.md index 5fc6b7bef..6400e0830 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -5,12 +5,13 @@ A huge thank-you to the great teams/devs behind these projects, being used by Ma ## Core Components * [Chia™](https://www.chia.net/): the distributed cryptocurrency project. +* [Forks](https://github.com/guydavis/machinaris/wiki/Forks): All the other blockchain clones. * [Plotman](https://github.com/ericaltendorf/plotman): a parallel plotting manager. * [Chiadog](https://github.com/martomi/chiadog): a log monitor with alerting. * [Madmax](https://github.com/madMAx43v3r/chia-plotter): a pipelined, multi-threaded plotter. * [Bladebit](https://github.com/harold-b/bladebit): an in-memory plotter. -* [Farmr](https://github.com/gilnobrega/farmr): provides advanced monitoring at [farmr.net](https://farmr.net). * [Forktools](https://github.com/Qwinn1/forktools): shell utilities for managing Chia forks. +* [FD-CLI](https://github.com/Flora-Network/flora-dev-cli) - script to regularly recover 7/8 rewards ## Web Application * [Flask](https://flask.palletsprojects.com/en/2.0.x/): Web UI application server. @@ -28,25 +29,9 @@ A huge thank-you to the great teams/devs behind these projects, being used by Ma * [Maxmind](https://maxmind.com/): Geolocation API for mapping IP addresses of peer connections. * [Mapbox](https://mapbox.com): Nice looking map tiles for use with Leaflet on the Connections page map. -## Blockchains -* [BTCgreen](https://github.com/BTCgreen-Network/btcgreen-blockchain) -* [Cactus](https://github.com/Cactus-Network/cactus-blockchain) -* [Chives](https://github.com/HiveProject2021/chives-blockchain) -* [Cryptodoge](https://github.com/CryptoDoge-Network/cryptodoge) -* [Flax](https://github.com/Flax-Network/flax-blockchain) -* [Flora](https://github.com/Flora-Network/flora-blockchain) -* [HDDCoin](https://github.com/HDDcoin-Network/hddcoin-blockchain) -* [Maize](https://github.com/Maize-Network/maize-blockchain) -* [MMX](https://github.com/madMAx43v3r/mmx-node) -* [NChain](https://gitee.com/ext9/ext9-blockchain) -* [SHIBgreen](https://github.com/BTCgreen-Network/shibgreen-blockchain) -* [Staicoin](https://github.com/STATION-I/staicoin-blockchain) -* [Stor](https://github.com/Stor-Network/stor-blockchain) - ## Other Resources -* [FD-CLI](https://github.com/Flora-Network/flora-dev-cli) - script to regularly recover 7/8 rewards -* [Chia DB Downloads](https://www.chia-database.com/) - for Chia blockchain database * [All the Blocks](https://alltheblocks.net/) - blockchain, wallet, and pricing info +* [Infinex](infinex.cc) - blockchain coin exchange, also for pricing info * [Coin Gecko](https://coingecko.com/) - fiat currency exchange info ## Testers and Developers @@ -102,6 +87,10 @@ A big thanks to all that contributed with dev and test including: * Gnomuz * borifrmr (aka Inabon) * DeathandDestruction +* @ekersey +* Joe Zotac Experience +* @qoole +* @miguell ## Trademark Notice CHIA NETWORK INC, CHIA™, the CHIA BLOCKCHAIN™, the CHIA PROTOCOL™, CHIALISP™ and the “leaf Logo” (including the leaf logo alone when it refers to or indicates Chia), are trademarks or registered trademarks of Chia Network, Inc., a Delaware corporation. *There is no affliation between this Machinaris project and the main Chia Network project.* \ No newline at end of file diff --git a/VERSION b/VERSION index 120f53215..35864a97f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.8.6 \ No newline at end of file +0.8.7 \ No newline at end of file diff --git a/api/__init__.py b/api/__init__.py index 17a9ecc7e..fe7528634 100644 --- a/api/__init__.py +++ b/api/__init__.py @@ -30,15 +30,15 @@ def set_sqlite_pragma(dbapi_connection, connection_record): app.config.from_object(DefaultConfig) # Override config with optional settings file app.config.from_envvar('API_SETTINGS_FILE', silent=True) -babel = Babel(app) -@babel.localeselector def get_locale(): #for d in babel.translation_directories: # app.logger.info(d) #app.logger.info("API=> Returning locale: {0}".format(request.accept_languages.best_match(app.config['LANGUAGES']))) return request.accept_languages.best_match(app.config['LANGUAGES']) +babel = Babel(app, locale_selector=get_locale,) + from common.extensions.database import db migrate = Migrate(app, db) diff --git a/api/commands/chia_cli.py b/api/commands/chia_cli.py index 4e1cadc72..9f14ae39e 100644 --- a/api/commands/chia_cli.py +++ b/api/commands/chia_cli.py @@ -37,12 +37,13 @@ WALLET_SETTINGS_FILE = '/root/.chia/machinaris/config/wallet_settings.json' # Blockchains which dropped compatibility with `show -c` commands around v1.6 -BLOCKCHAINS_USING_PEER_CMD = ['cactus', 'chia', 'chinilla', 'littlelambocoin', 'maize', 'one', 'tad'] +BLOCKCHAINS_USING_PEER_CMD = ['btcgreen', 'cactus', 'chia', 'chinilla', 'flax', 'gigahorse', 'littlelambocoin', 'maize', 'one', 'pipscoin', 'shibgreen', 'tad'] def load_farm_summary(blockchain): chia_binary = globals.get_blockchain_binary(blockchain) + working_dir = globals.get_blockchain_working_dir(blockchain) if globals.farming_enabled(): - proc = Popen("{0} farm summary".format(chia_binary), stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen("{0} farm summary".format(chia_binary), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=30) if errs: @@ -92,17 +93,17 @@ def load_wallet_show(blockchain): app.logger.debug("Default SELECTED_WALLET_NUM is {0}".format(wallet_id_num)) while True: i = child.expect(["Wallet height:.*\r\n", "Wallet keys:.*\r\n", "Choose wallet key:.*\r\n", - "Choose a wallet key:.*\r\n", "No online backup file found.*\r\n", "Connection error.*\r\n"], timeout=90) + "Choose a wallet key .*\r\n", "Active Wallet Key.*\r\n", "No online backup file found.*\r\n", "Connection error.*\r\n"], timeout=90) if i == 0: app.logger.debug("wallet show returned 'Wallet height...' so collecting details.") wallet_show += child.after.decode("utf-8") + child.before.decode("utf-8") + child.read().decode("utf-8") break - elif i == 1 or i == 2 or i == 3: + elif i == 1 or i == 2 or i == 3 or i == 4: app.logger.info("Wallet show got num prompt so selecting wallet #{0}".format(wallet_id_num)) child.sendline("{0}".format(wallet_id_num)) - elif i == 4: - child.sendline("S") elif i == 5: + child.sendline("S") + elif i == 6: raise Exception("Skipping wallet status gathering as it returned 'Connection Error', so possibly still starting up. If this error persists more than 30 minutes after startup, try restarting the Machinaris Docker container.") else: raise Exception("ERROR:\n" + child.after.decode("utf-8") + child.before.decode("utf-8") + child.read().decode("utf-8")) @@ -110,7 +111,8 @@ def load_wallet_show(blockchain): def load_blockchain_show(blockchain): chia_binary = globals.get_blockchain_binary(blockchain) - proc = Popen("{0} show --state".format(chia_binary), stdout=PIPE, stderr=PIPE, shell=True) + working_dir = globals.get_blockchain_working_dir(blockchain) + proc = Popen("{0} show --state".format(chia_binary), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=30) if errs: @@ -123,10 +125,11 @@ def load_blockchain_show(blockchain): def load_connections_show(blockchain): chia_binary = globals.get_blockchain_binary(blockchain) + working_dir = globals.get_blockchain_working_dir(blockchain) if blockchain in BLOCKCHAINS_USING_PEER_CMD: # These now support only the 'peer' command - proc = Popen("{0} peer -c full_node".format(chia_binary), stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen("{0} peer -c full_node".format(chia_binary), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) else: - proc = Popen("{0} show --connections".format(chia_binary), stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen("{0} show --connections".format(chia_binary), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=30) if errs: @@ -139,11 +142,12 @@ def load_connections_show(blockchain): def load_keys_show(blockchain): chia_binary = globals.get_blockchain_binary(blockchain) + working_dir = globals.get_blockchain_working_dir(blockchain) # If a legacy blockchain that hasn't kept pace with Chia, there is only non-observer key if globals.legacy_blockchain(blockchain): - proc = Popen("{0} keys show".format(chia_binary), stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen("{0} keys show".format(chia_binary), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) else: # Get both observer and non-observer keys for newer blockchains - proc = Popen("{0} keys show && {0} keys show -d | grep 'non-observer'".format(chia_binary), stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen("{0} keys show && {0} keys show -d | grep 'non-observer'".format(chia_binary), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=30) if errs: @@ -156,12 +160,13 @@ def load_keys_show(blockchain): def restart_farmer(blockchain): chia_binary = globals.get_blockchain_binary(blockchain) + working_dir = globals.get_blockchain_working_dir(blockchain) if os.path.exists(WALLET_SETTINGS_FILE): - cmd = "{0} stop farmer && {0} start farmer-no-wallet".format(chia_binary) + cmd = "{0} stop -d farmer && {0} start farmer-no-wallet".format(chia_binary) else: - cmd = "{0} start farmer && {0} start farmer -r".format(chia_binary) + cmd = "{0} stop -d farmer && {0} start farmer -r".format(chia_binary) app.logger.info("Executing farmer restart: {0}".format(cmd)) - proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen(cmd, cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=90) if errs: @@ -175,10 +180,14 @@ def restart_farmer(blockchain): return True def start_wallet(blockchain): + if blockchain == 'gigahorse': + app.logger.info("Gigahorse doesn't run it's own wallet. Machinaris uses the wallet of the main Chia container instead.") + return chia_binary = globals.get_blockchain_binary(blockchain) + working_dir = globals.get_blockchain_working_dir(blockchain) cmd = "{0} start wallet -r".format(chia_binary) app.logger.info("Executing wallet start: {0}".format(cmd)) - proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen(cmd, cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=90) if errs: @@ -192,13 +201,17 @@ def start_wallet(blockchain): return True def pause_wallet(blockchain): + if blockchain == 'gigahorse': + app.logger.info("Gigahorse doesn't run it's own wallet. Machinaris uses the wallet of the main Chia container instead.") + return chia_binary = globals.get_blockchain_binary(blockchain) + working_dir = globals.get_blockchain_working_dir(blockchain) if globals.legacy_blockchain(blockchain): # Old chains will stop fullnode(!) if ask to stop just the wallet... - cmd = "{0} stop farmer && {0} start farmer-no-wallet".format(chia_binary) + cmd = "{0} stop -d farmer && {0} start farmer-no-wallet".format(chia_binary) else: # Updated blockchains can simply stop the wallet cmd = "{0} stop wallet".format(chia_binary) app.logger.info("Executing wallet pause: {0}".format(cmd)) - proc = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen(cmd, cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=90) if errs: @@ -213,11 +226,12 @@ def pause_wallet(blockchain): def remove_connection(node_id, ip, blockchain): chia_binary = globals.get_blockchain_binary(blockchain) + working_dir = globals.get_blockchain_working_dir(blockchain) try: if blockchain in BLOCKCHAINS_USING_PEER_CMD: # These now support only the 'peer' command - proc = Popen("{0} peer --remove-connection {1} full_node".format(chia_binary, node_id), stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen("{0} peer --remove-connection {1} full_node".format(chia_binary, node_id), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) else: - proc = Popen("{0} show --remove-connection {1}".format(chia_binary, node_id), stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen("{0} show --remove-connection {1}".format(chia_binary, node_id), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=30) if errs: @@ -242,18 +256,18 @@ def is_plots_check_running(): return None def plot_check(blockchain, plot_path): - if blockchain == 'mmx': - app.logger.debug("MMX doesn't offer a plot check function.") - return None if not os.path.exists(plot_path): app.logger.error("No such plot file to check at: {0}".format(plot_path)) return None - chia_binary = globals.get_blockchain_binary(blockchain) app.logger.info("Starting plot check on: {0}".format(plot_path)) - proc = Popen("{0} plots check -g {1}".format(chia_binary, plot_path), - universal_newlines=True, stdout=PIPE, stderr=STDOUT, shell=True) + if blockchain in ['gigahorse', 'mmx']: # Use Madmax's custom plot check binary + proc = Popen("/usr/bin/ProofOfSpace check -r 8 -f {0}".format(plot_path), universal_newlines=True, stdout=PIPE, stderr=STDOUT, shell=True) + else: # All Chia forks and clones + chia_binary = globals.get_blockchain_binary(blockchain) + working_dir = globals.get_blockchain_working_dir(blockchain) + proc = Popen("{0} plots check -g {1}".format(chia_binary, plot_path), cwd=working_dir, universal_newlines=True, stdout=PIPE, stderr=STDOUT, shell=True) try: - outs, errs = proc.communicate(timeout=30) + outs, errs = proc.communicate(timeout=180) except TimeoutExpired: proc.kill() proc.communicate() @@ -292,6 +306,7 @@ def dispatch_action(job): def add_connections(connections, blockchain): chia_binary = globals.get_blockchain_binary(blockchain) + working_dir = globals.get_blockchain_working_dir(blockchain) for connection in connections: try: hostname,port = connection.split(':') @@ -301,9 +316,9 @@ def add_connections(connections, blockchain): app.logger.debug('{} is a valid hostname'.format(hostname)) app.logger.info("Adding {0} connection to peer: {1}".format(blockchain, connection)) if blockchain in BLOCKCHAINS_USING_PEER_CMD: # These now support only the 'peer' command - proc = Popen("{0} peer --add-connection {1} full_node".format(chia_binary, connection), stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen("{0} peer --add-connection {1} full_node".format(chia_binary, connection), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) else: - proc = Popen("{0} show --add-connection {1}".format(chia_binary, connection), stdout=PIPE, stderr=PIPE, shell=True) + proc = Popen("{0} show --add-connection {1}".format(chia_binary, connection), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=60) if errs: @@ -320,10 +335,14 @@ def add_connections(connections, blockchain): def remove_connection(node_ids, blockchain): chia_binary = globals.get_blockchain_binary(blockchain) + working_dir = globals.get_blockchain_working_dir(blockchain) app.logger.debug("About to remove connection for nodeid: {0}".format(node_ids)) for node_id in node_ids: try: - proc = Popen("{0} show --remove-connection {1}".format(chia_binary, node_id), stdout=PIPE, stderr=PIPE, shell=True) + if blockchain in BLOCKCHAINS_USING_PEER_CMD: # These now support only the 'peer' command + proc = Popen("{0} peer --add-connection {1} full_node".format(chia_binary, node_id), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) + else: + proc = Popen("{0} show --add-connection {1}".format(chia_binary, node_id), cwd=working_dir, stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=5) if errs: diff --git a/api/commands/farmr_cli.py b/api/commands/farmr_cli.py deleted file mode 100644 index 776fdaffd..000000000 --- a/api/commands/farmr_cli.py +++ /dev/null @@ -1,29 +0,0 @@ -# -# CLI access to Farmr binary - https://github.com/gilnobrega/farmr -# - -import datetime -import json -import os -import sqlite3 -import time -import traceback - -from common.config import globals -from api import app - -def load_device_id(): - if os.path.exists('/root/.farmr/id.json'): - try: - id_json = json.load(open('/root/.farmr/id.json')) - except Exception as ex: - app.logger.error("Farmr id.json malformed: {0}".format(str(ex))) - return None - try: - id = id_json['ids'][0] - blockchain = os.environ['blockchains'] - return "{0}-{1}".format(id, globals.get_blockchain_symbol(blockchain).lower()) - except Exception as ex: - app.logger.error("Farmr id.json missing ids: {0}".format(str(ex))) - app.logger.info(id_json) - return None diff --git a/api/commands/log_parser.py b/api/commands/log_parser.py index 625fd15e2..ffef5a80f 100644 --- a/api/commands/log_parser.py +++ b/api/commands/log_parser.py @@ -97,8 +97,9 @@ def recent_farmed_blocks(blockchain): #app.logger.info("MMX executing: grep 'Created block' {0}".format(log_file)) proc = Popen("grep 'Created block' {0}".format(log_file), stdout=PIPE, stderr=PIPE, shell=True) else: - # Chia 1.4+ sprays lots of useless "Cumulative cost" log lines right in middle of important lines, so ignore them - proc = Popen("grep -v 'Cumulative cost' {0} {1} | grep -v 'CompressorArg' | grep -B 15 'Farmed unfinished_block'".format(rotated_log_file, log_file), + # Chia 1.4+ sprays lots of useless "Cumulative cost" and "CompressorArg" log lines right in middle of important lines, so ignore them + # Hopefully, there are not more than about 80 of such useless log lines else the selection of 100 before lines might exclude some blocks + proc = Popen("grep -B 100 'Farmed unfinished_block' {0} {1} | grep -ve 'Cumulative cost' -ve 'CompressorArg'".format(rotated_log_file, log_file), stdout=PIPE, stderr=PIPE, shell=True) try: outs, errs = proc.communicate(timeout=90) @@ -112,7 +113,7 @@ def recent_farmed_blocks(blockchain): cli_stdout = outs.decode('utf-8') #app.logger.info("Blocks grep: {0}".format(cli_stdout)) blocks = log.Blocks(blockchain, cli_stdout.splitlines()) - #app.logger.info(blocks.rows) + app.logger.info(blocks.rows) return blocks def get_farming_log_file(blockchain): diff --git a/api/commands/plotman_cli.py b/api/commands/plotman_cli.py index 0814ad764..fcd40bc4c 100644 --- a/api/commands/plotman_cli.py +++ b/api/commands/plotman_cli.py @@ -24,6 +24,7 @@ PLOTMAN_CONFIG = '/root/.chia/plotman/plotman.yaml' PLOTMAN_SAMPLE = '/machinaris/config/plotman.sample.yaml' PLOTMAN_SCRIPT = '/chia-blockchain/venv/bin/plotman' +PLOTTING_SCHEDULES = '/root/.chia/machinaris/config/plotting_schedules.json' # Don't query plotman unless at least this long since last time. RELOAD_MINIMUM_SECS = 30 @@ -142,6 +143,10 @@ def get_plotman_pid(): return None def start_plotman(): + pid = get_plotman_pid() + if pid: + app.logger.error("Not starting Plotman as already running with PID: {0}".format(pid)) + return app.logger.info("Starting Plotman run...") check_config() if len(load_plotting_summary().rows) == 0: # No plots running @@ -162,31 +167,15 @@ def clean_tmp_dirs_before_run(): for tmp_dir in config['directories']['tmp']: app.logger.info("No running plot jobs found so deleting {0}/*.tmp before starting plotman.".format(tmp_dir)) for p in pathlib.Path(tmp_dir).glob("*.tmp"): - if check_tmp_file_is_day_old(p): - p.unlink() + p.unlink() if 'tmp2' in config['directories']: tmp_dir = config['directories']['tmp2'] app.logger.info("No running plot jobs found so deleting {0}/*.tmp before starting plotman.".format(tmp_dir)) for p in pathlib.Path(tmp_dir).glob("*.tmp"): - if check_tmp_file_is_day_old(p): - p.unlink() + p.unlink() except Exception as ex: app.logger.info("Skipping deletion of temp files due to {0}.".format(traceback.format_exc())) -def check_tmp_file_is_day_old(path): - try: - match = re.match("plot(?:-mmx)?-k(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+)", path.name) - if match: - plot_date = datetime.datetime.strptime("{0}-{1}-{2} {3}:{4}".format( - match.group(2), match.group(3), match.group(4), match.group(5), match.group(6)), - '%Y-%m-%d %H:%M') - day_ago = datetime.datetime.now() - datetime.timedelta(days=1) - return plot_date < day_ago # Only safe to remove temp file if day old - except Exception as ex: - app.logger.info("Failed to check age of temp file at: {0}".format(path)) - app.logger.info("Due to: {0}".format(str(ex))) - return False - def clean_tmp_dirs_after_kill(plot_id): try: with open("/root/.chia/plotman/plotman.yaml") as f: @@ -195,21 +184,23 @@ def clean_tmp_dirs_after_kill(plot_id): if 'tmp' in config['directories']: for tmp_dir in config['directories']['tmp']: for p in pathlib.Path(tmp_dir).glob("*{0}*.tmp".format(plot_id)): - if check_tmp_file_is_day_old(p): - app.logger.info("After kill, deleting stale tmp file: {0}".format(p)) - p.unlink() + app.logger.info("After kill, deleting stale tmp file: {0}".format(p)) + p.unlink() if 'tmp2' in config['directories']: tmp_dir = config['directories']['tmp2'] for p in pathlib.Path(tmp_dir).glob("*{0}*.tmp".format(plot_id)): - if check_tmp_file_is_day_old(p): - app.logger.info("After kill, deleting stale tmp file: {0}".format(p)) - p.unlink() + app.logger.info("After kill, deleting stale tmp file: {0}".format(p)) + p.unlink() except Exception as ex: app.logger.info("Skipping deletion of temp files due to {0}.".format(traceback.format_exc())) def stop_plotman(): + pid = get_plotman_pid() + if not pid: + app.logger.error("No need to stop Plotman as not currently running.") + return app.logger.info("Stopping Plotman run...") - os.kill(get_plotman_pid(), signal.SIGTERM) + os.kill(pid, signal.SIGTERM) def get_archiver_pid(): for proc in psutil.process_iter(['pid', 'name', 'cmdline']): @@ -276,7 +267,7 @@ def find_plotting_job_log(plot_id): return None def analyze(plot_file): - groups = re.match("plot(?:-mmx)?-k(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", plot_file) + groups = re.match("plot(?:-mmx)?-k(\d+)(?:-c\d)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", plot_file) if not groups: return "Invalid plot file name provided: {0}".format(plot_file) plot_log_file = find_plotting_job_log(groups[7]) @@ -336,4 +327,50 @@ def load_dirs(blockchain): result = {'response': response, } if errs.decode('utf-8'): result['errors'] = errs.decode('utf-8') - return json.dumps(result) \ No newline at end of file + return json.dumps(result) + +def load_schedule(): + if os.path.exists(PLOTTING_SCHEDULES): + try: + return json.dumps(json.loads(open(PLOTTING_SCHEDULES,'r').read())) + except Exception as ex: + app.logger.error("Failed to read plotting schedule from {0} due to {1}.".format(PLOTTING_SCHEDULES, str(ex))) + return [] # Return an empty schedule response if not present. + +# A reference to the scheduler +saved_scheduler = None + +def save_schedule(schedule): + global saved_scheduler + with open(PLOTTING_SCHEDULES, 'w') as writer: + writer.write(schedule) + if saved_scheduler: + schedule_plotting(saved_scheduler) + app.logger.info("Saved updated plotting schedule to {0}.".format(PLOTTING_SCHEDULES)) + +# Invoked on launch of the API app when it creates the scheduler +def schedule_plotting(scheduler): + global saved_scheduler + if scheduler: + saved_scheduler = scheduler + for job in scheduler.get_jobs(): + app.logger.debug("JOB NAME: {0}".format(job.name)) + if job.name in ['scheduled_start_plotman', 'scheduled_stop_plotman']: + app.logger.info("Removing previously scheduled job {0}".format(job.id)) + job.remove() + try: + schedules = json.loads(load_schedule()) + for schedule in schedules: + app.logger.info("Scheduling plotting with schedule: {0}".format(schedule)) + start = schedule['start'].split(' ') + if len(start) == 5: + scheduler.add_job(func=start_plotman, name="scheduled_start_plotman", trigger='cron', minute=start[0], hour=start[1], day=start[2], month=start[3], day_of_week=start[4]) + else: + app.logger.error("Skipped stop of plotting for malformed schedule cron: {0}") + stop = schedule['stop'].split(' ') + if len(stop) == 5: + scheduler.add_job(func=stop_plotman, name="scheduled_stop_plotman", trigger='cron', minute=stop[0], hour=stop[1], day=stop[2], month=stop[3], day_of_week=stop[4]) + else: + app.logger.error("Skipped stop of plotting for malformed schedule cron: {0}") + except Exception as ex: + app.logger.error("Error when scheduling plotman: {0}".format(str(ex))) diff --git a/api/commands/pools_cli.py b/api/commands/pools_cli.py index 3806e77ec..eacdc2b34 100644 --- a/api/commands/pools_cli.py +++ b/api/commands/pools_cli.py @@ -100,16 +100,16 @@ def load_plotnft_show(blockchain): pool_wallet_id = 1 while True: i = child.expect(["Wallet height:.*\r\n", "Wallet keys:.*\r\n", "Choose wallet key:.*\r\n", - "Choose a wallet key:.*\r\n", "No online backup file found.*\r\n"], timeout=30) + "Choose a wallet key .*\r\n", "Active Wallet Key.*\r\n", "No online backup file found.*\r\n"], timeout=30) if i == 0: app.logger.debug("wallet show returned 'Wallet height...' so collecting details.") wallet_show += child.after.decode("utf-8") + child.before.decode("utf-8") + child.read().decode("utf-8") break - elif i == 1 or i == 2 or i == 3: + elif i == 1 or i == 2 or i == 3 or i == 4: app.logger.debug("wallet show got index prompt so selecting #{0}".format(pool_wallet_id)) child.sendline("{0}".format(pool_wallet_id)) pool_wallet_id += 1 - elif i == 4: + elif i == 5: child.sendline("S") else: app.logger.debug("pexpect returned {0}".format(i)) diff --git a/api/commands/rpc.py b/api/commands/rpc.py index 70dc80623..1b546e377 100644 --- a/api/commands/rpc.py +++ b/api/commands/rpc.py @@ -22,6 +22,13 @@ from apple.util.default_root import DEFAULT_ROOT_PATH from apple.util.ints import uint16 from apple.util.config import load_config as load_fork_config +elif blockchain == "ballcoin": + from ball.rpc.full_node_rpc_client import FullNodeRpcClient + from ball.rpc.farmer_rpc_client import FarmerRpcClient + from ball.rpc.wallet_rpc_client import WalletRpcClient + from ball.util.default_root import DEFAULT_ROOT_PATH + from ball.util.ints import uint16 + from ball.util.config import load_config as load_fork_config elif blockchain == "bpx": from chia.rpc.full_node_rpc_client import FullNodeRpcClient from chia.rpc.farmer_rpc_client import FarmerRpcClient @@ -43,7 +50,7 @@ from cactus.util.default_root import DEFAULT_ROOT_PATH from cactus.util.ints import uint16 from cactus.util.config import load_config as load_fork_config -elif blockchain == "chia": +elif blockchain in ["chia", 'gigahorse']: from chia.rpc.full_node_rpc_client import FullNodeRpcClient from chia.rpc.farmer_rpc_client import FarmerRpcClient, PlotPathRequestData from chia.rpc.wallet_rpc_client import WalletRpcClient @@ -64,6 +71,13 @@ from chives.util.default_root import DEFAULT_ROOT_PATH from chives.util.ints import uint16 from chives.util.config import load_config as load_fork_config +elif blockchain == "coffee": + from coffee.rpc.full_node_rpc_client import FullNodeRpcClient + from coffee.rpc.farmer_rpc_client import FarmerRpcClient + from coffee.rpc.wallet_rpc_client import WalletRpcClient + from coffee.util.default_root import DEFAULT_ROOT_PATH + from coffee.util.ints import uint16 + from coffee.util.config import load_config as load_fork_config elif blockchain == "cryptodoge": from cryptodoge.rpc.full_node_rpc_client import FullNodeRpcClient from cryptodoge.rpc.farmer_rpc_client import FarmerRpcClient @@ -92,6 +106,13 @@ from chia.util.default_root import DEFAULT_ROOT_PATH from chia.util.ints import uint16 from chia.util.config import load_config as load_fork_config +elif blockchain == "greenbtc": + from greenbtc.rpc.full_node_rpc_client import FullNodeRpcClient + from greenbtc.rpc.farmer_rpc_client import FarmerRpcClient + from greenbtc.rpc.wallet_rpc_client import WalletRpcClient + from greenbtc.util.default_root import DEFAULT_ROOT_PATH + from greenbtc.util.ints import uint16 + from greenbtc.util.config import load_config as load_fork_config elif blockchain == "gold": from chia.rpc.full_node_rpc_client import FullNodeRpcClient from chia.rpc.farmer_rpc_client import FarmerRpcClient @@ -143,6 +164,13 @@ from chia.util.default_root import DEFAULT_ROOT_PATH from chia.util.ints import uint16 from chia.util.config import load_config as load_fork_config +elif blockchain == "one": + from one.rpc.full_node_rpc_client import FullNodeRpcClient + from one.rpc.farmer_rpc_client import FarmerRpcClient + from one.rpc.wallet_rpc_client import WalletRpcClient + from one.util.default_root import DEFAULT_ROOT_PATH + from one.util.ints import uint16 + from one.util.config import load_config as load_fork_config elif blockchain == "petroleum": from chia.rpc.full_node_rpc_client import FullNodeRpcClient from chia.rpc.farmer_rpc_client import FarmerRpcClient @@ -150,6 +178,13 @@ from chia.util.default_root import DEFAULT_ROOT_PATH from chia.util.ints import uint16 from chia.util.config import load_config as load_fork_config +elif blockchain == "pipscoin": + from pipscoin.rpc.full_node_rpc_client import FullNodeRpcClient + from pipscoin.rpc.farmer_rpc_client import FarmerRpcClient + from pipscoin.rpc.wallet_rpc_client import WalletRpcClient + from pipscoin.util.default_root import DEFAULT_ROOT_PATH + from pipscoin.util.ints import uint16 + from pipscoin.util.config import load_config as load_fork_config elif blockchain == "profit": from profit.rpc.full_node_rpc_client import FullNodeRpcClient from profit.rpc.farmer_rpc_client import FarmerRpcClient diff --git a/api/commands/websvcs.py b/api/commands/websvcs.py index aa3f8a4cf..5d8898d25 100644 --- a/api/commands/websvcs.py +++ b/api/commands/websvcs.py @@ -289,31 +289,9 @@ def request_atb_prices(debug=False): app.logger.error("Failed to request recent blockchain pricing from {0} due to {1}".format(url, str(ex))) return prices -def request_posat_prices(debug=False): +def request_infinex_prices(debug=False): prices = {} - url = "https://mrkt.posat.io/api/prices/v2" - try: - app.logger.info("Requesting recent pricing for blockchains from {0}".format(url)) - if debug: - http.client.HTTPConnection.debuglevel = 1 - data = json.loads(requests.get(url, timeout=30).content) - http.client.HTTPConnection.debuglevel = 0 - for blockchain in data.keys(): - machinaris_blockchain = blockchain.replace('stai', 'staicoin').lower() - if not machinaris_blockchain in SUPPORTED_BLOCKCHAINS: - continue - #app.logger.info("POSAT: {0} @ {1}".format(blockchain, data[blockchain]['price']['usd'])) - try: - prices[machinaris_blockchain] = float(data[blockchain]['price']['usd']) - except Exception as ex: - traceback.print_exc() - except Exception as ex: - app.logger.error("Failed to request recent blockchain pricing from {0} due to {1}".format(url, str(ex))) - return prices - -def request_vayamos_prices(debug=False): - prices = {} - url = "https://api.vayamos.cc/spot/markets" + url = "https://api.infinex.cc/spot/markets" try: app.logger.info("Requesting recent pricing for blockchains from {0}".format(url)) if debug: @@ -327,15 +305,15 @@ def request_vayamos_prices(debug=False): if not market['pair'].endswith('USDT'): continue # Skip other market pairs than USDT for blockchain in SUPPORTED_BLOCKCHAINS: - vayamos_symbol = globals.get_blockchain_symbol(blockchain).upper() - if market['base'] == vayamos_symbol: + infinex_symbol = globals.get_blockchain_symbol(blockchain).upper() + if market['base'] == infinex_symbol: #app.logger.info("VAYAMOS: {0} @ {1}".format(blockchain, market['price'])) try: prices[blockchain] = float(market['price']) except Exception as ex: traceback.print_exc() else: - app.logger.info("vayamos response was not success=True.") + app.logger.info("infinex response was not success=True.") except Exception as ex: app.logger.error("Failed to request recent blockchain pricing from {0} due to {1}".format(url, str(ex))) return prices @@ -343,25 +321,17 @@ def request_vayamos_prices(debug=False): def request_peers(blockchain, debug=False): peers = [] alltheblocks_blockchain = globals.get_alltheblocks_name(blockchain) - url = "https://alltheblocks.net/{0}/peers".format(alltheblocks_blockchain) + url = "https://api.alltheblocks.net/{0}/peer/recent?amount=10".format(alltheblocks_blockchain) app.logger.info("Requesting node peers for {0} from {1}".format(blockchain, url)) - if debug: - http.client.HTTPConnection.debuglevel = 1 - data = requests.get(url, timeout=30).text - http.client.HTTPConnection.debuglevel = 0 - soup = bs4.BeautifulSoup(data, 'html.parser') - div = soup.find('div', class_="p-2 text-monospace") - for row in div.find_all('div'): - if len(row.contents) == 1: - add_cmd = row.contents[0].string.strip() - if 'show -a' in add_cmd: - peer = add_cmd[(add_cmd.index('show -a ') + len('show -a ')):].strip() - peers.append(peer) - elif 'peer -a' in add_cmd: - peer = add_cmd[(add_cmd.index('peer -a ') + len('peer -a ')):].strip() - peers.append(peer.splitlines()[0]) - else: - app.logger.error("Unparseable peer connection: {0}".format(row.contents[0].string)) + try: + if debug: + http.client.HTTPConnection.debuglevel = 1 + data = json.loads(requests.get(url, timeout=30).content) + http.client.HTTPConnection.debuglevel = 0 + for peer in data: + peers.append("{0}:{1}".format(peer['host'], peer['port'])) + except Exception as ex: + app.logger.error("Failed to request network peers from {0} due to {1}".format(url, str(ex))) return peers last_price_request_time = None @@ -372,8 +342,7 @@ def get_prices(): try: last_price_request_time = datetime.datetime.now() store_exchange_prices(prices, 'alltheblocks', request_atb_prices(), last_price_request_time) - #store_exchange_prices(prices, 'posat', request_posat_prices(), last_price_request_time) # Dead as of Sept 2022 - store_exchange_prices(prices, 'vayamos', request_vayamos_prices(), last_price_request_time) + store_exchange_prices(prices, 'infinex', request_infinex_prices(), last_price_request_time) save_prices_cache(prices) except Exception as ex: app.logger.info("Failed to save current blockchain prices because {0}".format(str(ex))) @@ -451,7 +420,7 @@ def request_chain_statuses(statuses, debug=False): if resp.status_code == 200: result = json.loads(resp.text) for fork in result['forks']: - fork_name = fork['pathName'].replace('stai', 'staicoin') + fork_name = fork['pathName'].replace('stai', 'staicoin').replace('ballcoin', 'ball') peak_time = datetime.datetime.fromtimestamp(int(fork['peakTimestamp'])).strftime("%Y-%m-%d %H:%M:%S") statuses[fork_name] = { 'peak_height': fork['peakHeight'], 'peak_time': peak_time, } else: diff --git a/api/default_settings.py b/api/default_settings.py index b303327ee..097715d86 100644 --- a/api/default_settings.py +++ b/api/default_settings.py @@ -1,4 +1,5 @@ import os +import traceback class DefaultConfig: API_TITLE = "Machinaris API" @@ -48,7 +49,7 @@ class DefaultConfig: 'stat_container_mem_gib': 'sqlite:////root/.chia/machinaris/dbs/stat_container_mem_gib.db', 'stat_host_mem_pct': 'sqlite:////root/.chia/machinaris/dbs/stat_host_mem_pct.db', } - SQLALCHEMY_ECHO = True if 'FLASK_ENV' in os.environ and os.environ['FLASK_ENV'] == "development" else False + SQLALCHEMY_ECHO = True if 'FLASK_DEBUG' in os.environ and os.environ['FLASK_DEBUG'] == "development" else False ETAG_DISABLED = True # https://flask-smorest.readthedocs.io/en/latest/etag.html CONTROLLER_SCHEME = 'http' CONTROLLER_HOST = os.environ['controller_host'] if 'controller_host' in os.environ else 'localhost' @@ -62,3 +63,10 @@ class DefaultConfig: BABEL_TRANSLATION_DIRECTORIES = "api/translations" LANGUAGES = ['en', 'de_DE', 'fr_FR', 'it_IT', 'nl_NL', 'pt_PT', 'zh'] + + # For latest APScheduler library, pass the TZ through + try: + SCHEDULER_TIMEZONE = os.environ['TZ'] + except: + print("Found no TZ environment variable containing timezone. Generate a working Machinaris launch at https://www.machinaris.app") + traceback.print_exc() diff --git a/api/gunicorn.conf.py b/api/gunicorn.conf.py index 810c8f7e5..0dece2dbc 100644 --- a/api/gunicorn.conf.py +++ b/api/gunicorn.conf.py @@ -6,6 +6,7 @@ def on_starting(server): import atexit import os import time + import tzlocal from datetime import datetime, timedelta from apscheduler.schedulers.background import BackgroundScheduler @@ -21,31 +22,30 @@ def on_starting(server): from common.config import globals from common.models import pools, plottings - from api.commands import websvcs + from api.commands import websvcs, plotman_cli - scheduler = BackgroundScheduler() + scheduler = BackgroundScheduler(timezone=str(tzlocal.get_localzone())) schedule_every_x_minutes = "?" try: schedule_every_x_minutes = app.config['STATUS_EVERY_X_MINUTES'] JOB_FREQUENCY = 60 * int(schedule_every_x_minutes) - JOB_JITTER = JOB_FREQUENCY / 2 except: app.logger.info("Failed to configure job schedule frequency in minutes as setting was: '{0}'".format(schedule_every_x_minutes)) - JOB_FREQUENCY = 60 # once a minute - JOB_JITTER = 30 # 30 seconds + JOB_FREQUENCY = 120 # once every two minutes app.logger.info("Scheduler frequency will be once every {0} seconds.".format(JOB_FREQUENCY)) + JOB_JITTER = JOB_FREQUENCY / 2 # Every single container should report as a worker scheduler.add_job(func=status_worker.update, name="status_workers", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) # Collect disk stats from all modes where blockchain is chia, avoiding duplicate disks from multiple forks on same host if 'chia' in globals.enabled_blockchains(): - scheduler.add_job(func=stats_disk.collect, name="stats_disk", trigger='cron', minute="*/10") # Every 10 minutes - scheduler.add_job(func=status_drives.update, name="status_drives", trigger='cron', minute="*/15") # Every 15 minutes + scheduler.add_job(func=stats_disk.collect, name="stats_disk", trigger='cron', minute="*/10", jitter=5*60) # Every 10 minutes + scheduler.add_job(func=status_drives.update, name="status_drives", trigger='cron', minute="*/15", jitter=7.5*60) # Every 15 minutes # MMX needs to report plots from harvesters directly as they are not listed via the fullnode like Chia does - if not utils.is_fullnode() and globals.harvesting_enabled() and 'mmx' in globals.enabled_blockchains(): + if not utils.is_fullnode() and globals.harvesting_enabled() and globals.enabled_blockchains() in ['mmx']: scheduler.add_job(func=status_plots.update, name="status_plots", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) # Status for both farmers and harvesters (includes fullnodes) @@ -56,12 +56,13 @@ def on_starting(server): scheduler.add_job(func=log_rotate.execute, name="log_rotate", trigger='cron', minute=0) # Hourly if globals.farming_enabled() and 'chia' in globals.enabled_blockchains(): # For now, only Chia fullnodes - scheduler.add_job(func=status_warnings.collect, name="status_warnings", trigger='cron', minute="*/20") # Every 20 minutes + scheduler.add_job(func=status_warnings.collect, name="status_warnings", trigger='cron', minute="*/20", jitter=JOB_JITTER) # Every 20 minutes # Status for plotters if globals.plotting_enabled(): scheduler.add_job(func=status_plotting.update, name="status_plottings", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) scheduler.add_job(func=status_archiving.update, name="status_archiving", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) + plotman_cli.schedule_plotting(scheduler) # Status for fullnodes, all different forks if utils.is_fullnode(): @@ -72,11 +73,11 @@ def on_starting(server): scheduler.add_job(func=status_connections.update, name="status_connections", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) scheduler.add_job(func=status_keys.update, name="status_keys", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) scheduler.add_job(func=status_farm.update, name="status_farm", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) - scheduler.add_job(func=stats_blocks.collect, name="status_blocks", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) - scheduler.add_job(func=restart_stuck_farmer.execute, name="status_blockchain_sync", trigger='interval', minutes=5, jitter=0) - scheduler.add_job(func=periodically_sync_wallet.execute, name="status_wallet_sync", trigger='interval', minutes=15, jitter=0) - scheduler.add_job(func=nft_recover.execute, name="status_nft_recover", trigger='interval', hours=1) # Once an hour - if globals.enabled_blockchains()[0] in plottings.PLOTTABLE_BLOCKCHAINS: # Only get plot listing from these three blockchains + scheduler.add_job(func=stats_blocks.collect, name="status_blocks", trigger='interval', minutes=10, jitter=JOB_JITTER) + scheduler.add_job(func=restart_stuck_farmer.execute, name="status_blockchain_sync", trigger='interval', minutes=5, jitter=JOB_JITTER) + scheduler.add_job(func=periodically_sync_wallet.execute, name="status_wallet_sync", trigger='interval', minutes=15, jitter=JOB_JITTER) + scheduler.add_job(func=nft_recover.execute, name="status_nft_recover", trigger='interval', hours=1, jitter=JOB_JITTER) # Once an hour + if globals.enabled_blockchains()[0] in plottings.PLOTTABLE_BLOCKCHAINS: # Only get plot listing from these blockchains scheduler.add_job(func=status_plots.update, name="status_plots", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) if globals.enabled_blockchains()[0] in pools.POOLABLE_BLOCKCHAINS: # Only get pool submissions from poolable blockchains scheduler.add_job(func=status_pools.update, name="status_pools", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) @@ -91,12 +92,12 @@ def on_starting(server): scheduler.add_job(func=websvcs.get_prices, name="status_exchange_prices", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) scheduler.add_job(func=websvcs.get_chain_statuses, name="status_blockchain_networks", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) scheduler.add_job(func=geolocate_peers.execute, name="stats_geolocate_peers", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) - scheduler.add_job(func=stats_balances.collect, name="stats_balances", trigger='cron', minute=0) # Hourly + scheduler.add_job(func=stats_balances.collect, name="stats_balances", trigger='cron', minute=0, jitter=JOB_JITTER) # Hourly scheduler.add_job(func=plots_replot.execute, name="replot_check", trigger='interval', seconds=JOB_FREQUENCY, jitter=JOB_JITTER) # Testing only #scheduler.add_job(func=plots_check.execute, name="plots_check", trigger='interval', seconds=60) # Test immediately - #scheduler.add_job(func=stats_effort.collect, name="stats_effort", trigger='interval', seconds=10) # Test immediately + #scheduler.add_job(func=stats_blocks.collect, name="stats_effort", trigger='interval', seconds=10) # Test immediately #scheduler.add_job(func=stats_balances.collect, name="stats_balances", trigger='interval', seconds=10) # Test immediately #scheduler.add_job(func=websvcs.get_chain_statuses, name="get_chain_statuses", trigger='interval', seconds=10) # Test immediately #scheduler.add_job(func=status_farm.update, name="farms", trigger='interval', seconds=10) # Test immediately diff --git a/api/migrations/env.py b/api/migrations/env.py index 04b1ff749..7f48c373c 100644 --- a/api/migrations/env.py +++ b/api/migrations/env.py @@ -19,14 +19,23 @@ fileConfig(config.config_file_name) logger = logging.getLogger('alembic.env') + +def get_engine(bind_key=None): + try: + # this works with Flask-SQLAlchemy<3 and Alchemical + return current_app.extensions['migrate'].db.get_engine(bind=bind_key) + except TypeError: + # this works with Flask-SQLAlchemy>=3 + return current_app.extensions['migrate'].db.engines.get(bind_key) + + # add your model's MetaData object here # for 'autogenerate' support # from myapp import mymodel # target_metadata = mymodel.Base.metadata config.set_main_option( - 'sqlalchemy.url', - str(current_app.extensions['migrate'].db.get_engine().url).replace( - '%', '%%')) + 'sqlalchemy.url', str(get_engine().url).replace('%', '%%')) +bind_names = [] if current_app.config.get('SQLALCHEMY_BINDS') is not None: bind_names = list(current_app.config['SQLALCHEMY_BINDS'].keys()) else: @@ -37,10 +46,8 @@ for bind in bind_names: context.config.set_section_option( bind, "sqlalchemy.url", - str(current_app.extensions['migrate'].db.get_engine( - bind=bind).url).replace('%', '%%')) -target_metadata = current_app.extensions['migrate'].db.metadata - + str(get_engine(bind_key=bind).url).replace('%', '%%')) +target_db = current_app.extensions['migrate'].db # other values from the config, defined by the needs of env.py, # can be acquired: @@ -52,8 +59,12 @@ def get_metadata(bind): """Return the metadata for a bind.""" if bind == '': bind = None + if hasattr(target_db, 'metadatas'): + return target_db.metadatas[bind] + + # legacy, less flexible implementation m = MetaData() - for t in target_metadata.tables.values(): + for t in target_db.metadata.tables.values(): if t.info.get('bind_key') == bind: t.tometadata(m) return m @@ -124,12 +135,11 @@ def process_revision_directives(context, revision, directives): # for the direct-to-DB use case, start a transaction on all # engines, then run all migrations, then commit all transactions. engines = { - '': {'engine': current_app.extensions['migrate'].db.get_engine()} + '': {'engine': get_engine()} } for name in bind_names: engines[name] = rec = {} - rec['engine'] = current_app.extensions['migrate'].db.get_engine( - bind=name) + rec['engine'] = get_engine(bind_key=name) for name, rec in engines.items(): engine = rec['engine'] @@ -171,4 +181,4 @@ def process_revision_directives(context, revision, directives): if context.is_offline_mode(): run_migrations_offline() else: - run_migrations_online() + run_migrations_online() \ No newline at end of file diff --git a/api/migrations/versions/6cda05ff2952_.py b/api/migrations/versions/6cda05ff2952_.py new file mode 100644 index 000000000..d42a7b5f5 --- /dev/null +++ b/api/migrations/versions/6cda05ff2952_.py @@ -0,0 +1,440 @@ +"""empty message + +Revision ID: 6cda05ff2952 +Revises: 2f7f4aa4758b +Create Date: 2023-01-30 15:28:21.362394 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = '6cda05ff2952' +down_revision = '2f7f4aa4758b' +branch_labels = None +depends_on = None + + +def upgrade(engine_name): + globals()["upgrade_%s" % engine_name]() + + +def downgrade(engine_name): + globals()["downgrade_%s" % engine_name]() + + + + + +def upgrade_(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_alerts(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_alerts(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_blockchains(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_blockchains(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_challenges(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_challenges(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_connections(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_connections(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_drives(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_drives(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_farms(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_farms(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_keys(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_keys(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_partials(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_partials(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_plotnfts(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_plotnfts(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_plottings(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('plottings', schema=None) as batch_op: + batch_op.add_column(sa.Column('lvl', sa.Integer(), nullable=True)) + + # ### end Alembic commands ### + + +def downgrade_plottings(): + # ### commands auto generated by Alembic - please adjust! ### + with op.batch_alter_table('plottings', schema=None) as batch_op: + batch_op.drop_column('lvl') + + # ### end Alembic commands ### + + +def upgrade_plots(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_plots(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_pools(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_pools(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_transfers(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_transfers(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_wallets(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_wallets(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_warnings(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_warnings(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_workers(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_workers(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_plot_count(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_plot_count(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_plots_size(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_plots_size(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_total_coins(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_total_coins(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_netspace_size(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_netspace_size(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_time_to_win(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_time_to_win(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_effort(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_effort(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_plots_total_used(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_plots_total_used(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_plots_disk_used(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_plots_disk_used(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_plots_disk_free(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_plots_disk_free(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_plotting_total_used(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_plotting_total_used(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_plotting_disk_used(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_plotting_disk_used(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_plotting_disk_free(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_plotting_disk_free(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_farmed_blocks(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_farmed_blocks(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_wallet_balances(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_wallet_balances(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_total_balance(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_total_balance(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_container_mem_gib(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_container_mem_gib(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def upgrade_stat_host_mem_pct(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + + +def downgrade_stat_host_mem_pct(): + # ### commands auto generated by Alembic - please adjust! ### + pass + # ### end Alembic commands ### + diff --git a/api/models/mmx.py b/api/models/mmx.py index 653b7b4a8..5410c5d0a 100644 --- a/api/models/mmx.py +++ b/api/models/mmx.py @@ -82,7 +82,7 @@ def __init__(self, entries): app.logger.info("Skipping non-plot file named: {0}".format(path)) continue dir,file=os.path.split(path) - groups = re.match("plot-mmx-k(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) + groups = re.match("plot-mmx-k(\d+)(-c\d)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) if not groups: app.logger.info("Invalid plot file name provided: {0}".format(file)) continue diff --git a/api/models/plotman.py b/api/models/plotman.py index 43955a363..6c604f8c9 100644 --- a/api/models/plotman.py +++ b/api/models/plotman.py @@ -16,14 +16,10 @@ def __init__(self, cli_stdout, plotman_pid): elif "plot id" in line.strip(): # The header row self.columns = line.replace('plot id', 'plot_id').strip().split() # Plotman has two columns both named 'tmp' so change the 2nd one to 'size' - self.columns[7] = 'size' + self.columns[8] = 'size' else: # Check for a plotting job row values = line.split() if len(values) > 1 and values[1] in ['chia', 'madmax', 'bladebit']: - if len(values) == len(self.columns) - 1: - app.logger.info("Bladebit job before: {0}".format(values)) - values.insert(3, '-') # bladebit rows don't have a tmp directory - app.logger.info("Bladebit job after: {0}".format(values)) if len(values) == len(self.columns): row = {} i = 0 @@ -84,7 +80,7 @@ def parse_transfer_log(self, log_file, running_transfers): elif line.startswith("Completed"): self.end_date = line[line.index(' at ')+4:].strip() elif line.startswith("+ rsync"): - m = re.search("plot(?:-mmx)?-k(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", line) + m = re.search("plot(?:-mmx)?-k(\d+)(?:-c\d)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", line) if m: self.plot_id = m.group(7)[:16].strip() self.k = int(m.group(1).strip()) diff --git a/api/schedules/log_rotate.py b/api/schedules/log_rotate.py index 1bb3fd836..d939d9956 100644 --- a/api/schedules/log_rotate.py +++ b/api/schedules/log_rotate.py @@ -12,7 +12,6 @@ LOG_ROTATE_CONFIG_DIR = '/etc/logrotate.d/' LOG_ROTATE_CONFIGS = [ 'machinaris', - 'farmr', 'mmx-node', 'plotman', ] @@ -22,12 +21,3 @@ def execute(): if os.path.exists(LOG_ROTATE_CONFIG_DIR + config): app.logger.info("Rotating config: " + LOG_ROTATE_CONFIG_DIR + config) subprocess.call("/usr/sbin/logrotate " + LOG_ROTATE_CONFIG_DIR + config + " >/dev/null 2>&1", shell=True) - - # Extra guards for farmr which can eat GBs of log space sometimes - if os.path.exists("/root/.chia/farmr"): - for file in os.listdir("/root/.chia/farmr"): - if file.startswith("log"): - size_mbs = os.path.getsize(os.path.join("/root/.chia/farmr", file)) >> 20 - if (size_mbs > MAX_LOG_SIZE_MB): - app.logger.info("Deleting large farmr log at {0}".format(os.path.join("/root/.chia/farmr", file))) - os.unlink(os.path.join("/root/.chia/farmr", file)) diff --git a/api/schedules/nft_recover.py b/api/schedules/nft_recover.py index 36b5fdaff..3ccfebf01 100644 --- a/api/schedules/nft_recover.py +++ b/api/schedules/nft_recover.py @@ -19,5 +19,7 @@ def execute(): with app.app_context(): from api import db gc = globals.load() + if globals.enabled_blockchains()[0] == 'mmx': + return # No such thing for MMX app.logger.info("****************** Starting hourly NFT 7/8 qualified reward coins check... *********************") rewards.update_qualified_coins_cache() diff --git a/api/schedules/plots_check.py b/api/schedules/plots_check.py index 7c0d074d5..450fff46b 100644 --- a/api/schedules/plots_check.py +++ b/api/schedules/plots_check.py @@ -19,6 +19,9 @@ from common.config import globals from api import app, utils +# If found no valid check for a plot, don't attempt again for at least a week +RETRY_INTERVAL_MINS = 60 * 24 * 7 + STATUS_FILE = '/root/.chia/plotman/status.json' ANALYZE_LOGS = '/root/.chia/plotman/analyze' CHECK_LOGS = '/root/.chia/plotman/checks' @@ -99,27 +102,27 @@ def request_analyze(plot_file, workers): plotter.hostname, plotter.latest_ping_result)) continue try: - app.logger.debug("Trying {0}:{1} for analyze....".format(plotter.hostname, plotter.port)) + app.logger.info("Trying {0}:{1} for analyze....".format(plotter.hostname, plotter.port)) payload = {"service":"plotting", "action":"analyze", "plot_file": plot_file } response = utils.send_worker_post(plotter, "/analysis/", payload, debug=False) if response.status_code == 200: return [plotter.hostname, plotter.displayname, response.content.decode('utf-8')] elif response.status_code == 404: - app.logger.debug("Plotter on {0}:{1} did not have plot log for {2}".format( + app.logger.info("Plotter on {0}:{1} did not have plot log for {2}".format( plotter.hostname, plotter.port, plot_file)) else: - app.logger.debug("Plotter on {0}:{1} returned an unexpected error: {2}".format( + app.logger.info("Plotter on {0}:{1} returned an unexpected error: {2}".format( plotter.hostname, plotter.port, response.status_code)) except Exception as ex: app.logger.error(str(ex)) return [None, None, None] -def set_check_status(workers, status, plot): - app.logger.debug("Checking for plot check of {0}".format(plot.plot_id)) +def set_check_status(workers, status, plot, refresh): check_log = CHECK_LOGS + '/' + plot.plot_id[:8] + '.log' check_status = None requested_status = False - if not os.path.exists(check_log): + if refresh or not os.path.exists(check_log): + app.logger.info("Requesting plot check of {0}".format(plot.plot_id)) requested_status = True [hostname, displayname, result] = request_check(plot, workers) if result: @@ -141,7 +144,7 @@ def set_check_status(workers, status, plot): except Exception as ex: app.log.error("Failed to parse plots check header because: {0}".format(str(ex))) app.log.error(line) - elif "Found 1 valid plots" in line: + elif "Found 1 valid plots" in line or "Total success: " in line: check_status = 'GOOD' if plot.plot_id[:8] in status: plot_state = status[plot.plot_id[:8]] @@ -158,24 +161,24 @@ def set_check_status(workers, status, plot): def request_check(plot, workers): # Don't know which harvester might have the plot result so try them in-turn for harvester in workers: - app.logger.debug("{0}:{1} - {2} - {3}".format(harvester.hostname, harvester.port, harvester.blockchain, harvester.mode)) + #app.logger.info("{0}:{1} - {2} - {3}".format(harvester.hostname, harvester.port, harvester.blockchain, harvester.mode)) if harvester.mode == 'fullnode' or 'harvester' in harvester.mode: if harvester.latest_ping_result != "Responding": - app.logger.debug("Skipping check call to {0} as last ping was: {1}".format( \ + app.logger.info("Skipping check call to {0} as last ping was: {1}".format( \ harvester.hostname, harvester.latest_ping_result)) continue if harvester.hostname != plot.hostname or harvester.blockchain != plot.blockchain: - app.logger.debug("Skipping check call to {0} ({1}) for plot on {2} ({3})".format( \ + app.logger.info("Skipping check call to {0} ({1}) for plot on {2} ({3})".format( \ harvester.hostname, harvester.blockchain, plot.hostname, plot.blockchain)) continue try: - app.logger.debug("Trying {0}:{1} for plot check....".format(harvester.hostname, harvester.port)) + app.logger.info("Trying {0}:{1} for plot check....".format(harvester.hostname, harvester.port)) payload = {"service":"farming", "action":"check", "plot_file": plot.dir + '/' + plot.file } response = utils.send_worker_post(harvester, "/analysis/", payload, debug=True) if response.status_code == 200: return [harvester.hostname, harvester.displayname, response.content.decode('utf-8')] elif response.status_code == 404: - app.logger.debug("Harvester on {0}:{1} did not have plot check for {2}".format( + app.logger.info("Harvester on {0}:{1} did not have plot check for {2}".format( harvester.hostname, harvester.port, plot.file)) else: app.logger.info("Harvester on {0}:{1} returned an unexpected error: {2}".format( @@ -184,32 +187,56 @@ def request_check(plot, workers): app.logger.info(str(ex)) return [None, None, None] -def execute(): +def refresh_status_file_from_logs(): + status = open_status_json() + for key in list(status.keys()): + if (not 'check' in status[key] or status[key]['check'] is None) and (not 'analyze' in status[key] or status[key]['analyze'] is None): + app.logger.info("Deleting {0} both".format(key)) + del status[key] + elif 'check' in status[key] and status[key]['check'] is None: + app.logger.info("Deleting {0} check".format(key)) + del status[key]['check'] + elif 'analyze' in status[key] and status[key]['analyze'] is None: + app.logger.info("Deleting {0} analyze".format(key)) + del status[key]['analyze'] + write_status_json(status) + +last_retry_time = None +def execute(plot_id=None): + global last_retry_time if 'plots_check_analyze_skip' in os.environ and os.environ['plots_check_analyze_skip'].lower() == 'true': app.logger.info("Skipping plots check and analyze as environment variable 'plots_check_analyze_skip' is present.") return + if not last_retry_time or last_retry_time <= \ + (datetime.datetime.now() - datetime.timedelta(minutes=RETRY_INTERVAL_MINS)): + last_retry_time = datetime.datetime.now() # Delete any empty markers allowing a retry once a day. + os.system("/usr/bin/find /root/.chia/plotman/checks/ -type f -empty -print -delete") + refresh_status_file_from_logs() with app.app_context(): from api import db gc = globals.load() if not gc['is_controller']: return # Only controller should initiate check/analyze against other fullnodes/harvesters try: - os.makedirs(ANALYZE_LOGS) - os.makedirs(CHECK_LOGS) + if not os.path.isdir(ANALYZE_LOGS): + os.makedirs(ANALYZE_LOGS) + if not os.path.isdir(CHECK_LOGS): + os.makedirs(CHECK_LOGS) except Exception as ex: - app.logger.debug("Unable to create analyze and check folders in plotman. {0}".format(str(ex))) + app.logger.info("Unable to create analyze and check folders in plotman. {0}".format(str(ex))) workers = db.session.query(w.Worker) - plots = db.session.query(p.Plot).filter(or_(p.Plot.plot_check.is_(None), - p.Plot.plot_analyze.is_(None))).order_by(p.Plot.created_at.desc()).all() + if plot_id: + plots = db.session.query(p.Plot).filter(p.Plot.plot_id == plot_id).all() + else: + plots = db.session.query(p.Plot).filter(or_(p.Plot.plot_check.is_(None), + p.Plot.plot_analyze.is_(None))).order_by(p.Plot.created_at.desc()).all() status = open_status_json() requested_status_count = 0 #app.logger.info("Querying for plots...") for plot in plots: #app.logger.info("Checking plot {0}".format(plot.plot_id)) set_analyze_status(workers, status, plot) - if os.environ['blockchains'][0] == 'mmx': - continue # Skip over MMX plots as they can't be checked - if set_check_status(workers, status, plot): + if set_check_status(workers, status, plot, plot_id != None): requested_status_count += 1 if requested_status_count > 5: # Only remote request `check plots` on at most 5 plots per cycle break diff --git a/api/schedules/stats_effort.py b/api/schedules/stats_effort.py index 6de3c6071..045b9efe5 100644 --- a/api/schedules/stats_effort.py +++ b/api/schedules/stats_effort.py @@ -41,7 +41,7 @@ def get_oldest_plot_file_time(): for plot_dir in globals.get_disks("plots"): plots = [f for f in os.listdir(plot_dir) if os.path.isfile(os.path.join(plot_dir,f))] for plot in plots: - match = re.match("plot(?:-mmx)?-k(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", plot) + match = re.match("plot(?:-mmx)?-k(\d+)(?:-c\d)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", plot) if match: created_at_str = "{0}-{1}-{2} {3}:{4}".format( match.group(2),match.group(3),match.group(4),match.group(5),match.group(6)) created_at_secs = time.mktime(datetime.datetime.strptime(created_at_str, "%Y-%m-%d %H:%M").timetuple()) @@ -56,7 +56,7 @@ def collect(): current_datetime = datetime.datetime.now().strftime("%Y%m%d%H%M") blockchain = globals.enabled_blockchains()[0] try: - if blockchain == 'mmx': + if blockchain in ['gigahorse', 'mmx']: app.logger.debug("Unable to calculate effort for MMX blockchain. Only Chia and forks supported.") return farm_summary = chia_cli.load_farm_summary(blockchain) diff --git a/api/schedules/status_farm.py b/api/schedules/status_farm.py index e5cd46755..40ddc4dcf 100644 --- a/api/schedules/status_farm.py +++ b/api/schedules/status_farm.py @@ -29,6 +29,8 @@ def safely_gather_plots_size_gibs(plots_size): return plots_size_gibs def update(): + if not utils.is_fullnode(): + return # Only fullnodes have farm info, skip on harvesters & plotters. with app.app_context(): hostname = utils.get_hostname() blockchain = globals.enabled_blockchains()[0] diff --git a/api/schedules/status_plotnfts.py b/api/schedules/status_plotnfts.py index c988c6f50..bf44bf58d 100644 --- a/api/schedules/status_plotnfts.py +++ b/api/schedules/status_plotnfts.py @@ -36,7 +36,7 @@ def update(): with app.app_context(): try: for blockchain in globals.enabled_blockchains(): - if not blockchain in pools.POOLABLE_BLOCKCHAINS: + if not blockchain in ['chia', 'chives']: continue hostname = utils.get_hostname() plotnfts = pools_cli.load_plotnft_show(blockchain) diff --git a/api/schedules/status_plots.py b/api/schedules/status_plots.py index f7370d518..79ba14947 100644 --- a/api/schedules/status_plots.py +++ b/api/schedules/status_plots.py @@ -29,7 +29,7 @@ def get_plot_attrs(plot_id, filename): dir,file = os.path.split(filename) - match = re.match("plot(?:-mmx)?-k(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) + match = re.match("plot(?:-mmx)?-k(\d+)(?:-c\d)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) if match: short_plot_id = match.group(7)[:16] created_at = "{0}-{1}-{2} {3}:{4}".format( match.group(2),match.group(3),match.group(4),match.group(5),match.group(6)) @@ -61,10 +61,12 @@ def update(): update_chia_plots(plots_status, since) elif 'chives' in globals.enabled_blockchains(): update_chives_plots(since) + elif 'gigahorse' in globals.enabled_blockchains(): + update_gigahorse_plots(since) elif 'mmx' in globals.enabled_blockchains(): update_mmx_plots(since) else: - app.logger.debug("Skipping plots update from blockchains other than chia and chives as they all farm same as chia.") + app.logger.debug("Skipping plots update from other blockchains they all farm same as chia.") def add_duplicate_plots(duplicated_plots, file, host1, path1, host2, path2): if file in duplicated_plots: @@ -227,6 +229,48 @@ def update_chives_plots(since): except Exception as ex: app.logger.error("Failed to load and send Chives plots farming because {0}".format(str(ex))) +# Sent from a separate fullnode container +def update_gigahorse_plots(since): + try: + blockchain = 'gigahorse' + blockchain_rpc = rpc.RPC() + hostname = utils.get_hostname() + plots_farming = blockchain_rpc.get_all_plots() + payload = [] + plots_by_filename = {} + for plot in plots_farming: + short_plot_id,dir,file,created_at = get_plot_attrs(plot['plot_id'], plot['filename']) + duplicated_on_same_host = False + if not since and file in plots_by_filename: # Only check for duplicates on full load + if plot['hostname'] == plots_by_filename[file]['hostname']: + app.logger.error("DUPLICATE GIGAHORSE PLOT FOUND ON SAME WORKER {0} AT BOTH {1}/{2} AND {3}/{4}".format( + plot['hostname'], plots_by_filename[file]['path'], plots_by_filename[file]['file'], dir, file)) + duplicated_on_same_host = True + else: + app.logger.error("DUPLICATE GIGAHORSE PLOT FOUND ON DIFFERENT WORKERS AT {0}@{1}/{2} AND {3}@{4}/{5}".format( + plots_by_filename[file]['worker'], plots_by_filename[file]['path'], plots_by_filename[file]['file'], plot['hostname'], dir, file)) + plots_by_filename[file] = { 'hostname': plot['hostname'], 'worker': plot['hostname'], 'path': dir, 'file': file } + if not duplicated_on_same_host and not since or created_at > since: + payload.append({ + "plot_id": short_plot_id, + "blockchain": blockchain, + "hostname": hostname if plot['hostname'] in ['127.0.0.1'] else plot['hostname'], + "displayname": None, # Can't know all Gigahorse workers' displaynames here, done in API receiver + "dir": dir, + "file": file, + "type": plot['type'], + "created_at": created_at, + "plot_analyze": None, # Handled in receiver + "plot_check": None, # Handled in receiver + "size": plot['file_size'] + }) + if not since: # If no filter, delete all before sending all current again + utils.send_delete('/plots/{0}/{1}'.format(hostname, blockchain), debug=False) + if len(payload) > 0: + utils.send_post('/plots/', payload, debug=False) + except Exception as ex: + app.logger.error("Failed to load and send Gigahorse plots farming because {0}".format(str(ex))) + # Sent from a separate fullnode container def update_mmx_plots(since): try: @@ -252,7 +296,7 @@ def update_mmx_plots(since): "plot_id": short_plot_id, "blockchain": blockchain, "hostname": hostname if plot['hostname'] in ['127.0.0.1'] else plot['hostname'], - "displayname": None, # Can't know all Chives workers' displaynames here, done in API receiver + "displayname": None, # Can't know all MMX workers' displaynames here, done in API receiver "dir": dir, "file": file, "type": plot['type'], diff --git a/api/schedules/status_plotting.py b/api/schedules/status_plotting.py index c4c6b7a46..d279b2b73 100644 --- a/api/schedules/status_plotting.py +++ b/api/schedules/status_plotting.py @@ -29,6 +29,7 @@ def update(): "blockchain": blockchain, "plotter": plot['plotter'], "k": plot['k'], + "lvl": plot['lvl'], "tmp": plot['tmp'], "dst": plot['dst'], "wall": plot['wall'], diff --git a/api/schedules/status_pools.py b/api/schedules/status_pools.py index 588719168..31c8a23f0 100644 --- a/api/schedules/status_pools.py +++ b/api/schedules/status_pools.py @@ -25,7 +25,7 @@ def update(): blockchain_rpc = rpc.RPC() try: for blockchain in globals.enabled_blockchains(): - if not blockchain in p.POOLABLE_BLOCKCHAINS: + if not blockchain in ['chia', 'chives']: continue payload = [] hostname = utils.get_hostname() diff --git a/api/schedules/status_wallets.py b/api/schedules/status_wallets.py index b9ed0838e..795f3f4b9 100644 --- a/api/schedules/status_wallets.py +++ b/api/schedules/status_wallets.py @@ -22,21 +22,23 @@ def update(): with app.app_context(): try: - for blockchain in globals.enabled_blockchains(): - hostname = utils.get_hostname() - if blockchain == 'mmx': - public_wallet = mmx_cli.load_wallet_show(blockchain) - else: - public_wallet = chia_cli.load_wallet_show(blockchain) - if public_wallet: - payload = { - "hostname": hostname, - "blockchain": blockchain, - "details": public_wallet.text.replace('\r', ''), - } - #app.logger.info(payload) - utils.send_post('/wallets/', payload, debug=False) - else: - app.logger.info("Not sending public wallet status as wallet is not running.") + blockchain = globals.enabled_blockchains()[0] + hostname = utils.get_hostname() + if blockchain == 'gigahorse': + return # Gigahorse is Chia blockchain with proprietary plot files, no wallet running + elif blockchain == 'mmx': + public_wallet = mmx_cli.load_wallet_show(blockchain) + else: + public_wallet = chia_cli.load_wallet_show(blockchain) + if public_wallet: + payload = { + "hostname": hostname, + "blockchain": blockchain, + "details": public_wallet.text.replace('\r', ''), + } + #app.logger.info(payload) + utils.send_post('/wallets/', payload, debug=False) + else: + app.logger.info("Not sending public wallet status as wallet is not running.") except Exception as ex: app.logger.info("Failed to load and send public wallet status because {0}".format(str(ex))) diff --git a/api/schedules/status_worker.py b/api/schedules/status_worker.py index d22b44de1..425e27afd 100644 --- a/api/schedules/status_worker.py +++ b/api/schedules/status_worker.py @@ -15,7 +15,7 @@ from flask import g from common.config import globals -from api.commands import chia_cli, chiadog_cli, plotman_cli, farmr_cli, mmx_cli +from api.commands import chia_cli, chiadog_cli, plotman_cli, mmx_cli from api import app from api import utils @@ -25,8 +25,6 @@ def update(): hostname = utils.get_hostname() displayname = utils.get_displayname() config = globals.load() - if config['farming_enabled'] or config['harvesting_enabled']: - config['farmr_device_id'] = farmr_cli.load_device_id() payload = { "hostname": hostname, "blockchain": os.environ['blockchains'], diff --git a/api/views/configs/resources.py b/api/views/configs/resources.py index 893616efc..e7a134260 100644 --- a/api/views/configs/resources.py +++ b/api/views/configs/resources.py @@ -43,6 +43,9 @@ def get(self, type, blockchain): elif type == "plotting_dirs": config = plotman_cli.load_dirs(blockchain) mimetype = "application/json" + elif type == "plotting_schedule": + config = plotman_cli.load_schedule() + mimetype = "application/json" elif type == "tools": config = forktools_cli.load_config(blockchain) else: @@ -70,6 +73,8 @@ def put(self, type, blockchain): chiadog_cli.save_config(self.clean_config(request.data), blockchain) elif type == "plotting": plotman_cli.save_config(self.clean_config(request.data), blockchain) + elif type == "plotting_schedule": + plotman_cli.save_schedule(json.loads(request.data)) elif type == "tools": forktools_cli.save_config(self.clean_config(request.data), blockchain) elif type == "wallet": diff --git a/common/config/blockchains.json b/common/config/blockchains.json index 4201aceb3..87acfb82b 100644 --- a/common/config/blockchains.json +++ b/common/config/blockchains.json @@ -16,6 +16,23 @@ "discord_url": null, "website_url": "https://applecoin.in/" }, + "ballcoin": { + "name": "Ballcoin", + "symbol": "BALL", + "binary": "/ballcoin-blockchain/venv/bin/ball", + "network_path": "/root/.ball/mainnet", + "network_name": "mainnet", + "network_port": 38888, + "farmer_port": 38891, + "fullnode_rpc_port": 38885, + "worker_port": 8957, + "reward": 200, + "mojos_per_coin": 1000000000000, + "blocks_per_day": 4608, + "git_url": "https://github.com/ball-network/ballcoin-blockchain", + "discord_url": null, + "website_url": "https://ballcoin.top/" + }, "bpx": { "name": "BPX", "symbol": "BPX", @@ -220,6 +237,23 @@ "discord_url": null, "website_url": "https://greenbtc.top/" }, + "gigahorse": { + "name": "Gigahorse", + "symbol": "XCH", + "binary": "/chia-gigahorse-farmer/chia.bin", + "network_path": "/root/.chia/mainnet", + "network_name": "mainnet", + "network_port": 28744, + "farmer_port": 28745, + "fullnode_rpc_port": 28855, + "worker_port": 8959, + "reward": 2.0, + "mojos_per_coin": 1000000000000, + "blocks_per_day": 4608, + "git_url": "https://github.com/madMAx43v3r/chia-gigahorse", + "discord_url": null, + "website_url": "https://github.com/madMAx43v3r/chia-gigahorse" + }, "gold": { "name": "Gold", "symbol": "GL", @@ -308,7 +342,7 @@ "mmx": { "name": "MMX", "symbol": "MMX" , - "binary": "/mmx-node/build/mmx", + "binary": "/mmx-node/bin/mmx", "network_path": "/root/.mmx/testnet9", "network_name": "testnet9", "network_port": 12339, @@ -364,7 +398,7 @@ "farmer_port": 11113, "fullnode_rpc_port": 11114, "worker_port": 8956, - "reward": 2.0, + "reward": 10000.0, "mojos_per_coin": 1000000000000, "blocks_per_day": 4608, "git_url": "https://github.com/xone-network/one-blockchain", @@ -388,6 +422,23 @@ "discord_url": "https://discord.gg/7bFQxmtjHx", "website_url": "https://petroleum.farm/" }, + "pipscoin": { + "name": "Pipscoin", + "symbol": "PIPS" , + "binary": "/pipscoin-blockchain/venv/bin/pipscoin", + "network_path": "/root/.pipscoin/mainnet", + "network_name": "mainnet", + "network_port": 7477, + "farmer_port": 16339, + "fullnode_rpc_port": 18868, + "worker_port": 8958, + "reward": 5.0, + "mojos_per_coin": 1000000000000, + "blocks_per_day": 4608, + "git_url": "https://github.com/Pipscoin-Network/pipscoin-blockchain", + "discord_url": "https://discord.gg/T8taazt7Pf", + "website_url": "https://www.pipscoin.net/" + }, "profit": { "name": "Profit", "symbol": "PROFIT" , @@ -507,4 +558,4 @@ "discord_url": null, "website_url": "http://wheat.top/" } -} \ No newline at end of file +} diff --git a/common/config/globals.py b/common/config/globals.py index b8d2fb820..b0f44a46f 100644 --- a/common/config/globals.py +++ b/common/config/globals.py @@ -45,6 +45,11 @@ def get_supported_blockchains(): def get_blockchain_binary(blockchain): return load_blockchain_info(blockchain, 'binary') +def get_blockchain_working_dir(blockchain): + if blockchain == 'gigahorse': + return os.path.dirname(get_blockchain_binary(blockchain)) + return None # Default for other blockchains that are cwd-independent + def get_blockchain_network_path(blockchain): return load_blockchain_info(blockchain, 'network_path') @@ -84,7 +89,6 @@ def load(): cfg['chiadog_version'] = load_chiadog_version() cfg['madmax_version'] = load_madmax_version() cfg['bladebit_version'] = load_bladebit_version() - cfg['farmr_version'] = load_farmr_version() cfg['is_controller'] = "localhost" == ( os.environ['controller_host'] if 'controller_host' in os.environ else 'localhost') fullnode_db_version = load_fullnode_db_version() @@ -377,28 +381,6 @@ def load_bladebit_version(): last_bladebit_version_load_time = datetime.datetime.now() return last_bladebit_version -last_farmr_version = None -last_farmr_version_load_time = None -def load_farmr_version(): - global last_farmr_version - global last_farmr_version_load_time - if last_farmr_version_load_time and last_farmr_version_load_time >= \ - (datetime.datetime.now() - datetime.timedelta(days=RELOAD_MINIMUM_DAYS)): - return last_farmr_version - last_farmr_version = "" - try: - proc = Popen("apt-cache policy farmr | grep -i installed | cut -f 2 -d ':'", - stdout=PIPE, stderr=PIPE, shell=True) - outs, errs = proc.communicate(timeout=90) - last_farmr_version = outs.decode('utf-8').strip() - except TimeoutExpired: - proc.kill() - proc.communicate() - except: - logging.debug(traceback.format_exc()) - last_farmr_version_load_time = datetime.datetime.now() - return last_farmr_version - last_machinaris_version = None last_machinaris_version_load_time = None def load_machinaris_version(): @@ -459,10 +441,12 @@ def get_disks(disk_type): def get_alltheblocks_name(blockchain): if blockchain == 'staicoin': return 'stai' # Special case for staicoin's inconsistent naming convention + elif blockchain == 'gigahorse': + return 'chia' # Special case for gigahorse which is really Chia return blockchain def legacy_blockchain(blockchain): - return blockchain in ['ecostake', 'flora', 'gold', 'hddcoin', 'mint', 'nchain', 'petroleum', 'profit', 'silicoin', 'stor'] + return blockchain in ['ballcoin', 'coffee', 'ecostake', 'flora', 'greenbtc', 'gold', 'hddcoin', 'mint', 'nchain', 'petroleum', 'profit', 'silicoin', 'stor'] last_mmx_reward = None last_mmx_reward_load_time = None diff --git a/common/models/plottings.py b/common/models/plottings.py index 859763767..401821375 100644 --- a/common/models/plottings.py +++ b/common/models/plottings.py @@ -5,7 +5,7 @@ from common.extensions.database import db -PLOTTABLE_BLOCKCHAINS = [ 'chia', 'chives', 'mmx' ] +PLOTTABLE_BLOCKCHAINS = [ 'chia', 'chives', 'gigahorse', 'mmx' ] class Plotting(db.Model): __bind_key__ = 'plottings' @@ -16,6 +16,7 @@ class Plotting(db.Model): plotter = sa.Column(sa.String(length=64), nullable=False) blockchain = sa.Column(sa.String(length=64), nullable=False) k = sa.Column(sa.Integer, nullable=False) + lvl = sa.Column(sa.Integer, nullable=True) tmp = sa.Column(sa.String(length=255), nullable=False) dst = sa.Column(sa.String(length=255), nullable=False) wall = sa.Column(sa.String(length=8), nullable=False) diff --git a/common/models/pools.py b/common/models/pools.py index 5be9ba723..6b98141ca 100644 --- a/common/models/pools.py +++ b/common/models/pools.py @@ -5,7 +5,7 @@ from common.extensions.database import db -POOLABLE_BLOCKCHAINS = [ 'chia', 'chives' ] +POOLABLE_BLOCKCHAINS = [ 'chia', 'chives', 'gigahorse' ] class Pool(db.Model): __bind_key__ = 'pools' diff --git a/config/chiadog/ballcoin.sample.yaml b/config/chiadog/ballcoin.sample.yaml new file mode 100644 index 000000000..048dd7557 --- /dev/null +++ b/config/chiadog/ballcoin.sample.yaml @@ -0,0 +1,91 @@ +# This is useful to differentiate multiple +# instances monitoring multiple harvesters +notification_title_prefix: '$HOSTNAME-ballcoin' +log_level: INFO +coin_name: 'ballcoin' +coin_symbol: 'ball' + +# Only one consumer can be enabled at a time, you can +# delete the section for the consumer which you aren't using +# DON'T CHANGE file_path IT'S ALREADY SET IN-CONTAINER FOR MACHINARIS! +chia_logs: + file_log_consumer: + enable: true + prefix: 'ball' + file_path: '~/.chia/ballcoin/mainnet/log/debug.log' + +# Enable this and chiadog will ping a remote server every 5 minutes +# That way you can know that the monitoring is running as expected +#keep_alive_monitor: +# enable_remote_ping: false +# ping_url: '' + +# Enable this and you'll receive a daily summary notification +# on your farm performance at the specified time of the day. +daily_stats: + enable: true + time_of_day: 21 + +# We support a lot of notifiers, please check the README for more +# information. You can delete the sections which you aren't using. +# You can also enable more than one notifier and send different +# notifications to each of them. E.g. enable daily_stats only to E-mail. +# If you enable wallet_events you'll get notifications anytime your +# wallet receives some XCH (e.g. farming reward). +notifier: + pushover: + enable: false + daily_stats: true + wallet_events: true + credentials: + api_token: 'dummy_token' + user_key: 'dummy_key' + telegram: + enable: false + daily_stats: true + wallet_events: true + credentials: + bot_token: 'dummy_bot_token' + chat_id: 'dummy_chat_id' + smtp: + enable: false + daily_stats: true + wallet_events: true + credentials: + sender: 'ballcoin@example.com' + sender_name: 'Machinaris' + recipient: 'you@example.com' + username_smtp: 'username' + password_smtp: 'password' + host: 'smtp.example.com' + port: 587 + script: + # DON'T CHANGE THIS SCRIPT NOTIFIER, IT'S USED BY MACHINARIS! + enable: true + daily_stats: true + wallet_events: true + script_path: '/root/.chia/chiadog/notifier.sh' + discord: + enable: false + daily_stats: true + wallet_events: true + credentials: + webhook_url: 'https://discord.com/api/webhooks/...' + slack: + enable: false + daily_stats: true + wallet_events: true + credentials: + webhook_url: 'https://hooks.slack.com/services/...' + mqtt: + enable: false + daily_stats: true + wallet_events: true + topic: ballcoin/ballcoindog/alert + qos: 1 + retain: false + credentials: + host: '192.168.0.10' + port: 8883 + username: '' + password: '' diff --git a/config/chiadog/greenbtc.sample.yaml b/config/chiadog/greenbtc.sample.yaml index cf3244ee2..553eab7a7 100644 --- a/config/chiadog/greenbtc.sample.yaml +++ b/config/chiadog/greenbtc.sample.yaml @@ -11,8 +11,8 @@ coin_symbol: 'gbtc' chia_logs: file_log_consumer: enable: true - prefix: 'chia' - file_path: '~/.chia/sit/mainnet/log/debug.log' + prefix: 'greenbtc' + file_path: '~/.chia/greenbtc/mainnet/log/debug.log' # Enable this and chiadog will ping a remote server every 5 minutes # That way you can know that the monitoring is running as expected diff --git a/config/chiadog/pipscoin.sample.yaml b/config/chiadog/pipscoin.sample.yaml new file mode 100644 index 000000000..9bfcb5bd7 --- /dev/null +++ b/config/chiadog/pipscoin.sample.yaml @@ -0,0 +1,91 @@ +# This is useful to differentiate multiple +# instances monitoring multiple harvesters +notification_title_prefix: '$HOSTNAME-pipscoin' +log_level: INFO +coin_name: 'pipscoin' +coin_symbol: 'pips' + +# Only one consumer can be enabled at a time, you can +# delete the section for the consumer which you aren't using +# DON'T CHANGE file_path IT'S ALREADY SET IN-CONTAINER FOR MACHINARIS! +chia_logs: + file_log_consumer: + enable: true + prefix: 'chia' + file_path: '~/.chia/pipscoin/mainnet/log/debug.log' + +# Enable this and chiadog will ping a remote server every 5 minutes +# That way you can know that the monitoring is running as expected +#keep_alive_monitor: +# enable_remote_ping: false +# ping_url: '' + +# Enable this and you'll receive a daily summary notification +# on your farm performance at the specified time of the day. +daily_stats: + enable: true + time_of_day: 21 + +# We support a lot of notifiers, please check the README for more +# information. You can delete the sections which you aren't using. +# You can also enable more than one notifier and send different +# notifications to each of them. E.g. enable daily_stats only to E-mail. +# If you enable wallet_events you'll get notifications anytime your +# wallet receives some XCH (e.g. farming reward). +notifier: + pushover: + enable: false + daily_stats: true + wallet_events: true + credentials: + api_token: 'dummy_token' + user_key: 'dummy_key' + telegram: + enable: false + daily_stats: true + wallet_events: true + credentials: + bot_token: 'dummy_bot_token' + chat_id: 'dummy_chat_id' + smtp: + enable: false + daily_stats: true + wallet_events: true + credentials: + sender: 'pipscoin@example.com' + sender_name: 'Machinaris' + recipient: 'you@example.com' + username_smtp: 'username' + password_smtp: 'password' + host: 'smtp.example.com' + port: 587 + script: + # DON'T CHANGE THIS SCRIPT NOTIFIER, IT'S USED BY MACHINARIS! + enable: true + daily_stats: true + wallet_events: true + script_path: '/root/.chia/chiadog/notifier.sh' + discord: + enable: false + daily_stats: true + wallet_events: true + credentials: + webhook_url: 'https://discord.com/api/webhooks/...' + slack: + enable: false + daily_stats: true + wallet_events: true + credentials: + webhook_url: 'https://hooks.slack.com/services/...' + mqtt: + enable: false + daily_stats: true + wallet_events: true + topic: pipscoin/pipscoindog/alert + qos: 1 + retain: false + credentials: + host: '192.168.0.10' + port: 8883 + username: '' + password: '' diff --git a/config/plotman.sample-chives.yaml b/config/plotman.sample-chives.yaml index d8193b927..f1cd1e757 100644 --- a/config/plotman.sample-chives.yaml +++ b/config/plotman.sample-chives.yaml @@ -102,12 +102,10 @@ plotting: # See 'Settings | Pools' page, for 'Pool contract address' value, UNCOMMENT IF PORTABLE PLOTTING!!! #pool_contract_address: REPLACE_WITH_THE_REAL_VALUE - # If you enable 'chia', plot in *parallel* with higher tmpdir_max_jobs and global_max_jobs - # If you enable 'madmax', plot in *sequence* with very low tmpdir_max_jobs and global_max_jobs type: madmax madmax: - # madMAx plotter: https://github.com/madMAx43v3r/chia-plotter + # Classic Madmax plotter: https://github.com/madMAx43v3r/chia-plotter k: 31 # Default is 32 for Chia, but use 29,30,31 for Chives n_threads: 4 # Default is 4, SLOWLY crank up if you have many cores n_buckets: 256 # Default is 256 diff --git a/config/plotman.sample-gigahorse.yaml b/config/plotman.sample-gigahorse.yaml new file mode 100644 index 000000000..d5dbbb865 --- /dev/null +++ b/config/plotman.sample-gigahorse.yaml @@ -0,0 +1,118 @@ +# Learn more about Plotman at https://github.com/ericaltendorf/plotman +# https://github.com/ericaltendorf/plotman/wiki/Configuration#versions +version: [2] + +logging: + # DO NOT CHANGE THESE IN-CONTAINER PATHS USED BY MACHINARIS! + plots: /root/.chia/plotman/logs + transfers: /root/.chia/plotman/logs/archiving + application: /root/.chia/plotman/logs/plotman.log + +user_interface: + use_stty_size: False + +commands: + interactive: + autostart_plotting: False + autostart_archiving: False + +# Where to plot and log. +directories: + + # One or more directories to use as tmp dirs for plotting. The + # scheduler will use all of them and distribute jobs among them. + # It assumes that IO is independent for each one (i.e., that each + # one is on a different physical device). + # + # If multiple directories share a common prefix, reports will + # abbreviate and show just the uniquely identifying suffix. + # REMEMBER ALL PATHS ARE IN-CONTAINER, THEY MAP TO HOST PATHS + tmp: + - /plotting + + # Optional: tmp2 directory. If specified, will be passed to the madmax plotter as the '-2' param. + # If gpu-plotting, this will enable 128 GB partial RAM mode onto this SSD path + # tmp2: /plotting2 + + # Optional: tmp3 directory. If specified, will be passed to the madmax plotter as the '-3' param. + # If gpu-plotting, this will enable 64 GB partial RAM mode onto this SSD path + # tmp3: /plotting3 + + # One or more directories; the scheduler will use all of them. + # These again are presumed to be on independent physical devices, + # so writes (plot jobs) and reads (archivals) can be scheduled + # to minimize IO contention. + # REMEMBER ALL PATHS ARE IN-CONTAINER, THEY MAP TO HOST PATHS + dst: + - /plots1 + +# See: https://github.com/guydavis/machinaris/wiki/Plotman#archiving +#archiving: + #target: rsyncd + #env: + #site_root: /mnt/disks + #user: root + #host: aragorn + #rsync_port: 12000 + #site: disks + +# Plotting scheduling parameters +scheduling: + # Run a job on a particular temp dir only if the number of existing jobs + # before tmpdir_stagger_phase_major tmpdir_stagger_phase_minor + # is less than tmpdir_stagger_phase_limit. + # Phase major corresponds to the plot phase, phase minor corresponds to + # the table or table pair in sequence, phase limit corresponds to + # the number of plots allowed before [phase major, phase minor] + # Five is the final move stage of madmax + tmpdir_stagger_phase_major: 5 + tmpdir_stagger_phase_minor: 0 + # Optional: default is 1 + tmpdir_stagger_phase_limit: 1 + + # Don't run more than this many jobs at a time on a single temp dir. + # Increase for staggered plotting by chia, leave at 2 for madmax sequential plotting + tmpdir_max_jobs: 2 + + # Don't run more than this many jobs at a time in total. + # Increase for staggered plotting by chia, leave at 2 for madmax sequential plotting + global_max_jobs: 2 + + # Don't run any jobs (across all temp dirs) more often than this, in minutes. + global_stagger_m: 30 + + # How often the daemon wakes to consider starting a new plot job, in seconds. + polling_time_s: 20 + + # Optional: Allows overriding some characteristics of certain tmp + # directories. This contains a map of tmp directory names to + # attributes. If a tmp directory and attribute is not listed here, + # it uses the default attribute setting from the main configuration. + # + # Currently support override parameters: + # - tmpdir_max_jobs + #tmp_overrides: + # In this example, /plotting3 is larger than the other tmp + # dirs and it can hold more plots than the default. + #/plotting3: + # tmpdir_max_jobs: 5 + +# Configure the plotter. See: https://github.com/guydavis/machinaris/wiki/Chives#plotting-page +plotting: + # See Keys page, for 'Farmer public key' value + farmer_pk: REPLACE_WITH_THE_REAL_VALUE + # See Keys page, for 'Pool public key' value + pool_pk: REPLACE_WITH_THE_REAL_VALUE + + type: madmax + + madmax: + # Gigahorse plotter: https://github.com/guydavis/machinaris/wiki/MadMax + k: 30 # The minimum K size for mainnet will probably be k30 + mode: diskplot # Either enable diskplot or gpuplot. + n_threads: 4 # Default is 4, SLOWLY crank up if you have many cores + n_buckets: 256 # Default is 256 + n_buckets3: 256 # Default is 256 + n_rmulti2: 1 # Default is 1 + network_port: 11337 # Use 11337 + compression: 1 # Compression level (default = 1, min = 1, max = 9) diff --git a/config/plotman.sample-mmx.yaml b/config/plotman.sample-mmx.yaml index 34de53937..b7b637147 100644 --- a/config/plotman.sample-mmx.yaml +++ b/config/plotman.sample-mmx.yaml @@ -30,10 +30,14 @@ directories: tmp: - /plotting - # Optional: tmp2 directory. If specified, will be passed to - # the chia and madmax plotters as the '-2' param. + # Optional: tmp2 directory. If specified, will be passed to the madmax plotter as the '-2' param. + # If gpu-plotting, this will enable 128 GB partial RAM mode onto this SSD path # tmp2: /plotting2 + # Optional: tmp3 directory. If specified, will be passed to the madmax plotter as the '-3' param. + # If gpu-plotting, this will enable 64 GB partial RAM mode onto this SSD path + # tmp3: /plotting3 + # One or more directories; the scheduler will use all of them. # These again are presumed to be on independent physical devices, # so writes (plot jobs) and reads (archivals) can be scheduled @@ -103,10 +107,12 @@ plotting: type: madmax madmax: - # madMAx plotter: https://github.com/madMAx43v3r/chia-plotter - k: 30 # The minimum K size for mainnet will probably be k30 + # Madmax plotter: https://github.com/guydavis/machinaris/wiki/MadMax + k: 32 # The minimum K size for mainnet will probably be k30 + mode: diskplot # Either enable diskplot or gpuplot. n_threads: 4 # Default is 4, SLOWLY crank up if you have many cores n_buckets: 256 # Default is 256 n_buckets3: 256 # Default is 256 n_rmulti2: 1 # Default is 1 - network_port: 11337 # Use 11337 + network_port: 11337 # Use 11337 + compression: 1 # Compression level (default = 1, min = 1, max = 9) diff --git a/config/plotman.sample.yaml b/config/plotman.sample.yaml index c1e173eef..c016fb9e4 100644 --- a/config/plotman.sample.yaml +++ b/config/plotman.sample.yaml @@ -99,31 +99,23 @@ plotting: # See 'Settings | Pools' page, for 'Pool contract address' value, UNCOMMENT IF PORTABLE PLOTTING!!! #pool_contract_address: REPLACE_WITH_THE_REAL_VALUE - # If you enable 'chia', plot in *parallel* with higher tmpdir_max_jobs and global_max_jobs - # If you enable 'bladebit or 'madmax', plot in *sequence* with very low tmpdir_max_jobs and global_max_jobs type: bladebit bladebit: # BladeBit plotter; see https://github.com/guydavis/machinaris/wiki/Bladebit threads: 2 # Threads per job no_numa: true # Whether to disable NUMA memory support or not - diskplot: true # Whether to plot to tmp1 (and tmp2) disks or only RAM (false) + mode: diskplot # Either enable ramplot, diskplot, or gpuplot. diskplot_cache: 4GB # If diskplot, amount of RAM to allocate to caching disk writes diskplot_buckets: 256 # Optionally set a different number of buckets to use for diskplot + compression: 1 # Compression level (default = 1, min = 1, max = 9) madmax: - # madMAx plotter; see https://github.com/guydavis/machinaris/wiki/MadMax + # Classic Madmax plotter; see https://github.com/guydavis/machinaris/wiki/MadMax k: 32 # Default is 32 for Chia, but can do 33 or 34. Use 29,30,31 for Chives n_threads: 4 # Default is 4, SLOWLY crank up if you have many cores n_buckets: 256 # Default is 256 n_buckets3: 256 # Default is 256 n_rmulti2: 1 # Default is 1 network_port: 8444 # Default is 8444, but use 9699 for Chives - - chia: - # The stock plotter; see https://github.com/guydavis/machinaris/wiki/Chia#plotting - k: 32 # k-size of plot, leave at 32 most of the time - e: False # Disable bitfield back sorting (default is True) - n_threads: 2 # Threads per job - n_buckets: 128 # Number of buckets to split data into - job_buffer: 3389 # Per job memory + diff --git a/docker/dockerfile b/docker/dockerfile index 20857515d..cb60007d0 100644 --- a/docker/dockerfile +++ b/docker/dockerfile @@ -9,13 +9,16 @@ ARG CHIADOG_BRANCH=main ARG FDCLI_BRANCH=master ARG FORKTOOLS_BRANCH=main ARG BLADEBIT_BRANCH=master +ARG MADMAX_BRANCH=master ARG APPLE_BRANCH +ARG BALLCOIN_BRANCH ARG BPX_BRANCH ARG BTCGREEN_BRANCH ARG CACTUS_BRANCH ARG CHIA_BRANCH ARG CHINILLA_BRANCH +ARG CHIVES_REPO ARG CHIVES_BRANCH ARG COFFEE_BRANCH ARG CRYPTODOGE_BRANCH @@ -23,6 +26,7 @@ ARG ECOSTAKE_BRANCH ARG FLAX_BRANCH ARG FLORA_BRANCH ARG GREENBTC_BRANCH +ARG GIGAHORSE_BRANCH ARG GOLD_BRANCH ARG HDDCOIN_BRANCH ARG LITTLELAMBOCOIN_BRANCH @@ -33,6 +37,7 @@ ARG MOON_BRANCH ARG NCHAIN_BRANCH ARG ONE_BRANCH ARG PETROLEUM_BRANCH +ARG PIPSCOIN_BRANCH ARG PROFIT_BRANCH ARG SHIBGREEN_BRANCH ARG SILICOIN_BRANCH @@ -50,11 +55,12 @@ WORKDIR /chia-blockchain # Install specific blockchain fork (based on branch enabled) + tools that depend on the fork RUN \ /usr/bin/bash /machinaris/scripts/forks/apple_install.sh ${APPLE_BRANCH} \ + && /usr/bin/bash /machinaris/scripts/forks/ballcoin_install.sh ${BALLCOIN_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/bpx_install.sh ${BPX_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/btcgreen_install.sh ${BTCGREEN_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/cactus_install.sh ${CACTUS_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/chia_install.sh ${CHIA_BRANCH} \ - && /usr/bin/bash /machinaris/scripts/forks/chives_install.sh ${CHIVES_BRANCH} \ + && /usr/bin/bash /machinaris/scripts/forks/chives_install.sh ${CHIVES_REPO} ${CHIVES_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/chinilla_install.sh ${CHINILLA_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/coffee_install.sh ${COFFEE_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/cryptodoge_install.sh ${CRYPTODOGE_BRANCH} \ @@ -62,6 +68,7 @@ RUN \ && /usr/bin/bash /machinaris/scripts/forks/flax_install.sh ${FLAX_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/flora_install.sh ${FLORA_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/greenbtc_install.sh ${GREENBTC_BRANCH} \ + && /usr/bin/bash /machinaris/scripts/forks/gigahorse_install.sh ${GIGAHORSE_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/gold_install.sh ${GOLD_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/hddcoin_install.sh ${HDDCOIN_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/littlelambocoin_install.sh ${LITTLELAMBOCOIN_BRANCH} \ @@ -72,6 +79,7 @@ RUN \ && /usr/bin/bash /machinaris/scripts/forks/nchain_install.sh ${NCHAIN_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/one_install.sh ${ONE_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/petroleum_install.sh ${PETROLEUM_BRANCH} \ + && /usr/bin/bash /machinaris/scripts/forks/pipscoin_install.sh ${PIPSCOIN_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/profit_install.sh ${PROFIT_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/shibgreen_install.sh ${SHIBGREEN_BRANCH} \ && /usr/bin/bash /machinaris/scripts/forks/silicoin_install.sh ${SILICOIN_BRANCH} \ @@ -89,11 +97,12 @@ RUN \ /var/tmp/* # Provide a colon-separated list of in-container paths to your mnemonic keys -ENV keys="/root/.chia/mnemonic.txt" +ENV keys="/root/.chia/mnemonic.txt" # Provide a colon-separated list of in-container paths to your completed plots ENV plots_dir="/plots" # One of fullnode, farmer, harvester, plotter, farmer+plotter, harvester+plotter. Default is fullnode -ENV mode="fullnode" +ENV mode="fullnode" +ENV chives_masternode="false" # The single blockchain to run: chia, flax, nchain, hddcoin, chives, etc ENV blockchains="chia" # If provided then these optional 3 public keys will be set in your plotman.yaml @@ -121,12 +130,11 @@ ENV FORKTOOLSDIR=/forktools ENV FORKTOOLSBLOCKCHAINDIRS=/ ENV FORKTOOLSHIDDENDIRS=/root -ENV PATH="${PATH}:/chia-blockchain/venv/bin:/forktools:/mmx-node/build" +ENV PATH="${PATH}:/chia-blockchain/venv/bin:/forktools:/mmx-node/bin" ENV TZ=Etc/UTC ENV LC_ALL en_US.UTF-8 ENV LANG en_US.UTF-8 ENV LANGUAGE en_US.UTF-8 -ENV FLASK_ENV=production ENV XDG_CONFIG_HOME=/root/.chia ENV AUTO_PLOT=false ENV PLOTMAN_BRANCH=${PLOTMAN_BRANCH} @@ -134,6 +142,7 @@ ENV CHIADOG_BRANCH=${CHIADOG_BRANCH} ENV FDCLI_BRANCH=${FDCLI_BRANCH} ENV FORKTOOLS_BRANCH=${FORKTOOLS_BRANCH} ENV BLADEBIT_BRANCH=${BLADEBIT_BRANCH} +ENV MADMAX_BRANCH=${MADMAX_BRANCH} ENV MMX_HOME=/root/.mmx/ VOLUME [ "/id_rsa" ] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 23abd60bf..47d6587e8 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -96,9 +96,6 @@ if /usr/bin/bash /machinaris/scripts/forks/${blockchains}_launch.sh; then # During concurrent startup of multiple fork containers, stagger less important setups sleep $[ ( $RANDOM % 180 ) + 1 ]s - # Conditionally install farmr on harvesters and fullnodes - /usr/bin/bash /machinaris/scripts/farmr_setup.sh > /tmp/farmr_setup.log 2>&1 - # Conditionally install fd-cli on fullnodes, excluding Chia and Chives /usr/bin/bash /machinaris/scripts/fd-cli_setup.sh ${FDCLI_BRANCH} > /tmp/fd-cli_setup.log 2>&1 @@ -106,7 +103,7 @@ if /usr/bin/bash /machinaris/scripts/forks/${blockchains}_launch.sh; then /usr/bin/bash /machinaris/scripts/bladebit_setup.sh ${BLADEBIT_BRANCH} > /tmp/bladebit_setup.log 2>&1 # Conditionally madmax on plotters and fullnodes, sleep a bit first - /usr/bin/bash /machinaris/scripts/madmax_setup.sh > /tmp/madmax_setup.log 2>&1 + /usr/bin/bash /machinaris/scripts/madmax_setup.sh ${MADMAX_BRANCH} > /tmp/madmax_setup.log 2>&1 # Conditionally install plotman on plotters and fullnodes, after the plotters setup /usr/bin/bash /machinaris/scripts/plotman_autoplot.sh > /tmp/plotman_autoplot.log 2>&1 diff --git a/docker/requirements.txt b/docker/requirements.txt index b090303fe..9c54bba17 100644 --- a/docker/requirements.txt +++ b/docker/requirements.txt @@ -1,6 +1,6 @@ -apscheduler==3.8.0 -click==7.1.2 -jinja2==3.0.3 +apscheduler +click +jinja2 flask flask-smorest python-dotenv diff --git a/scripts/bladebit_setup.sh b/scripts/bladebit_setup.sh index c412f3fb3..ea8a32070 100644 --- a/scripts/bladebit_setup.sh +++ b/scripts/bladebit_setup.sh @@ -1,6 +1,6 @@ #!/bin/env bash # -# Installs bladebit - A fast RAM-only (or disk cached), k32-only, Chia plotter. +# Installs bladebit - A fast Chia plotter, offering disk, ram, and gpu modes. # See https://github.com/Chia-Network/bladebit # # Can't acutally build on Github servers, must build on each target system diff --git a/scripts/chiadog_notifier.sh b/scripts/chiadog_notifier.sh index d47d8b28e..be59b4dbc 100644 --- a/scripts/chiadog_notifier.sh +++ b/scripts/chiadog_notifier.sh @@ -10,8 +10,7 @@ hostname="$(hostname -s)" now="$(date +'%Y-%m-%d %H:%M:%S.%3N')" unique_id="${hostname}_${blockchains}_${now}" echo "${now} ${hostname} ${event_service_name} ${event_priority_name}: ${event_message}" - -now_secs_only=$(echo "${now}" | sed 's/...$//') +now_secs_only=${now::-4} cd /root/.chia/machinaris/dbs sqlite3 -cmd '.timeout 5000' alerts.db < unsupported architecture: ${arch_name}" - fi - fi - - # Only the /root/.chia folder is volume-mounted so store farmr within - mkdir -p /root/.chia/farmr - rm -f /root/.farmr - ln -s /root/.chia/farmr /root/.farmr - - cd /root/.farmr - - if [[ ! -d ./blockchain ]]; then # Never run before, will create default configs - nohup farmr 2>&1 >/dev/null & - sleep 30 - kill $(pidof farmr) - fi - - if [[ ${blockchains} != "chia" ]] && [[ -f blockchain/xch.json ]]; then - mv -f blockchain/xch.json blockchain/xch.json.template - fi - - if [[ ${blockchains} == 'btcgreen' ]]; then - cp -n blockchain/xbtc.json.template blockchain/xbtc.json - echo "/btcgreen-blockchain/venv/bin/btcgreen" > override-xbtc-binary.txt - elif [[ ${blockchains} == 'cactus' ]]; then - cp -n blockchain/cac.json.template blockchain/cac.json - echo "/cactus-blockchain/venv/bin/cactus" > override-cac-binary.txt - elif [[ ${blockchains} == 'chia' ]]; then - echo "/chia-blockchain/venv/bin/chia" > override-xch-binary.txt - elif [[ ${blockchains} == 'chives' ]]; then - cp -n blockchain/xcc.json.template blockchain/xcc.json - echo "/chives-blockchain/venv/bin/chives" > override-xcc-binary.txt - elif [[ ${blockchains} == 'cryptodoge' ]]; then - cp -n blockchain/xcd.json.template blockchain/xcd.json - echo "/cryptodoge-blockchain/venv/bin/cryptodoge" > override-xcd-binary.txt - elif [[ ${blockchains} == 'flax' ]]; then - cp -n blockchain/xfx.json.template blockchain/xfx.json - echo "/flax-blockchain/venv/bin/flax" > override-xfx-binary.txt - elif [[ ${blockchains} == 'flora' ]]; then - cp -n blockchain/xfl.json.template blockchain/xfl.json - echo "/flora-blockchain/venv/bin/flora" > override-xfl-binary.txt - elif [[ ${blockchains} == 'hddcoin' ]]; then - cp -n blockchain/hdd.json.template blockchain/hdd.json - echo "/hddcoin-blockchain/venv/bin/hddcoin" > override-hdd-binary.txt - elif [[ ${blockchains} == 'maize' ]]; then - cp -n blockchain/xmz.json.template blockchain/xmz.json - echo "/maize-blockchain/venv/bin/maize" > override-xmz-binary.txt - elif [[ ${blockchains} == 'nchain' ]]; then - cp -n blockchain/nch.json.template blockchain/nch.json - echo "/chia-blockchain/venv/bin/chia" > override-nch-binary.txt - elif [[ ${blockchains} == 'silicoin' ]]; then - sed -i 's/11560/22560/g' blockchain/sit.json.template - sed -i 's/11559/22559/g' blockchain/sit.json.template - sed -i 's/11555/22555/g' blockchain/sit.json.template - sed -i 's/11256/22256/g' blockchain/sit.json.template - sed -i 's/56402/22402/g' blockchain/sit.json.template - cp -n blockchain/sit.json.template blockchain/sit.json - echo "/silicoin-blockchain/venv/bin/sit" > override-sit-binary.txt - elif [[ ${blockchains} == 'staicoin' ]]; then - cp -n blockchain/stai.json.template blockchain/stai.json - echo "/staicoin-blockchain/venv/bin/staicoin" > override-stai-binary.txt - elif [[ ${blockchains} == 'stor' ]]; then - cp -n blockchain/stor.json.template blockchain/stor.json - echo "/stor-blockchain/venv/bin/stor" > override-stor-binary.txt - else - echo "Oops! Looks like farmr does not support ${blockchains}. Please look in /root/.chia/farmr/blockchains..." - fi - - tee /etc/logrotate.d/farmr >/dev/null <&1 ) & - elif [[ ${mode} == 'farmer' ]] || [[ ${mode} == 'fullnode' ]]; then - echo "After a pause, about to start Farmr in farmer mode..." - (sleep 180 && nohup /usr/bin/farmr farmer headless 2>&1 ) & - fi -fi diff --git a/scripts/fd-cli_setup.sh b/scripts/fd-cli_setup.sh index ea25d1aa1..8713e9e31 100644 --- a/scripts/fd-cli_setup.sh +++ b/scripts/fd-cli_setup.sh @@ -8,7 +8,7 @@ FDCLI_BRANCH=$1 if [[ ${mode} == 'fullnode' ]]; then - if [[ "${blockchains}" != 'chia' ]] && [[ "${blockchains}" != 'chives' ]] && [[ "${blockchains}" != 'mmx' ]]; then + if [[ "${blockchains}" != 'chia' ]] && [[ "${blockchains}" != 'chives' ]] && [[ "${blockchains}" != 'mmx' ]] && [[ "${blockchains}" != 'gigahorse' ]]; then cd / git clone --branch ${FDCLI_BRANCH} https://github.com/guydavis/flora-dev-cli.git cd flora-dev-cli diff --git a/scripts/forks/apple_install.sh b/scripts/forks/apple_install.sh index 48eb6449d..1625bca84 100644 --- a/scripts/forks/apple_install.sh +++ b/scripts/forks/apple_install.sh @@ -8,24 +8,24 @@ APPLE_BRANCH=$1 HASH=c4884b2774d1cf4a9ff8816ecd7b4e6676335c2c if [ -z ${APPLE_BRANCH} ]; then - echo 'Skipping Apple install as not requested.' + echo 'Skipping Apple install as not requested.' else - rm -rf /root/.cache - git clone --branch ${APPLE_BRANCH} --single-branch https://github.com/Apple-Network/apple-blockchain.git /apple-blockchain - cd /apple-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 + rm -rf /root/.cache + git clone --branch ${APPLE_BRANCH} --single-branch https://github.com/Apple-Network/apple-blockchain.git /apple-blockchain + cd /apple-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 sed -e 's/^ self.log.debug($/ self.log.info(/g' apple/wallet/wallet_state_manager.py - /usr/bin/sh ./install.sh + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /apple-blockchain /chia-blockchain - ln -s /apple-blockchain/venv/bin/apple /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /apple-blockchain /chia-blockchain + ln -s /apple-blockchain/venv/bin/apple /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/ballcoin_install.sh b/scripts/forks/ballcoin_install.sh new file mode 100644 index 000000000..211ff4060 --- /dev/null +++ b/scripts/forks/ballcoin_install.sh @@ -0,0 +1,28 @@ +#!/bin/env bash +# +# Installs Ballcoin as per https://github.com/ball-network/ballcoin-blockchain +# + +BALLCOIN_BRANCH=$1 +# On 2023-01-16 +HASH=1c60346a5f75e9a489a5904db521336fd9d2d769 + +if [ -z ${BALLCOIN_BRANCH} ]; then + echo 'Skipping Ballcoin install as not requested.' +else + rm -rf /root/.cache + git clone --branch ${BALLCOIN_BRANCH} --single-branch https://github.com/ball-network/ballcoin-blockchain.git /ballcoin-blockchain + cd /ballcoin-blockchain + git submodule update --init mozilla-ca + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh + + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /ballcoin-blockchain /chia-blockchain + ln -s /ballcoin-blockchain/venv/bin/ballcoin /chia-blockchain/venv/bin/chia + fi +fi diff --git a/scripts/forks/ballcoin_launch.sh b/scripts/forks/ballcoin_launch.sh new file mode 100644 index 000000000..a9b139612 --- /dev/null +++ b/scripts/forks/ballcoin_launch.sh @@ -0,0 +1,109 @@ +#!/bin/env bash +# +# Initialize Ballcoin service, depending on mode of system requested +# + +cd /ballcoin-blockchain + +. ./activate + +# Only the /root/.chia folder is volume-mounted so store ballcoin within +mkdir -p /root/.chia/ballcoin +rm -f /root/.ballcoin +ln -s /root/.chia/ballcoin /root/.ballcoin +rm -f /root/.ball +ln -s /root/.chia/ballcoin /root/.ball + +if [[ "${blockchain_db_download}" == 'true' ]] \ + && [[ "${mode}" == 'fullnode' ]] \ + && [[ ! -f /root/.ball/mainnet/db/blockchain_v1_mainnet.sqlite ]] \ + && [[ ! -f /root/.ball/mainnet/db/blockchain_v2_mainnet.sqlite ]]; then + echo "Sorry, Ballcoin does not offer a recent blockchain DB for download. Standard sync will happen over a few weeks." + echo "It is recommended to add some peer node connections on the Connections page of Machinaris." +fi + +mkdir -p /root/.ball/mainnet/log +ball init >> /root/.ball/mainnet/log/init.log 2>&1 + +echo 'Configuring Ballcoin...' +if [ -f /root/.ball/mainnet/config/config.yaml ]; then + sed -i 's/log_stdout: true/log_stdout: false/g' /root/.ball/mainnet/config/config.yaml + sed -i 's/log_level: WARNING/log_level: INFO/g' /root/.ball/mainnet/config/config.yaml + sed -i 's/localhost/127.0.0.1/g' /root/.ball/mainnet/config/config.yaml +fi + +# Loop over provided list of key paths +for k in ${keys//:/ }; do + if [[ "${k}" == "persistent" ]]; then + echo "Not touching key directories." + elif [ -s ${k} ]; then + echo "Adding key at path: ${k}" + ball keys add -f ${k} > /dev/null + fi +done + +# Loop over provided list of completed plot directories +IFS=':' read -r -a array <<< "$plots_dir" +joined=$(printf ", %s" "${array[@]}") +echo "Adding plot directories at: ${joined:1}" +for p in ${plots_dir//:/ }; do + ball plots add -d ${p} +done + +chmod 755 -R /root/.ball/mainnet/config/ssl/ &> /dev/null +ball init --fix-ssl-permissions > /dev/null + +# Start services based on mode selected. Default is 'fullnode' +if [[ ${mode} == 'fullnode' ]]; then + for k in ${keys//:/ }; do + while [[ "${k}" != "persistent" ]] && [[ ! -s ${k} ]]; do + echo 'Waiting for key to be created/imported into mnemonic.txt. See: http://localhost:8926' + sleep 10 # Wait 10 seconds before checking for mnemonic.txt presence + if [ -s ${k} ]; then + ball keys add -f ${k} + sleep 10 + fi + done + done + if [ -f /root/.chia/machinaris/config/wallet_settings.json ]; then + ball start farmer-no-wallet + else + ball start farmer + fi +elif [[ ${mode} =~ ^farmer.* ]]; then + if [ ! -f ~/.ball/mainnet/config/ssl/wallet/public_wallet.key ]; then + echo "No wallet key found, so not starting farming services. Please add your Chia mnemonic.txt to the ~/.machinaris/ folder and restart." + else + ball start farmer-only + fi +elif [[ ${mode} =~ ^harvester.* ]]; then + if [[ -z ${farmer_address} || -z ${farmer_port} ]]; then + echo "A farmer peer address and port are required." + exit + else + if [ ! -f /root/.ball/farmer_ca/private_ca.crt ]; then + mkdir -p /root/.ball/farmer_ca + response=$(curl --write-out '%{http_code}' --silent http://${farmer_address}:8957/certificates/?type=ballcoin --output /tmp/certs.zip) + if [ $response == '200' ]; then + unzip /tmp/certs.zip -d /root/.ball/farmer_ca + else + echo "Certificates response of ${response} from http://${farmer_address}:8957/certificates/?type=ballcoin. Is the fork's fullnode container running?" + fi + rm -f /tmp/certs.zip + fi + if [[ -f /root/.ball/farmer_ca/private_ca.crt ]] && [[ ! ${keys} == "persistent" ]]; then + ball init -c /root/.ball/farmer_ca 2>&1 > /root/.ball/mainnet/log/init.log + chmod 755 -R /root/.ball/mainnet/config/ssl/ &> /dev/null + ball init --fix-ssl-permissions > /dev/null + else + echo "Did not find your farmer's certificates within /root/.ball/farmer_ca." + echo "See: https://github.com/guydavis/machinaris/wiki/Workers#harvester" + fi + echo "Configuring farmer peer at ${farmer_address}:${farmer_port}" + ball configure --set-farmer-peer ${farmer_address}:${farmer_port} + ball configure --enable-upnp false + ball start harvester -r + fi +elif [[ ${mode} == 'plotter' ]]; then + echo "Starting in Plotter-only mode. Run Plotman from either CLI or WebUI." +fi diff --git a/scripts/forks/bpx_install.sh b/scripts/forks/bpx_install.sh index 460017ec1..d62b194c3 100644 --- a/scripts/forks/bpx_install.sh +++ b/scripts/forks/bpx_install.sh @@ -8,24 +8,24 @@ BPX_BRANCH=$1 HASH=9c96494c576e112e093d5c7fbab0db531b12bbf8 if [ -z ${BPX_BRANCH} ]; then - echo 'Skipping BPX install as not requested.' + echo 'Skipping BPX install as not requested.' else - rm -rf /root/.cache - git clone --branch ${BPX_BRANCH} --single-branch https://github.com/bpx-network/bpx-blockchain.git /bpx-blockchain - cd /bpx-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${BPX_BRANCH} --single-branch https://github.com/bpx-network/bpx-blockchain.git /bpx-blockchain + cd /bpx-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /bpx-blockchain /chia-blockchain - ln -s /bpx-blockchain/venv/bin/bpx /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /bpx-blockchain /chia-blockchain + ln -s /bpx-blockchain/venv/bin/bpx /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/btcgreen_install.sh b/scripts/forks/btcgreen_install.sh index 9918fb44d..f7528c48e 100644 --- a/scripts/forks/btcgreen_install.sh +++ b/scripts/forks/btcgreen_install.sh @@ -4,8 +4,8 @@ # BTCGREEN_BRANCH=$1 -# On 2022-08-20 -HASH=6599c84c1e91b90e91389caa37643b9586af589e +# On 2023-01-16 +HASH=5a719f85694c01cc3b56dfaba3f8f8b1c99aa681 if [ -z ${BTCGREEN_BRANCH} ]; then echo 'Skipping BTCGreen install as not requested.' diff --git a/scripts/forks/btcgreen_launch.sh b/scripts/forks/btcgreen_launch.sh index 7bfc0623f..c237878b4 100644 --- a/scripts/forks/btcgreen_launch.sh +++ b/scripts/forks/btcgreen_launch.sh @@ -34,12 +34,14 @@ if [ -f /root/.btcgreen/mainnet/config/config.yaml ]; then fi # Loop over provided list of key paths +label_num=0 for k in ${keys//:/ }; do if [[ "${k}" == "persistent" ]]; then echo "Not touching key directories." elif [ -s ${k} ]; then - echo "Adding key at path: ${k}" - btcgreen keys add -f ${k} > /dev/null + echo "Adding key #${label_num} at path: ${k}" + btcgreen keys add -l "key_${label_num}" -f ${k} > /dev/null + ((label_num=label_num+1)) fi done diff --git a/scripts/forks/cactus_install.sh b/scripts/forks/cactus_install.sh index 0216d34a7..70095e310 100644 --- a/scripts/forks/cactus_install.sh +++ b/scripts/forks/cactus_install.sh @@ -4,27 +4,27 @@ # CACTUS_BRANCH=$1 -# On 2022-12-08 -HASH=5789962eba648c5532f1f54fc12057862b7be009 +# On 2023-01-24 +HASH=96dcdf36a214fea2236e88bd5fb251c81da46897 if [ -z ${CACTUS_BRANCH} ]; then - echo 'Skipping Cactus install as not requested.' + echo 'Skipping Cactus install as not requested.' else - git clone --branch ${CACTUS_BRANCH} --recurse-submodules https://github.com/Cactus-Network/cactus-blockchain.git /cactus-blockchain - cd /cactus-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 + git clone --branch ${CACTUS_BRANCH} --recurse-submodules https://github.com/Cactus-Network/cactus-blockchain.git /cactus-blockchain + cd /cactus-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 sed -e 's/^ self.log.debug($/ self.log.info(/g' cactus/wallet/wallet_state_manager.py - /usr/bin/sh ./install.sh + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /cactus-blockchain /chia-blockchain - ln -s /cactus-blockchain/venv/bin/cactus /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /cactus-blockchain /chia-blockchain + ln -s /cactus-blockchain/venv/bin/cactus /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/chia_install.sh b/scripts/forks/chia_install.sh index 46b3eb278..0e9085730 100644 --- a/scripts/forks/chia_install.sh +++ b/scripts/forks/chia_install.sh @@ -8,6 +8,15 @@ CHIA_BRANCH=$1 if [ -z ${CHIA_BRANCH} ]; then echo 'Skipping Chia install as not requested.' else + cd /tmp + rm -rf /root/.cache + apt-get update && apt-get install -y dialog apt-utils + # Install dependencies for GPU support + apt-get install -y git cmake build-essential ocl-icd-opencl-dev clinfo screen initramfs-tools ocl-icd-libopencl1 opencl-headers libnuma1 + # For AMDGPU, install the amdgpu-install stub, optionally invoked later if OPENCL_GPU=amd at launch time + curl -O http://repo.radeon.com/amdgpu-install/22.20.5/ubuntu/jammy/amdgpu-install_22.20.50205-1_all.deb + apt-get install -y ./amdgpu-install_22.20.50205-1_all.deb + git clone --branch ${CHIA_BRANCH} --recurse-submodules=mozilla-ca https://github.com/Chia-Network/chia-blockchain.git /chia-blockchain cd /chia-blockchain diff --git a/scripts/forks/chia_launch.sh b/scripts/forks/chia_launch.sh index 0fbf45167..ccfc17580 100644 --- a/scripts/forks/chia_launch.sh +++ b/scripts/forks/chia_launch.sh @@ -85,6 +85,24 @@ done chmod 755 -R /root/.chia/mainnet/config/ssl/ &> /dev/null chia init --fix-ssl-permissions > /dev/null +# Support for GPUs used when plotting/farming +if [[ ${OPENCL_GPU} == 'nvidia' ]]; then + mkdir -p /etc/OpenCL/vendors + echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd + echo "Enabling Nvidia GPU support inside this container." +elif [[ ${OPENCL_GPU} == 'amd' ]]; then + pushd /tmp > /dev/null + echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + apt-get update 2>&1 > /tmp/amdgpu_setup.log + amdgpu-install -y --usecase=opencl --opencl=rocr --no-dkms --no-32 --accept-eula 2>&1 >> /tmp/amdgpu_setup.log + popd > /dev/null + echo "Enabling AMD GPU support inside this container." +elif [[ ${OPENCL_GPU} == 'intel' ]]; then + echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + apt-get update 2>&1 > /tmp/intelgpu_setup.log + apt-get install -y intel-opencl-icd 2>&1 >> /tmp/intelgpu_setup.log + echo "Enabling Intel GPU support inside this container." +fi # Start services based on mode selected. Default is 'fullnode' if [[ ${mode} == 'fullnode' ]]; then diff --git a/scripts/forks/chinilla_install.sh b/scripts/forks/chinilla_install.sh index 7632f1276..4297eed50 100644 --- a/scripts/forks/chinilla_install.sh +++ b/scripts/forks/chinilla_install.sh @@ -4,28 +4,28 @@ # CHINILLA_BRANCH=$1 -# On 2022-12-19 -HASH=f664e8279f45f5a76a6d67c281c5a1a2740a1931 +# On 2023-01-05 +HASH=de8119eb8e1cc13418e7df30eb7d73aae900c40a if [ -z ${CHINILLA_BRANCH} ]; then - echo 'Skipping Chinilla install as not requested.' + echo 'Skipping Chinilla install as not requested.' else - rm -rf /root/.cache - git clone --branch ${CHINILLA_BRANCH} --single-branch https://github.com/Chinilla/chinilla-blockchain.git /chinilla-blockchain - cd /chinilla-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 + rm -rf /root/.cache + git clone --branch ${CHINILLA_BRANCH} --single-branch https://github.com/Chinilla/chinilla-blockchain.git /chinilla-blockchain + cd /chinilla-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 sed -e 's/^ self.log.debug($/ self.log.info(/g' chinilla/wallet/wallet_state_manager.py - /usr/bin/sh ./install.sh + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /chinilla-blockchain /chia-blockchain - ln -s /chinilla-blockchain/venv/bin/chinilla /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /chinilla-blockchain /chia-blockchain + ln -s /chinilla-blockchain/venv/bin/chinilla /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/chives_install.sh b/scripts/forks/chives_install.sh index 78b1288b0..76d36c9ed 100644 --- a/scripts/forks/chives_install.sh +++ b/scripts/forks/chives_install.sh @@ -1,24 +1,26 @@ #!/bin/env bash # # Installs Chives as per https://github.com/HiveProject2021/chives-blockchain +# Alternatively, also supports the Foxy port: https://github.com/foxypool/chives-blockchain # -CHIVES_BRANCH=$1 +CHIVES_REPO=$1 +CHIVES_BRANCH=$2 if [ -z ${CHIVES_BRANCH} ]; then - echo 'Skipping Chives install as not requested.' + echo 'Skipping Chives install as not requested.' else - git clone --branch ${CHIVES_BRANCH} --recurse-submodules https://github.com/HiveProject2021/chives-blockchain.git /chives-blockchain - cd /chives-blockchain - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + git clone --branch ${CHIVES_BRANCH} --recurse-submodules ${CHIVES_REPO} /chives-blockchain + cd /chives-blockchain + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /chives-blockchain /chia-blockchain - ln -s /chives-blockchain/venv/bin/chives /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /chives-blockchain /chia-blockchain + ln -s /chives-blockchain/venv/bin/chives /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/chives_launch.sh b/scripts/forks/chives_launch.sh index 01b702d2a..139a58d27 100644 --- a/scripts/forks/chives_launch.sh +++ b/scripts/forks/chives_launch.sh @@ -63,6 +63,10 @@ if [[ ${mode} == 'fullnode' ]]; then chives start farmer-no-wallet else chives start farmer + if [[ ${chives_masternode} == "true" ]]; then + echo "Starting Chives masternode in a minute..." + sleep 60 && chives start masternode + fi fi elif [[ ${mode} =~ ^farmer.* ]]; then if [ ! -f ~/.chives/mainnet/config/ssl/wallet/public_wallet.key ]; then diff --git a/scripts/forks/coffee_install.sh b/scripts/forks/coffee_install.sh index 86892bea6..15481a553 100644 --- a/scripts/forks/coffee_install.sh +++ b/scripts/forks/coffee_install.sh @@ -8,24 +8,24 @@ COFFEE_BRANCH=$1 HASH=0b2678d3d64722e787e6ee35a690ed6503a5d08c if [ -z ${COFFEE_BRANCH} ]; then - echo 'Skipping Coffee install as not requested.' + echo 'Skipping Coffee install as not requested.' else - rm -rf /root/.cache - git clone --branch ${COFFEE_BRANCH} --single-branch https://github.com/Coffee-Network/coffee-blockchain.git /coffee-blockchain - cd /coffee-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${COFFEE_BRANCH} --single-branch https://github.com/Coffee-Network/coffee-blockchain.git /coffee-blockchain + cd /coffee-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /coffee-blockchain /chia-blockchain - ln -s /coffee-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /coffee-blockchain /chia-blockchain + ln -s /coffee-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/cryptodoge_install.sh b/scripts/forks/cryptodoge_install.sh index c2ea961b0..623a83294 100644 --- a/scripts/forks/cryptodoge_install.sh +++ b/scripts/forks/cryptodoge_install.sh @@ -8,21 +8,21 @@ CRYPTODOGE_BRANCH=$1 HASH=02ce973fe88d62c0c0ee106d988e172ee3f5aecf if [ -z ${CRYPTODOGE_BRANCH} ]; then - echo 'Skipping Cryptodoge install as not requested.' + echo 'Skipping Cryptodoge install as not requested.' else - git clone --branch ${CRYPTODOGE_BRANCH} --recurse-submodules https://github.com/CryptoDoge-Network/cryptodoge.git /cryptodoge-blockchain - cd /cryptodoge-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + git clone --branch ${CRYPTODOGE_BRANCH} --recurse-submodules https://github.com/CryptoDoge-Network/cryptodoge.git /cryptodoge-blockchain + cd /cryptodoge-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /cryptodoge-blockchain /chia-blockchain - ln -s /cryptodoge-blockchain/venv/bin/cryptodoge /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /cryptodoge-blockchain /chia-blockchain + ln -s /cryptodoge-blockchain/venv/bin/cryptodoge /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/ecostake_install.sh b/scripts/forks/ecostake_install.sh index fafb9c454..4a090fa50 100644 --- a/scripts/forks/ecostake_install.sh +++ b/scripts/forks/ecostake_install.sh @@ -8,24 +8,24 @@ ECOSTAKE_BRANCH=$1 HASH=8ea8bb9743c7caccb2f8c670853d93ee12d00c86 if [ -z ${ECOSTAKE_BRANCH} ]; then - echo 'Skipping Ecostake install as not requested.' + echo 'Skipping Ecostake install as not requested.' else - rm -rf /root/.cache - git clone --branch ${ECOSTAKE_BRANCH} --single-branch https://github.com/ecostake-network/ecostake-blockchain /ecostake-blockchain - cd /ecostake-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${ECOSTAKE_BRANCH} --single-branch https://github.com/ecostake-network/ecostake-blockchain /ecostake-blockchain + cd /ecostake-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /ecostake-blockchain /chia-blockchain - ln -s /ecostake-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /ecostake-blockchain /chia-blockchain + ln -s /ecostake-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/flax_install.sh b/scripts/forks/flax_install.sh index b0900e944..1aff10de8 100644 --- a/scripts/forks/flax_install.sh +++ b/scripts/forks/flax_install.sh @@ -8,24 +8,24 @@ FLAX_BRANCH=$1 HASH=bb8715f3155bb8011a04cc8c05b3fa8133e4c64b if [ -z ${FLAX_BRANCH} ]; then - echo 'Skipping Flax install as not requested.' + echo 'Skipping Flax install as not requested.' else - rm -rf /root/.cache - git clone --branch ${FLAX_BRANCH} --single-branch https://github.com/Flax-Network/flax-blockchain.git /flax-blockchain - cd /flax-blockchain - git checkout $HASH - git submodule update --init mozilla-ca - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 + rm -rf /root/.cache + git clone --branch ${FLAX_BRANCH} --single-branch https://github.com/Flax-Network/flax-blockchain.git /flax-blockchain + cd /flax-blockchain + git checkout $HASH + git submodule update --init mozilla-ca + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 sed -e 's/^ self.log.debug($/ self.log.info(/g' flax/wallet/wallet_state_manager.py - /usr/bin/sh ./install.sh + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /flax-blockchain /chia-blockchain - ln -s /flax-blockchain/venv/bin/flax /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /flax-blockchain /chia-blockchain + ln -s /flax-blockchain/venv/bin/flax /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/flora_install.sh b/scripts/forks/flora_install.sh index 560eba932..53a0bd09a 100644 --- a/scripts/forks/flora_install.sh +++ b/scripts/forks/flora_install.sh @@ -8,24 +8,24 @@ FLORA_BRANCH=$1 HASH=f4da13dd7160de772ea5daa333984bed3882e84c if [ -z ${FLORA_BRANCH} ]; then - echo 'Skipping Flora install as not requested.' + echo 'Skipping Flora install as not requested.' else - rm -rf /root/.cache - git clone --branch ${FLORA_BRANCH} --single-branch https://github.com/Flora-Network/flora-blockchain.git /flora-blockchain - cd /flora-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${FLORA_BRANCH} --single-branch https://github.com/Flora-Network/flora-blockchain.git /flora-blockchain + cd /flora-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /flora-blockchain /chia-blockchain - ln -s /flora-blockchain/venv/bin/flora /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /flora-blockchain /chia-blockchain + ln -s /flora-blockchain/venv/bin/flora /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/gigahorse_install.sh b/scripts/forks/gigahorse_install.sh new file mode 100644 index 000000000..a1d142e37 --- /dev/null +++ b/scripts/forks/gigahorse_install.sh @@ -0,0 +1,28 @@ +#!/bin/env bash +# +# Installs Gigahorse as per https://github.com/madMAx43v3r/chia-gigahorse +# + +GIGAHORSE_BRANCH=$1 +GIGAHORSE_VERSION=${GIGAHORSE_BRANCH#?} # Strip off the leading 'v' from his branch + +if [ -z ${GIGAHORSE_BRANCH} ]; then + echo 'Skipping Gigahorse install as not requested.' +else + cd /tmp + rm -rf /root/.cache + apt-get update && apt-get install -y dialog apt-utils libgomp1 + # Install dependencies for GPU support + apt-get install -y git cmake build-essential ocl-icd-opencl-dev clinfo screen initramfs-tools ocl-icd-libopencl1 opencl-headers libnuma1 + # For AMDGPU, install the amdgpu-install stub, optionally invoked later if OPENCL_GPU=amd at launch time + curl -O http://repo.radeon.com/amdgpu-install/22.20.5/ubuntu/jammy/amdgpu-install_22.20.50205-1_all.deb + apt-get install -y ./amdgpu-install_22.20.50205-1_all.deb + + arch_name="$(uname -m)" + url="https://github.com/madMAx43v3r/chia-gigahorse/releases/download/${GIGAHORSE_BRANCH}/chia-gigahorse-farmer-${GIGAHORSE_VERSION}-${arch_name}.tar.gz" + echo "Pulling Madmax closed-source Chia farming binary from..." + echo ${url} + cd / && curl --retry 5 --retry-max-time 120 -skJLO ${url} + du -hsc chia-gigahorse-farmer* + tar -xzf chia-gigahorse-farmer* +fi diff --git a/scripts/forks/gigahorse_launch.sh b/scripts/forks/gigahorse_launch.sh new file mode 100644 index 000000000..2d4450c7b --- /dev/null +++ b/scripts/forks/gigahorse_launch.sh @@ -0,0 +1,141 @@ +#!/bin/env bash +# +# Initialize Gigahorse farmer or harvester (also optionally plotter) +# + +cd /chia-gigahorse-farmer + +# Link the Madmax chia.bin to chia in main PATH +. ./activate.sh +mv /chia-blockchain/venv/bin/chia /chia-blockchain/venv/bin/chia.orig +ln -s /chia-gigahorse-farmer/chia.bin /chia-blockchain/venv/bin/chia + +mkdir -p /root/.chia/mainnet/db +mkdir -p /root/.chia/mainnet/log + +if [[ "${blockchain_db_download}" == 'true' ]] \ + && [[ "${mode}" == 'fullnode' ]] \ + && [[ ! -f /root/.chia/mainnet/db/blockchain_v1_mainnet.sqlite ]] \ + && [[ ! -f /root/.chia/mainnet/db/blockchain_v2_mainnet.sqlite ]]; then + # Create machinaris dbs and launch web only while blockchain database downloads + . /machinaris/scripts/setup_databases.sh + mkdir -p /root/.chia/machinaris/config + mkdir -p /root/.chia/machinaris/logs + cd /machinaris + /chia-blockchain/venv/bin/gunicorn \ + --bind 0.0.0.0:8926 --timeout 90 \ + --log-level=info \ + --workers=2 \ + --log-config web/log.conf \ + web:app & + echo 'Starting web server... Browse to port 8926.' + echo "Downloading Chia blockchain DB (many GBs in size) on first launch..." + echo "Please be patient as takes minutes now, but saves days of syncing time later." + mkdir -p /root/.chia/mainnet/db/chia && cd /root/.chia/mainnet/db/chia + # Latest Blockchain DB download from direct from https://sweetchia.com/ + db_url=$(curl -s https://sweetchia.com | grep -Po "https:.*/blockchain_v2_mainnet-\d{4}-\d{2}-\d{2}-\d{4}.7z" | shuf -n 1) + echo "Please be patient! Downloading blockchain database from: " + echo " ${db_url}" + curl -skLJ -O ${db_url} + p7zip --decompress --force blockchain_v2_mainnet*.7z + cd /root/.chia/mainnet/db + mv /root/.chia/mainnet/db/chia/blockchain_v2_mainnet.sqlite . + rm -rf /root/.chia/mainnet/db/chia +fi + +/chia-gigahorse-farmer/chia.bin init >> /root/.chia/mainnet/log/init.log 2>&1 + +echo 'Configuring Gigahorse for the Chia blockchain...' +if [ ! -f /root/.chia/mainnet/config/config.yaml ]; then + sleep 60 # Give Chia long enough to initialize and create a config file... +fi +if [ -f /root/.chia/mainnet/config/config.yaml ]; then + sed -i 's/log_stdout: true/log_stdout: false/g' /root/.chia/mainnet/config/config.yaml + sed -i 's/log_level: WARNING/log_level: INFO/g' /root/.chia/mainnet/config/config.yaml + sed -i 's/localhost/127.0.0.1/g' /root/.chia/mainnet/config/config.yaml + # Fix port conflicts with other fullnodes like Chia. + sed -i 's/ 8444/ 28744/g' /root/.chia/mainnet/config/config.yaml + sed -i 's/ 8447/ 28745/g' /root/.chia/mainnet/config/config.yaml + sed -i 's/ 8555/ 28855/g' /root/.chia/mainnet/config/config.yaml + sed -i '/^ *host: introducer.chia.net/,/^ *[^:]*:/s/port: 28744/port: 8444/' /root/.chia/mainnet/config/config.yaml +fi + +# Loop over provided list of key paths +label_num=0 +for k in ${keys//:/ }; do + if [[ "${k}" == "persistent" ]]; then + echo "Not touching key directories." + elif [ -s ${k} ]; then + echo "Adding key #${label_num} at path: ${k}" + /chia-gigahorse-farmer/chia.bin keys add -l "key_${label_num}" -f ${k} > /dev/null + ((label_num=label_num+1)) + elif [[ ${mode} == 'fullnode' ]]; then + echo "Skipping 'chia keys add' as no file found at: ${k}" + fi +done + +# Loop over provided list of completed plot directories +IFS=':' read -r -a array <<< "$plots_dir" +joined=$(printf ", %s" "${array[@]}") +echo "Adding plot directories at: ${joined:1}" +for p in ${plots_dir//:/ }; do + /chia-gigahorse-farmer/chia.bin plots add -d ${p} +done + +chmod 755 -R /root/.chia/mainnet/config/ssl/ &> /dev/null +/chia-gigahorse-farmer/chia.bin init --fix-ssl-permissions > /dev/null + +# Support for GPUs used when plotting/farming +if [[ ${OPENCL_GPU} == 'nvidia' ]]; then + mkdir -p /etc/OpenCL/vendors + echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd + echo "Enabling Nvidia GPU support inside this container." +elif [[ ${OPENCL_GPU} == 'amd' ]]; then + pushd /tmp > /dev/null + echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + apt-get update 2>&1 > /tmp/amdgpu_setup.log + amdgpu-install -y --usecase=opencl --opencl=rocr --no-dkms --no-32 --accept-eula 2>&1 >> /tmp/amdgpu_setup.log + popd > /dev/null + echo "Enabling AMD GPU support inside this container." +elif [[ ${OPENCL_GPU} == 'intel' ]]; then + echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + apt-get update 2>&1 > /tmp/intelgpu_setup.log + apt-get install -y intel-opencl-icd 2>&1 >> /tmp/intelgpu_setup.log + echo "Enabling Intel GPU support inside this container." +fi + +# Start services based on mode selected. Always skip a duplicate Chia wallet launch +if [[ ${mode} == 'fullnode' ]]; then + /chia-gigahorse-farmer/chia.bin start farmer-no-wallet +elif [[ ${mode} =~ ^farmer.* ]]; then + /chia-gigahorse-farmer/chia.bin start farmer-only +elif [[ ${mode} =~ ^harvester.* ]]; then + if [[ -z ${farmer_address} || -z ${farmer_port} ]]; then + echo "A farmer peer address and port are required." + exit 1 + else + if [ ! -f /root/.chia/farmer_ca/chia_ca.crt ]; then + mkdir -p /root/.chia/farmer_ca + response=$(curl --write-out '%{http_code}' --silent http://${farmer_address}:8959/certificates/?type=gigahorse --output /tmp/certs.zip) + if [ $response == '200' ]; then + unzip /tmp/certs.zip -d /root/.chia/farmer_ca + else + echo "Certificates response of ${response} from http://${farmer_address}:8959/certificates/?type=gigahorse. Is the Machinaris fullnode container running?" + fi + rm -f /tmp/certs.zip + fi + if [[ -f /root/.chia/farmer_ca/chia_ca.crt ]] && [[ ! ${keys} == "persistent" ]]; then + /chia-gigahorse-farmer/chia.bin init -c /root/.chia/farmer_ca 2>&1 > /root/.chia/mainnet/log/init.log + chmod 755 -R /root/.chia/mainnet/config/ssl/ &> /dev/null + /chia-gigahorse-farmer/chia.bin init --fix-ssl-permissions > /dev/null + else + echo "Did not find your farmer's certificates within /root/.chia/farmer_ca." + echo "See: https://github.com/guydavis/machinaris/wiki/Workers#harvester" + fi + /chia-gigahorse-farmer/chia.bin configure --set-farmer-peer ${farmer_address}:${farmer_port} + /chia-gigahorse-farmer/chia.bin configure --enable-upnp false + /chia-gigahorse-farmer/chia.bin start harvester -r + fi +elif [[ ${mode} == 'plotter' ]]; then + echo "Starting in Plotter-only mode. Run Plotman from either CLI or WebUI." +fi diff --git a/scripts/forks/gold_install.sh b/scripts/forks/gold_install.sh index 381c91b75..def21e072 100644 --- a/scripts/forks/gold_install.sh +++ b/scripts/forks/gold_install.sh @@ -8,24 +8,24 @@ GOLD_BRANCH=$1 HASH=8f3bd229813a820e4b9d2e4cd69a28c00c27b7d2 if [ -z ${GOLD_BRANCH} ]; then - echo 'Skipping Gold install as not requested.' + echo 'Skipping Gold install as not requested.' else - rm -rf /root/.cache - git clone --branch ${GOLD_BRANCH} --single-branch https://github.com/goldcoin-gl/gold-blockchain.git /gold-blockchain - cd /gold-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${GOLD_BRANCH} --single-branch https://github.com/goldcoin-gl/gold-blockchain.git /gold-blockchain + cd /gold-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /gold-blockchain /chia-blockchain - ln -s /gold-blockchain/venv/bin/gold /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /gold-blockchain /chia-blockchain + ln -s /gold-blockchain/venv/bin/gold /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/greenbtc_install.sh b/scripts/forks/greenbtc_install.sh index ec56f2995..347bf1689 100644 --- a/scripts/forks/greenbtc_install.sh +++ b/scripts/forks/greenbtc_install.sh @@ -8,24 +8,24 @@ GREENBTC_BRANCH=$1 HASH=e14bc12696af1cbcdf89a3e7bea0cdb1dd0e89ad if [ -z ${GREENBTC_BRANCH} ]; then - echo 'Skipping GreenBTC install as not requested.' + echo 'Skipping GreenBTC install as not requested.' else - rm -rf /root/.cache - git clone --branch ${GREENBTC_BRANCH} --single-branch https://github.com/greenbtc/greenbtc-blockchain.git /greenbtc-blockchain - cd /greenbtc-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${GREENBTC_BRANCH} --single-branch https://github.com/greenbtc/greenbtc-blockchain.git /greenbtc-blockchain + cd /greenbtc-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /greenbtc-blockchain /chia-blockchain - ln -s /greenbtc-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /greenbtc-blockchain /chia-blockchain + ln -s /greenbtc-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/hddcoin_install.sh b/scripts/forks/hddcoin_install.sh index 8c8ac76a1..68a1d03e6 100644 --- a/scripts/forks/hddcoin_install.sh +++ b/scripts/forks/hddcoin_install.sh @@ -8,23 +8,23 @@ HDDCOIN_BRANCH=$1 HASH=42403754da1d819632b0442964eabc2962e30484 if [ -z ${HDDCOIN_BRANCH} ]; then - echo 'Skipping HDDCoin install as not requested.' + echo 'Skipping HDDCoin install as not requested.' else - git clone --branch ${HDDCOIN_BRANCH} --recurse-submodules https://github.com/HDDcoin-Network/hddcoin-blockchain.git /hddcoin-blockchain - cd /hddcoin-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + git clone --branch ${HDDCOIN_BRANCH} --recurse-submodules https://github.com/HDDcoin-Network/hddcoin-blockchain.git /hddcoin-blockchain + cd /hddcoin-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /hddcoin-blockchain /chia-blockchain - ln -s /hddcoin-blockchain/venv/bin/hddcoin /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /hddcoin-blockchain /chia-blockchain + ln -s /hddcoin-blockchain/venv/bin/hddcoin /chia-blockchain/venv/bin/chia + fi fi \ No newline at end of file diff --git a/scripts/forks/littlelambocoin_install.sh b/scripts/forks/littlelambocoin_install.sh index b55be8d6f..b73bbc822 100644 --- a/scripts/forks/littlelambocoin_install.sh +++ b/scripts/forks/littlelambocoin_install.sh @@ -8,24 +8,24 @@ LITTLELAMBOCOIN_BRANCH=$1 HASH=a656e0d3478773a38ac4959a611b5d064bb22cb5 if [ -z ${LITTLELAMBOCOIN_BRANCH} ]; then - echo 'Skipping LittleLamboCoin install as not requested.' + echo 'Skipping LittleLamboCoin install as not requested.' else - rm -rf /root/.cache - git clone --branch ${LITTLELAMBOCOIN_BRANCH} --single-branch https://github.com/BTCgreen-Network/littlelambocoin-blockchain /littlelambocoin-blockchain - cd /littlelambocoin-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 + rm -rf /root/.cache + git clone --branch ${LITTLELAMBOCOIN_BRANCH} --single-branch https://github.com/BTCgreen-Network/littlelambocoin-blockchain /littlelambocoin-blockchain + cd /littlelambocoin-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 sed -e 's/^ self.log.debug($/ self.log.info(/g' littlelambocoin/wallet/wallet_state_manager.py - /usr/bin/sh ./install.sh + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /littlelambocoin-blockchain /chia-blockchain - ln -s /littlelambocoin-blockchain/venv/bin/littlelambocoin /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /littlelambocoin-blockchain /chia-blockchain + ln -s /littlelambocoin-blockchain/venv/bin/littlelambocoin /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/maize_install.sh b/scripts/forks/maize_install.sh index 31ea8b101..4af7a2edd 100644 --- a/scripts/forks/maize_install.sh +++ b/scripts/forks/maize_install.sh @@ -8,26 +8,26 @@ MAIZE_BRANCH=$1 HASH=1530e15a5fba769f9387508e842121daca5d44e2 if [ -z ${MAIZE_BRANCH} ]; then - echo 'Skipping Maize install as not requested.' + echo 'Skipping Maize install as not requested.' else - cd / - rm -rf /root/.cache - git clone --branch ${MAIZE_BRANCH} --single-branch https://github.com/Maize-Network/maize-blockchain.git /maize-blockchain - cd /maize-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - pwd - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 + cd / + rm -rf /root/.cache + git clone --branch ${MAIZE_BRANCH} --single-branch https://github.com/Maize-Network/maize-blockchain.git /maize-blockchain + cd /maize-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + pwd + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 sed -e 's/^ self.log.debug($/ self.log.info(/g' maize/wallet/wallet_state_manager.py - /usr/bin/sh ./install.sh + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /maize-blockchain /chia-blockchain - ln -s /maize-blockchain/venv/bin/maize /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /maize-blockchain /chia-blockchain + ln -s /maize-blockchain/venv/bin/maize /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/mint_install.sh b/scripts/forks/mint_install.sh index 07e9456c0..c9a261aad 100644 --- a/scripts/forks/mint_install.sh +++ b/scripts/forks/mint_install.sh @@ -8,24 +8,24 @@ MINT_BRANCH=$1 HASH=65ec05a015a07664ed25f83efa736065a17f7d7a if [ -z ${MINT_BRANCH} ]; then - echo 'Skipping Mint install as not requested.' + echo 'Skipping Mint install as not requested.' else - rm -rf /root/.cache - git clone --branch ${MINT_BRANCH} --single-branch https://github.com/MintNetwork/mint-blockchain.git /mint-blockchain - cd /mint-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${MINT_BRANCH} --single-branch https://github.com/MintNetwork/mint-blockchain.git /mint-blockchain + cd /mint-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /mint-blockchain /chia-blockchain - ln -s /mint-blockchain/venv/bin/mint /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /mint-blockchain /chia-blockchain + ln -s /mint-blockchain/venv/bin/mint /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/mmx_install.sh b/scripts/forks/mmx_install.sh index 813e351c0..0d88b2134 100644 --- a/scripts/forks/mmx_install.sh +++ b/scripts/forks/mmx_install.sh @@ -1,24 +1,34 @@ #!/bin/env bash # # Installs MMX as per https://github.com/madMAx43v3r/mmx-node +# using his binaries from https://github.com/madMAx43v3r/mmx-binaries.git # MMX_BRANCH=$1 if [ -z ${MMX_BRANCH} ]; then - echo 'Skipping MMX install as not requested.' + echo 'Skipping MMX install as not requested.' else - rm -rf /root/.cache - apt-get update - # Install dependencies for MMX and GPU support - apt-get install -y git cmake build-essential libsecp256k1-dev libsodium-dev zlib1g-dev ocl-icd-opencl-dev clinfo screen - apt-get install -y initramfs-tools ocl-icd-libopencl1 opencl-headers apt-utils libnuma1 - # For AMDGPU, install the amdgpu-install stub, optionally invoked later if OPENCL_GPU=amd at launch time - curl -O http://repo.radeon.com/amdgpu-install/22.20.5/ubuntu/jammy/amdgpu-install_22.20.50205-1_all.deb - apt-get install -y ./amdgpu-install_22.20.50205-1_all.deb - # Clone and install MMX - git clone --branch ${MMX_BRANCH} --single-branch https://github.com/madMAx43v3r/mmx-node.git /mmx-node - cd /mmx-node - git submodule update --init --recursive - ./make_release.sh + rm -rf /root/.cache + apt-get update + # Install dependencies for MMX and GPU support + apt-get install -y git cmake build-essential libsecp256k1-dev libsodium-dev libminiupnpc-dev libjemalloc-dev zlib1g-dev ocl-icd-opencl-dev clinfo screen + apt-get install -y initramfs-tools ocl-icd-libopencl1 opencl-headers apt-utils libnuma1 + # For AMDGPU, install the amdgpu-install stub, optionally invoked later if OPENCL_GPU=amd at launch time + curl -O http://repo.radeon.com/amdgpu-install/22.20.5/ubuntu/jammy/amdgpu-install_22.20.50205-1_all.deb + apt-get install -y ./amdgpu-install_22.20.50205-1_all.deb + # Clone and install MMX from the author's own binaries, not linked to his code branches unfortunately + pushd /tmp + git clone --branch ${MMX_BRANCH} --single-branch --depth 1 --filter=blob:none --sparse https://github.com/madMAx43v3r/mmx-binaries.git + pushd mmx-binaries/ + git sparse-checkout set mmx-node/linux/x86_64/ + pushd mmx-node/linux + mv x86_64 /mmx-node + popd + rm -f mmx-binaries + popd + tee /etc/ld.so.conf.d/30-mmx.conf >/dev/null </dev/null </dev/null < /root/.chia/mmx/config/local/timelord + # For a fresh install of Machinaris-MMX, disable timelord by default to save CPU usage + echo false > /root/.chia/mmx/config/local/timelord fi escaped_plot_dirs=$(printf '%s\n' "$plot_dirs" | sed -e 's/[\/&]/\\&/g') sed -i "s/\"plot_dirs\":.*$/\"plot_dirs\": [ $escaped_plot_dirs ]/g" /root/.chia/mmx/config/local/Harvester.json -if [[ ${OPENCL_GPU} == 'nvidia' ]]; then +# Support for GPUs used when plotting/farming +if [[ ${OPENCL_GPU} == 'nvidia' ]]; then mkdir -p /etc/OpenCL/vendors echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd + echo "Enabling Nvidia GPU support inside this container." elif [[ ${OPENCL_GPU} == 'amd' ]]; then - pushd /tmp - apt-get update 2>&1 > /tmp/amdgpu_setup.log - amdgpu-install -y --usecase=opencl --opencl=rocr --no-dkms --no-32 --accept-eula 2>&1 >> /tmp/amdgpu_setup.log - popd + pushd /tmp > /dev/null + echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections + apt-get update 2>&1 > /tmp/amdgpu_setup.log + amdgpu-install -y --usecase=opencl --opencl=rocr --no-dkms --no-32 --accept-eula 2>&1 >> /tmp/amdgpu_setup.log + popd > /dev/null + echo "Enabling AMD GPU support inside this container." elif [[ ${OPENCL_GPU} == 'intel' ]]; then - apt-get update 2>&1 > /tmp/intelgpu_setup.log - apt-get install -y intel-opencl-icd 2>&1 >> /tmp/intelgpu_setup.log + apt-get update 2>&1 > /tmp/intelgpu_setup.log + apt-get install -y intel-opencl-icd 2>&1 >> /tmp/intelgpu_setup.log + echo "Enabling Intel GPU support inside this container." else - echo "No OPENCL_GPU provided. MMX blockchain will use use CPU instead." + echo "No OPENCL_GPU provided. MMX blockchain will use use CPU instead." fi echo 'testnet9' > /root/.chia/mmx/NETWORK # Symlink the testnet9 folder if [ ! -d /root/.chia/mmx/testnet9 ]; then - mkdir /root/.chia/mmx/testnet9 + mkdir /root/.chia/mmx/testnet9 fi # Create a key if none found from previous runs if [[ ${mode} == 'fullnode' ]]; then - if [ ! -f /root/.chia/mmx/wallet.dat ]; then - echo "Creating key at path: /root/.chia/mmx/wallet.dat" - mmx wallet create - else - echo "Adding key at path: /root/.chia/mmx/wallet.dat" - fi - # Setup log rotation - tee /etc/logrotate.d/mmx-node >/dev/null </dev/null </root/.chia/mmx/logs/mmx_node.log 2>&1 & + # Now start the MMX node + ./run_node.sh >/root/.chia/mmx/logs/mmx_node.log 2>&1 & elif [[ ${mode} =~ ^farmer.* ]]; then - # Setup log rotation - tee /etc/logrotate.d/mmx-farmer >/dev/null </dev/null </root/.chia/mmx/logs/mmx_farmer.log 2>&1 & + ./run_farmer.sh -n ${node_address}:11330 >/root/.chia/mmx/logs/mmx_farmer.log 2>&1 & elif [[ ${mode} =~ ^harvester.* ]]; then - # Setup log rotation - tee /etc/logrotate.d/mmx-harvester >/dev/null </dev/null </root/.chia/mmx/logs/mmx_harvester.log 2>&1 & + ./run_harvester.sh -n ${farmer_address}:11330 >/root/.chia/mmx/logs/mmx_harvester.log 2>&1 & elif [[ ${mode} == 'plotter' ]]; then echo "Starting in Plotter-only mode. Run Plotman from either CLI or WebUI." fi diff --git a/scripts/forks/moon_install.sh b/scripts/forks/moon_install.sh index 8dcc99e3c..4e7c1ed58 100644 --- a/scripts/forks/moon_install.sh +++ b/scripts/forks/moon_install.sh @@ -7,26 +7,26 @@ MOON_BRANCH=$1 HASH=dbb7e66d4cb1af20caa3d8f3dc883a345d7643e3 if [ -z ${MOON_BRANCH} ]; then - echo 'Skipping Moon install as not requested.' + echo 'Skipping Moon install as not requested.' else - cd / - rm -rf /root/.cache - git clone --branch ${MOON_BRANCH} --single-branch https://github.com/MOONCOINTEAM/moon-blockchain.git /moon-blockchain - cd /moon-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - pwd - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 + cd / + rm -rf /root/.cache + git clone --branch ${MOON_BRANCH} --single-branch https://github.com/MOONCOINTEAM/moon-blockchain.git /moon-blockchain + cd /moon-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + pwd + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 sed -e 's/^ self.log.debug($/ self.log.info(/g' moon/wallet/wallet_state_manager.py - /usr/bin/sh ./install.sh + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /moon-blockchain /chia-blockchain - ln -s /moon-blockchain/venv/bin/moon /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /moon-blockchain /chia-blockchain + ln -s /moon-blockchain/venv/bin/moon /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/nchain_install.sh b/scripts/forks/nchain_install.sh index 7a7c6f65b..de42a5ee6 100644 --- a/scripts/forks/nchain_install.sh +++ b/scripts/forks/nchain_install.sh @@ -10,22 +10,22 @@ NCHAIN_BRANCH=$1 HASH=3c51a0bc6ee3930b40296a75dccf0ad8daab3a68 if [ -z ${NCHAIN_BRANCH} ]; then - echo 'Skipping NChain install as not requested.' + echo 'Skipping NChain install as not requested.' else - git clone --branch ${NCHAIN_BRANCH} --recurse-submodules https://gitee.com/ext9/ext9-blockchain.git /ext9-blockchain - cd /ext9-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + git clone --branch ${NCHAIN_BRANCH} --recurse-submodules https://gitee.com/ext9/ext9-blockchain.git /ext9-blockchain + cd /ext9-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /ext9-blockchain /chia-blockchain - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /ext9-blockchain /chia-blockchain + fi fi \ No newline at end of file diff --git a/scripts/forks/nchain_launch.sh b/scripts/forks/nchain_launch.sh index c25aaedba..615c27249 100644 --- a/scripts/forks/nchain_launch.sh +++ b/scripts/forks/nchain_launch.sh @@ -7,11 +7,6 @@ cd /ext9-blockchain . ./activate -# farmr binary makes hard-coded assumptions about N-Chain locations, so create symlinks -if [ ! -d /root/.ext9 ]; then - ln -s /root/.chia/ /root/.ext9 -fi - if [[ "${blockchain_db_download}" == 'true' ]] \ && [[ "${mode}" == 'fullnode' ]] \ && [[ ! -f /root/.chia/ext9/db/blockchain_v1_ext9.sqlite ]] \ diff --git a/scripts/forks/one_install.sh b/scripts/forks/one_install.sh index a479b93ba..295ba332d 100644 --- a/scripts/forks/one_install.sh +++ b/scripts/forks/one_install.sh @@ -8,23 +8,23 @@ ONE_BRANCH=$1 HASH=29854541a4a6b2b9bc4d423302642e10ddf8fc77 if [ -z ${ONE_BRANCH} ]; then - echo 'Skipping One install as not requested.' + echo 'Skipping One install as not requested.' else - git clone --branch ${ONE_BRANCH} --recurse-submodules https://github.com/xone-network/one-blockchain.git /one-blockchain - cd /one-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 + git clone --branch ${ONE_BRANCH} --recurse-submodules https://github.com/xone-network/one-blockchain.git /one-blockchain + cd /one-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 sed -e 's/^ self.log.debug($/ self.log.info(/g' one/wallet/wallet_state_manager.py - /usr/bin/sh ./install.sh + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /one-blockchain /chia-blockchain - ln -s /one-blockchain/venv/bin/one /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /one-blockchain /chia-blockchain + ln -s /one-blockchain/venv/bin/one /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/petroleum_install.sh b/scripts/forks/petroleum_install.sh index b8e166bb3..4a24cb556 100644 --- a/scripts/forks/petroleum_install.sh +++ b/scripts/forks/petroleum_install.sh @@ -8,24 +8,24 @@ PETROLEUM_BRANCH=$1 HASH=8fae07695353b4e7fb7d861ab747b04aebab176c if [ -z ${PETROLEUM_BRANCH} ]; then - echo 'Skipping Petroleum install as not requested.' + echo 'Skipping Petroleum install as not requested.' else - rm -rf /root/.cache - git clone --branch ${PETROLEUM_BRANCH} --single-branch https://github.com/petroleum-network/petroleum-blockchain /petroleum-blockchain - cd /petroleum-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${PETROLEUM_BRANCH} --single-branch https://github.com/petroleum-network/petroleum-blockchain /petroleum-blockchain + cd /petroleum-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /petroleum-blockchain /chia-blockchain - ln -s /petroleum-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /petroleum-blockchain /chia-blockchain + ln -s /petroleum-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/pipscoin_install.sh b/scripts/forks/pipscoin_install.sh new file mode 100644 index 000000000..87bd034f4 --- /dev/null +++ b/scripts/forks/pipscoin_install.sh @@ -0,0 +1,30 @@ +#!/bin/env bash +# +# Installs Pipscoin as per https://github.com/Pipscoin-Network/pipscoin-blockchain" +# + +PIPSCOIN_BRANCH=$1 +# On 2023-01-17 +HASH=3017cde5f8c463f5e494c5c1e258dd2bf8281fee + +if [ -z ${PIPSCOIN_BRANCH} ]; then + echo 'Skipping Pipscoin install as not requested.' +else + git clone --branch ${PIPSCOIN_BRANCH} --recurse-submodules https://github.com/Pipscoin-Network/pipscoin-blockchain.git /pipscoin-blockchain + cd /pipscoin-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 + sed -e 's/^ self.log.debug($/ self.log.info(/g' pipscoin/wallet/wallet_state_manager.py + /usr/bin/sh ./install.sh + + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /pipscoin-blockchain /chia-blockchain + ln -s /pipscoin-blockchain/venv/bin/pipscoin /chia-blockchain/venv/bin/chia + fi +fi diff --git a/scripts/forks/pipscoin_launch.sh b/scripts/forks/pipscoin_launch.sh new file mode 100644 index 000000000..64917b44c --- /dev/null +++ b/scripts/forks/pipscoin_launch.sh @@ -0,0 +1,108 @@ +#!/bin/env bash +# +# Initialize Pipscoin service, depending on mode of system requested +# + +cd /pipscoin-blockchain + +. ./activate + +# Only the /root/.chia folder is volume-mounted so store pipscoin within +mkdir -p /root/.chia/pipscoin +rm -f /root/.pipscoin +ln -s /root/.chia/pipscoin /root/.pipscoin + +if [[ "${blockchain_db_download}" == 'true' ]] \ + && [[ "${mode}" == 'fullnode' ]] \ + && [[ ! -f /root/.pipscoin/mainnet/db/blockchain_v1_mainnet.sqlite ]] \ + && [[ ! -f /root/.pipscoin/mainnet/db/blockchain_v2_mainnet.sqlite ]]; then + echo "Sorry, Pipscoin does not offer a recent blockchain DB for download via script. Standard sync will happen over a few days." + echo "It is recommended to add some peer node connections on the Connections page of Machinaris." +fi + +mkdir -p /root/.pipscoin/mainnet/log +pipscoin init >> /root/.pipscoin/mainnet/log/init.log 2>&1 + +echo 'Configuring Pipscoin...' +if [ -f /root/.pipscoin/mainnet/config/config.yaml ]; then + sed -i 's/log_stdout: true/log_stdout: false/g' /root/.pipscoin/mainnet/config/config.yaml + sed -i 's/log_level: WARNING/log_level: INFO/g' /root/.pipscoin/mainnet/config/config.yaml + sed -i 's/localhost/127.0.0.1/g' /root/.pipscoin/mainnet/config/config.yaml +fi + +# Loop over provided list of key paths +label_num=0 +for k in ${keys//:/ }; do + if [[ "${k}" == "persistent" ]]; then + echo "Not touching key directories." + elif [ -s ${k} ]; then + echo "Adding key #${label_num} at path: ${k}" + pipscoin keys add -l "key_${label_num}" -f ${k} > /dev/null + ((label_num=label_num+1)) + fi +done + +# Loop over provided list of completed plot directories +IFS=':' read -r -a array <<< "$plots_dir" +joined=$(printf ", %s" "${array[@]}") +echo "Adding plot directories at: ${joined:1}" +for p in ${plots_dir//:/ }; do + pipscoin plots add -d ${p} +done + +chmod 755 -R /root/.pipscoin/mainnet/config/ssl/ &> /dev/null +pipscoin init --fix-ssl-permissions > /dev/null + +# Start services based on mode selected. Default is 'fullnode' +if [[ ${mode} == 'fullnode' ]]; then + for k in ${keys//:/ }; do + while [[ "${k}" != "persistent" ]] && [[ ! -s ${k} ]]; do + echo 'Waiting for key to be created/imported into mnemonic.txt. See: http://localhost:8926' + sleep 10 # Wait 10 seconds before checking for mnemonic.txt presence + if [ -s ${k} ]; then + pipscoin keys add -f ${k} + sleep 10 + fi + done + done + if [ -f /root/.chia/machinaris/config/wallet_settings.json ]; then + pipscoin start farmer-no-wallet + else + pipscoin start farmer + fi +elif [[ ${mode} =~ ^farmer.* ]]; then + if [ ! -f ~/.pipscoin/mainnet/config/ssl/wallet/public_wallet.key ]; then + echo "No wallet key found, so not starting farming services. Please add your Chia mnemonic.txt to the ~/.machinaris/ folder and restart." + else + pipscoin start farmer-only + fi +elif [[ ${mode} =~ ^harvester.* ]]; then + if [[ -z ${farmer_address} || -z ${farmer_port} ]]; then + echo "A farmer peer address and port are required." + exit + else + if [ ! -f /root/.pipscoin/farmer_ca/private_ca.crt ]; then + mkdir -p /root/.pipscoin/farmer_ca + response=$(curl --write-out '%{http_code}' --silent http://${farmer_address}:8958/certificates/?type=pipscoin --output /tmp/certs.zip) + if [ $response == '200' ]; then + unzip /tmp/certs.zip -d /root/.pipscoin/farmer_ca + else + echo "Certificates response of ${response} from http://${farmer_address}:8958/certificates/?type=pipscoin. Is the fork's fullnode container running?" + fi + rm -f /tmp/certs.zip + fi + if [[ -f /root/.pipscoin/farmer_ca/private_ca.crt ]] && [[ ! ${keys} == "persistent" ]]; then + pipscoin init -c /root/.pipscoin/farmer_ca 2>&1 > /root/.pipscoin/mainnet/log/init.log + chmod 755 -R /root/.pipscoin/mainnet/config/ssl/ &> /dev/null + pipscoin init --fix-ssl-permissions > /dev/null + else + echo "Did not find your farmer's certificates within /root/.pipscoin/farmer_ca." + echo "See: https://github.com/guydavis/machinaris/wiki/Workers#harvester" + fi + pipscoin configure --set-farmer-peer ${farmer_address}:${farmer_port} + pipscoin configure --enable-upnp false + pipscoin start harvester -r + fi +elif [[ ${mode} == 'plotter' ]]; then + echo "Starting in Plotter-only mode. Run Plotman from either CLI or WebUI." +fi diff --git a/scripts/forks/profit_install.sh b/scripts/forks/profit_install.sh index 8b7d4af2d..0f417c120 100644 --- a/scripts/forks/profit_install.sh +++ b/scripts/forks/profit_install.sh @@ -8,24 +8,24 @@ PROFIT_BRANCH=$1 HASH=966811500810a0dcbf13a8e02f507b9449bb418c if [ -z ${PROFIT_BRANCH} ]; then - echo 'Skipping Profit install as not requested.' + echo 'Skipping Profit install as not requested.' else - rm -rf /root/.cache - git clone --branch ${PROFIT_BRANCH} --single-branch https://github.com/ProfitCrypto/profit-blockchain /profit-blockchain - cd /profit-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${PROFIT_BRANCH} --single-branch https://github.com/ProfitCrypto/profit-blockchain /profit-blockchain + cd /profit-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /profit-blockchain /chia-blockchain - ln -s /profit-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /profit-blockchain /chia-blockchain + ln -s /profit-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/shibgreen_install.sh b/scripts/forks/shibgreen_install.sh index 7999832e2..c45539e97 100644 --- a/scripts/forks/shibgreen_install.sh +++ b/scripts/forks/shibgreen_install.sh @@ -4,31 +4,31 @@ # SHIBGREEN_BRANCH=$1 -# On 2022-08-20 -HASH=89a081f0163e52adcfe8a71ed384f90a9301d2f5 +# On 2023-01-30 +HASH=74e65f98ea2d94eb4f895acc5512efd17acbde3c if [ -z ${SHIBGREEN_BRANCH} ]; then - echo 'Skipping SHIBGreen install as not requested.' + echo 'Skipping SHIBGreen install as not requested.' else - rm -rf /root/.cache - git clone --branch ${SHIBGREEN_BRANCH} --single-branch https://github.com/BTCgreen-Network/shibgreen-blockchain /shibgreen-blockchain - cd /shibgreen-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh + rm -rf /root/.cache + git clone --branch ${SHIBGREEN_BRANCH} --single-branch https://github.com/BTCgreen-Network/shibgreen-blockchain /shibgreen-blockchain + cd /shibgreen-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 sed -i -e 's/^ self.log.debug($/ self.log.info(/g' shibgreen/wallet/wallet_state_manager.py - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /shibgreen-blockchain /chia-blockchain - ln -s /shibgreen-blockchain/venv/bin/shibgreen /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /shibgreen-blockchain /chia-blockchain + ln -s /shibgreen-blockchain/venv/bin/shibgreen /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/shibgreen_launch.sh b/scripts/forks/shibgreen_launch.sh index 73c3e9bce..0b1855031 100644 --- a/scripts/forks/shibgreen_launch.sh +++ b/scripts/forks/shibgreen_launch.sh @@ -34,12 +34,14 @@ if [ -f /root/.shibgreen/mainnet/config/config.yaml ]; then fi # Loop over provided list of key paths +label_num=0 for k in ${keys//:/ }; do if [[ "${k}" == "persistent" ]]; then echo "Not touching key directories." elif [ -s ${k} ]; then - echo "Adding key at path: ${k}" - shibgreen keys add -f ${k} > /dev/null + echo "Adding key #${label_num} at path: ${k}" + shibgreen keys add -l "key_${label_num}" -f ${k} > /dev/null + ((label_num=label_num+1)) fi done diff --git a/scripts/forks/silicoin_install.sh b/scripts/forks/silicoin_install.sh index 38ff0d8ef..94eed4945 100644 --- a/scripts/forks/silicoin_install.sh +++ b/scripts/forks/silicoin_install.sh @@ -8,24 +8,24 @@ SILICOIN_BRANCH=$1 HASH=ebe7880e24b22d8f3bf8d0c8b31ad5397b3e7af3 if [ -z ${SILICOIN_BRANCH} ]; then - echo 'Skipping Silicoin install as not requested.' + echo 'Skipping Silicoin install as not requested.' else - rm -rf /root/.cache - git clone --branch ${SILICOIN_BRANCH} --single-branch https://github.com/silicoin-network/silicoin-blockchain /silicoin-blockchain - cd /silicoin-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${SILICOIN_BRANCH} --single-branch https://github.com/silicoin-network/silicoin-blockchain /silicoin-blockchain + cd /silicoin-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /silicoin-blockchain /chia-blockchain - ln -s /silicoin-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /silicoin-blockchain /chia-blockchain + ln -s /silicoin-blockchain/venv/bin/sit /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/staicoin_install.sh b/scripts/forks/staicoin_install.sh index 6df619ce4..2100bc9c9 100644 --- a/scripts/forks/staicoin_install.sh +++ b/scripts/forks/staicoin_install.sh @@ -4,25 +4,25 @@ # STAICOIN_BRANCH=$1 -# On 2022-10-24 -HASH=2fad4e4f12e374eff6e83b2830876902139156f9 +# On 2023-01-08 +HASH=60b6a001795af56ed1b2fc6e464cdc10884193a1 if [ -z ${STAICOIN_BRANCH} ]; then - echo 'Skipping Staicoin install as not requested.' + echo 'Skipping Staicoin install as not requested.' else - rm -rf /root/.cache - git clone --branch ${STAICOIN_BRANCH} --single-branch https://github.com/STATION-I/staicoin-blockchain.git /staicoin-blockchain - cd /staicoin-blockchain - git submodule update --init mozilla-ca - chmod +x install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${STAICOIN_BRANCH} --single-branch https://github.com/STATION-I/staicoin-blockchain.git /staicoin-blockchain + cd /staicoin-blockchain + git submodule update --init mozilla-ca + chmod +x install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /staicoin-blockchain /chia-blockchain - ln -s /staicoin-blockchain/venv/bin/staicoin /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /staicoin-blockchain /chia-blockchain + ln -s /staicoin-blockchain/venv/bin/staicoin /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/stor_install.sh b/scripts/forks/stor_install.sh index 6759ffbef..a40efd6de 100644 --- a/scripts/forks/stor_install.sh +++ b/scripts/forks/stor_install.sh @@ -8,23 +8,23 @@ STOR_BRANCH=$1 HASH=3c3cd1a3b99592e88160107ca5b81afc0937b992 if [ -z ${STOR_BRANCH} ]; then - echo 'Skipping Stor install as not requested.' + echo 'Skipping Stor install as not requested.' else - git clone --branch ${STOR_BRANCH} --recurse-submodules https://github.com/Stor-Network/stor-blockchain.git /stor-blockchain - cd /stor-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + git clone --branch ${STOR_BRANCH} --recurse-submodules https://github.com/Stor-Network/stor-blockchain.git /stor-blockchain + cd /stor-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /stor-blockchain /chia-blockchain - ln -s /stor-blockchain/venv/bin/stor /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /stor-blockchain /chia-blockchain + ln -s /stor-blockchain/venv/bin/stor /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/tad_install.sh b/scripts/forks/tad_install.sh index a3f10cbee..9c798a791 100644 --- a/scripts/forks/tad_install.sh +++ b/scripts/forks/tad_install.sh @@ -8,27 +8,27 @@ TAD_BRANCH=$1 HASH=177cf628f94a023549cbb955b49a1cf857c73851 if [ -z ${TAD_BRANCH} ]; then - echo 'Skipping Tad install as not requested.' + echo 'Skipping Tad install as not requested.' else - rm -rf /root/.cache - git clone --branch ${TAD_BRANCH} --single-branch https://github.com/BTCgreen-Network/tad-blockchain.git /tad-blockchain - cd /tad-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh + rm -rf /root/.cache + git clone --branch ${TAD_BRANCH} --single-branch https://github.com/BTCgreen-Network/tad-blockchain.git /tad-blockchain + cd /tad-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh # Log "Added Coins" at info, not debug level. See: https://github.com/Chia-Network/chia-blockchain/issues/11955 sed -i -e 's/^ self.log.debug($/ self.log.info(/g' tad/wallet/wallet_state_manager.py - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /tad-blockchain /chia-blockchain - ln -s /tad-blockchain/venv/bin/tad /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /tad-blockchain /chia-blockchain + ln -s /tad-blockchain/venv/bin/tad /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forks/wheat_install.sh b/scripts/forks/wheat_install.sh index 9bf5fc46a..376681ec0 100644 --- a/scripts/forks/wheat_install.sh +++ b/scripts/forks/wheat_install.sh @@ -8,24 +8,24 @@ WHEAT_BRANCH=$1 HASH=07f451a4d124f714246391585c00c79332840759 if [ -z ${WHEAT_BRANCH} ]; then - echo 'Skipping Wheat install as not requested.' + echo 'Skipping Wheat install as not requested.' else - rm -rf /root/.cache - git clone --branch ${WHEAT_BRANCH} --single-branch https://github.com/wheatnetwork/wheat-blockchain.git /wheat-blockchain - cd /wheat-blockchain - git submodule update --init mozilla-ca - git checkout $HASH - chmod +x install.sh - # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 - sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh - # 2022-07-20: Python needs 'packaging==21.3' - sed -i 's/packaging==21.0/packaging==21.3/g' setup.py - /usr/bin/sh ./install.sh + rm -rf /root/.cache + git clone --branch ${WHEAT_BRANCH} --single-branch https://github.com/wheatnetwork/wheat-blockchain.git /wheat-blockchain + cd /wheat-blockchain + git submodule update --init mozilla-ca + git checkout $HASH + chmod +x install.sh + # 2022-01-30: pip broke due to https://github.com/pypa/pip/issues/10825 + sed -i 's/upgrade\ pip$/upgrade\ "pip<22.0"/' install.sh + # 2022-07-20: Python needs 'packaging==21.3' + sed -i 's/packaging==21.0/packaging==21.3/g' setup.py + /usr/bin/sh ./install.sh - if [ ! -d /chia-blockchain/venv ]; then - cd / - rmdir /chia-blockchain - ln -s /wheat-blockchain /chia-blockchain - ln -s /wheat-blockchain/venv/bin/wheat /chia-blockchain/venv/bin/chia - fi + if [ ! -d /chia-blockchain/venv ]; then + cd / + rmdir /chia-blockchain + ln -s /wheat-blockchain /chia-blockchain + ln -s /wheat-blockchain/venv/bin/wheat /chia-blockchain/venv/bin/chia + fi fi diff --git a/scripts/forktools_setup.sh b/scripts/forktools_setup.sh index 530ee2a9e..270d9dcfa 100644 --- a/scripts/forktools_setup.sh +++ b/scripts/forktools_setup.sh @@ -6,7 +6,7 @@ FORKTOOLS_BRANCH=$1 if [[ "${forktools_skip_build}" != 'true' ]]; then - if [[ (${mode} == 'fullnode' || ${mode} =~ "harvester") && ${blockchains} != 'mmx' ]]; then + if [[ (${mode} == 'fullnode' || ${mode} =~ "harvester") && ${blockchains} != 'mmx' && ${blockchains} != 'gigahorse' ]]; then cd / git clone --branch ${FORKTOOLS_BRANCH} https://github.com/guydavis/forktools.git cd forktools diff --git a/scripts/madmax_setup.sh b/scripts/madmax_setup.sh index 9ac406bae..828e802bc 100644 --- a/scripts/madmax_setup.sh +++ b/scripts/madmax_setup.sh @@ -1,20 +1,21 @@ #!/bin/env bash # -# Installs chia-plotter (pipelined multi-threaded) -# See https://github.com/madMAx43v3r/chia-plotter +# Installs Madmax plotters: +# * Classic open source for the default Chia image +# * Closed source binary for the Madmax Gigahorse farmer image # # As of 2022-08-20 HASH=d1a9e88b44ba37f61bfabcb68e80e83f8b939648 -MADMAX_BRANCH=master +CLASSIC_MADMAX_BRANCH=master -if [[ (${mode} == 'fullnode' || ${mode} =~ "plotter") && (${blockchains} == 'chia' || ${blockchains} == 'chives' || ${blockchains} == 'mmx') ]]; then +if [[ (${mode} == 'fullnode' || ${mode} =~ "plotter") && (${blockchains} == 'chia' || ${blockchains} == 'chives') ]]; then if [ ! -f /usr/bin/chia_plot ] && [[ "${madmax_skip_build}" != 'true' ]]; then arch_name="$(uname -m)" if [[ "${arch_name}" = "x86_64" ]] || [[ "${arch_name}" = "arm64" ]]; then apt update && apt install -y libsodium-dev cmake g++ git build-essential cd / - git clone --branch ${MADMAX_BRANCH} https://github.com/madMAx43v3r/chia-plotter.git + git clone --branch ${CLASSIC_MADMAX_BRANCH} https://github.com/madMAx43v3r/chia-plotter.git cd chia-plotter && echo "Building madmax on ${arch_name}..." if [[ -z "${madmax_relic_main}" ]]; then # Hack on 2021-11-29 due to failed builds on some systems... sed -i 's/set(ENV{RELIC_MAIN} "1")/#set(ENV{RELIC_MAIN} "1")/g' CMakeLists.txt @@ -33,3 +34,35 @@ if [[ (${mode} == 'fullnode' || ${mode} =~ "plotter") && (${blockchains} == 'chi fi fi fi + + +# MMX Plotter binaries, https://github.com/madMAx43v3r/chia-gigahorse +GIGAHORSE_MADMAX_BRANCH=$1 + +# MMX and Gigahorse container gets the "new" Madmax plotters with compression, only available as binaries +if [[ (${mode} == 'fullnode' || ${mode} =~ "plotter") && (${blockchains} == 'mmx' || ${blockchains} == 'gigahorse') ]]; then + if [ ! -f /usr/bin/chia_plot ] && [[ "${madmax_skip_build}" != 'true' ]]; then + arch_name="$(uname -m)" + if [[ "${arch_name}" = "x86_64" ]]; then + pushd /usr/bin + curl -sLJO https://github.com/madMAx43v3r/chia-gigahorse/raw/${MADMAX_BRANCH}/cpu-plotter/linux/x86_64/chia_plot + curl -sLJO https://github.com/madMAx43v3r/chia-gigahorse/raw/${MADMAX_BRANCH}/cpu-plotter/linux/x86_64/chia_plot_k34 + chmod 755 chia_plot* + curl -sLJO https://github.com/madMAx43v3r/chia-gigahorse/raw/${MADMAX_BRANCH}/cuda-plotter/linux/x86_64/cuda_plot_k26 + curl -sLJO https://github.com/madMAx43v3r/chia-gigahorse/raw/${MADMAX_BRANCH}/cuda-plotter/linux/x86_64/cuda_plot_k29 + curl -sLJO https://github.com/madMAx43v3r/chia-gigahorse/raw/${MADMAX_BRANCH}/cuda-plotter/linux/x86_64/cuda_plot_k30 + curl -sLJO https://github.com/madMAx43v3r/chia-gigahorse/raw/${MADMAX_BRANCH}/cuda-plotter/linux/x86_64/cuda_plot_k31 + curl -sLJO https://github.com/madMAx43v3r/chia-gigahorse/raw/${MADMAX_BRANCH}/cuda-plotter/linux/x86_64/cuda_plot_k32 + curl -sLJO https://github.com/madMAx43v3r/chia-gigahorse/raw/${MADMAX_BRANCH}/cuda-plotter/linux/x86_64/cuda_plot_k33 + chmod 755 cuda_plot* + curl -sLJO https://github.com/madMAx43v3r/chia-gigahorse/raw/${MADMAX_BRANCH}/chiapos/linux/x86_64/ProofOfSpace + chmod 755 ProofOfSpace + popd + echo "Completed download of Madmax binaries for plotting:" + echo "chia_plot @ "`chia_plot --version` + echo "cuda_plot @ "`cuda_plot_k32 --version` + else + echo "Downloading MMX chia_plot and cuda_plot skipped -> unsupported architecture: ${arch_name}" + fi + fi +fi diff --git a/scripts/plotman_autoplot.sh b/scripts/plotman_autoplot.sh index 6411d783a..006f2ca92 100644 --- a/scripts/plotman_autoplot.sh +++ b/scripts/plotman_autoplot.sh @@ -3,7 +3,7 @@ # Starts Plotman, when AUTO_PLOT enabled, on a Chia/Chives fullnode or a plotter instance # -if [[ (${mode} == 'fullnode' || ${mode} =~ "plotter") && (${blockchains} == 'chia' || ${blockchains} == 'chives' || ${blockchains} == 'mmx') ]]; then +if [[ (${mode} == 'fullnode' || ${mode} =~ "plotter") && (${blockchains} == 'chia' || ${blockchains} == 'chives' || ${blockchains} == 'mmx' || ${blockchains} == 'gigahorse') ]]; then # Start plotting automatically if requested (not the default) if [ ${AUTO_PLOT,,} = "true" ]; then nohup plotman plot >> /root/.chia/plotman/logs/plotman.log 2>&1 & diff --git a/scripts/plotman_setup.sh b/scripts/plotman_setup.sh index b13212b93..1c4a4cc7e 100644 --- a/scripts/plotman_setup.sh +++ b/scripts/plotman_setup.sh @@ -5,7 +5,7 @@ PLOTMAN_BRANCH=$1 -if [[ (${mode} == 'fullnode' || ${mode} =~ "plotter") && (${blockchains} == 'chia' || ${blockchains} == 'chives' || ${blockchains} == 'mmx') ]]; then +if [[ (${mode} == 'fullnode' || ${mode} =~ "plotter") && (${blockchains} == 'chia' || ${blockchains} == 'chives' || ${blockchains} == 'mmx' || ${blockchains} == 'gigahorse') ]]; then if [[ ! -f /chia-blockchain/venv/bin/plotman ]]; then echo 'Installing Plotman...' cd / diff --git a/scripts/pull_3rd_party_libs.sh b/scripts/pull_3rd_party_libs.sh index 88b6e9e71..d9cc873cc 100755 --- a/scripts/pull_3rd_party_libs.sh +++ b/scripts/pull_3rd_party_libs.sh @@ -3,20 +3,23 @@ # Due to complaints about JS CDNs, this pulls all JS libs into web/static/3rd_party folder # -# Bootstrap Icons -BSI_VERSION=1.10.2 +# Bootstrap and Icons +BSI_VERSION=1.10.3 BOOTSTRAP_VERSION=5.2.3 BASEPATH=${JS_LIBS_BASEPATH:-/machinaris/web/static/3rd_party} +# Mapping library +LEAFLET_VERSION=1.9.3 + # List of other css/js links LIST=" https://cdn.datatables.net/1.13.1/css/dataTables.bootstrap5.css https://cdn.datatables.net/1.13.1/js/dataTables.bootstrap5.js https://cdn.datatables.net/1.13.1/js/jquery.dataTables.js -https://cdn.jsdelivr.net/npm/chart.js@4.0.1/dist/chart.umd.min.js -https://cdn.jsdelivr.net/npm/chartjs-adapter-luxon@1.3.0/dist/chartjs-adapter-luxon.umd.min.js +https://cdn.jsdelivr.net/npm/chart.js@4.2.0/dist/chart.umd.min.js +https://cdn.jsdelivr.net/npm/chartjs-adapter-luxon@1.3.1/dist/chartjs-adapter-luxon.umd.min.js https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.2.0/dist/chartjs-plugin-datalabels.min.js -https://cdn.jsdelivr.net/npm/jquery@3.6.1/dist/jquery.min.js +https://cdn.jsdelivr.net/npm/jquery@3.6.3/dist/jquery.min.js https://moment.github.io/luxon/global/luxon.min.js" mkdir -p $BASEPATH @@ -36,7 +39,7 @@ unzip -q -o -j ${BASEPATH}/bs.zip -d $BASEPATH/ bootstrap-${BOOTSTRAP_VERSION}*/ rm -f ${BASEPATH}/bs.zip # Leaflet and plugins -wget -O ${BASEPATH}/leaflet.zip -nv "https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/v1.9.3/leaflet.zip" && \ +wget -O ${BASEPATH}/leaflet.zip -nv "https://leafletjs-cdn.s3.amazonaws.com/content/leaflet/v${LEAFLET_VERSION}/leaflet.zip" && \ unzip -q -o ${BASEPATH}/leaflet.zip -d $BASEPATH/ && \ rm -f ${BASEPATH}/leaflet.zip wget -O ${BASEPATH}/leaflet-layervisibility.js -nv "https://unpkg.com/leaflet-layervisibility/dist/leaflet-layervisibility.js" diff --git a/scripts/start_machinaris.sh b/scripts/start_machinaris.sh index 068c4c4b8..cb13c7ac7 100644 --- a/scripts/start_machinaris.sh +++ b/scripts/start_machinaris.sh @@ -11,6 +11,9 @@ if [[ "${blockchains}" == 'chives' ]]; then elif [[ "${blockchains}" == 'mmx' ]]; then cp -f /machinaris/config/plotman.sample-mmx.yaml /root/.chia/plotman/plotman.sample.yaml cp -n /machinaris/config/plotman.sample-mmx.yaml /root/.chia/plotman/plotman.yaml +elif [[ "${blockchains}" == 'gigahorse' ]]; then + cp -f /machinaris/config/plotman.sample-gigahorse.yaml /root/.chia/plotman/plotman.sample.yaml + cp -n /machinaris/config/plotman.sample-gigahorse.yaml /root/.chia/plotman/plotman.yaml else # If Chia cp -f /machinaris/config/plotman.sample.yaml /root/.chia/plotman/plotman.sample.yaml cp -n /machinaris/config/plotman.sample.yaml /root/.chia/plotman/plotman.yaml @@ -43,7 +46,7 @@ fi mkdir -p /root/.chia/machinaris/config mkdir -p /root/.chia/machinaris/logs cd /machinaris -if [ $FLASK_ENV == "development" ]; +if [ -n $FLASK_DEBUG ]; then LOG_LEVEL='debug' RELOAD='--reload' diff --git a/scripts/worker_port_warning.sh b/scripts/worker_port_warning.sh index 7e7a48374..c74586615 100644 --- a/scripts/worker_port_warning.sh +++ b/scripts/worker_port_warning.sh @@ -2,6 +2,9 @@ if [[ "${blockchains}" == "apple" && "${worker_api_port}" != '8947' ]]; then echo "Apple worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8947?" fi +if [[ "${blockchains}" == "ballcoin" && "${worker_api_port}" != '8597' ]]; then + echo "Ballcoin worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8957?" +fi if [[ "${blockchains}" == "bpx" && "${worker_api_port}" != '8945' ]]; then echo "BPX worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8945?" fi @@ -20,6 +23,9 @@ fi if [[ "${blockchains}" == "chives" && "${worker_api_port}" != '8931' ]]; then echo "Chives worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8931?" fi +if [[ "${blockchains}" == "coffee" && "${worker_api_port}" != '8954' ]]; then + echo "Coffee worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8954?" +fi if [[ "${blockchains}" == "cryptodoge" && "${worker_api_port}" != '8937' ]]; then echo "Cryptodoge worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8937?" fi @@ -32,6 +38,12 @@ fi if [[ "${blockchains}" == "flora" && "${worker_api_port}" != '8932' ]]; then echo "Flora worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8932?" fi +if [[ "${blockchains}" == "greenbtc" && "${worker_api_port}" != '8955' ]]; then + echo "GreenBTC worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8955?" +fi +if [[ "${blockchains}" == "gigahorse" && "${worker_api_port}" != '8959' ]]; then + echo "Gigahorse worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8959?" +fi if [[ "${blockchains}" == "gold" && "${worker_api_port}" != '8949' ]]; then echo "Gold worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8949?" fi @@ -50,12 +62,21 @@ fi if [[ "${blockchains}" == "mmx" && "${worker_api_port}" != '8940' ]]; then echo "MMX worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8940?" fi +if [[ "${blockchains}" == "moon" && "${worker_api_port}" != '8953' ]]; then + echo "Moon worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8953?" +fi if [[ "${blockchains}" == "nchain" && "${worker_api_port}" != '8929' ]]; then echo "N-Chain worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8936?" fi +if [[ "${blockchains}" == "one" && "${worker_api_port}" != '8956' ]]; then + echo "One blockchain worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8956?" +fi if [[ "${blockchains}" == "petroleum" && "${worker_api_port}" != '8943' ]]; then echo "Petroleum worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8943?" fi +if [[ "${blockchains}" == "pipscoin" && "${worker_api_port}" != '8958' ]]; then + echo "Pipscoin worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8958?" +fi if [[ "${blockchains}" == "profit" && "${worker_api_port}" != '8944' ]]; then echo "Profit worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8944?" fi diff --git a/web/__init__.py b/web/__init__.py index 282b16f44..754cefa2f 100644 --- a/web/__init__.py +++ b/web/__init__.py @@ -18,9 +18,7 @@ app.config.from_object(DefaultConfig) # Override config with optional settings file app.config.from_envvar('WEB_SETTINGS_FILE', silent=True) -babel = Babel(app) -@babel.localeselector def get_locale(): try: accept = request.headers['Accept-Language'] @@ -36,6 +34,8 @@ def get_locale(): app.logger.debug("INIT: Request had no Accept-Language, returning default locale of en.") return request.accept_languages.best_match(app.config['LANGUAGES']) +babel = Babel(app, locale_selector=get_locale,) + @event.listens_for(Engine, "connect") def set_sqlite_pragma(dbapi_connection, connection_record): cursor = dbapi_connection.cursor() @@ -84,13 +84,7 @@ def timesecondstrimmer(value): app.jinja_env.filters['timesecondstrimmer'] = timesecondstrimmer def plotnameshortener(value): - #app.logger.info("Shorten: {0}".format(value)) - match = re.match("plot(?:-mmx)?-k(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", value) - if match: - return "plot-k{0}-{1}-{2}-{3}-{4}-{5}-{6}...".format( match.group(1), - match.group(2), match.group(3), match.group(4), match.group(5), match.group(6), - match.group(7)[:16]) - return value + return value[:30] app.jinja_env.filters['plotnameshortener'] = plotnameshortener diff --git a/web/actions/chia.py b/web/actions/chia.py index 99a8adc3f..97c594545 100644 --- a/web/actions/chia.py +++ b/web/actions/chia.py @@ -14,6 +14,7 @@ import socket import sys import time +import threading import traceback import urllib import yaml @@ -34,6 +35,7 @@ Blockchains, Connections, Keys, ChallengesChartData, Summaries from . import worker as wk from . import stats +from api.schedules import plots_check COLD_WALLET_ADDRESSES_FILE = '/root/.chia/machinaris/config/cold_wallet_addresses.json' WALLET_SETTINGS_FILE = '/root/.chia/machinaris/config/wallet_settings.json' @@ -75,6 +77,7 @@ def order_plots_query(args, query): def search_plots_query(search, query): app.logger.info("Searching all plots for: {0}".format(search)) + search = '%{0}%'.format(search) query = query.filter(or_( p.Plot.displayname.like(search), p.Plot.blockchain.like(search), @@ -382,11 +385,26 @@ def save_cold_wallet_addresses(blockchain, cold_wallet_addresses): return def check(plot_id): - check_file = '/root/.chia/plotman/checks/{0}.log'.format(plot_id) - if os.path.exists(check_file): + check_file = '/root/.chia/plotman/checks/{0}.log'.format(plot_id[:8]) + if os.path.exists(check_file) and os.path.getsize(check_file): with open(check_file, 'r+') as fp: return fp.read() - return make_response(_("Sorry, no plot check log found. Please wait for scheduled plot check to run."), 200) + try: + thread = threading.Thread(target=plots_check.execute, + kwargs={ + 'plot_id': plot_id + } + ) + thread.start() + except Exception as ex: + app.logger.info(traceback.format_exc()) + try: # Clear any stale status + plot = db.session.query(p.Plot).filter(p.Plot.plot_id == plot_id).first() + plot.plot_check = None + db.session.commit() + except Exception as ex: + app.logger.info(traceback.format_exc()) + return _("Plot check initiated for ID: %(plot_id)s. Please refresh in a few minutes.\n\nNote that all plots will be checked slowly in the background so you\ndon't need to check each one individually. Please be patient.", plot_id=plot_id) def get_transactions(lang, worker, blockchain, wallet_id): try: diff --git a/web/actions/chiadog.py b/web/actions/chiadog.py index c0f70e4b0..9213f3a74 100644 --- a/web/actions/chiadog.py +++ b/web/actions/chiadog.py @@ -44,8 +44,13 @@ def save_config(farmer, blockchain, config): flash(_("Nice! Chiadog's config.yaml validated and saved successfully."), 'success') def get_notifications(): - alerts = db.session.query(a.Alert).order_by(a.Alert.created_at.desc()).all() - return Alerts(alerts) + try: # Due to defect in date formatting around January 2023, if get a Value + alerts = db.session.query(a.Alert).order_by(a.Alert.created_at.desc()).all() + return Alerts(alerts) + except ValueError: + app.logger.error("Found likely malformeed alert timestamp. Now clearing bad alerts.") + remove_all_alerts() + return Alerts([]) def remove_alerts(unique_ids): app.logger.info("Removing {0} alerts: {1}".format(len(unique_ids), unique_ids)) diff --git a/web/actions/plotman.py b/web/actions/plotman.py index 7975e0d27..db69896c2 100644 --- a/web/actions/plotman.py +++ b/web/actions/plotman.py @@ -309,4 +309,18 @@ def save_replotting_settings(form): app.logger.error(msg) flash(msg, 'danger') return - return settings \ No newline at end of file + return settings + + +def load_schedule(plotter, blockchain): + result = utils.send_get(plotter, "/configs/plotting_schedule/" + blockchain, debug=False).content.decode('utf-8') + return json.loads(result) + +# Method is invoked by a XHR post from the Settings | Plotting page. Don't use flash() +def save_schedules(worker, blockchain, schedule): + try: + response = utils.send_put(worker, "/configs/plotting_schedule/" + blockchain, schedule, debug=False) + except Exception as ex: + app.logger.error('Failed to save schedule to plotter because {0}'.format(str(ex))) + else: + app.logger.info('Plotting schedule has been saved and applied. Current plotting manager status of running or stopped is not immediately affected.') diff --git a/web/actions/stats.py b/web/actions/stats.py index d88077179..3fa2a07d5 100644 --- a/web/actions/stats.py +++ b/web/actions/stats.py @@ -41,6 +41,9 @@ # Don't overload the bar chart with tons of plots paths, randomly sample only this amount MAX_ALLOWED_PATHS_ON_BAR_CHART = 20 +# Ignore disk stats that are older than this many minutes ago +STALE_MINUTES_DISK_STATS = 30 + def load_daily_diff(farm_summary): for blockchain in farm_summary.farms: summary = {} @@ -236,8 +239,11 @@ def load_current_disk_usage(disk_type, hostname=None): free = [] used_result = free_result = None if disk_type == 'plots': - created_at_max = db.session.query(StatPlotsDiskUsed).order_by(StatPlotsDiskUsed.created_at.desc()).first() - if created_at_max: + created_at_max = db.session.query(StatPlotsDiskUsed).filter(or_(StatPlotsDiskUsed.hostname == host.hostname, + StatPlotsDiskUsed.hostname == host.displayname)).order_by(StatPlotsDiskUsed.created_at.desc()).first() + if created_at_max and datetime.datetime.strptime(created_at_max.created_at, '%Y%m%d%H%M') <= (datetime.datetime.now() - datetime.timedelta(minutes=STALE_MINUTES_DISK_STATS)): + app.logger.info("Last disk stats from {0} at {1}, ignoring as stale and out-of-date. Check on worker status!".format(host.displayname, created_at_max.created_at)) + elif created_at_max: used_result = db.session.query(StatPlotsDiskUsed).filter( or_(StatPlotsDiskUsed.hostname == host.hostname, StatPlotsDiskUsed.hostname == host.displayname), StatPlotsDiskUsed.created_at == created_at_max.created_at).order_by(StatPlotsDiskUsed.path).all() diff --git a/web/actions/warnings.py b/web/actions/warnings.py index 8a03c65ce..bf1785988 100644 --- a/web/actions/warnings.py +++ b/web/actions/warnings.py @@ -84,7 +84,7 @@ def check_warnings(args): def get_plot_attrs(filename): dir,file = os.path.split(filename) - match = re.match("plot(?:-mmx)?-k(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) + match = re.match("plot(?:-mmx)?-k(\d+)(?:-c\d)?-(\d+)-(\d+)-(\d+)-(\d+)-(\d+)-(\w+).plot", file) if match: short_plot_id = match.group(7)[:16] created_at = "{0}-{1}-{2} {3}:{4}".format( match.group(2),match.group(3),match.group(4),match.group(5),match.group(6)) @@ -135,3 +135,8 @@ def load_plot_warnings(): result['invalids'] = sorted(invalids, key = lambda x: (x['plot_id'], x['worker'], x['path'])) result['missingkeys'] = sorted(missingkeys, key = lambda x: (x['plot_id'], x['worker'], x['path'])) return result + +def clear_plot_warnings(): + db.session.query(w.Warning).delete() + db.session.commit() + flash(_('Plot warnings have been cleared. If they re-appear shortly, then please recheck the underlying cause has been addressed.'), 'success') diff --git a/web/default_settings.py b/web/default_settings.py index 1338f1867..ee36bd77d 100644 --- a/web/default_settings.py +++ b/web/default_settings.py @@ -40,7 +40,7 @@ class DefaultConfig: 'stat_container_mem_gib': 'sqlite:////root/.chia/machinaris/dbs/stat_container_mem_gib.db', 'stat_host_mem_pct': 'sqlite:////root/.chia/machinaris/dbs/stat_host_mem_pct.db', } - SQLALCHEMY_ECHO = True if 'FLASK_ENV' in os.environ and os.environ['FLASK_ENV'] == "development" else False + SQLALCHEMY_ECHO = True if 'FLASK_DEBUG' in os.environ and os.environ['FLASK_DEBUG'] == "development" else False CONTROLLER_SCHEME = 'http' CONTROLLER_HOST = os.environ['controller_host'] if 'controller_host' in os.environ else 'localhost' CONTROLLER_PORT = os.environ['controller_api_port'] if 'controller_api_port' in os.environ else '8926' @@ -50,3 +50,6 @@ class DefaultConfig: # Note, babel looks in /machinaris/web/translations with this path. BABEL_TRANSLATION_DIRECTORIES = "translations" LANGUAGES = ['en', 'de_DE', 'fr_FR', 'it_IT', 'nl_NL', 'pt_PT', 'zh'] + + # Enable client-side caching of static files; Thanks @qoole! + SEND_FILE_MAX_AGE_DEFAULT = 86400 diff --git a/web/models/chia.py b/web/models/chia.py index 02e5f8e81..5b72fe41e 100644 --- a/web/models/chia.py +++ b/web/models/chia.py @@ -34,9 +34,12 @@ def __init__(self, blockchains, farms, wallets, stats): if not farm: app.logger.error("No farm summary found for {0}".format(blockchain['blockchain'])) continue - wallet = self.find_wallet(wallets, blockchain['blockchain']) + blockhain_for_wallet = blockchain['blockchain'] + if blockhain_for_wallet == 'gigahorse': + blockhain_for_wallet = 'chia' # Same wallet + wallet = self.find_wallet(wallets, blockhain_for_wallet) if not wallet: - app.logger.error("No wallet found for {0}".format(blockchain['blockchain'])) + app.logger.error("No wallet found for {0}".format(blockhain_for_wallet)) continue if not blockchain['blockchain'] in stats: app.logger.error("No blockhain stats for {0} in {1}".format(blockchain['blockchain'], stats.keys())) @@ -432,7 +435,7 @@ def extract_wallet_id(self, lines): def link_to_wallet_transactions(self, blockchain, details): lines = [] - if globals.legacy_blockchain(blockchain) or blockchain in ['btcgreen', 'cryptodoge', 'flax', 'shibgreen', 'staicoin']: + if globals.legacy_blockchain(blockchain) or blockchain in ['cryptodoge']: for line in details.split('\n'): if 'wallet id' in line.lower(): lines.append("" + line.strip() + ":") @@ -589,7 +592,7 @@ def __init__(self, blockchains): row['atb_peak_height'] = atb_statuses[blockchain.blockchain]['peak_height'] if 'peak_time' in atb_statuses[blockchain.blockchain]: row['atb_peak_time'] = atb_statuses[blockchain.blockchain]['peak_time'] - else: + elif blockchain.blockchain != 'mmx': app.logger.info("No ATB blockchain status found for: {0}".format(blockchain.blockchain)) except Exception as ex: app.logger.info("Failed to include ATB blockchain status because {0}".format(str(ex))) @@ -604,6 +607,8 @@ def load_atb_blockchain_statuses(self): except Exception as ex: msg = "Unable to read ATB blockchain status cache from {0} because {1}".format(BLOCKCHAIN_STATUSES_CACHE_FILE, str(ex)) print(msg) + if 'chia' in data: + data['gigahorse'] = data['chia'] # Same status for both return data def extract_status(self, blockchain, details, worker_status): @@ -612,6 +617,8 @@ def extract_status(self, blockchain, details, worker_status): return None if blockchain == 'mmx': pattern = '^Synced: (.*)$' + elif blockchain == 'staicoin': # Staicoin being different for no good reason... + pattern = '^Current Status: (.*)$' else: pattern = '^Current Blockchain Status: (.*)$' for line in details.split('\n'): @@ -789,7 +796,7 @@ def parse_mmx(self, connection, blockchain, geoip_cache, lang): for line in connection.details.split('\n'): try: #app.logger.info(line) - m = re.match("\[(.+)\]\s+height\s+=\s+(\!?\d+), (\w+) \(\d+\.\d+\), (\d+\.?\d*) (\w)B/s recv, (\d*\.?\d*) (\w)B/s send,.* since (\d+) min, .* (\d+\.?\d?) sec timeout", line.strip(), re.IGNORECASE) + m = re.match("\[(.+)\]\s+height\s+=\s+(\!?\d+), (\w+) \(\d+\.\d+\), (\d+\.?\d*) (\w)B recv, (\d*\.?\d*) (\w)B sent,.* since (\d+) min, .* (\d+\.?\d?) sec timeout", line.strip(), re.IGNORECASE) if m: connection = { 'type': m.group(3), diff --git a/web/models/plotman.py b/web/models/plotman.py index ac2705f2c..eb37e86b9 100644 --- a/web/models/plotman.py +++ b/web/models/plotman.py @@ -15,6 +15,7 @@ def __init__(self, plottings): 'plotter', 'plot_id', 'k', + 'lvl', 'tmp', 'dst', 'wall', @@ -42,6 +43,7 @@ def __init__(self, plottings): 'plotter': plotting.plotter, 'plot_id': plotting.plot_id, 'k': plotting.k, + 'lvl': plotting.lvl, 'tmp': self.strip_trailing_slash(plotting.tmp), 'dst': self.strip_trailing_slash(plotting.dst), 'wall': plotting.wall, diff --git a/web/models/worker.py b/web/models/worker.py index f13839c5b..d96e0cb96 100644 --- a/web/models/worker.py +++ b/web/models/worker.py @@ -86,8 +86,6 @@ def set_worker_attributes(self, worker): other_versions += blockchain.capitalize() + ": " + config['blockchain_version'] + "
" if 'chiadog_version' in config and config['chiadog_version']: other_versions += "Chiadog: " + config['chiadog_version'] + "
" - if 'farmr_version' in config and config['farmr_version']: - other_versions += "Farmr: " + config['farmr_version'] + "
" if 'madmax_version' in config and config['madmax_version']: other_versions += "Madmax: " + config['madmax_version'] + "
" if 'plotman_version' in config and config['plotman_version']: @@ -97,8 +95,6 @@ def set_worker_attributes(self, worker): worker.time_on_worker = config['now'] else: worker.time_on_worker = '?' - if 'farmr_device_id' in config and config['farmr_device_id']: - worker.farmr_device_id = config['farmr_device_id'] if not worker.port: # Old records worker.port = 8927 diff --git a/web/routes.py b/web/routes.py index be02ca370..2a5011ff7 100644 --- a/web/routes.py +++ b/web/routes.py @@ -28,15 +28,15 @@ def get_lang(request): first_accept = accept.split(',')[0] # Like 'nl' alternative = "{0}_{1}".format(first_accept, first_accept.upper()) if alternative in app.config['LANGUAGES']: - app.logger.info("LOCALE: Accept-Language: {0} ----> using locale: {1}".format(accept, match)) + app.logger.debug("LOCALE: Accept-Language: {0} ----> using locale: {1}".format(accept, alternative)) return alternative if match: - app.logger.info("LOCALE: Accept-Language: {0} ----> matched locale: {1}".format(accept, match)) + app.logger.debug("LOCALE: Accept-Language: {0} ----> matched locale: {1}".format(accept, match)) return match - app.logger.info("LOCALE: Accept-Language: {0} returned no match so defaulting to 'en'.".format(accept)) + app.logger.debug("LOCALE: Accept-Language: {0} returned no match so defaulting to 'en'.".format(accept)) return "en" except: - app.logger.info("LOCALE: Request had no Accept-Language header, returning default locale of 'en'") + app.logger.debug("LOCALE: Request had no Accept-Language header, returning default locale of 'en'") return "en" def find_selected_worker(hosts, hostname, blockchain= None): @@ -170,6 +170,9 @@ def plotting_jobs(): action = request.form.get('action') plot_ids = request.form.getlist('plot_id') plotman.action_plots(action, plot_ids) + elif request.form.get('action') == 'schedule': + schedules = request.form.getlist('schedules') + plotman.save_schedules(schedules) else: app.logger.info(_("Unknown plotting form") + ": {0}".format(request.form)) return redirect(url_for('plotting_jobs')) # Force a redirect to allow time to update status @@ -224,7 +227,7 @@ def farming_plots(): return plotman.analyze(plot_id[:8]) elif request.args.get('check'): # Xhr with a plot_id plot_id = request.args.get('check') - return chia.check(plot_id[:8]) + return chia.check(plot_id) gc = globals.load() farmers = chia.load_farmers() plots = chia.load_plots_farming() @@ -253,9 +256,12 @@ def farming_workers(): MAX_COLUMNS_ON_CHART=stats.MAX_ALLOWED_PATHS_ON_BAR_CHART, global_config=gc) -@app.route('/farming/warnings') +@app.route('/farming/warnings', methods=['GET', 'POST']) def farming_warnings(): gc = globals.load() + if request.method == 'POST': + if request.form.get('action') == 'clear': + warnings.clear_plot_warnings() farmers = chia.load_farmers() plot_warnings = warnings.load_plot_warnings() return render_template('farming/warnings.html', farmers=farmers, @@ -425,12 +431,16 @@ def settings_plotting(): if request.method == 'POST': selected_worker_hostname = request.form.get('worker') selected_blockchain = request.form.get('blockchain') - plotman.save_config(worker.get_worker(selected_worker_hostname, selected_blockchain), selected_blockchain, request.form.get("config")) + if request.form.get('type') == 'schedule': + app.logger.info('Saving updated plotting schedule for worker: {0}'.format(selected_worker_hostname)) + plotman.save_schedules(worker.get_worker(selected_worker_hostname, selected_blockchain), selected_blockchain, request.form.get('schedules')) + return make_response("Successfully saved {0} plotting schedule on {1}.".format(selected_worker_hostname, selected_blockchain), 200) + else: # + plotman.save_config(worker.get_worker(selected_worker_hostname, selected_blockchain), selected_blockchain, request.form.get("config")) workers_summary = worker.load_worker_summary() selected_worker = find_selected_worker(workers_summary.plotters(), selected_worker_hostname, selected_blockchain) if not selected_blockchain: selected_blockchain = selected_worker['blockchain'] - app.logger.info(selected_worker['hostname']) return render_template('settings/plotting.html', blockchains=blockchains, selected_blockchain=selected_blockchain, workers=workers_summary.plotters, selected_worker=selected_worker['hostname'], global_config=gc) @@ -552,6 +562,11 @@ def views_settings_config(path): response = make_response(plotman.load_dirs(w, request.args.get('blockchain')), 200) except requests.exceptions.ConnectionError as ex: response = make_response(_("No responding fullnode found for %(blockchain)s. Please check your workers.", blockchain=escape(request.args.get('blockchain')))) + elif config_type == "plotting_schedule": + try: + response = make_response(plotman.load_schedule(w, request.args.get('blockchain')), 200) + except requests.exceptions.ConnectionError as ex: + response = make_response(_("No responding fullnode found for %(blockchain)s. Please check your workers.", blockchain=escape(request.args.get('blockchain')))) elif config_type == "tools": try: response = make_response(forktools.load_config(w, request.args.get('blockchain')), 200) diff --git a/web/static/landings/en.txt b/web/static/landings/en.txt index ac536a417..72e7a193d 100644 --- a/web/static/landings/en.txt +++ b/web/static/landings/en.txt @@ -64,4 +64,5 @@ Lights out! Do your hard drives have bad sectors now? Lights out! Does the system still boot? Lights out! Lets replot again! 1337.png -You said 'Buy Crypto'! No... I said 'Bye Crypto' \ No newline at end of file +You said 'Buy Crypto'! No... I said 'Bye Crypto' +2023: Dust off your GPU, Chia is going PoW! :) \ No newline at end of file diff --git a/web/templates/alerts.html b/web/templates/alerts.html index 1a1d4ac1e..7582506a7 100644 --- a/web/templates/alerts.html +++ b/web/templates/alerts.html @@ -93,13 +93,13 @@ -
+ {% else %}
{{_('No notifications from Chiadog yet... so check back soon.')}}
diff --git a/web/templates/blockchains.html b/web/templates/blockchains.html index fcc0f584b..1f55db760 100644 --- a/web/templates/blockchains.html +++ b/web/templates/blockchains.html @@ -151,7 +151,7 @@ if blockchain.blockchain == 'mmx' %}{% else - %}{{_('Plot Check')}}
- -
@@ -348,11 +340,13 @@ plot_id = arr[1].trim(); if (status == 'GOOD') { return ''; - } else { + } else if (status == 'BAD') { return ''; + } else { + return ''; } - } - return ""; + } + return ''; } }, ], diff --git a/web/templates/farming/warnings.html b/web/templates/farming/warnings.html index 0ab141892..caa077fdd 100644 --- a/web/templates/farming/warnings.html +++ b/web/templates/farming/warnings.html @@ -163,7 +163,12 @@
{{_('Great! No plots with missing keys were reported amongst the workers on {% endif %}
- +
+
+ +
+
{% endblock %} {% block scripts %} @@ -196,6 +201,14 @@
{{_('Great! No plots with missing keys were reported amongst the workers on }, {% endif %} }); + $("#btnClear").click(function () { + $('#btnClear').prop("disabled", true); + $('#btnClear').html( + ` {{_('Clearing...')}}` + ); + $('#warnings-form').append(''); + $("#warnings-form").submit(); + }); }) {% endblock %} \ No newline at end of file diff --git a/web/templates/index.html b/web/templates/index.html index c90aef30c..71d1d3e25 100644 --- a/web/templates/index.html +++ b/web/templates/index.html @@ -83,6 +83,7 @@
{{_('Total Plots Size')}}
+ {% if blockchain != 'gigahorse' %}
@@ -130,6 +131,7 @@
{{blockchain|capitalize}} - {{_('Wallets')}}
{% endif %} + {% endif %} {% if farms[blockchain].challenges.labels|length > 0 %}
diff --git a/web/templates/plotting/jobs.html b/web/templates/plotting/jobs.html index 99277a2e5..98a802739 100644 --- a/web/templates/plotting/jobs.html +++ b/web/templates/plotting/jobs.html @@ -85,13 +85,15 @@
+
-
+ +