Verified Commit 6449a2d1 authored by BTCxZelko's avatar BTCxZelko
Browse files

Merge branch 'development' for RoninDojo 1.8

parents 41918d77 25c3edf8
......@@ -8,14 +8,19 @@ Branch maintainers
The Core RoninDojo maintainers oversee the development of RoninDojo as a whole.
The branch maintainers for RoninDojo are:
RoninDojo CLI:
RoninDojo:
- @likewhoa - https://code.samourai.io/likewhoa
- @BTCxZelko - https://code.samourai.io/BTCxZelko
- @s2l1 (GuerraMoneta) - https://code.samourai.io/s2l1
RoninDojo GUI:
RoninDojo Website:
- @s2l1
- @likewhoa
- @pajasevi (Pavel Ševčík)
RoninUI:
- @pajasevi
RoninDojo Documentation:
- @Crazyk031
- @BitcoinQnA
......
<img src="https://raw.githubusercontent.com/Crazyk031/Images/master/RoninDojo%20Logo.png" width="300" height="300" />
<img src="https://ronindojo.io/assets/images/RoninDojo-logo.png" width="300" height="300" />
# RoninDojo
RoninDojo is an Installation Assistant and Administration Tool for Samourai Wallet's Dojo, Whirlpool, Indexer, and more. It is compatible with single-board computers such as Rockpro64, Odroid N2, Raspberry Pi4, etc. To get started you will need the computer, a micro SD card with RoninOS or Manjaro ARM XFCE flashed onto it, and a 1TB Solid State Drive.
Guides, hardware suggestions, useful commands, and more can be found on the RoninDojo Wiki page.
[**RoninDojo Wiki Home**](https://code.samourai.io/ronindojo/RoninDojo/-/wikis/home)
[**RoninDojo Wiki Home**](https://wiki.ronindojo.io/)
......@@ -5,20 +5,22 @@ RED=$(tput setaf 1)
NC=$(tput sgr0)
# No Color
cat << EOF
cat <<EOF
${NC}
_____________________________________________________|_._._._._._._._._,
\____________________________________________________|_|_|_|_|_|_|_|_|_|
\____________________________________________________|█|█|█|█|█|█|█|█|█|
!
${RED}
____ ___ _ _ ___ _ _ ____ _ ___
| _ \ / _ \| \ | |_ _| \ | | / ___| | |_ _|
| |_) | | | | \| || || \| | | | | | | |
| _ <| |_| | |\ || || |\ | | |___| |___ | |
|_| \_\\___/|_| \_|___|_| \_| \____|_____|___|
I dreamt of worldly success once.
██████╗ ██████╗ ███╗ ██╗██╗███╗ ██╗██████╗ ██████╗ ██╗ ██████╗
██╔══██╗██╔═══██╗████╗ ██║██║████╗ ██║██╔══██╗██╔═══██╗ ██║██╔═══██╗
██████╔╝██║ ██║██╔██╗ ██║██║██╔██╗ ██║██║ ██║██║ ██║ ██║██║ ██║
██╔══██╗██║ ██║██║╚██╗██║██║██║╚██╗██║██║ ██║██║ ██║██ ██║██║ ██║
██║ ██║╚██████╔╝██║ ╚████║██║██║ ╚████║██████╔╝╚██████╔╝╚█████╔╝╚██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝╚═╝ ╚═══╝╚═════╝ ╚═════╝ ╚════╝ ╚═════╝
I dreamt of worldly success once.
${NC}
,_._._._._._._._._|_____________________________________________________
|_|_|_|_|_|_|_|_|_|____________________________________________________/
|█|█|█|█|█|█|█|█|█|____________________________________________________/
!
EOF
sleep 5s
\ No newline at end of file
#!/bin/bash
# shellcheck source=/dev/null
. "$HOME"/RoninDojo/Scripts/defaults.sh
. "$HOME"/RoninDojo/Scripts/functions.sh
cd "$HOME" || exit
git clone "$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
# 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
cat <<EOF
${RED}
***
Press any key to continue...
***
${NC}
EOF
_pause
# will return to boltzmann menu option script
bash -c "$RONIN_BOLTZMANN_MENU"
\ No newline at end of file
......@@ -8,345 +8,404 @@
_load_user_conf
if ! findmnt "${INSTALL_DIR}" 1>/dev/null; then
cat <<DOJO
cat <<EOF
${RED}
***
Missing drive mount at ${INSTALL_DIR}! Please contact support for assistance.
***
${NC}
EOF
_sleep
cat <<EOF
${RED}
***
Missing drive mount at ${INSTALL_DIR}!
Please contact support for assistance.
Exiting RoninDojo in 5 seconds...
***
${NC}
DOJO
_sleep 5
exit 1
EOF
_sleep 5 --msg "Returning to menu in"
exit 1
fi
# Makes sure Dojo has been uninstalled
if [ -d "${DOJO_PATH}" ]; then
cat <<DOJO
if [ -d "${dojo_path_my_dojo}" ]; then
cat <<EOF
${RED}
***
Dojo is already installed...
RoninDojo is already installed...
***
${NC}
DOJO
_sleep 5 --msg "Returning to menu in"
bash -c ronin
EOF
_sleep 5 --msg "Returning to menu in"
ronin
exit
fi
# Makes sure RoninDojo has been uninstalled
cat <<EOF
${RED}
***
Running RoninDojo install...
***
${NC}
EOF
_sleep 2
cat <<EOF
${RED}
***
Use Ctrl+C to exit now if needed!
***
${NC}
EOF
_sleep 10 --msg "Installing in"
cat <<EOF
${RED}
***
Downloading and extracting latest RoninDojo release...
***
${NC}
EOF
echo -e "${RED}"
echo "***"
echo "Running Dojo install in 5s..."
echo "***"
echo -e "${NC}"
echo -e "${RED}"
echo "***"
echo "Use Ctrl+C to exit now if needed!"
echo "***"
echo -e "${NC}"
_sleep 5
echo -e "${RED}"
echo "***"
echo "Downloading and extracting latest RoninDojo release..."
echo "***"
echo -e "${NC}"
cd "$HOME" || exit
git clone -b "${SAMOURAI_COMMITISH:-master}" "$SAMOURAI_REPO" dojo 2>/dev/null
echo -e "${RED}"
echo "***"
echo "Values necessary for usernames, passwords, etc. will randomly be generated now..."
echo "***"
echo -e "${NC}"
if [ ! -d "${RONIN_UI_BACKEND_DIR}" ]; then
_install_ronin_ui_backend
# Install Ronin UI Backend service
fi
cat <<EOF
${RED}
***
Credentials necessary for usernames, passwords, etc. will randomly be generated now...
***
${NC}
EOF
_sleep 4
cat <<EOF
${RED}
***
Credentials are found in RoninDojo menu, ${dojo_path_my_dojo}/conf, or the ~/RoninDojo/user.conf.example file...
***
${NC}
EOF
_sleep 4
cat <<DOJO
cat <<EOF
${RED}
***
These values are found in RoninDojo menus, ${DOJO_PATH}/conf directory
or in the ~/RoninDojo/user.conf.example file. See file for more info
Be aware these credentials are used to login to Dojo Maintenance Tool, Block Explorer, and more!
***
${NC}
DOJO
EOF
_sleep 4
cat <<EOF
${RED}
***
Setting the RPC User and Password...
***
${NC}
EOF
_sleep
echo -e "${RED}"
echo "***"
echo "Be aware you will use these values to login to Dojo Maintenance Tool, Block Explorer, and more!"
echo "***"
echo -e "${NC}"
if [ -d "${DOJO_BACKUP_DIR}" ]; then
if ! _dojo_restore; then
cat <<EOF
${RED}
***
Backup restoration disabled!
***
${NC}
EOF
_sleep
cat <<EOF
${RED}
***
Enable in user.conf if you wish to restore credentials on dojo install when available...
***
${NC}
EOF
_sleep 3
else
cat <<EOF
${RED}
***
Credentials backup detected and restored...
***
${NC}
EOF
_sleep
cat <<EOF
${RED}
***
If you wish to disable this feature, set DOJO_RESTORE=false in $HOME/.config/RoninDojo/user.conf file...
***
${NC}
EOF
_sleep 3
fi
else
cat <<EOF
${RED}
***
Configuring the bitcoin daemon server...
***
${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}/" \
-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}
***
Configuring the Nodejs container...
***
${NC}
EOF
_sleep
sed -i -e "s/NODE_API_KEY=.*$/NODE_API_KEY=${NODE_API_KEY}/" \
-e "s/NODE_ADMIN_KEY=.*$/NODE_ADMIN_KEY=${NODE_ADMIN_KEY}/" \
-e "s/NODE_JWT_SECRET=.*$/NODE_JWT_SECRET=${NODE_JWT_SECRET}/" \
-e "s/NODE_ACTIVE_INDEXER=.*$/NODE_ACTIVE_INDEXER=${NODE_ACTIVE_INDEXER:-local_bitcoind}/" "${dojo_path_my_dojo}"/conf/docker-node.conf.tpl
# populate docker-node.conf.tpl template
sed -i -e "s/MYSQL_ROOT_PASSWORD=.*$/MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}/" \
-e "s/MYSQL_USER=.*$/MYSQL_USER=${MYSQL_USER}/" \
-e "s/MYSQL_PASSWORD=.*$/MYSQL_PASSWORD=${MYSQL_PASSWORD}/" "${dojo_path_my_dojo}"/conf/docker-mysql.conf.tpl
# populate docker-mysql.conf.tpl template
cat <<EOF
${RED}
***
Configuring the BTC RPC Explorer...
***
${NC}
EOF
_sleep
sed -i -e "s/EXPLORER_INSTALL=.*$/EXPLORER_INSTALL=${EXPLORER_INSTALL:-on}/" \
-e "s/EXPLORER_KEY=.*$/EXPLORER_KEY=${EXPLORER_KEY}/" "${dojo_path_my_dojo}"/conf/docker-explorer.conf.tpl
# populate docker-explorer.conf.tpl template
fi
cat <<EOF
${RED}
***
Preparing for Indexer Prompt...
***
${NC}
EOF
_sleep 2
echo -e "${RED}"
echo "***"
echo "Setting the RPC User and Password..."
echo "***"
echo -e "${NC}"
_sleep
cat <<EOF
${RED}
***
Samourai Indexer is recommended for most users as it helps with querying balances...
***
${NC}
EOF
_sleep 4
cat << EOF > "${DOJO_PATH}"/conf/docker-bitcoind.conf.tpl
#########################################
# CONFIGURATION OF BITCOIND CONTAINER
#########################################
# User account used for rpc access to bitcoind
# Type: alphanumeric
BITCOIND_RPC_USER=${BITCOIND_RPC_USER:-RoninDojo}
# Password of user account used for rpc access to bitcoind
# Type: alphanumeric
BITCOIND_RPC_PASSWORD=$RPC_PASS
# Max number of connections to network peers
# Type: integer
BITCOIND_MAX_CONNECTIONS=16
# Mempool maximum size in MB
# Type: integer
BITCOIND_MAX_MEMPOOL=400
# Db cache size in MB
# Type: integer
BITCOIND_DB_CACHE=${BITCOIND_DB_CACHE:-700}
# Number of threads to service RPC calls
# Type: integer
BITCOIND_RPC_THREADS=6
# Mempool expiry in hours
# Defines how long transactions stay in your local mempool before expiring
# Type: integer
BITCOIND_MEMPOOL_EXPIRY=72
# Min relay tx fee in BTC
# Type: numeric
BITCOIND_MIN_RELAY_TX_FEE=0.00001
#
# EXPERT SETTINGS
#
#
# EPHEMERAL ONION ADDRESS FOR BITCOIND
# THIS PARAMETER HAS NO EFFECT IF BITCOIND_INSTALL IS SET TO OFF
#
# Generate a new onion address for bitcoind when Dojo is launched
# Activation of this option is recommended for improved privacy.
# Values: on | off
BITCOIND_EPHEMERAL_HS=on
#
# EXPOSE BITCOIND RPC API AND ZMQ NOTIFICATIONS TO EXTERNAL APPS
# THESE PARAMETERS HAVE NO EFFECT IF BITCOIND_INSTALL IS SET TO OFF
#
# Expose the RPC API to external apps
# Warning: Do not expose your RPC API to internet!
# See BITCOIND_RPC_EXTERNAL_IP
# Value: on | off
BITCOIND_RPC_EXTERNAL=${BITCOIND_RPC_EXTERNAL:-on}
# IP address used to expose the RPC API to external apps
# This parameter is inactive if BITCOIND_RPC_EXTERNAL isn't set to 'on'
# Warning: Do not expose your RPC API to internet!
# Recommended value:
# linux: 127.0.0.1
# macos or windows: IP address of the VM running the docker host
# Type: string
BITCOIND_RPC_EXTERNAL_IP=${BITCOIND_RPC_EXTERNAL_IP:-127.0.0.1}
#
# INSTALL AND RUN BITCOIND INSIDE DOCKER
#
# Install and run bitcoind inside Docker
# Set this option to 'off' for using a bitcoind hosted outside of Docker (not recommended)
# Value: on | off
BITCOIND_INSTALL=on
# IP address of bitcoind used by Dojo
# Set value to 172.28.1.5 if BITCOIND_INSTALL is set to 'on'
# Type: string
BITCOIND_IP=172.28.1.5
# Port of the RPC API
# Set value to 28256 if BITCOIND_INSTALL is set to 'on'
# Type: integer
BITCOIND_RPC_PORT=28256
# Port exposing ZMQ notifications for raw transactions
# Set value to 9501 if BITCOIND_INSTALL is set to 'on'
# Type: integer
BITCOIND_ZMQ_RAWTXS=9501
# Port exposing ZMQ notifications for block hashes
# Set value to 9502 if BITCOIND_INSTALL is set to 'on'
# Type: integer
BITCOIND_ZMQ_BLK_HASH=9502
EOF
# create new docker bitcoind conf file
# websearch "bash heredoc" for info on redirection
echo -e "${RED}"
echo "***"
echo "Setting the Node API Key and JWT Secret..."
echo "***"
echo -e "${NC}"
_sleep
cat <<EOF
${RED}
***
Electrum Rust Server is recommended for Hardware Wallets, Multisig, and other Electrum features...
***
${NC}
EOF
_sleep 4
echo -e "${RED}"
echo "***"
echo "Setting the Node Admin Key..."
echo "***"
echo -e "${NC}"
_sleep
cat <<EOF
${RED}
***
Skipping the installation of either Indexer option is ok! You can always install later...
***
${NC}
EOF
_sleep 3
cat << EOF > "${DOJO_PATH}"/conf/docker-node.conf.tpl
#########################################
# CONFIGURATION OF NODE JS CONTAINER
#########################################
# API key required for accessing the services provided by the server
# Keep this API key secret!
# Provide a value with a high entropy!
# Type: alphanumeric
NODE_API_KEY=$NODE_API_KEY
# API key required for accessing the admin/maintenance services provided by the server
# Keep this Admin key secret!
# Provide a value with a high entropy!
# Type: alphanumeric
NODE_ADMIN_KEY=$NODE_ADMIN_KEY
# Secret used by the server for signing Json Web Token
# Keep this value secret!
# Provide a value with a high entropy!
# Type: alphanumeric
NODE_JWT_SECRET=$NODE_JWT_SECRET
# Indexer or third-party service used for imports and rescans of addresses
# Values: local_bitcoind | third_party_explorer
NODE_ACTIVE_INDEXER=${NODE_ACTIVE_INDEXER:-local_bitcoind}
# FEE TYPE USED FOR FEES ESTIMATIONS BY BITCOIND
# Allowed values are ECONOMICAL or CONSERVATIVE
NODE_FEE_TYPE=ECONOMICAL
EOF
# create new docker node conf file
# websearch "bash heredoc" for info on redirection
cat << EOF > "${DOJO_PATH}"/conf/docker-mysql.conf.tpl
#########################################
# CONFIGURATION OF MYSQL CONTAINER
#########################################
# Password of MySql root account
# Type: alphanumeric
MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
# User account used for db access
# Type: alphanumeric
MYSQL_USER=$MYSQL_USER
# Password of of user account
# Type: alphanumeric
MYSQL_PASSWORD=$MYSQL_PASSWORD
EOF
# create new mysql conf file
# websearch "bash heredoc" for info on redirection
# BTC-EXPLORER PASSWORD
echo -e "${RED}"
echo "***"
echo "Installing your Dojo-backed Bitcoin Explorer..."
echo "***"
echo -e "${NC}"
_sleep
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
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
fi
cat << EOF > "${DOJO_PATH}"/conf/docker-explorer.conf.tpl
#########################################
# CONFIGURATION OF EXPLORER CONTAINER
#########################################
# Install and run a block explorer inside Dojo (recommended)
# Value: on | off
EXPLORER_INSTALL=${EXPLORER_INSTALL:-on}
# Password required for accessing the block explorer
# (login can be anything)
# Keep this password secret!
# Provide a value with a high entropy!
# Type: alphanumeric
EXPLORER_KEY=$EXPLORER_KEY
EOF
# create new block explorer conf file
# websearch "bash heredoc" for info on redirection
read -rp "Do you want to install an indexer? [y/n]" yn
case $yn in
[Y/y]* )
sudo sed -i 's/INDEXER_INSTALL=off/INDEXER_INSTALL=on/' "${DOJO_PATH}"/conf/docker-indexer.conf.tpl
sudo sed -i 's/NODE_ACTIVE_INDEXER=local_bitcoind/NODE_ACTIVE_INDEXER=local_indexer/' "${DOJO_PATH}"/conf/docker-node.conf.tpl
;;
[N/n]* ) echo "Indexer will not be installed!";;
* ) echo "Please answer Yes or No.";;
esac
# install indexer prompt