Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Machinaris v2.2.0 #973

Merged
merged 37 commits into from
Feb 29, 2024
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
c960812
Gigahorse version bump to 2.1.4.giga26
guydavis Jan 12, 2024
0799fa4
Optionally start chia exporter in harvester mode as well.
guydavis Jan 12, 2024
badc2c9
Update status_plotnfts.py
chris-merritt Jan 15, 2024
4cd6f65
Merge pull request #963 from chris-merritt/integration
guydavis Jan 15, 2024
3f6976f
Merge pull request #964 from guydavis/develop
guydavis Jan 15, 2024
6a63957
Cactus to v2.1.4
guydavis Jan 24, 2024
a786159
Cactus @ v2.1.4
guydavis Jan 24, 2024
3cc7c8f
Chia 2.2.0rc1
guydavis Feb 1, 2024
0ac7b6e
Optionally start chia data layer services.
guydavis Feb 3, 2024
fc35031
Merge pull request #965 from guydavis/develop
guydavis Feb 5, 2024
d1a50e5
Merge pull request #6 from guydavis/develop
priyankub Feb 7, 2024
2b40032
Bump up GreenBTC to latest hash
priyankub Feb 8, 2024
6885ae2
Update chia_cli.py for greenbtc
priyankub Feb 8, 2024
25352ac
1. Achi check in - Develop branch
priyankub Feb 8, 2024
2c0ad12
1. Correct Achi links, and minor case corrections in comments
priyankub Feb 8, 2024
ca8e364
Merge branch 'guydavis:integration' into integration
priyankub Feb 8, 2024
0630f1d
Merge pull request #8 from priyankub/integration
priyankub Feb 8, 2024
9f9ad60
Merge pull request #7 from priyankub/develop
priyankub Feb 8, 2024
0a3213a
1. Update legacy chains - remove greenbtc, add achi
priyankub Feb 8, 2024
5ca5e93
Chia 2.2.0rc2
guydavis Feb 8, 2024
e3e56af
Chia 2.2.0rc3
guydavis Feb 16, 2024
af57d15
Merge pull request #966 from priyankub/integration
guydavis Feb 16, 2024
cee3d7d
Cleanups after merge.
guydavis Feb 16, 2024
bff7737
Formatting fix for Achi.
guydavis Feb 18, 2024
b7866fe
Wheat @ 2.1.5
guydavis Feb 19, 2024
59546f7
Latest JS libs.
guydavis Feb 20, 2024
e85d87e
Wheat @ 2.1.6
guydavis Feb 21, 2024
42e806f
Chia 2.2.0rc4
guydavis Feb 21, 2024
d7c163a
Merge pull request #968 from guydavis/develop
guydavis Feb 22, 2024
1d2696e
Fixing for Datatables.js v2.0 import issue.
guydavis Feb 22, 2024
f65f728
Merge pull request #969 from guydavis/develop
guydavis Feb 22, 2024
2735379
Fix for Chia's changes to bladebit packaging.
guydavis Feb 26, 2024
37bdebe
Merge pull request #970 from guydavis/develop
guydavis Feb 26, 2024
bf7b8d3
Chia 2.2.0
guydavis Feb 28, 2024
b8f1d8f
Merge pull request #971 from guydavis/develop
guydavis Feb 28, 2024
3be12ce
Account for another year of Chia blockchain DB bloat.
guydavis Feb 29, 2024
76b1699
Merge pull request #972 from guydavis/develop
guydavis Feb 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
1. Achi check in - Develop branch
priyankub committed Feb 8, 2024
commit 25352ac88699f2eff8d0adcc8782ac516b2c303b
51 changes: 51 additions & 0 deletions .github/workflows/develop-achi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: develop-achi

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@v4
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"
"ACHI_BRANCH=master"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-achi:develop
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-achi:develop
52 changes: 52 additions & 0 deletions .github/workflows/main-achi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: release-achi

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@v4
with:
file: docker/dockerfile
context: .
platforms: linux/amd64,linux/arm64
provenance: false
push: true
build-args: |
"UBUNTU_VER=focal"
"MACHINARIS_STREAM=latest"
"ACHI_BRANCH=master"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-achi:latest
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-achi:v${{ github.event.inputs.version }}
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-achi:latest
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-achi:v${{ github.event.inputs.version }}
50 changes: 50 additions & 0 deletions .github/workflows/test-achi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: test-achi

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@v4
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"
"ACHI_BRANCH=master"
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/machinaris-achi:test
ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/machinaris-achi:test
9 changes: 8 additions & 1 deletion api/commands/rpc.py
Original file line number Diff line number Diff line change
@@ -15,7 +15,14 @@

