From c1bc2e7a19d8772a97dade3a4a31d7a227b86b3c Mon Sep 17 00:00:00 2001 From: Christian Kessler Date: Thu, 25 Jul 2024 15:51:59 -0700 Subject: [PATCH] Delete init.sh Signed-off-by: Christian Kessler --- init.sh | 151 -------------------------------------------------------- 1 file changed, 151 deletions(-) delete mode 100644 init.sh diff --git a/init.sh b/init.sh deleted file mode 100644 index 12970a1e9d..0000000000 --- a/init.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/bash - -# Function to print messages -print_message() { - MESSAGE=$1 - echo "${MESSAGE}" -} - -# Function to check the OS -check_os() { - if [[ "$OSTYPE" == "linux-gnu"* ]]; then - OS="linux" - elif [[ "$OSTYPE" == "darwin"* ]]; then - OS="macos" - else - print_message "Unsupported OS: $OSTYPE" - exit 1 - fi - print_message "Detected OS: $OS" -} - -# Function to install a package if it's not already installed -install_if_not_installed() { - PACKAGE=$1 - if [[ "$OS" == "linux" ]]; then - if ! dpkg -l | grep -q "$PACKAGE"; then - print_message "Installing $PACKAGE..." - sudo apt-get install -y "$PACKAGE" > /dev/null 2>&1 - else - print_message "$PACKAGE is already installed." - fi - elif [[ "$OS" == "macos" ]]; then - if ! brew list -1 | grep -q "$PACKAGE"; then - print_message "Installing $PACKAGE..." - brew install "$PACKAGE" > /dev/null 2>&1 - else - print_message "$PACKAGE is already installed." - fi - fi -} - -# Function to install dependencies based on the OS -install_dependencies() { - if [[ "$OS" == "linux" ]]; then - print_message "Installing protobuf-compiler..." - install_if_not_installed "protobuf-compiler" - - print_message "Installing build dependencies for Substrate..." - dependencies=("build-essential" "clang" "libclang-dev" "curl" "libssl-dev" "llvm" "libudev-dev" "pkg-config" "zlib1g-dev" "git") - for package in "${dependencies[@]}"; do - install_if_not_installed "$package" - done - elif [[ "$OS" == "macos" ]]; then - print_message "Installing protobuf..." - brew install protobuf > /dev/null 2>&1 - - print_message "Installing build dependencies for Substrate..." - dependencies=("clang" "cmake" "pkg-config" "openssl" "llvm" "protobuf" "git") - for package in "${dependencies[@]}"; do - install_if_not_installed "$package" - done - fi -} - -# Function to source the environment -source_environment() { - if [[ "$OS" == "linux" ]]; then - if [ -f "$HOME/.cargo/env" ]; then - source "$HOME/.cargo/env" - print_message "Sourced cargo environment for Linux." - else - print_message "Cargo environment file not found for Linux." - fi - elif [[ "$OS" == "macos" ]]; then - if [ -f "/usr/local/bin/cargo/env" ]; then - source "/usr/local/bin/cargo/env" - print_message "Sourced cargo environment for macOS." - else - print_message "Cargo environment file not found for macOS." - fi - fi -} - -# Function to install Python3 -install_python3() { - print_message "Installing Python3 and pip..." - install_if_not_installed "python3" - install_if_not_installed "python3-pip" - print_message "Installing tqdm for Python..." - pip3 install tqdm > /dev/null 2>&1 -} - -# Function to insert bootnodes into minervaRaw.json -insert_bootnodes() { - python3 <