├── portlar.png ├── README.md └── sonaric.sh /portlar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aksamlan/Sonaric/HEAD/portlar.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sonaric AI Node Kurulum 2 | ![image](https://pbs.twimg.com/media/GO0Ojjga4AAqFnm?format=jpg&name=4096x4096) 3 | 4 | Minimum Sistem Gereksinimleri : 5 | ✅ 4 GB RAM 6 | ✅ 2 CPU cores 7 | ✅ 20 GB free disk space 8 | ✅ 64-bit operating system 9 | 10 | ### Linkler 11 | [Explorer](https://tracker.sonaric.xyz/) / 12 | [Twitter](https://x.com/Sonaricnetwork) / 13 | [Discord](https://discord.gg/MZ247hw47z) 14 | 15 | ## 🟢 Kullandığı portlar : 16 | ![image](https://github.com/aksamlan/Sonaric/blob/main/portlar.png?raw=true) 17 | 18 | ## 🟢 Sistemi güncelleyelim 19 | ```shell 20 | sudo apt update && \ 21 | sudo apt install curl git jq build-essential gcc unzip wget lz4 -y 22 | ``` 23 | 24 | ## 🟢 Gerekli dosyayı yüklüyoruz ve izinleri verelim 25 | ```shell 26 | wget https://raw.githubusercontent.com/aksamlan/Sonaric/main/sonaric.sh && chmod +x sonaric.sh && ./sonaric.sh 27 | ``` 28 | 29 | 30 | ## 🟢 Düğümünüzün Başarıyla Kurulup Kurulmadığını Kontrol Edin 31 | ```shell 32 | sonaric node-info 33 | ``` 34 | 35 | ## 🟢 GUI'yi çalıştırın 36 | ➖ Yerel terminalinizi açın 37 | ➖ "user@your-vps-ip" kendi IP'nizle değiştirin (örneğin: root@123.456.789) 38 | ```shell 39 | ssh -L 127.0.0.1:44003:127.0.0.1:44003 -L 127.0.0.1:44004:127.0.0.1:44004 -L 127.0.0.1:44005:127.0.0.1:44005 -L 127.0.0.1:44006:127.0.0.1:44006 user@your-vps-ip 40 | ``` 41 | Girdikten sonra sunucu şifrenizi girip çalışıyor. 42 | 43 | ## 🟢 Sunucudaki bilgilerinizi yedekleyin 44 | ```shell 45 | sonaric identity-export -o mysonaric.identity 46 | ``` 47 | ## 🟢 Sunucuda puanlarınızı görmek için bu kodu girin 48 | ```shell 49 | sonaric points 50 | ``` 51 | ## 🟢 İsim değiştirmek için bu kodu girin ve sonra isminizi yazın 52 | ```shell 53 | sonaric node-rename 54 | ``` 55 | 56 | mysonaric.identity dosyasını güvenli bir yere kaydedin. Root klasörü içerisinde oluşmaktadır. 57 | 58 | İŞLEMLERİMİZ BU KADARDI. TEŞEKKÜRLER... 59 | -------------------------------------------------------------------------------- /sonaric.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | APT_KEY_URL="https://us-central1-apt.pkg.dev/doc/repo-signing-key.gpg" 4 | APT_DOWNLOAD_URL="https://us-central1-apt.pkg.dev/projects/sonaric-platform" 5 | RPM_DOWNLOAD_URL="https://us-central1-yum.pkg.dev/projects/sonaric-platform/sonaric-releases-rpm" 6 | 7 | DOWNLOAD_URL="https://storage.googleapis.com/sonaric-releases/stable/linux/sonaric-amd64-latest.tar.gz" 8 | 9 | command_exists() { 10 | command -v "$@" > /dev/null 2>&1 11 | } 12 | 13 | get_distribution() { 14 | lsb_dist="" 15 | # Every system that we officially support has /etc/os-release 16 | if [ -r /etc/os-release ]; then 17 | lsb_dist="$(. /etc/os-release && echo "$ID")" 18 | fi 19 | # Returning an empty string here should be alright since the 20 | # case statements don't act unless you provide an actual value 21 | echo "$lsb_dist" 22 | } 23 | 24 | # Check if this is a forked Linux distro 25 | check_forked() { 26 | 27 | # Check for lsb_release command existence, it usually exists in forked distros 28 | if command_exists lsb_release; then 29 | # Check if the `-u` option is supported 30 | set +e 31 | lsb_release -a -u > /dev/null 2>&1 32 | lsb_release_exit_code=$? 33 | set -e 34 | 35 | # Check if the command has exited successfully, it means we're in a forked distro 36 | if [ "$lsb_release_exit_code" = "0" ]; then 37 | # Print info about current distro 38 | cat <<-EOF 39 | You're using '$lsb_dist' version '$dist_version'. 40 | EOF 41 | 42 | # Get the upstream release info 43 | lsb_dist=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'id' | cut -d ':' -f 2 | tr -d '[:space:]') 44 | dist_version=$(lsb_release -a -u 2>&1 | tr '[:upper:]' '[:lower:]' | grep -E 'codename' | cut -d ':' -f 2 | tr -d '[:space:]') 45 | 46 | # Print info about upstream distro 47 | cat <<-EOF 48 | Upstream release is '$lsb_dist' version '$dist_version'. 49 | EOF 50 | else 51 | if [ -r /etc/debian_version ] && [ "$lsb_dist" != "ubuntu" ] && [ "$lsb_dist" != "raspbian" ]; then 52 | if [ "$lsb_dist" = "osmc" ]; then 53 | # OSMC runs Raspbian 54 | lsb_dist=raspbian 55 | else 56 | lsb_dist=debian 57 | fi 58 | dist_version="$(sed 's/\/.*//' /etc/debian_version | sed 's/\..*//')" 59 | case "$dist_version" in 60 | 12) 61 | dist_version="bookworm" 62 | ;; 63 | 11) 64 | dist_version="bullseye" 65 | ;; 66 | 10) 67 | dist_version="buster" 68 | ;; 69 | 9) 70 | dist_version="stretch" 71 | ;; 72 | 8) 73 | dist_version="jessie" 74 | ;; 75 | esac 76 | fi 77 | fi 78 | fi 79 | } 80 | 81 | do_install() { 82 | echo "# Executing Sonaric install script" 83 | 84 | user="$(id -un 2>/dev/null || true)" 85 | 86 | sh_c='sh -c' 87 | if [ "$user" != 'root' ]; then 88 | if command_exists sudo; then 89 | sh_c='sudo -E sh -c' 90 | elif command_exists su; then 91 | sh_c='su -c' 92 | else 93 | cat >&2 <<-'EOF' 94 | Error: this installer needs the ability to run commands as root. 95 | We are unable to find either "sudo" or "su" available to make this happen. 96 | EOF 97 | exit 1 98 | fi 99 | fi 100 | 101 | # check if systemctl unit is present and if it is active 102 | if command_exists systemctl && systemctl list-units --full --all sonaricd.service | grep -Fq 'sonaricd.service'; then 103 | $sh_c 'systemctl start sonaricd' || echo "Failed to start sonaricd" 104 | fi 105 | 106 | # perform some very rudimentary platform detection 107 | lsb_dist=$( get_distribution ) 108 | lsb_dist="$(echo "$lsb_dist" | tr '[:upper:]' '[:lower:]')" 109 | 110 | case "$lsb_dist" in 111 | 112 | ubuntu) 113 | if command_exists lsb_release; then 114 | dist_version="$(lsb_release --codename | cut -f2)" 115 | fi 116 | if [ -z "$dist_version" ] && [ -r /etc/lsb-release ]; then 117 | dist_version="$(. /etc/lsb-release && echo "$DISTRIB_CODENAME")" 118 | fi 119 | ;; 120 | 121 | debian|raspbian) 122 | dist_version="$(sed 's/\/.*//' /etc/debian_version | sed 's/\..*//')" 123 | case "$dist_version" in 124 | 12) 125 | dist_version="bookworm" 126 | ;; 127 | 11) 128 | dist_version="bullseye" 129 | ;; 130 | 10) 131 | dist_version="buster" 132 | ;; 133 | 9) 134 | dist_version="stretch" 135 | ;; 136 | 8) 137 | dist_version="jessie" 138 | ;; 139 | esac 140 | ;; 141 | 142 | centos|rhel|sles) 143 | if [ -z "$dist_version" ] && [ -r /etc/os-release ]; then 144 | dist_version="$(. /etc/os-release && echo "$VERSION_ID")" 145 | fi 146 | ;; 147 | 148 | *) 149 | if command_exists lsb_release; then 150 | dist_version="$(lsb_release --release | cut -f2)" 151 | fi 152 | if [ -z "$dist_version" ] && [ -r /etc/os-release ]; then 153 | dist_version="$(. /etc/os-release && echo "$VERSION_ID")" 154 | fi 155 | ;; 156 | 157 | esac 158 | 159 | # Check if this is a forked Linux distro 160 | check_forked 161 | 162 | # Run setup for each distro accordingly 163 | case "$lsb_dist" in 164 | ubuntu|debian|raspbian) 165 | $sh_c 'apt-get update -qq >/dev/null' 166 | 167 | if command_exists sonaricd; then 168 | echo "Sonaric is already installed" 169 | $sh_c 'apt-get install sonaricd sonaric' 170 | for try in {1..30} ; do 171 | $sh_c "sonaric version" > /dev/null 2>&1 && break || sleep 2 172 | done 173 | $sh_c "sonaric update --nocolor --nofancy --all" 174 | exit 0 175 | fi 176 | 177 | # Check if apt satisfies the version requirement 178 | $sh_c "apt satisfy --dry-run 'podman (>=3.4.0)'" || ( 179 | echo "ERROR: Available podman version is too old, please upgrade to a supported distro" 180 | exit 1 181 | ) 182 | 183 | pre_reqs="apt-transport-https ca-certificates curl" 184 | if ! command -v gpg > /dev/null; then 185 | pre_reqs="$pre_reqs gnupg" 186 | fi 187 | apt_repo="deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/sonaric.gpg] $APT_DOWNLOAD_URL sonaric-releases-apt main" 188 | ( 189 | $sh_c 'apt-get update -qq >/dev/null' 190 | $sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq $pre_reqs >/dev/null" 191 | $sh_c 'install -m 0755 -d /etc/apt/keyrings' 192 | $sh_c "curl -fsSL \"$APT_KEY_URL\" | gpg --dearmor --yes -o /etc/apt/keyrings/sonaric.gpg" 193 | $sh_c "chmod a+r /etc/apt/keyrings/sonaric.gpg" 194 | $sh_c "echo \"$apt_repo\" > /etc/apt/sources.list.d/sonaric.list" 195 | $sh_c 'apt-get update -qq >/dev/null' 196 | ) 197 | $sh_c "DEBIAN_FRONTEND=noninteractive apt-get install -y -qq sonaric >/dev/null" 198 | exit 0 199 | ;; 200 | centos|fedora|rhel|rocky) 201 | # use dnf for fedora or rocky linux, yum for centos or rhel 202 | if [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "rocky" ]; then 203 | pkg_manager="dnf" 204 | pre_reqs="dnf-plugins-core" 205 | elif [ "$lsb_dist" = "centos" ]; then 206 | pkg_manager="yum" 207 | pre_reqs="yum-utils" 208 | fi 209 | 210 | if command_exists sonaricd; then 211 | echo "Sonaric is already installed" 212 | $sh_c "$pkg_manager update --refresh -y -q sonaricd sonaric" 213 | $sh_c 'systemctl start sonaricd' || echo "Failed to start sonaricd" 214 | for try in {1..30} ; do 215 | $sh_c "sonaric version" > /dev/null 2>&1 && break || sleep 2 216 | done 217 | $sh_c "sonaric update --nocolor --nofancy --all" 218 | exit 0 219 | fi 220 | 221 | ( 222 | $sh_c "$pkg_manager install -y -q $pre_reqs" 223 | $sh_c "tee -a /etc/yum.repos.d/artifact-registry.repo << EOF 224 | [sonaric-releases-rpm] 225 | name=sonaric-releases-rpm 226 | baseurl=$RPM_DOWNLOAD_URL 227 | enabled=1 228 | repo_gpgcheck=0 229 | gpgcheck=0 230 | EOF" 231 | 232 | # Enable the repository 233 | $sh_c "$pkg_manager makecache" 234 | ) 235 | ( 236 | pkgs="sonaricd sonaric" 237 | $sh_c "$pkg_manager install -y -q $pkgs" 238 | ) 239 | exit 0 240 | ;; 241 | *) 242 | echo 243 | echo "ERROR: Unsupported distribution '$lsb_dist'" 244 | echo 245 | exit 1 246 | ;; 247 | esac 248 | exit 1 249 | } 250 | 251 | # wrapped up in a function so that we have some protection against only getting 252 | # half the file during "curl | sh" 253 | do_install 254 | --------------------------------------------------------------------------------