Skip to content

Commit 4a015d1

Browse files
authored
Merge pull request #13 from afiniel/v2.3.1
V2.3.1
2 parents 448ec8d + 1b6dadf commit 4a015d1

18 files changed

+354
-527
lines changed

daemon_builder/berkeley.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,25 @@ echo -e "\n$MAGENTA => Building Berkeley 4.8 <= ${NC}"
5050
sudo mkdir -p $STORAGE_ROOT/berkeley/db4/
5151
hide_output sudo wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
5252
hide_output sudo tar -xzvf db-4.8.30.NC.tar.gz
53+
sudo sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-4.8.30.NC/dbinc/atomic.h
5354
cd db-4.8.30.NC/build_unix/
54-
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$STORAGE_ROOT/berkeley/db4/
55+
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/home/crypto-data/berkeley/db4
5556
hide_output sudo make -j$((`nproc`+1))
57+
hide_output sudo make install -j$((`nproc`+1))
5658
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
5759
sudo rm -r db-4.8.30.NC.tar.gz db-4.8.30.NC
5860
echo -e "$GREEN => Berkeley 4.8 Completed <= ${NC}"
5961

6062
# Build BerkeleyDB 5.1
6163
echo -e "\n$MAGENTA => Building Berkeley 5.1 <= ${NC}"
62-
sudo mkdir -p $STORAGE_ROOT/berkeley/db5/
64+
sudo mkdir -p $STORAGE_ROOT/berkeley/db5.1/
6365
hide_output sudo wget 'http://download.oracle.com/berkeley-db/db-5.1.29.tar.gz'
6466
hide_output sudo tar -xzvf db-5.1.29.tar.gz
67+
sudo sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-5.1.29/src/dbinc/atomic.h
6568
cd db-5.1.29/build_unix/
66-
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$STORAGE_ROOT/berkeley/db5/
69+
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/home/crypto-data/berkeley/db5.1
6770
hide_output sudo make -j$((`nproc`+1))
71+
hide_output sudo make install -j$((`nproc`+1))
6872
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
6973
sudo rm -r db-5.1.29.tar.gz db-5.1.29
7074
echo -e "$GREEN => Berkeley 5.1 Completed <= ${NC}"
@@ -74,23 +78,27 @@ echo -e "\n$MAGENTA => Building Berkeley 5.3 <= ${NC}"
7478
sudo mkdir -p $STORAGE_ROOT/berkeley/db5.3/
7579
hide_output sudo wget 'http://anduin.linuxfromscratch.org/BLFS/bdb/db-5.3.28.tar.gz'
7680
hide_output sudo tar -xzvf db-5.3.28.tar.gz
81+
sudo sed -i 's/__atomic_compare_exchange/__atomic_compare_exchange_db/g' db-5.3.28/src/dbinc/atomic.h
7782
cd db-5.3.28/build_unix/
78-
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$STORAGE_ROOT/berkeley/db5.3/
83+
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/home/crypto-data/berkeley/db5.3
7984
hide_output sudo make -j$((`nproc`+1))
85+
hide_output sudo make install -j$((`nproc`+1))
8086
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
8187
sudo rm -r db-5.3.28.tar.gz db-5.3.28
8288
echo -e "$GREEN => Berkeley 5.3 Completed <= ${NC}"
8389

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

96104
# Build BerkeleyDB 18
@@ -99,8 +107,9 @@ sudo mkdir -p $STORAGE_ROOT/berkeley/db18/
99107
hide_output sudo wget 'https://download.oracle.com/berkeley-db/db-18.1.40.tar.gz'
100108
hide_output sudo tar -xzvf db-18.1.40.tar.gz
101109
cd db-18.1.40/build_unix/
102-
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=$STORAGE_ROOT/berkeley/db18/
110+
hide_output sudo ../dist/configure --enable-cxx --disable-shared --with-pic --prefix=/home/crypto-data/berkeley/db18
103111
hide_output sudo make -j$((`nproc`+1))
112+
hide_output sudo make install -j$((`nproc`+1))
104113
cd $STORAGE_ROOT/yiimp/yiimp_setup/tmp
105114
sudo rm -r db-18.1.40.tar.gz db-18.1.40
106115
echo -e "$GREEN => Berkeley 18 Completed <= ${NC}"