blockchain = globals.enabled_blockchains()[0]

if blockchain == "apple":
if blockchain == "achi":
from achi.rpc.full_node_rpc_client import FullNodeRpcClient
from achi.rpc.farmer_rpc_client import FarmerRpcClient
from achi.rpc.wallet_rpc_client import WalletRpcClient
from achi.util.default_root import DEFAULT_ROOT_PATH
from achi.util.ints import uint16
from achi.util.config import load_config as load_fork_config
elif blockchain == "apple":
from apple.rpc.full_node_rpc_client import FullNodeRpcClient
from apple.rpc.farmer_rpc_client import FarmerRpcClient
from apple.rpc.wallet_rpc_client import WalletRpcClient
17 changes: 17 additions & 0 deletions common/config/blockchains.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
{
"achi": {
"name": "Achi",
"symbol": "ACH" ,
"binary": "/achi-blockchain/venv/bin/achi",
"network_path": "/root/.achi/mainnet",
"network_name": "mainnet",
"network_port": 9975,
"farmer_port": 9977,
"fullnode_rpc_port": 9965,
"worker_port": 8960,
"reward": 495,
"mojos_per_coin": 1000000000,
"blocks_per_day": 4608,
"git_url": "https://github.com/Achi-Coin/achi-blockchain/",
"discord_url": "https://discord.gg/ZTtQ9922zp",
"website_url": "https://achicoin.org/"
},
"apple": {
"name": "Apple",
"symbol": "APPLE",
4 changes: 3 additions & 1 deletion docker/dockerfile
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ ARG FDCLI_BRANCH=master
ARG FORKTOOLS_BRANCH=main
ARG BLADEBIT_BRANCH=master

ARG ACHI_BRANCH
ARG APPLE_BRANCH
ARG BALLCOIN_BRANCH
ARG BPX_BRANCH
@@ -53,7 +54,8 @@ 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/achi_install.sh ${ACHI_BRANCH} \
&& /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} \
26 changes: 26 additions & 0 deletions scripts/forks/achi_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/env bash
#
# Installs Achi as per https://github.com/Achi-Coin/achi-blockchain
#

ACHI_BRANCH=$1
# On 2024-02-08
HASH=e3ca475efb3d7267d3a2eedef8b4897d129aeb5d

if [ -z ${ACHI_BRANCH} ]; then
echo 'Skipping Achi install as not requested.'
else
git clone --branch ${ACHI_BRANCH} --recurse-submodules https://github.com/Achi-Coin/achi-blockchain.git /achi-blockchain
cd /achi-blockchain
git submodule update --init mozilla-ca
git checkout $HASH
chmod +x install.sh
/usr/bin/sh ./install.sh

if [ ! -d /chia-blockchain/venv ]; then
cd /
rmdir /chia-blockchain
ln -s /achi-blockchain /chia-blockchain
ln -s /achi-blockchain/venv/bin/achi /chia-blockchain/venv/bin/chia
fi
fi
116 changes: 116 additions & 0 deletions scripts/forks/achi_launch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
#!/bin/env bash
#
# Initialize Achi service, depending on mode of system requested
#

cd /achi-blockchain

. ./activate

# Only the /root/.chia folder is volume-mounted so store achi within
mkdir -p /root/.chia/achi
rm -f /root/.achi
ln -s /root/.chia/achi /root/.achi

if [[ "${blockchain_db_download}" == 'true' ]] \
&& [[ "${mode}" == 'fullnode' ]] \
&& [[ ! -f /root/.achi/mainnet/db/blockchain_v1_mainnet.sqlite ]] \
&& [[ ! -f /root/.achi/mainnet/db/blockchain_v2_mainnet.sqlite ]]; then
echo "Sorry, achi does not offer a recent blockchain DB for download. 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/.achi/mainnet/log
achi init >> /root/.achi/mainnet/log/init.log 2>&1

echo 'Configuring achi...'
if [ -f /root/.achi/mainnet/config/config.yaml ]; then
sed -i 's/log_stdout: true/log_stdout: false/g' /root/.achi/mainnet/config/config.yaml
sed -i 's/log_level: WARNING/log_level: INFO/g' /root/.achi/mainnet/config/config.yaml
sed -i 's/localhost/127.0.0.1/g' /root/.achi/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}"
achi 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
achi plots add -d ${p}
done

