Skip to content

Commit

Permalink
BETA cleanup for Mainet
Browse files Browse the repository at this point in the history
  • Loading branch information
rykcod authored Jan 2, 2024
1 parent bc1a231 commit 5660098
Show file tree
Hide file tree
Showing 9 changed files with 6 additions and 548 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/Paris"
RUN apt-get update \
&& apt-get upgrade -y \
&& apt install -y curl wget screen procps python3-pip netcat \
&& apt autoclean -y \
&& python3 -m pip install -U discord.py==1.7.3
&& apt autoclean -y

# Download the Massa package
COPY download-massa.sh .
Expand Down
4 changes: 0 additions & 4 deletions config/default_config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,4 @@ PATH_NODE="$PATH_MASSA"/massa-node
PATH_NODE_CONF="$PATH_NODE"/config
# Chemin ou se trouve la version compilee de massa-client
PATH_TARGET=.
# Path of massabot reply
PATH_MASSABOT_REPLY=/massa-guard/massabot.tmp
# Path to unreachable bootstrappers list
PATH_TO_UNREACHABLE_BOOTSTRAPPERS=/massa_mount/config/bootstrappers_unreachable.txt
##################################################
4 changes: 0 additions & 4 deletions config/default_config_template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@ NODE_LOGS=1
MASSAGUARD=1
# Autoupdate node when new node release version is available on massalabs website (Please note all update can occur an issue for massaguard working)
AUTOUPDATE=0
# Discord token - Must be set with your token discord - Please refer to https://shufflegazine.com/get-discord-token/
DISCORD_TOKEN="NULL"
# RAM max for node in percent - If RAM is over NODE_MAX_RAM value, node will restrat to purge RAM allocation
NODE_MAX_RAM=90
# Set maximum roll amount that you want - if value is NULL massa-guard will buy roll with no max limit
TARGET_ROLL_AMOUNT="NULL"
# Set if your node is under dyn or static public IP address - Set 1 for dynamic public IP or 0 for static public IP
DYN_PUB_IP=0
# Set if node registered with massabot - Set with OK if node registrered with massabot or KO if you want to check and use registration process
NODE_TESTNET_REGISTRATION="KO"
# Node password (If ENV not set, default value is MassaToTheMoon2022)
NODE_PWD="MassaToTheMoon2022"
# Wallet password (If ENV not set, default value is MassaToTheMoon2022)
Expand Down
20 changes: 4 additions & 16 deletions massa-guard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ do
MasBalance=$(GetMASAmount "$WalletAddress")
# Buy max roll or 1 roll if possible when candidate roll amount = 0
BuyOrSellRoll "$CandidateRolls" "$MasBalance" "$WalletAddress"
# [Depracated since testnet 16.0] Refresh bootstrap node with community connected and routable nodes
# RefreshBootstrapNode

# If logs are disable
if ([ $NODE_LOGS -eq 0 ] && [ -e $PATH_LOGS_MASSANODE/current.txt ])
Expand All @@ -52,21 +50,11 @@ do
rm $PATH_LOGS_MASSANODE/current.txt $PATH_NODE/logs.txt > /dev/null 2&>1
fi

# If Discord feature enable
if [ ! $DISCORD_TOKEN == "NULL" ]
# If dynamical IP feature enable and public IP is new
if ([ $DYN_PUB_IP -eq 1 ] && [ $(CheckPublicIP) -eq 1 ])
then
# Check and get faucet of current day
PingFaucet

# Check and registrer node with massabot if necessary
CheckTestnetNodeRegistration "$WalletAddress"

# If dynamical IP feature enable and public IP is new
if ([ $DYN_PUB_IP -eq 1 ] && [ $(CheckPublicIP) -eq 1 ])
then
# Refresh config.toml + restart node + push new IP to massabot
RefreshPublicIP
fi
# Refresh config.toml + restart node + [Depracated since Mainnet] push new IP to massabot
RefreshPublicIP
fi
fi

Expand Down
223 changes: 0 additions & 223 deletions sources/bootstrap_finder.py

This file was deleted.

50 changes: 0 additions & 50 deletions sources/faucet_spammer.py

This file was deleted.

15 changes: 1 addition & 14 deletions sources/init_copy_host_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ then
mkdir -p /massa_mount/config
echo "[$(date +%Y%m%d-%HH%M)][INFO][INIT]CREATE /massa_mount/config folder" |& tee -a $PATH_LOGS_MASSAGUARD/$(date +%Y%m%d)-massa_guard.txt
cp /massa-guard/config/default_config_template.ini $PATH_CONF_MASSAGUARD/config.ini
if [ $DISCORD ]; then python3 $PATH_SOURCES/set_config.py "DISCORD_TOKEN" \"$DISCORD\" $PATH_CONF_MASSAGUARD/config.ini ; fi
if [ $DYNIP ]; then python3 $PATH_SOURCES/set_config.py "DYN_PUB_IP" "$DYNIP" $PATH_CONF_MASSAGUARD/config.ini ; fi
if [ $NODEPWD ]; then python3 $PATH_SOURCES/set_config.py "NODE_PWD" \"$NODEPWD\" $PATH_CONF_MASSAGUARD/config.ini ; fi
if [ $WALLETPWD ]; then python3 $PATH_SOURCES/set_config.py "WALLET_PWD" \"$WALLETPWD\" $PATH_CONF_MASSAGUARD/config.ini ; fi
Expand Down Expand Up @@ -57,12 +56,6 @@ else
echo "routable_ip = \"$myIP\"" >> $PATH_MOUNT/config.toml
cp $PATH_MOUNT/config.toml $PATH_NODE_CONF/config.toml

if [ ! $DISCORD_TOKEN == "NULL" ]
then
# Push IP to massabot
timeout 2 python3 $PATH_SOURCES/push_command_to_discord.py $DISCORD_TOKEN $myIP > $PATH_MASSABOT_REPLY
fi

echo "[$(date +%Y%m%d-%HH%M)][INFO][INIT]Create your default config.toml with $myIP as routable IP" |& tee -a $PATH_LOGS_MASSAGUARD/$(date +%Y%m%d)-massa_guard.txt
fi
# Wallet to use
Expand All @@ -88,10 +81,4 @@ then
rm $PATH_NODE_CONF/staking_wallets/wallet_* > /dev/null 2&>1
cp $PATH_MOUNT/wallet_* $PATH_NODE_CONF/staking_wallets/
echo "[$(date +%Y%m%d-%HH%M)][INFO][LOAD]LOAD MOUNTED WALLET as ref to stacke" |& tee -a $PATH_LOGS_MASSAGUARD/$(date +%Y%m%d)-massa_guard.txt
fi
# If unreachable node file dont exist
if [ ! -e $PATH_CONF_MASSAGUARD/bootstrappers_unreachable.txt ]
then
# Create bootstrappers_unreachable.txt
touch $PATH_CONF_MASSAGUARD/bootstrappers_unreachable.txt
fi
fi
Loading

0 comments on commit 5660098

Please sign in to comment.