network-api/public/install.sh

32 lines
893 B
Bash
Raw Normal View History

#!/bin/sh
rustc --version || curl https://sh.rustup.rs -sSf | sh
NEXUS_HOME=$HOME/.nexus
2024-10-09 00:47:55 +00:00
while [ -z "$NONINTERACTIVE" ]; do
read -p "Do you agree to the Nexus Beta Terms of Use (https://nexus.xyz/terms-of-use)? (Y/n) " yn </dev/tty
case $yn in
[Nn]* ) exit;;
[Yy]* ) break;;
"" ) break;;
* ) echo "Please answer yes or no.";;
esac
done
git --version 2>&1 >/dev/null
GIT_IS_AVAILABLE=$?
if [ $GIT_IS_AVAILABLE != 0 ]; then
echo Unable to find git. Please install it and try again.
exit 1;
fi
if [ -d "$NEXUS_HOME/network-api" ]; then
echo "$NEXUS_HOME/network-api exists. Updating.";
(cd $NEXUS_HOME/network-api && git pull)
else
2024-09-25 16:03:20 +00:00
mkdir -p $NEXUS_HOME
2024-10-09 04:38:53 +00:00
(cd $NEXUS_HOME && git clone https://github.com/nexus-xyz/network-api)
fi
2024-09-25 16:03:20 +00:00
(cd $NEXUS_HOME/network-api/clients/cli && cargo run --release --bin prover -- beta.orchestrator.nexus.xyz)