Skip to content

Commit

Permalink
Merge pull request #13 from afiniel/v2.3.1
Browse files Browse the repository at this point in the history
V2.3.1
  • Loading branch information
afiniel authored Jan 16, 2025
2 parents 448ec8d + 1b6dadf commit 4a015d1
Show file tree
Hide file tree
Showing 18 changed files with 354 additions and 527 deletions.
29 changes: 19 additions & 10 deletions daemon_builder/berkeley.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,25 @@ echo -e "\n$MAGENTA => Building Berkeley 4.8 <= ${NC}"
sudo mkdir -p $STORAGE_ROOT/berkeley/db4/
hide_output sudo wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
hide_output sudo tar -xzvf db-4.8.30.NC.tar.gz
sudo sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-4.8.30.NC/dbinc/atomic.h
cd db-4.8.30.NC/build_unix/
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$STORAGE_ROOT/berkeley/db4/
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/home/crypto-data/berkeley/db4
hide_output sudo make -j$((`nproc`+1))
hide_output sudo make install -j$((`nproc`+1))
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
sudo rm -r db-4.8.30.NC.tar.gz db-4.8.30.NC
echo -e "$GREEN => Berkeley 4.8 Completed <= ${NC}"

# Build BerkeleyDB 5.1
echo -e "\n$MAGENTA => Building Berkeley 5.1 <= ${NC}"
sudo mkdir -p $STORAGE_ROOT/berkeley/db5/
sudo mkdir -p $STORAGE_ROOT/berkeley/db5.1/
hide_output sudo wget 'http://download.oracle.com/berkeley-db/db-5.1.29.tar.gz'
hide_output sudo tar -xzvf db-5.1.29.tar.gz
sudo sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-5.1.29/src/dbinc/atomic.h
cd db-5.1.29/build_unix/
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$STORAGE_ROOT/berkeley/db5/
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/home/crypto-data/berkeley/db5.1
hide_output sudo make -j$((`nproc`+1))
hide_output sudo make install -j$((`nproc`+1))
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
sudo rm -r db-5.1.29.tar.gz db-5.1.29
echo -e "$GREEN => Berkeley 5.1 Completed <= ${NC}"
Expand All @@ -74,23 +78,27 @@ echo -e "\n$MAGENTA => Building Berkeley 5.3 <= ${NC}"
sudo mkdir -p $STORAGE_ROOT/berkeley/db5.3/
hide_output sudo wget 'http://anduin.linuxfromscratch.org/BLFS/bdb/db-5.3.28.tar.gz'
hide_output sudo tar -xzvf db-5.3.28.tar.gz
sudo sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-5.3.28/src/dbinc/atomic.h
cd db-5.3.28/build_unix/
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$STORAGE_ROOT/berkeley/db5.3/
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/home/crypto-data/berkeley/db5.3
hide_output sudo make -j$((`nproc`+1))
hide_output sudo make install -j$((`nproc`+1))
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
sudo rm -r db-5.3.28.tar.gz db-5.3.28
echo -e "$GREEN => Berkeley 5.3 Completed <= ${NC}"

# Build BerkeleyDB 6.2
echo -e "\n$MAGENTA => Building Berkeley 6.2 <= ${NC}"
sudo mkdir -p $STORAGE_ROOT/berkeley/db6.2/
hide_output sudo wget 'https://download.oracle.com/berkeley-db/db-6.2.23.tar.gz'
hide_output sudo tar -xzvf db-6.2.23.tar.gz
cd db-6.2.23/build_unix/
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$STORAGE_ROOT/berkeley/db6.2/
hide_output sudo wget 'http://download.oracle.com/berkeley-db/db-6.2.32.tar.gz'
hide_output sudo tar -xzvf db-6.2.32.tar.gz
sudo sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-6.2.32/src/dbinc/atomic.h
cd db-6.2.32/build_unix/
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/home/crypto-data/berkeley/db6.2
hide_output sudo make -j$((`nproc`+1))
hide_output sudo make install -j$((`nproc`+1))
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
sudo rm -r db-6.2.23.tar.gz db-6.2.23
sudo rm -r db-6.2.32.tar.gz db-6.2.32
echo -e "$GREEN => Berkeley 6.2 Completed <= ${NC}"

