Skip to content

Commit 6613065

Browse files
authored
Merge pull request #32 from Devolved-AI/psyfercom-patch-7
Update update_bootnodes.sh
2 parents 51b556e + 947af7d commit 6613065

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

update_bootnodes.sh

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,55 @@ print_message() {
66
echo "${MESSAGE}"
77
}
88

9+
# Function to install Python 3 and pip3
10+
install_python3() {
11+
# Detect the operating system
12+
OS=$(uname -s)
13+
14+
if [ "$OS" == "Linux" ]; then
15+
# Check if the system is using apt (Debian/Ubuntu)
16+
if command -v apt-get &> /dev/null; then
17+
sudo apt-get update
18+
sudo apt-get install -y python3 python3-pip
19+
# Check if the system is using yum (CentOS/RHEL)
20+
elif command -v yum &> /dev/null; then
21+
sudo yum install -y python3 python3-pip
22+
else
23+
echo "Unsupported Linux package manager. Please install Python 3 manually."
24+
exit 1
25+
fi
26+
elif [ "$OS" == "Darwin" ]; then
27+
# macOS
28+
if command -v brew &> /dev/null; then
29+
brew install python3
30+
else
31+
echo "Homebrew not found. Please install Homebrew and try again."
32+
exit 1
33+
fi
34+
else
35+
echo "Unsupported OS. Please install Python 3 manually."
36+
exit 1
37+
fi
38+
39+
# Ensure Python 3 is usable in PATH
40+
if ! command -v python3 &> /dev/null; then
41+
echo "Python 3 installation failed or not found in PATH."
42+
exit 1
43+
else
44+
echo "Python 3 is successfully installed and available in PATH."
45+
fi
46+
47+
# Install tqdm using pip3
48+
sudo -H pip3 install tqdm
49+
50+
if ! python3 -m pip show tqdm &> /dev/null; then
51+
echo "tqdm installation failed."
52+
exit 1
53+
else
54+
echo "tqdm is successfully installed."
55+
fi
56+
}
57+
958
# Function to insert bootnodes into minervaRaw.json
1059
insert_bootnodes() {
1160
python3 <<EOF

0 commit comments

Comments
 (0)