Skip to content

Commit 1282cc0

Browse files
Merge pull request #327 from opentensor/fix/localnet_setup
chore: replace localnet_setup with rust installation
2 parents 184c1b2 + 7eafa0b commit 1282cc0

File tree

3 files changed

+42
-32
lines changed

3 files changed

+42
-32
lines changed

.github/PULL_REQUEST_TEMPLATE/pull_request_template.md renamed to .github/pull_request_template.md

File renamed without changes.

scripts/install_rust.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/sh
2+
3+
echo "*** Checking if Rust is already installed"
4+
5+
if which rustup >/dev/null 2>&1; then
6+
echo "Rust is already installed. Exiting."
7+
exit 0
8+
fi
9+
10+
echo "*** Installing Rust"
11+
12+
if [[ "$(uname)" == "Darwin" ]]; then
13+
# macOS
14+
if ! which brew >/dev/null 2>&1; then
15+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
16+
fi
17+
18+
brew update
19+
brew install openssl cmake llvm
20+
elif [[ "$(uname)" == "Linux" ]]; then
21+
if [[ -f "/etc/arch-release" ]]; then
22+
# Arch Linux
23+
sudo pacman -Syu --noconfirm
24+
sudo pacman -S --noconfirm cmake pkgconf openssl git gcc clang
25+
else
26+
# Ubuntu (and other Debian-based distributions)
27+
sudo apt-get update
28+
sudo apt-get install -y cmake pkg-config libssl-dev git gcc build-essential clang libclang-dev
29+
fi
30+
else
31+
echo "Unsupported operating system. Exiting."
32+
exit 1
33+
fi
34+
35+
curl https://sh.rustup.rs -sSf | sh -s -- -y
36+
source "$HOME/.cargo/env"
37+
rustup default stable
38+
39+
rustup update nightly
40+
rustup target add wasm32-unknown-unknown --toolchain nightly
41+
42+
echo "*** Rust installation complete"

scripts/localnet_setup.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)