#!/bin/sh # MeshInfer node installer, https://meshinfer.app # Clones the public MESHINFER-node repository and installs the daemon # into ~/.meshinfer. Linux and macOS; for Windows follow the repo README. set -eu REPO_URL="https://git.154.83.149.72.nip.io/normar00/MESHINFER-node.git" MESHINFER_HOME="${MESHINFER_HOME:-$HOME/.meshinfer}" SRC_DIR="$MESHINFER_HOME/src" VENV_DIR="$MESHINFER_HOME/venv" BIN_DIR="${MESHINFER_BIN:-$HOME/.local/bin}" say() { printf '%s\n' "$*"; } fail() { printf 'error: %s\n' "$*" >&2; exit 1; } say '' say 'MeshInfer node installer' say '========================' case "$(uname -s 2>/dev/null || echo unknown)" in Linux | Darwin) ;; *) fail "this installer supports Linux and macOS. On Windows follow the README: $REPO_URL" ;; esac command -v git >/dev/null 2>&1 || fail 'git is required' # The daemon pins Python >=3.11,<3.12 PY='' for cand in python3.11 python3 python; do command -v "$cand" >/dev/null 2>&1 || continue if "$cand" -c 'import sys; raise SystemExit(0 if sys.version_info[:2] == (3, 11) else 1)' 2>/dev/null; then PY="$cand" break fi done [ -n "$PY" ] || fail 'Python 3.11 is required (the daemon pins >=3.11,<3.12). Install it and re-run.' say "-> fetching source into $SRC_DIR" if [ -d "$SRC_DIR/.git" ]; then git -C "$SRC_DIR" pull --ff-only else mkdir -p "$MESHINFER_HOME" git clone --depth 1 "$REPO_URL" "$SRC_DIR" fi say '-> creating the Python environment' "$PY" -m venv "$VENV_DIR" "$VENV_DIR/bin/python" -m pip install --quiet --upgrade pip say '-> installing the meshinfer daemon (local inference build can take a few minutes)' if ! "$VENV_DIR/bin/python" -m pip install --quiet -e "$SRC_DIR/daemon[inference]"; then say ' local inference extra failed to build, installing the base daemon instead' "$VENV_DIR/bin/python" -m pip install --quiet -e "$SRC_DIR/daemon" fi say '-> linking the meshinfer command' mkdir -p "$BIN_DIR" cat >"$BIN_DIR/meshinfer" <