Verified Commit a977dd36 authored by likewhoa's avatar likewhoa
Browse files

Merge branch 'ronin_1.9' into development

parents 2bea0d3b 0e5ab7a6
RoninDojo v1.9 Change Log
- Update to Samourai Dojo 1.9.0
- Add Specter 1.2.2
- Add Bisq Support
- Added Automatic Indexer Data backup and restore
- Add rockchip bbbfancontrol in applications menu
- Fix issue with new backup drive creation
- Automatically set BITCOIND_DB_CACHE to 30% of total RAM
(see bitcoind_db_cache_total variable in user.conf to increase it)
- Automatic swapfile size calculation during creation
- Cosmetic changes
- Menu restructuring
- Better application management
- Lots of bug fixes
- Lots of optimizations and code refactoring
- General UX enhancement
RoninDojo v1.8 Change Log
- Boltzmann Calculator v1.0
- Mempool v1.0 (external links set to OXT via Tor Browser)
- Electrs 0.8.6
- Whirlpool 0.10.9
- SW Indexer/Electrs Swap Capability
- Tor Hidden Service Backup
- Tor bug fixes
- Credentials backup during install
- Menu consolidation and restructure
- General UX enhancement
RoninDojo v1.7 Change Log
- Dojo 1.8.0
- minor patch to Tor setup
RoninDojo v1.6 Change Log
- Integration of Ronin UI Backend
......
......@@ -20,6 +20,7 @@ RoninDojo Website:
RoninUI:
- @pajasevi
- @miguelm9 - https://code.samourai.io/miguelmartinn9
RoninDojo Documentation:
- @Crazyk031
......
#!/bin/bash
# shellcheck source=/dev/null
RED=$(tput setaf 1)
# used for color with ${RED}
NC=$(tput sgr0)
. "$HOME"/RoninDojo/Scripts/functions.sh
red=$(tput setaf 1)
# used for color with ${red}
nc=$(tput sgr0)
# No Color
cat <<EOF
${NC}
${nc}
_____________________________________________________|_._._._._._._._._,
\____________________________________________________|█|█|█|█|█|█|█|█|█|
!
${RED}
${red}
██████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗██████╗ ██████╗ ██╗ ██████╗
██╔══██╗██╔═══██╗████╗ ██║██║████╗ ██║██╔══██╗██╔═══██╗ ██║██╔═══██╗
██████╔╝██║ ██║██╔██╗ ██║██║██╔██╗ ██║██║ ██║██║ ██║ ██║██║ ██║
......@@ -18,9 +21,9 @@ ${RED}
██║ ██║╚██████╔╝██║ ╚████║██║██║ ╚████║██████╔╝╚██████╔╝╚█████╔╝╚██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚════╝ ╚═════╝
I dreamt of worldly success once.
${NC}
${nc}
,_._._._._._._._._|_____________________________________________________
|█|█|█|█|█|█|█|█|█|____________________________________________________/
!
EOF
sleep 5s
\ No newline at end of file
_sleep 5
\ No newline at end of file
#!/bin/bash
# shellcheck source=/dev/null
# shellcheck source=/dev/null disable=SC2154
. "$HOME"/RoninDojo/Scripts/defaults.sh
. "$HOME"/RoninDojo/Scripts/functions.sh
cd "$HOME" || exit
git clone "$BOLTZMANN_REPO" &>/dev/null
git clone -q "$boltzmann_repo" &>/dev/null
cd boltzmann || exit
# pull Boltzmann
cat <<EOF
${RED}
***
Checking package dependencies...
***
${NC}
EOF
_sleep
if ! hash pipenv; then
cat <<EOF
${RED}
***
Installing pipenv...
***
${NC}
EOF
sudo pacman -S --noconfirm python-pipenv &>/dev/null
fi
_check_pkg "pipenv" "python-pipenv"
# Setup a virtual environment to hold boltzmann dependencies. We should use this
# with all future packages that ship a requirements.txt.
pipenv install -r requirements.txt &>/dev/null
pipenv install &>/dev/null
cat <<EOF
${RED}
***
Press any key to continue...
***
${NC}
EOF
_pause
_pause continue
# will return to boltzmann menu option script
bash -c "$RONIN_BOLTZMANN_MENU"
\ No newline at end of file
bash -c "$ronin_boltzmann_menu"
#!/bin/bash
# shellcheck source=/dev/null
# shellcheck source=/dev/null disable=SC2154
. "$HOME"/RoninDojo/Scripts/defaults.sh
. "$HOME"/RoninDojo/Scripts/generated-credentials.sh
......@@ -7,172 +7,187 @@
_load_user_conf
if ! findmnt "${INSTALL_DIR}" 1>/dev/null; then
if ! findmnt "${install_dir}" 1>/dev/null; then
cat <<EOF
${RED}
${red}
***
Missing drive mount at ${INSTALL_DIR}! Please contact support for assistance.
Missing drive mount at ${install_dir}! Please contact support for assistance...
***
${NC}
${nc}
EOF
_sleep
_sleep 2
cat <<EOF
${RED}
${red}
***
Exiting RoninDojo in 5 seconds...
Exiting RoninDojo...
***
${NC}
${nc}
EOF
_sleep 5 --msg "Returning to menu in"
_sleep 2
_pause return
exit 1
fi
if [ -d "${dojo_path_my_dojo}" ]; then
cat <<EOF
${RED}
${red}
***
RoninDojo is already installed...
***
${NC}
${nc}
EOF
_sleep 5 --msg "Returning to menu in"
_sleep 2
_pause return
ronin
exit
fi
# Makes sure RoninDojo has been uninstalled
cat <<EOF
${RED}
${red}
***
Running RoninDojo install...
***
${NC}
${nc}
EOF
_sleep 2
cat <<EOF
${RED}
${red}
***
Use Ctrl+C to exit now if needed!
***
${NC}
${nc}
EOF
_sleep 10 --msg "Installing in"
cat <<EOF
${RED}
${red}
***
Downloading and extracting latest RoninDojo release...
Downloading latest RoninDojo release...
***
${NC}
${nc}
EOF
cd "$HOME" || exit
git clone -b "${SAMOURAI_COMMITISH:-master}" "$SAMOURAI_REPO" dojo 2>/dev/null
git clone -q -b "${samourai_commitish#*/}" "$samourai_repo" dojo 2>/dev/null
# Switch over to a branch if in detached state. Usually this happens
# when you clone a tag instead of a branch
cd "${dojo_path}" || exit
if [ ! -d "${RONIN_UI_BACKEND_DIR}" ]; then
_install_ronin_ui_backend
# Install Ronin UI Backend service
_git_ref_type
_ret=$?
if ((_ret==3)); then
# valid branch
git switch -q -c "${samourai_commitish}" -t "${samourai_commitish}"
else
# valid tag
git checkout -q -b "${samourai_commitish}" "${samourai_commitish}"
fi
# Check if UI Backend needs installing
if ! _ronin_ui_update_check; then
_install_ronin_ui_backend
fi
cat <<EOF
${RED}
${red}
***
Credentials necessary for usernames, passwords, etc. will randomly be generated now...
***
${NC}
${nc}
EOF
_sleep 4
cat <<EOF
${RED}
${red}
***
Credentials are found in RoninDojo menu, ${dojo_path_my_dojo}/conf, or the ~/RoninDojo/user.conf.example file...
***
${NC}
${nc}
EOF
_sleep 4
cat <<EOF
${RED}
${red}
***
Be aware these credentials are used to login to Dojo Maintenance Tool, Block Explorer, and more!
***
${NC}
${nc}
EOF
_sleep 4
cat <<EOF
${RED}
${red}
***
Setting the RPC User and Password...
***
${NC}
${nc}
EOF
_sleep
if [ -d "${DOJO_BACKUP_DIR}" ]; then
if [ -d "${dojo_backup_dir}" ]; then
if ! _dojo_restore; then
cat <<EOF
${RED}
${red}
***
Backup restoration disabled!
***
${NC}
${nc}
EOF
_sleep
cat <<EOF
${RED}
${red}
***
Enable in user.conf if you wish to restore credentials on dojo install when available...
***
${NC}
${nc}
EOF
_sleep 3
else
cat <<EOF
${RED}
${red}
***
Credentials backup detected and restored...
***
${NC}
${nc}
EOF
_sleep
cat <<EOF
${RED}
${red}
***
If you wish to disable this feature, set DOJO_RESTORE=false in $HOME/.config/RoninDojo/user.conf file...
If you wish to disable this feature, set dojo_conf_backup=false in the $HOME/.config/RoninDojo/user.conf file...
***
${NC}
${nc}
EOF
_sleep 3
fi
else
cat <<EOF
${RED}
${red}
***
Configuring the bitcoin daemon server...
***
${NC}
${nc}
EOF
_sleep
sed -i -e "s/BITCOIND_RPC_USER=.*$/BITCOIND_RPC_USER=${BITCOIND_RPC_USER:-$RPC_USER}/" \
-e "s/BITCOIND_RPC_PASSWORD=.*$/BITCOIND_RPC_PASSWORD=${BITCOIND_RPC_PASSWORD:-$RPC_PASS}/" \
-e "s/BITCOIND_DB_CACHE=.*$/BITCOIND_DB_CACHE=${BITCOIND_DB_CACHE:-700}/" \
-e "s/BITCOIND_MAX_MEMPOOL=.*$/BITCOIND_MAX_MEMPOOL=400/" \
-e "s/BITCOIND_RPC_EXTERNAL=.*$/BITCOIND_RPC_EXTERNAL=${BITCOIND_RPC_EXTERNAL:-on}/" \
sed -i -e "s/BITCOIND_RPC_USER=.*$/BITCOIND_RPC_USER=${BITCOIND_RPC_USER:-$rpc_user}/" \
-e "s/BITCOIND_RPC_PASSWORD=.*$/BITCOIND_RPC_PASSWORD=${BITCOIND_RPC_PASSWORD:-$rpc_pass}/" \
-e "s/BITCOIND_DB_CACHE=.*$/BITCOIND_DB_CACHE=${BITCOIND_DB_CACHE:-$(_mem_total "${bitcoind_db_cache_total}")}/" \
-e "s/BITCOIND_MAX_MEMPOOL=.*$/BITCOIND_MAX_MEMPOOL=${BITCOIND_MAX_MEMPOOL:-1024}/" \
-e "s/BITCOIND_RPC_EXTERNAL_IP=.*$/BITCOIND_RPC_EXTERNAL_IP=${BITCOIND_RPC_EXTERNAL_IP:-127.0.0.1}/" "${dojo_path_my_dojo}"/conf/docker-bitcoind.conf.tpl
# populate docker-bitcoind.conf.tpl template
cat <<EOF
${RED}
${red}
***
Configuring the Nodejs container...
***
${NC}
${nc}
EOF
_sleep
......@@ -188,11 +203,11 @@ EOF
# populate docker-mysql.conf.tpl template
cat <<EOF
${RED}
${red}
***
Configuring the BTC RPC Explorer...
***
${NC}
${nc}
EOF
_sleep
......@@ -201,211 +216,117 @@ EOF
# populate docker-explorer.conf.tpl template
fi
cat <<EOF
${RED}
***
Preparing for Indexer Prompt...
***
${NC}
EOF
_sleep 2
cat <<EOF
${RED}
***
Samourai Indexer is recommended for most users as it helps with querying balances...
***
${NC}
EOF
_sleep 4
cat <<EOF
${RED}
***
Electrum Rust Server is recommended for Hardware Wallets, Multisig, and other Electrum features...
***
${NC}
EOF
_sleep 4
cat <<EOF
${RED}
***
Skipping the installation of either Indexer option is ok! You can always install later...
***
${NC}
EOF
_sleep 3
cat <<EOF
${RED}
***
Choose one of the following options for your Indexer...
***
${NC}
EOF
_sleep 3
_no_indexer_found
# give user menu for install choices, see functions.sh
_check_indexer
if _is_mempool; then
cat <<EOF
${RED}
***
Do you want to install the Mempool Visualizer?
***
${NC}
EOF
while true; do
read -rp "[${GREEN}Yes${NC}/${RED}No${NC}]: " answer
case $answer in
[yY][eE][sS]|[yY])
_mempool_conf
break
;;
[nN][oO]|[Nn])
break
;;
*)
cat <<EOF
${RED}
***
Invalid answer! Enter Y or N
***
${NC}
EOF
;;
esac
done
# install mempool prompt
else
# Repopulate mempool/Dockerfile with current credentials
_mempool_conf
if (($?==2)); then # No indexer, fresh install so show prompts for indexer selection
_indexer_prompt
# give user menu for install choices, see functions.sh
fi
cat <<EOF
${RED}
${red}
***
Please see Wiki for FAQ, help, and so much more...
***
${NC}
${nc}
EOF
_sleep 3
cat <<EOF
${RED}
${red}
***
https://wiki.ronindojo.io
***
${NC}
${nc}
EOF
_sleep 3
cat <<EOF
${RED}
${red}
***
Installing Samourai Wallet's Dojo...
***
${NC}
${nc}
EOF
_sleep 2
# Restart docker here for good measure
sudo systemctl restart docker
cd "$dojo_path_my_dojo" || exit
if ./dojo.sh install --nolog; then
cat <<EOF
${RED}
${red}
***
All RoninDojo feature installations complete...
***
${NC}
${nc}
EOF
_sleep 3
# Make sure to wait for user interaction before continuing
_pause continue
cat <<EOF
${RED}
***
Press any key to continue...
***
${NC}
EOF
# Backup dojo credentials
"${dojo_conf_backup}" && _dojo_backup
_pause
# press to continue is needed because sudo password can be requested for next steps
# if the user is AFK there may be timeout
# Restore any saved IBD from a previous uninstall
"${dojo_data_bitcoind_backup}" && _dojo_data_bitcoind restore
_mempool_urls_to_local_btc_explorer
# checks if urls need to be changed for mempool UI
# Restore any saved indexer data from a previous uninstall
"${dojo_data_indexer_backup}" && _dojo_data_indexer restore
if ${tor_backup}; then
_tor_restore
docker restart tor 1>/dev/null
fi
# restore tor credentials backup to container
# Backup credentials
_dojo_backup
# Installing SW Toolkit
if sudo test -d "${INSTALL_DIR_UNINSTALL}/blocks" && sudo test -d "${DOCKER_VOLUME_BITCOIND}"; then
if [ ! -d "${HOME}"/boltzmann ]; then
cat <<EOF
${RED}
${red}
***
Blockchain data salvage starting...
Installing Boltzmann Calculator...
***
${NC}
${nc}
EOF
_sleep 2
cd "$dojo_path_my_dojo" || exit
_stop_dojo
_sleep
sudo rm -rf "${DOCKER_VOLUME_BITCOIND}"/_data/{blocks,chainstate}
sudo mv -v "${INSTALL_DIR_UNINSTALL}"/{blocks,chainstate} "${DOCKER_VOLUME_BITCOIND}"/_data/ 1>/dev/null
# changes to dojo path, otherwise exit
# websearch "bash Logical OR (||)" for info
# stops dojo and removes new data directories
# then moves salvaged block data
# install Boltzmann
_install_boltzmann
fi
if [ ! -d "${HOME}"/Whirlpool-Stats-Tool ]; then
cat <<EOF
${RED}
${red}
***
Blockchain data salvage completed...
Installing Whirlpool Stat Tool...
***
${NC}
${nc}
EOF
_sleep 2
sudo rm -rf "${INSTALL_DIR_UNINSTALL}"
# remove old salvage directories
_install_wst
fi
cd "$dojo_path_my_dojo" || exit
_source_dojo_conf
# Source update script
. "$HOME"/RoninDojo/Scripts/update.sh
# Start docker containers
yamlFiles=$(_select_yaml_files)
docker-compose $yamlFiles up --remove-orphans -d || exit # failed to start dojo
# start dojo
fi