Skip to content

Commit

Permalink
Merge pull request #702 from guydavis/integration
Browse files Browse the repository at this point in the history
v0.8.0
  • Loading branch information
guydavis authored Jun 30, 2022
2 parents 5619a7a + 96bb7a9 commit 158c966
Show file tree
Hide file tree
Showing 162 changed files with 10,162 additions and 2,057 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/develop-btcgreen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"BTCGREEN_BRANCH=main"
"CHIADOG_BRANCH=dev"
"BTCGREEN_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-btcgreen:develop
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-btcgreen:develop
1 change: 1 addition & 0 deletions .github/workflows/develop-cactus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"CACTUS_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-cactus:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-chia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"CHIA_BRANCH=latest"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-chives.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"CHIVES_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chives:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-cryptodoge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"CRYPTODOGE_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-cryptodoge:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-flax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"FLAX_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-flax:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-flora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"FLORA_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-flora:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-hddcoin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"HDDCOIN_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-hddcoin:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-maize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"MAIZE_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-maize:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-nchain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"NCHAIN_BRANCH=net9.dev"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-nchain:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-shibgreen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"SHIBGREEN_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-shibgreen:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-silicoin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"SILICOIN_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-silicoin:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-staicoin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"STAICOIN_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-staicoin:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/develop-stor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=develop"
"CHIADOG_BRANCH=dev"
"STOR_BRANCH=master"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-stor:develop
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-btcgreen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"BTCGREEN_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-btcgreen:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-cactus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"CACTUS_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-cactus:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-chia.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"CHIA_BRANCH=latest"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-chives.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"CHIVES_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-chives:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-cryptodoge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"CRYPTODOGE_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-cryptodoge:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-flax.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"FLAX_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-flax:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-flora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"FLORA_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-flora:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-hddcoin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"HDDCOIN_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-hddcoin:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-maize.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"MAIZE_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-maize:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-nchain.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"NCHAIN_BRANCH=net9.dev"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-nchain:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-shibgreen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"SHIBGREEN_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-shibgreen:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-silicoin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"SILICOIN_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-silicoin:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-staicoin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"STAICOIN_BRANCH=main"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-staicoin:test
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-stor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
push: true
build-args: |
"MACHINARIS_STREAM=test"
"CHIADOG_BRANCH=dev"
"STOR_BRANCH=master"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-stor:test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

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.0] - 2022-06-30
- Charting of each blockchain's netspace, farmed coins, and wallet balances over the past month.
- Tracking farmed blocks sent directly to cold wallet. Set your cold wallet addresses on the Wallets page.
- Added a read-only transactions viewer for each blockchain's wallet, available from Wallets page.
- Alerts: per-notifier [allow setting](https://github.com/guydavis/machinaris/wiki/ChiaDog#ignore-alerts) to allow only selected alerts, based on criteria.
- [Chia](https://github.com/Chia-Network/chia-blockchain/releases/tag/1.4.0) - v1.4.0, after a month of pre-release testing with Machinaris.
- [Cactus](https://github.com/Cactus-Network/cactus-blockchain) - v1.3.4, matches Chia 1.3.4, please run: `cactus db upgrade`
- [Chives](https://github.com/HiveProject2021/chives-blockchain) - v1.3.1, please run: `chives db upgrade`
- [Cryptodoge](https://github.com/CryptoDoge-Network/cryptodoge) - v1.3.4, matches Chia 1.3.4, please run: `cryptodoge db upgrade`
- [Flax](https://github.com/Flax-Network/flax-blockchain) - v0.1.8, matches Chia 1.3.3, please run: `flax db upgrade` if you haven't yet
- [MMX](https://github.com/madMAx43v3r/mmx-node) - updated version for their `testnet6` network.

## [0.7.2] - 2022-05-17
- Drives monitoring page - allow [overrides of smartctl commands](https://github.com/guydavis/machinaris/wiki/Drives#override-command) for special hardware. Drive failure alerts thru our enhanced Chiadog.
- Alerts: per-notifier [ignore setting](https://github.com/guydavis/machinaris/wiki/ChiaDog#ignore-alerts) to prevent unwanted alerts, based on criteria.
Expand All @@ -23,7 +35,8 @@ All notable changes to this project will be documented in this file. The format
- [Internationalization](https://github.com/guydavis/machinaris/wiki/Localization) for locale-specific text, numbers, and currencies. Huge thanks to @antcasq (pt_PT) and @fabriziocacicia (it_IT) for providing translations!
- Geolocation of peer connections for each blockchain by their IP address. [Optionally enabled](https://github.com/guydavis/machinaris/wiki/Connections) using a free Maxmind account.
- [Flax](https://github.com/Flax-Network/flax-blockchain) - updated to v0.1.6, supporting new v2 DB format.
- [Silicoin](https://github.com/silicoin-network/silicoin-blockchain) - supported again as per Discord votes.
- [HDDCoin](https://github.com/HDDcoin-Network/hddcoin-blockchain/releases) - update to version 2.0.2
- [Silicoin](https://github.com/silicoin-network/silicoin-blockchain) - v1.2.2, supported again as per Discord votes.

## [0.6.9] - 2022-02-04
- [MMX](https://github.com/madMAx43v3r/mmx-node) - support for this new blockchain, which requires its own plot files.
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Plotting with the [MadMax](https://github.com/madMAx43v3r/chia-plotter), [Bladeb

![Plotting](https://raw.githubusercontent.com/guydavis/machinaris-unraid/master/docs/img/machinaris_plotting.png)

Track your plotter machines performance as you fine-tune your plotting, graphed for each k-size you plot.

![Speed](https://raw.githubusercontent.com/guydavis/machinaris-unraid/master/docs/img/plotting_speed_chart.png)

## Farming View

Machinaris bundles the [latest Chia™ version](https://github.com/Chia-Network/chia-blockchain/wiki/INSTALL#ubuntudebian) inside the Docker image.
Expand All @@ -26,6 +30,8 @@ Machinaris also optionally farms your plots to many other blockchain forks inclu

![Alerts](https://raw.githubusercontent.com/guydavis/machinaris-unraid/master/docs/img/ChiaDog-1-Example.png)

Notifications can be sent to e-mail, telegram, discord, slack, etc.

## Setup

Simplified setup allows you to either import your existing key mnemonic or generate a new one directly in the Machinaris WebUI on first launch:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.7.2
0.8.0
14 changes: 10 additions & 4 deletions api/commands/chia_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,16 @@ def load_wallet_show(blockchain):
child = pexpect.spawn("{0} wallet show".format(chia_binary))
wallet_index = 1
while True:
i = child.expect(["Wallet height:.*\r\n", "Choose wallet key:.*\r\n", "No online backup file found.*\r\n"], timeout=120)
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=120)
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:
elif i == 1 or i == 2 or i == 3:
app.logger.debug("wallet show got index prompt so selecting #{0}".format(wallet_index))
child.sendline("{0}".format(wallet_index))
wallet_index += 1
elif i == 2:
elif i == 4:
child.sendline("S")
else:
app.logger.debug("pexpect returned {0}".format(i))
Expand Down Expand Up @@ -121,7 +121,11 @@ def load_connections_show(blockchain):

def load_keys_show(blockchain):
chia_binary = globals.get_blockchain_binary(blockchain)
proc = Popen("{0} keys show".format(chia_binary), stdout=PIPE, stderr=PIPE, shell=True)
# 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)
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)
try:
outs, errs = proc.communicate(timeout=90)
except TimeoutExpired:
Expand Down Expand Up @@ -182,6 +186,7 @@ def plot_check(blockchain, 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)
try:
Expand All @@ -190,6 +195,7 @@ def plot_check(blockchain, plot_path):
proc.kill()
proc.communicate()
abort(500, description="The timeout is expired attempting to check plots.")
app.logger.info("Completed plot check of: {0}".format(plot_path))
class_escape = re.compile(r'.*: INFO\s+')
ansi_escape = re.compile(r'\x1B(?:[@-Z\\-_]|\[[0-?]*[ -/]*[@-~])')
return class_escape.sub('', ansi_escape.sub('', outs))
Expand Down
27 changes: 26 additions & 1 deletion api/commands/log_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# Methods around reading and parsing service logs
#


import datetime
import itertools
import os
Expand Down Expand Up @@ -84,6 +83,32 @@ def recent_partials(blockchain):
# app.logger.debug(partials)
return partials

def recent_farmed_blocks(blockchain):
log_file = get_farming_log_file(blockchain)
if not os.path.exists(log_file):
app.logger.debug(
"Skipping farmed blocks parsing as no such log file: {0}".format(log_file))
return []
rotated_log_file = ''
if os.path.exists(log_file + '.1'):
rotated_log_file = log_file + '.1'
proc = Popen("grep -B 15 'Farmed unfinished_block' {0} {1}".format(rotated_log_file, log_file),
stdout=PIPE, stderr=PIPE, shell=True)
try:
outs, errs = proc.communicate(timeout=90)
except TimeoutExpired:
proc.kill()
proc.communicate()
abort(500, description="The timeout is expired!")
if errs:
app.logger.error(errs.decode('utf-8'))
abort(500, description=errs.decode('utf-8'))
cli_stdout = outs.decode('utf-8')
#app.logger.info("Blocks grep: {0}".format(cli_stdout))
blocks = log.Blocks(cli_stdout.splitlines())
#app.logger.info(blocks.rows)
return blocks

def find_plotting_job_log(plot_id):
dir_path = '/root/.chia/plotman/logs'
directory = os.fsencode(dir_path)
Expand Down
Loading

0 comments on commit 158c966

Please sign in to comment.