Commit c43eaf1e authored by BTCxZelko's avatar BTCxZelko
Browse files

Merge branch 'release/v1.13.0' into 'master'

Release/v1.13.0

Closes #98

See merge request ronindojo/RoninDojo!175
parents 96c00a5e 1f5a8c1d
RoninDojo v1.13.0 Change Log
-Dojo 1.13.0
-Electrs 0.9.4
-Specter 1.7.2
-RoninUI Re-install menu option
-Prep for Plug-n-Play
-Bug fixes
RoninDojo v1.12.0 Change Log
- Update Dojo to v1.12.1
......
......@@ -12,6 +12,7 @@ RoninDojo:
- @likewhoa - https://code.samourai.io/likewhoa
- @BTCxZelko - https://code.samourai.io/BTCxZelko
- @s2l1 (GuerraMoneta) - https://code.samourai.io/s2l1
- @dammkewl - https://code.samourai.io/dammkewl
Website:
- @s2l1
......@@ -32,6 +33,8 @@ Quality Assurance:
- @likewhoa
- @BTCxZelko
- @s2l1
- @dammkewl
- @kycfree
Translation:
- @likewhoa
......
......@@ -2,6 +2,7 @@
# shellcheck source=/dev/null disable=SC2154
. "$HOME"/RoninDojo/Scripts/defaults.sh
. "$HOME"/RoninDojo/Scripts/dojo-defaults.sh
. "$HOME"/RoninDojo/Scripts/functions.sh
cd "$HOME" || exit
......
......@@ -24,7 +24,7 @@ Exiting RoninDojo...
${nc}
EOF
_sleep
_pause return
[ $# -eq 0 ] && _pause return
exit 1
fi
......@@ -37,7 +37,7 @@ RoninDojo is already installed...
${nc}
EOF
_sleep
_pause return
[ $# -eq 0 ] && _pause return
ronin
exit
fi
......@@ -89,7 +89,7 @@ fi
# Check if RoninUI needs installing
if ! _is_ronin_ui; then
printf "%s\n***\nInstalling Ronin UI\n***\n%s\n" "${red}" "${nc}"
printf "%s\n***\nInstalling Ronin UI...\n***\n%s\n" "${red}" "${nc}"
_ronin_ui_install
fi
......@@ -223,12 +223,18 @@ _check_indexer
if (($?==2)); then
# No indexer found, fresh install
# Enable default samourai indexer unless dojo_indexer="electrs-indexer" set in user.conf
# Enable default electrs indexer unless dojo_indexer="samourai-indexer" set in user.conf
_set_indexer
# Enable Electrs indexer
if [ "${dojo_indexer}" = "electrs-indexer" ]; then
# Enable Samourai indexer
if [ "${dojo_indexer}" = "samourai-indexer" ]; then
_uninstall_electrs_indexer
_set_indexer
else
bash "$HOME"/RoninDojo/Scripts/Install/install-electrs-indexer.sh
touch "$HOME"/.config/RoninDojo/data/electrs.install
fi
fi
......@@ -301,7 +307,7 @@ EOF
_sleep
# Make sure to wait for user interaction before continuing
_pause continue
[ $# -eq 0 ] && _pause continue
# Backup dojo credentials
"${dojo_conf_backup}" && _dojo_backup
......@@ -334,7 +340,7 @@ _sleep
test -f "$HOME"/.config/RoninDojo/data/updates/08-* || _update_08 # Make sure mnt-usb.mount is available
# Press to continue to prevent from snapping back to menu too quickly
_pause return
[ $# -eq 0 ] && _pause return
else
cat <<EOF
${red}
......@@ -344,6 +350,6 @@ Install failed! Please contact support...
${nc}
EOF
_pause return
ronin
[ $# -eq 0 ] && _pause return
[ $# -eq 0 ] && ronin
fi
\ No newline at end of file
......@@ -33,10 +33,6 @@ fi\n\
# using the backslash \ along with sed insert command so that the spaces are not ignored
# we append everything above the EXPLORER if statement
#sed -i '/docker-tor.conf/i\ - ./conf/docker-indexer.conf' "${dojo_path_my_dojo}"/docker-compose.yaml
# add indexer to tor section of docker-compose.yaml
# using the backslash \ along with sed insert command so that the spaces are not ignored
sed -i "/onion() {/a\
if [ \"\$INDEXER_INSTALL\" == \"on\" ]; then\n\
tor_addr_electrs=\$( docker exec -it tor cat /var/lib/tor/hsv3electrs/hostname )\n\
......@@ -47,11 +43,16 @@ fi\n\
# using the backslash \ along with sed insert command so that the spaces are not ignored
sed -i \
-e 's/--indexer-rpc-addr=.*$/--electrum-rpc-addr="172.28.1.6:50001"/' \
-e '/--cookie=.*$/d' \
-e '/--indexer-http-addr*/d' \
-e 's/^addrindexrs/electrs/' "${dojo_path_my_dojo}"/indexer/restart.sh
-e 's/-vvvv/--log-filters="INFO"/' \
-e 's/--indexer-rpc-addr=.*$/--electrum-rpc-addr="$INDEXER_IP:$INDEXER_RPC_PORT"/' \
-e '/--daemon-rpc-addr=.*$/i\ --daemon-p2p-addr="$BITCOIND_IP:8333"' \
-e '/--jsonrpc-import/d' \
-e '/--indexer-http-addr*/d' \
-e '/--cookie=.*$/d' \
-e 's/txid-limit/index-lookup-limit/' \
-e '/blocktxids-cache-size-mb/d' \
-e 's/^addrindexrs/electrs/' "${dojo_path_my_dojo}"/indexer/restart.sh
# modify indexer/restart.sh for electrs
wget -qO "${dojo_path_my_dojo}"/indexer/Dockerfile https://code.samourai.io/Ronin/samourai-dojo/raw/feat_mydojo_local_indexer/docker/my-dojo/indexer/Dockerfile
# replace indexer dockerfile for electrs usagedocker/my-dojo/indexer/Dockerfile
\ No newline at end of file
cp "${dojo_path_my_dojo}"/indexer/electrs.Dockerfile.tpl "${dojo_path_my_dojo}"/indexer/Dockerfile
# replace indexer Dockerfile for electrs support
......@@ -241,8 +241,7 @@ cd "${dojo_path_my_dojo}" || exit
_source_dojo_conf
# Start docker containers
yamlFiles=$(_select_yaml_files)
docker-compose $yamlFiles up --remove-orphans -d || exit # failed to start dojo
./dojo.sh start
_pause return
bash -c "${ronin_dojo_menu2}"
......
......@@ -224,8 +224,7 @@ cd "${dojo_path_my_dojo}" || exit
_source_dojo_conf
# Start docker containers
yamlFiles=$(_select_yaml_files)
docker-compose $yamlFiles up --remove-orphans -d || exit # failed to start dojo
./dojo.sh start
_pause return
......
......@@ -16,7 +16,7 @@ ${nc}
EOF
_sleep
_pause return
[ $# -eq 0 ] && _pause return
bash "$HOME"/RoninDojo/Scripts/Menu/menu-install.sh
elif [ -f "${ronin_data_dir}"/system-install ]; then
cat <<EOF
......@@ -26,9 +26,12 @@ Previous system install detected. Exiting script...
***
${nc}
EOF
_pause return
[ $# -eq 0 ] && _pause return
bash "$HOME"/RoninDojo/Scripts/Menu/menu-install.sh
else
# Automatically set primary_storage for nvme capable hardware
_nvme_check && _load_user_conf
cat <<EOF
${red}
***
......@@ -375,7 +378,7 @@ ${nc}
EOF
# Make sure to wait for user interaction before continuing
_pause continue
[ $# -eq 0 ] && _pause continue
# Make sure we don't run system install twice
touch "${ronin_data_dir}"/system-install
......@@ -511,7 +514,7 @@ ${nc}
EOF
# Make sure to wait for user interaction before continuing
_pause continue
[ $# -eq 0 ] && _pause continue
# Make sure we don't run system install twice
touch "${ronin_data_dir}"/system-install
......@@ -580,17 +583,28 @@ df -h "${primary_storage}"
_sleep 5
# checks disk info
# tor configuration setup, see functions.sh
_setup_tor
# docker data directory setup, see functions.sh
_docker_datadir_setup
# Install Ronin UI
cat <<EOF
${red}
***
Installing Ronin UI...
***
${nc}
EOF
_ronin_ui_install
# Calculate swapfile size
_swap_size
create_swap --file "${install_dir_swap}" --count "${_size}"
# created a 2GB swapfile on the external drive instead of sd card to preserve sd card life
_setup_tor
# tor configuration setup, see functions.sh
_docker_datadir_setup
# docker data directory setup, see functions.sh
create_swap --file "${install_dir_swap}" --count "${_size}"
cat <<EOF
${red}
......@@ -624,17 +638,6 @@ _sleep
_install_wst
# Install Ronin UI
cat <<EOF
${red}
***
Installing Ronin UI...
***
${nc}
EOF
_ronin_ui_install
cat <<EOF
${red}
***
......@@ -644,7 +647,7 @@ ${nc}
EOF
# Make sure to wait for user interaction before continuing
_pause continue
[ $# -eq 0 ] && _pause continue
# Make sure we don't run system install twice
touch "${ronin_data_dir}"/system-install
......
......@@ -128,6 +128,8 @@ EOF
_sleep
bash -c "$HOME"/RoninDojo/Scripts/Install/install-electrs-indexer.sh
sudo test -d "${docker_volume_indexer}"/_data/db/mainnet && sudo rm -rf "${docker_volume_indexer}"/_data/db/mainnet
sudo test -d "${docker_volume_indexer}"/_data/addrindexrs && sudo rm -rf "${docker_volume_indexer}"/_data/addrindexrs
;;
"Install Indexer")
cat <<EOF
......
......@@ -2,6 +2,7 @@
# shellcheck source=/dev/null disable=SC2154
. "$HOME"/RoninDojo/Scripts/defaults.sh
. "$HOME"/RoninDojo/Scripts/dojo-defaults.sh
. "$HOME"/RoninDojo/Scripts/functions.sh
if [ ! -d "${boltzmann_path}" ]; then
......@@ -78,4 +79,4 @@ EOF
else
bash -c "${ronin_samourai_toolkit_menu}"
fi
done
\ No newline at end of file
done
......@@ -109,6 +109,7 @@ ret=$?
if ((ret==0)); then
bash -c "$HOME"/RoninDojo/Scripts/Install/install-electrs-indexer.sh
test -d "${docker_volume_indexer}"/_data/db/mainnet && sudo rm -rf "${docker_volume_indexer}"/_data/db/mainnet
elif ((ret==1)); then
test -f "${dojo_path_my_dojo}"/indexer/electrs.toml && rm "${dojo_path_my_dojo}"/indexer/electrs.toml
......
......@@ -51,8 +51,7 @@ EOF
_source_dojo_conf
# Start docker containers
yamlFiles=$(_select_yaml_files)
docker-compose $yamlFiles up --remove-orphans -d || exit # failed to start dojo
./dojo.sh start
fi
# checks if dojo is running (check the db container), if running, tells user to dojo has already started
......@@ -101,8 +100,7 @@ ${nc}
DOJO
# Start docker containers
yamlFiles=$(_select_yaml_files)
docker-compose $yamlFiles up --remove-orphans -d || exit # failed to start dojo
./dojo.sh start
# restart dojo
_pause return
......
......@@ -12,7 +12,8 @@ OPTIONS=(1 "Start"
4 "Status"
5 "Logs"
6 "Reset"
7 "Go Back")
7 "Re-install"
8 "Go Back")
CHOICE=$(dialog --clear \
--title "$TITLE" \
......@@ -160,6 +161,22 @@ EOF
bash -c "${ronin_ui_menu}"
;;
7)
cat <<EOF
${red}
***
Re-installing Ronin UI...
***
${nc}
EOF
_ronin_ui_uninstall
_ronin_ui_install
pm2 status
_pause return
bash -c "${ronin_ui_menu}"
;;
8)
ronin
# returns to main menu
;;
......
......@@ -71,7 +71,7 @@ ronin_mempool_menu="$HOME/RoninDojo/Scripts/Menu/menu-mempool.sh"
ronin_specter_menu="$HOME/RoninDojo/Scripts/Menu/menu-specter.sh"
ronin_system_menu="$HOME/RoninDojo/Scripts/Menu/menu-system.sh"
ronin_system_menu2="$HOME/RoninDojo/Scripts/Menu/menu-system2.sh"
ronin_system_update="$HOME/RoninDojo/Scripts/Menu/menu-updates.sh"
ronin_system_update="$HOME/RoninDojo/Scripts/Menu/menu-system-updates.sh"
ronin_system_storage="$HOME/RoninDojo/Scripts/Menu/menu-system-storage.sh"
ronin_ui_menu="$HOME/RoninDojo/Scripts/Menu/menu-ronin-ui.sh"
ronin_updates_menu="$HOME/RoninDojo/Scripts/Menu/menu-system-updates.sh"
......@@ -110,7 +110,7 @@ backup_format=false
ronin_dojo_branch="origin/master" # defaults to origin/master
ronin_dojo_repo="https://code.samourai.io/ronindojo/RoninDojo"
samourai_repo='https://code.samourai.io/ronindojo/samourai-dojo.git'
samourai_commitish="v1.12.1" # Tag release
samourai_commitish="v1.13.0" # Tag release
boltzmann_repo='https://code.samourai.io/oxt/boltzmann.git'
whirlpool_stats_repo='https://code.samourai.io/whirlpool/whirlpool_stats.git'
ronin_ui_repo="https://code.samourai.io/ronindojo/ronin-ui.git"
......@@ -158,7 +158,7 @@ fi
specter_sign_key_url="https://stepansnigirev.com/ss-specter-release.asc"
specter_sign_key="ss-specter-release.asc"
specter_url="https://github.com/cryptoadvance/specter-desktop.git"
specter_version="v1.7.0"
specter_version="v1.7.2"
specter_port="25441"
# Network info
......
......@@ -250,7 +250,7 @@ EOF
#
# Package version match
#
_check_pkgver() {
_check_pkg_ver() {
local pkgver pkg
pkgver="${2}"
......@@ -1030,6 +1030,7 @@ _set_indexer() {
#
_uninstall_electrs_indexer() {
test -f "${dojo_path_my_dojo}"/indexer/electrs.toml && rm "${dojo_path_my_dojo}"/indexer/electrs.toml
sudo test -d "${docker_volume_indexer}"/_data/db && sudo rm -rf "${docker_volume_indexer}"/_data/db/*
cd "${dojo_path_my_dojo}" || exit
......@@ -1079,7 +1080,7 @@ EOF
cat <<EOF
${red}
***
Samourai Indexer is recommended for most users as it helps with querying balances...
Samourai Indexer is recommended for Samourai only users as it helps with querying balances...
***
${nc}
EOF
......@@ -1105,7 +1106,7 @@ EOF
# indexer names here are used as data source
while true; do
select indexer in "Samourai Indexer (recommended)" "Electrum Rust Server"; do
select indexer in "Samourai Indexer" "Electrum Rust Server"; do
case $indexer in
"Samourai Indexer"*)
cat <<EOF
......@@ -1136,6 +1137,8 @@ EOF
_set_indexer
bash "$HOME"/RoninDojo/Scripts/Install/install-electrs-indexer.sh
sudo test -d "${docker_volume_indexer}"/_data/addrindexrs && sudo rm -rf "${docker_volume_indexer}"/_data/addrindexrs
sudo test -d "${docker_volume_indexer}"/_data/db/mainnet && sudo rm -rf "${docker_volume_indexer}"/_data/db/mainnet
return 0
;;
# triggers electrs install script
......@@ -1398,8 +1401,25 @@ EOF
_dojo_check && _stop_dojo
cd "${dojo_path_my_dojo}" || exit
# Delete existing electrs mainnet directory if upgrading
if [ ! -f "$HOME"/.config/RoninDojo/data/electrs.install ]; then
# Show Indexer Install State
_check_indexer
ret=$?
if ((ret==0)); then # Electrs enabled
if [ -d "${docker_volume_indexer}"/_data/db/mainnet ]; then
sudo rm -rf "${docker_volume_indexer}"/_data/db/mainnet
fi
fi
# Mark as fresh install
touch "$HOME"/.config/RoninDojo/data/electrs.install
fi
. dojo.sh upgrade --nolog --auto
# Used with mempool uninstall to get rid of orphan volumes
if [ "${1}" = "prune" ]; then
docker volume prune -f &>/dev/null
fi
......@@ -1562,67 +1582,13 @@ EOF
cat <<EOF
${red}
***
Preparing shutdown of Dojo...
Shutting down Dojo...
***
${nc}
EOF
_sleep
# Source conf files
_source_dojo_conf
# Shutdown the bitcoin daemon
if [ "$BITCOIND_INSTALL" == "on" ]; then
# Renewal of bitcoind onion address
if [ "$BITCOIND_LISTEN_MODE" == "on" ]; then
if [ "$BITCOIND_EPHEMERAL_HS" = "on" ]; then
docker exec -it tor rm -rf /var/lib/tor/hsv*bitcoind &> /dev/null
fi
fi
# Stop the bitcoin daemon
docker exec -it bitcoind bitcoin-cli -rpcconnect=bitcoind --rpcport=28256 \
--rpcuser="$BITCOIND_RPC_USER" --rpcpassword="$BITCOIND_RPC_PASSWORD" stop &>/dev/null
cat <<EOF
${red}
***
Waiting for shutdown of Bitcoin Daemon...
***
${nc}
EOF
# Check for bitcoind process
i=0
nbIters=$((BITCOIND_SHUTDOWN_DELAY/10))
while ((i<nbIters)); do
if timeout -k 12 10 docker container top bitcoind | grep bitcoind &>/dev/null; then
sleep 1
((i++))
else
cat <<EOF
${red}
***
Bitcoin Server Daemon stopped...
***
${nc}
EOF
break
fi
done
cat <<EOF
${red}
***
Stopping all Docker containers...
***
${nc}
EOF
fi
# Stop docker containers
yamlFiles=$(_select_yaml_files)
docker-compose $yamlFiles stop || exit
./dojo.sh stop
return 0
}
......@@ -2673,8 +2639,7 @@ Starting all Docker containers...
${nc}
EOF
# Start docker containers
yamlFiles=$(_select_yaml_files)
docker-compose $yamlFiles up --remove-orphans -d || exit # failed to start dojo
./dojo.sh start
# start dojo
fi
# check for indexer db data directory, if not found continue
......@@ -2684,8 +2649,7 @@ EOF
_source_dojo_conf
# Start docker containers
yamlFiles=$(_select_yaml_files)
docker-compose $yamlFiles up --remove-orphans -d || exit # failed to start dojo
./dojo.sh start
# start dojo
fi
......@@ -2770,8 +2734,7 @@ Starting all Docker containers...
${nc}
EOF
# Start docker containers
yamlFiles=$(_select_yaml_files)
docker-compose $yamlFiles up --remove-orphans -d || exit # failed to start dojo
./dojo.sh start
# start dojo
fi
# Only start dojo if no indexer restore is enabled
......@@ -2947,4 +2910,16 @@ EOF
return 1
fi
}
\ No newline at end of file
}
#
# Check if nvme drive available
#
_nvme_check() {
if test -b /dev/nvme0n1; then
sudo sed -i 's:#primary_storage="":primary_storage="/dev/nvme0n1p1":' "$HOME"/.config/RoninDojo/user.conf
return 0
fi
return 1
}
......@@ -3,8 +3,10 @@
. "$HOME"/RoninDojo/Scripts/defaults.sh
_load_user_conf
_update_01() {
if ! _check_pkgver bridge-utils 1.7-1; then
if ! _check_pkg_ver bridge-utils 1.7-1; then
cat <<EOF
${red}
***
......@@ -135,8 +137,6 @@ _update_07() {
# Create mnt-usb.mount if missing and system is already mounted.
_update_08() {
_load_user_conf
local uuid tmp systemd_mountpoint fstype
if findmnt /mnt/usb 1>/dev/null && [ ! -f /etc/systemd/system/mnt-usb.mount ]; then
......@@ -224,8 +224,6 @@ _update_11() {
# Set BITCOIND_DB_CACHE to use bitcoind_db_cache_total value if not set
_update_12() {
_load_user_conf
if [ -f "${dojo_path_my_dojo}"/conf/docker-bitcoind.conf ] && [ -z "${BITCOIND_DB_CACHE}" ]; then
if findmnt /mnt/usb 1>/dev/null && ! _dojo_check && ! grep BITCOIND_DB_CACHE="$(_mem_total "${bitcoind_db_cache_total}")" "${dojo_path_my_dojo}"/conf/docker-bitcoind.conf 1>/dev/null; then
sed -i "s/BITCOIND_DB_CACHE=.*$/BITCOIND_DB_CACHE=$(_mem_total "${bitcoind_db_cache_total}")/" "${dojo_path_my_dojo}"/conf/docker-bitcoind.conf
......@@ -347,8 +345,6 @@ EOF
# Update docker-bitcoind.conf settings for existing users
_update_18() {
_load_user_conf
if [ -f "${dojo_path_my_dojo}"/conf/docker-bitcoind.conf ]; then
if grep -q "BITCOIND_RPC_THREADS=12" "${dojo_path_my_dojo}"/conf/docker-bitcoind.conf; then
sed -i "s/BITCOIND_RPC_THREADS.*$/BITCOIND_RPC_THREADS=${BITCOIND_RPC_THREADS:-16}/" "${dojo_path_my_dojo}"/conf/docker-bitcoind.conf
......@@ -389,8 +385,6 @@ EOF
# Revert some settings in docker-bitcoind.conf
_update_20() {
_load_user_conf
if [ -f "${dojo_path_my_dojo}"/conf/docker-bitcoind.conf ]; then
sed -i "s/BITCOIND_RPC_THREADS.*$/BITCOIND_RPC_THREADS=${BITCOIND_RPC_THREADS:-10}/" "${dojo_path_my_dojo}"/conf/docker-bitcoind.conf
sed -i "s/BITCOIND_MAX_MEMPOOL.*$/BITCOIND_MAX_MEMPOOL=${BITCOIND_MAX_MEMPOOL:-1024}/" "${dojo_path_my_dojo}"/conf/docker-bitcoind.conf
......@@ -406,11 +400,11 @@ _update_21() {
_pacman=false
if [ -d "${dojo_path}" ]; then
_dojo_check && _stop_dojo
printf "%s\n***\nPerfoming a full system update...\n***\n%s" "${red}" "${nc}"
_pause continue
_pause continue
_dojo_check && _stop_dojo
# Modify pacman.conf and comment ignore packages line
if test -f "$HOME"/.config/RoninDojo/data/updates/06-*; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!