chmod 755 -R /root/.achi/mainnet/config/ssl/ &> /dev/null
achi init --fix-ssl-permissions >/dev/null 2>&1

# 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
achi keys add -f ${k}
sleep 10
fi
done
done
if [ -f /root/.chia/machinaris/config/wallet_settings.json ]; then
achi start farmer-no-wallet
else
achi start farmer
fi
if [[ ${mode} =~ .*timelord$ ]]; then
if [ ! -f vdf_bench ]; then
echo "Building timelord binaries..."
apt-get update > /tmp/timelord_build.sh 2>&1
apt-get install -y libgmp-dev libboost-python-dev libboost-system-dev >> /tmp/timelord_build.sh 2>&1
BUILD_VDF_CLIENT=Y BUILD_VDF_BENCH=Y /usr/bin/sh ./install-timelord.sh >> /tmp/timelord_build.sh 2>&1
fi
achi start timelord-only
fi
elif [[ ${mode} =~ ^farmer.* ]]; then
if [ ! -f ~/.achi/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
achi 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/.achi/farmer_ca/private_ca.crt ]; then
mkdir -p /root/.achi/farmer_ca
response=$(curl --write-out '%{http_code}' --silent http://${farmer_address}:8960/certificates/?type=achi --output /tmp/certs.zip)
if [ $response == '200' ]; then
unzip /tmp/certs.zip -d /root/.achi/farmer_ca
else
echo "Certificates response of ${response} from http://${farmer_address}:8960/certificates/?type=achi. Is the fork's fullnode container running?"
fi
rm -f /tmp/certs.zip
fi
if [[ -f /root/.achi/farmer_ca/private_ca.crt ]] && [[ ! ${keys} == "persistent" ]]; then
achi init -c /root/.achi/farmer_ca 2>&1 > /root/.achi/mainnet/log/init.log
chmod 755 -R /root/.achi/mainnet/config/ssl/ &> /dev/null
achi init --fix-ssl-permissions >/dev/null 2>&1
else
echo "Did not find your farmer's certificates within /root/.achi/farmer_ca."
echo "See: https://github.com/guydavis/machinaris/wiki/Workers#harvester"
fi
echo "Configuring farmer peer at ${farmer_address}:${farmer_port}"
achi configure --set-farmer-peer ${farmer_address}:${farmer_port} 2>&1 >> /root/.achi/mainnet/log/init.log
achi configure --enable-upnp false 2>&1 >> /root/.achi/mainnet/log/init.log
achi start harvester -r
fi
elif [[ ${mode} == 'plotter' ]]; then
echo "Starting in Plotter-only mode. Run Plotman from either CLI or WebUI."
fi
3 changes: 3 additions & 0 deletions scripts/worker_port_warning.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Warn if non-standard worker_api_port is being used, likely default value they did not override properly
if [[ "${blockchains}" == "achi" && "${worker_api_port}" != '8960' ]]; then
echo "Achi worker with non-standard worker_api_port of ${worker_api_port} found. Did you mean to use 8960?"
fi
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
13 changes: 13 additions & 0 deletions web/templates/worker_launch.html
Original file line number Diff line number Diff line change
@@ -155,6 +155,9 @@
}

function lookup_worker_port(blockchain) {
if (blockchain == 'achi') {
return 8960;
}
if (blockchain == 'apple') {
return 8947;
}
@@ -258,6 +261,9 @@
}

function lookup_farmer_port(blockchain) {
if (blockchain == 'achi') {
return 9977;
}
if (blockchain == 'apple') {
return 26667;
}
@@ -671,6 +677,13 @@ <h2>{{_('Machinaris Worker - Launch Config')}}</h2>
<div class="col offset">
<label for="inputState" class="form-label">{{_('Blockchains to Farm')}} <a href="https://alltheblocks.net" target="_blank"><i class="fs-4 bi-box-arrow-up-right text-white"></i></a></label>
<div class="row">
<div class="col">
<input class="form-check-input" type="checkbox" name="blockchains"
id="blockchain-achi" onclick="updateDocker()" value="achi">
<label class="form-check-label" for="blockchain-achi" onclick="updateDocker()">
Achi
</label>
</div>
<div class="col">
<input class="form-check-input" type="checkbox" name="blockchains"
id="blockchain-apple" onclick="updateDocker()" value="apple">