# Build BerkeleyDB 18
Expand All @@ -99,8 +107,9 @@ sudo mkdir -p $STORAGE_ROOT/berkeley/db18/
hide_output sudo wget 'https://download.oracle.com/berkeley-db/db-18.1.40.tar.gz'
hide_output sudo tar -xzvf db-18.1.40.tar.gz
cd db-18.1.40/build_unix/
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$STORAGE_ROOT/berkeley/db18/
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/home/crypto-data/berkeley/db18
hide_output sudo make -j$((`nproc`+1))
hide_output sudo make install -j$((`nproc`+1))
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
sudo rm -r db-18.1.40.tar.gz db-18.1.40
echo -e "$GREEN => Berkeley 18 Completed <= ${NC}"
Expand Down
2 changes: 1 addition & 1 deletion daemon_builder/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
################################################################################

if [ -z "${TAG}" ]; then
TAG=v2.3.0
TAG=v2.3.1
fi

clear
Expand Down
10 changes: 5 additions & 5 deletions daemon_builder/requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@ fi
echo -e "$GREEN Additional System Files Completed...$NC"
echo

# Updating gcc & g++ to version 8
# Updating gcc & g++ to version 9
echo
echo -e "$CYAN => Updating gcc & g++ to version 8 $NC"
echo -e "$CYAN => Updating gcc & g++ to version 9 $NC"
hide_output sudo apt-get update
hide_output sudo apt-get -y upgrade
apt_dist_upgrade
Expand All @@ -80,12 +80,12 @@ hide_output sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
fi
hide_output sudo apt-get update

apt_install gcc-8 g++-8
apt_install gcc-9 g++-9

hide_output sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 60 --slave /usr/bin/g++ g++ /usr/bin/g++-8
hide_output sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
hide_output sudo update-alternatives --config gcc

echo -e "$GREEN gcc & g++ Updated...$NC"
echo -e "$GREEN gcc & g++ Updated to version 9...$NC"

set +eu +o pipefail
cd $HOME/Yiimpoolv1/daemon_builder
Expand Down
2 changes: 1 addition & 1 deletion daemon_builder/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ source /etc/yiimpool.conf

# Create DaemonBuilder directory
if [ ! -d $STORAGE_ROOT/daemon_builder ]; then
mkdir -p $STORAGE_ROOT/daemon_builder
sudo mkdir -p $STORAGE_ROOT/daemon_builder
fi

# Start the DeamonBuilder installation.
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#########################################################

# Default version tag if not provided as environment variable
TAG=${TAG:-v2.3.0}
TAG=${TAG:-v2.3.1}

# File paths
YIIMPOOL_VERSION_FILE="/etc/yiimpoolversion.conf"
Expand Down
15 changes: 15 additions & 0 deletions ver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
#########################################################
# Source https://mailinabox.email/ https://github.com/mail-in-a-box/mailinabox
# Updated by Afiniel for Yiimpool use...
# This script is intended to be run like this:
#
# curl https://raw.githubusercontent.com/afiniel/yiimp_install_script/master/install.sh | bash
#
#########################################################

if [ -z "${TAG}" ]; then
TAG=v2.3.1
fi

echo 'VERSION='"${TAG}"'' | sudo -E tee /etc/yiimpoolversion.conf >/dev/null 2>&1
101 changes: 64 additions & 37 deletions yiimp_single/db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -106,37 +106,65 @@ echo
echo -e "$YELLOW => Importing YiiMP Default database values <= ${NC}"
cd "$STORAGE_ROOT/yiimp/yiimp_setup/yiimp/sql"

# Import SQL dump
sudo zcat 2020-11-10-yaamp.sql.gz | sudo mysql -u root -p"${DBRootPassword}" "${YiiMPDBName}"