daemon_builder/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
################################################################################
1111

1212
if [ -z "${TAG}" ]; then
13-
TAG=v2.3.0
13+
TAG=v2.3.1
1414
fi
1515

1616
clear

daemon_builder/requirements.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ fi
6666
echo -e "$GREEN Additional System Files Completed...$NC"
6767
echo
6868

69-
# Updating gcc & g++ to version 8
69+
# Updating gcc & g++ to version 9
7070
echo
71-
echo -e "$CYAN => Updating gcc & g++ to version 8 $NC"
71+
echo -e "$CYAN => Updating gcc & g++ to version 9 $NC"
7272
hide_output sudo apt-get update
7373
hide_output sudo apt-get -y upgrade
7474
apt_dist_upgrade
@@ -80,12 +80,12 @@ hide_output sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
8080
fi
8181
hide_output sudo apt-get update
8282

83-
apt_install gcc-8 g++-8
83+
apt_install gcc-9 g++-9
8484

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

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

9090
set +eu +o pipefail
9191
cd $HOME/Yiimpoolv1/daemon_builder

daemon_builder/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ source /etc/yiimpool.conf
1111

1212
# Create DaemonBuilder directory
1313
if [ ! -d $STORAGE_ROOT/daemon_builder ]; then
14-
mkdir -p $STORAGE_ROOT/daemon_builder
14+
sudo mkdir -p $STORAGE_ROOT/daemon_builder
1515
fi
1616

1717
# Start the DeamonBuilder installation.

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#########################################################
1616

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

2020
# File paths
2121
YIIMPOOL_VERSION_FILE="/etc/yiimpoolversion.conf"

ver.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
#########################################################
3+
# Source https://mailinabox.email/ https://github.com/mail-in-a-box/mailinabox
4+
# Updated by Afiniel for Yiimpool use...
5+
# This script is intended to be run like this:
6+
#
7+
# curl https://raw.githubusercontent.com/afiniel/yiimp_install_script/master/install.sh | bash
8+
#
9+
#########################################################
10+
11+
if [ -z "${TAG}" ]; then
12+
TAG=v2.3.1
13+
fi
14+
15+
echo 'VERSION='"${TAG}"'' | sudo -E tee /etc/yiimpoolversion.conf >/dev/null 2>&1

yiimp_single/db.sh

Lines changed: 64 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -106,37 +106,65 @@ echo
106106
echo -e "$YELLOW => Importing YiiMP Default database values <= ${NC}"
107107
cd "$STORAGE_ROOT/yiimp/yiimp_setup/yiimp/sql"
108108

