-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathsetup.sh
executable file
·139 lines (117 loc) · 4.84 KB
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#!/usr/bin/env bash
set -eo pipefail
NODE_VERSION="20"
INSTALL_PATH="./omron"
if git rev-parse --is-inside-work-tree &>/dev/null; then
INSTALL_PATH="."
fi
BREW_PACKAGES=(
"node@${NODE_VERSION}"
"jq"
"aria2"
"pkg-config"
"certifi"
"ca-certificates"
"openssl"
"pipx"
)
APT_PACKAGES=(
"jq"
"aria2"
"pkg-config"
"libssl-dev"
"openssl"
"pipx"
)
case "$(uname)" in
"Darwin")
if ! command -v brew &>/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
echo "Installing brew packages..."
brew update
for pkg in "${BREW_PACKAGES[@]}"; do
brew install "$pkg" || brew upgrade "$pkg"
done
brew link --force "node@${NODE_VERSION}"
npm config set cafile /etc/ssl/cert.pem
;;
"Linux")
echo "Installing apt packages..."
sudo apt update
sudo apt install -y "${APT_PACKAGES[@]}"
curl -fsSL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | sudo -E bash -
sudo apt install -y nodejs
;;
*)
echo "Unsupported OS"
exit 1
;;
esac
echo "Checking for SnarkJS..."
local_snarkjs_dir="${HOME}/.snarkjs"
local_snarkjs_path="${local_snarkjs_dir}/node_modules/.bin/snarkjs"
if ! command -v "${local_snarkjs_path} r1cs info --help" >/dev/null 2>&1; then
echo "SnarkJS 0.7.4 not found in local directory. Installing..."
mkdir -p "${local_snarkjs_dir}"
npm install --prefix "${local_snarkjs_dir}" [email protected]
echo "SnarkJS has been installed in the local directory."
fi
echo "Installing pm2..."
sudo npm install -g pm2
pipx ensurepath
export PATH="$HOME/.local/bin:$PATH"
echo "Installing uv..."
pipx install uv
echo "Installing btcli..."
"$HOME/.local/bin/uv" tool install --python 3.12 bittensor-cli
if [[ ! -d ${INSTALL_PATH} ]]; then
echo "Cloning omron-subnet repository..."
if ! git clone https://github.com/inference-labs-inc/omron-subnet.git "${INSTALL_PATH}"; then
echo "Failed to clone repository. Check your internet connection and try again."
exit 1
fi
fi
cd "${INSTALL_PATH}" || {
echo "Failed to change to ${INSTALL_PATH} directory"
exit 1
}
"$HOME/.local/bin/uv" sync --frozen --no-dev
echo "
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@%#%@@@@@@@@@@@@@@@@@@
@@@@@@@@*.......*@@@@@@@@@@@@@@@
@@@@@@@+.........+@@@@@@@@@@@@@@
@@@@@@@:.....-#%%+..:=%@@@@@@@@@
@@@@@@@*...:#@@@@=.....=@@@@@@@@
@@@@@@@@#-.#@@@#-.......+@@@@@@@
@@@@@@@@@@*.-:..........:@@@@@@@
@@@@@@@@@@%.............-@@@@@@@
@@@@@@@@@@@*...........:%@@@@@@@
@@@@@@@@@@@@@-........*@@@@@@@@@
@@@@@@@@@@@@@@@%###%%@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
██████╗ ███╗ ███╗██████╗ ██████╗ ███╗ ██╗
██╔═══██╗████╗ ████║██╔══██╗██╔═══██╗████╗ ██║
██║ ██║██╔████╔██║██████╔╝██║ ██║██╔██╗ ██║
██║ ██║██║╚██╔╝██║██╔══██╗██║ ██║██║╚██╗██║
╚██████╔╝██║ ╚═╝ ██║██║ ██║╚██████╔╝██║ ╚████║
╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
███████╗██╗ ██╗██████╗ ███╗ ██╗███████╗████████╗
██╔════╝██║ ██║██╔══██╗████╗ ██║██╔════╝╚══██╔══╝
███████╗██║ ██║██████╔╝██╔██╗ ██║█████╗ ██║
╚════██║██║ ██║██╔══██╗██║╚██╗██║██╔══╝ ██║
███████║╚██████╔╝██████╔╝██║ ╚████║███████╗ ██║
╚══════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝ ╚═╝
"
echo "🥩 Setup complete! 🥩"
echo "Next steps:"
echo "1. Re-login for PATH changes to take effect, or run 'source ~/.bashrc' or 'source ~/.zshrc'"
echo "2. Check ${INSTALL_PATH}/docs/shared_setup_steps.md to setup your wallet and register on the subnet"
echo "3. cd ${INSTALL_PATH}"
echo "4. make <pm2-miner|pm2-validator> WALLET_NAME=<your_wallet_name> WALLET_HOTKEY=<your_wallet_hotkey>"