# Import additional SQL files
SQL_FILES=(
2016-04-24-market_history.sql
2016-04-27-settings.sql
2016-05-11-coins.sql
2016-05-15-benchmarks.sql
2016-05-23-bookmarks.sql
2016-06-01-notifications.sql
2016-06-04-bench_chips.sql
2016-11-23-coins.sql
2017-02-05-benchmarks.sql
2017-03-31-earnings_index.sql
2017-05-accounts_case_swaptime.sql
2017-06-payouts_coinid_memo.sql
2017-09-notifications.sql
2017-10-bookmarks.sql
2017-11-segwit.sql
2018-01-stratums_ports.sql
2018-02-coins_getinfo.sql
2018-09-22-workers.sql
2019-03-coins_thepool_life.sql
2020-06-03-blocks.sql
2022-10-14-shares_solo.sql
2022-10-29-blocks_effort.sql
# Check if we're in the correct directory
if [[ ! -d "$(pwd)" ]]; then
echo -e "${RED}Error: SQL directory not found at $(pwd)${NC}"
exit 1
fi

# Look for the base database file
BASE_DB_FILE=""
for file in *.sql *.sql.gz; do
if [[ -f "$file" ]]; then
if [[ "$file" == *"complete"* ]] || [[ "$file" == *"base"* ]] || [[ "$file" == *"structure"* ]]; then
BASE_DB_FILE="$file"
break
fi
fi
done

if [[ -z "$BASE_DB_FILE" ]]; then
echo -e "${RED}Error: Could not find base database file. Please ensure a database export file exists in $(pwd)${NC}"
echo -e "${YELLOW}The file should be named something like 'complete_export.sql' or 'base_structure.sql'${NC}"
exit 1
fi

# Create the database structure
echo -e "Creating database structure from $BASE_DB_FILE..."
if [[ "$BASE_DB_FILE" == *.gz ]]; then
sudo zcat "$BASE_DB_FILE" | sudo mysql -u root -p"${DBRootPassword}" "${YiiMPDBName}" || {
echo -e "${RED}Error: Failed to import gzipped database file${NC}"
exit 1
}
else
sudo mysql -u root -p"${DBRootPassword}" "${YiiMPDBName}" < "$BASE_DB_FILE" || {
echo -e "${RED}Error: Failed to import database file${NC}"
exit 1
}
fi

# Then apply updates in order, ignoring errors
echo -e "Applying database updates..."
SQL_UPDATE_FILES=(
"2024-03-18-add_aurum_algo.sql"
"2024-03-29-add_github_version.sql"
"2024-03-31-add_payout_threshold.sql"
"2024-04-01-add_auto_exchange.sql"
"2024-04-01-shares_blocknumber.sql"
"2024-04-05-algos_port_color.sql"
"2024-04-22-add_equihash_algos.sql"
"2024-04-23-add_pers_string.sql"
"2024-04-29-add_sellthreshold.sql"
"2024-05-04-add_neoscrypt_xaya_algo.sql"
)

for file in "${SQL_FILES[@]}"; do
sudo mysql -u root -p"${DBRootPassword}" "${YiiMPDBName}" --force < "$file"
for file in "${SQL_UPDATE_FILES[@]}"; do
if [[ -f "$file" ]]; then
echo -e "Applying update from $file..."
sudo mysql -u root -p"${DBRootPassword}" "${YiiMPDBName}" < "$file" || true
else
echo -e "${YELLOW}Warning: Update file $file not found${NC}"
fi
done

echo
Expand All @@ -147,12 +175,13 @@ echo -e "$YELLOW => Tweaking MariaDB for better performance <= ${NC}"

# Define MariaDB configuration changes
config_changes=(
'max_connections = 800'
'thread_cache_size = 512'
'tmp_table_size = 128M'
'max_heap_table_size = 128M'
'wait_timeout = 60'
'max_allowed_packet = 64M'
'[mysqld]'
'max_connections=800'
'thread_cache_size=512'
'tmp_table_size=128M'
'max_heap_table_size=128M'
'wait_timeout=60'
'max_allowed_packet=64M'
)

# Add bind-address if WireGuard is true
Expand All @@ -166,10 +195,8 @@ config_string=$(printf "%s\n" "${config_changes[@]}")
# Apply changes to MariaDB configuration
sudo bash -c "echo \"$config_string\" >> /etc/mysql/my.cnf"

# Restart MariaDB
restart_service mysql

# Reset error handling
set +eu +o pipefail

cd $HOME/Yiimpoolv1/yiimp_single
2 changes: 1 addition & 1 deletion yiimp_single/nginx_domain_ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
source /etc/functions.sh
source /etc/yiimpool.conf
source $STORAGE_ROOT/yiimp/.yiimp.conf
source $HOME/yiimp_install_script/yiimp_single/.wireguard.install.cnf
source $HOME/Yiimpoolv1/yiimp_single/.wireguard.install.cnf

set -eu -o pipefail

Expand Down
Loading

0 comments on commit 4a015d1

Please sign in to comment.