109-
# Import SQL dump
110-
sudo zcat 2020-11-10-yaamp.sql.gz | sudo mysql -u root -p"${DBRootPassword}" "${YiiMPDBName}"
111-
112-
# Import additional SQL files
113-
SQL_FILES=(
114-
2016-04-24-market_history.sql
115-
2016-04-27-settings.sql
116-
2016-05-11-coins.sql
117-
2016-05-15-benchmarks.sql
118-
2016-05-23-bookmarks.sql
119-
2016-06-01-notifications.sql
120-
2016-06-04-bench_chips.sql
121-
2016-11-23-coins.sql
122-
2017-02-05-benchmarks.sql
123-
2017-03-31-earnings_index.sql
124-
2017-05-accounts_case_swaptime.sql
125-
2017-06-payouts_coinid_memo.sql
126-
2017-09-notifications.sql
127-
2017-10-bookmarks.sql
128-
2017-11-segwit.sql
129-
2018-01-stratums_ports.sql
130-
2018-02-coins_getinfo.sql
131-
2018-09-22-workers.sql
132-
2019-03-coins_thepool_life.sql
133-
2020-06-03-blocks.sql
134-
2022-10-14-shares_solo.sql
135-
2022-10-29-blocks_effort.sql
109+
# Check if we're in the correct directory
110+
if [[ ! -d "$(pwd)" ]]; then
111+
echo -e "${RED}Error: SQL directory not found at $(pwd)${NC}"
112+
exit 1
113+
fi
114+
115+
# Look for the base database file
116+
BASE_DB_FILE=""
117+
for file in *.sql *.sql.gz; do
118+
if [[ -f "$file" ]]; then
119+
if [[ "$file" == *"complete"* ]] || [[ "$file" == *"base"* ]] || [[ "$file" == *"structure"* ]]; then
120+
BASE_DB_FILE="$file"
121+
break
122+
fi
123+
fi
124+
done
125+
126+
if [[ -z "$BASE_DB_FILE" ]]; then
127+
echo -e "${RED}Error: Could not find base database file. Please ensure a database export file exists in $(pwd)${NC}"
128+
echo -e "${YELLOW}The file should be named something like 'complete_export.sql' or 'base_structure.sql'${NC}"
129+
exit 1
130+
fi
131+
132+
# Create the database structure
133+
echo -e "Creating database structure from $BASE_DB_FILE..."
134+
if [[ "$BASE_DB_FILE" == *.gz ]]; then
135+
sudo zcat "$BASE_DB_FILE" | sudo mysql -u root -p"${DBRootPassword}" "${YiiMPDBName}" || {
136+
echo -e "${RED}Error: Failed to import gzipped database file${NC}"
137+
exit 1
138+
}
139+
else
140+
sudo mysql -u root -p"${DBRootPassword}" "${YiiMPDBName}" < "$BASE_DB_FILE" || {
141+
echo -e "${RED}Error: Failed to import database file${NC}"
142+
exit 1
143+
}
144+
fi
145+
146+
# Then apply updates in order, ignoring errors
147+
echo -e "Applying database updates..."
148+
SQL_UPDATE_FILES=(
149+
"2024-03-18-add_aurum_algo.sql"
150+
"2024-03-29-add_github_version.sql"
151+
"2024-03-31-add_payout_threshold.sql"
152+
"2024-04-01-add_auto_exchange.sql"
153+
"2024-04-01-shares_blocknumber.sql"
154+
"2024-04-05-algos_port_color.sql"
155+
"2024-04-22-add_equihash_algos.sql"
156+
"2024-04-23-add_pers_string.sql"
157+
"2024-04-29-add_sellthreshold.sql"
158+
"2024-05-04-add_neoscrypt_xaya_algo.sql"
136159
)
137160

138-
for file in "${SQL_FILES[@]}"; do
139-
sudo mysql -u root -p"${DBRootPassword}" "${YiiMPDBName}" --force < "$file"
161+
for file in "${SQL_UPDATE_FILES[@]}"; do
162+
if [[ -f "$file" ]]; then
163+
echo -e "Applying update from $file..."
164+
sudo mysql -u root -p"${DBRootPassword}" "${YiiMPDBName}" < "$file" || true
165+
else
166+
echo -e "${YELLOW}Warning: Update file $file not found${NC}"
167+
fi
140168
done
141169

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

148176
# Define MariaDB configuration changes
149177
config_changes=(
150-
'max_connections = 800'
151-
'thread_cache_size = 512'
152-
'tmp_table_size = 128M'
153-
'max_heap_table_size = 128M'
154-
'wait_timeout = 60'
155-
'max_allowed_packet = 64M'
178+
'[mysqld]'
179+
'max_connections=800'
180+
'thread_cache_size=512'
181+
'tmp_table_size=128M'
182+
'max_heap_table_size=128M'
183+
'wait_timeout=60'
184+
'max_allowed_packet=64M'
156185
)
157186

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

169-
# Restart MariaDB
170198
restart_service mysql
171199

172-
# Reset error handling
173200
set +eu +o pipefail
174201

175202
cd $HOME/Yiimpoolv1/yiimp_single

yiimp_single/nginx_domain_ssl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
source /etc/functions.sh
77
source /etc/yiimpool.conf
88
source $STORAGE_ROOT/yiimp/.yiimp.conf
9-
source $HOME/yiimp_install_script/yiimp_single/.wireguard.install.cnf
9+
source $HOME/Yiimpoolv1/yiimp_single/.wireguard.install.cnf
1010

1111
set -eu -o pipefail
1212

0 commit comments

Comments
 (0)