fix: Terms (#6)

This commit is contained in:
Collin Jackson 2024-10-08 17:47:55 -07:00 committed by GitHub
parent a613ae9bfa
commit b5aad54d42
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 25 deletions

View File

@ -5,7 +5,7 @@ Command line interface (CLI) for accessing the Nexus Network. Highest-performanc
## Quick start
```
curl https://network-cli.nexus.xyz/install.sh | sh
curl https://cli.nexus.xyz/install.sh | sh
```
If you do not already have Rust, you will be prompted to install it.
@ -15,7 +15,7 @@ If you do not already have Rust, you will be prompted to install it.
Use of the CLI is subject to the [Terms of Use](https://nexus.xyz/terms_of_use).
The first time you run it, it prompts you to accept the terms. To accept the terms
noninteractively (for example, in a continuous integration environment),
add `NONINTERACTIVE=1` at the start of the command.
add `NONINTERACTIVE=1` before `sh`.
## Known issues

View File

@ -74,19 +74,6 @@ async fn main() {
// If the prover_id file is found, use the contents, otherwise generate a new random id
// and store it.
let _ = match env::var("NONINTERACTIVE") {
Ok(_) => (),
Err(_) => {
println!(
"Do you agree to the Nexus Beta Terms of Use (https://nexus.xyz/terms-of-use)? (Y/n)"
);
let mut input = String::new();
let _ = std::io::stdin().read_line(&mut input);
if input.chars().nth(0).unwrap() == 'n' || input.chars().nth(0).unwrap() == 'N' {
return ();
}
}
};
let mut prover_id = format!(
"{}-{}-{}",
random_word::gen(Lang::En),

View File

@ -2,18 +2,30 @@
rustc --version || curl https://sh.rustup.rs -sSf | sh
NEXUS_HOME=$HOME/.nexus
CLI_ZIP=/tmp/nexus-network-api.zip
curl -L --verbose "https://docs.google.com/uc?export=download&id=1kcbEeKpVEyvIqL-_cgR5sYdZe_fOEPs6" > $CLI_ZIP
if [ -d "$NEXUS_HOME" ]; then
echo "$NEXUS_HOME exists. Updating.";
(cd $NEXUS_HOME && rm -rf network-api && unzip $CLI_ZIP)
# TODO: Once GitHub repo is public, do this instead
# (cd $NEXUS_HOME && git pull)
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
# TODO: Once GitHub repo is public, do this instead
# git clone git@github.com:nexus-xyz/network-cli $NEXUS_HOME
mkdir -p $NEXUS_HOME
(cd $NEXUS_HOME && unzip $CLI_ZIP)
(cd $NEXUS_HOME && git clone git@github.com:nexus-xyz/network-cli)
fi
(cd $NEXUS_HOME/network-api/clients/cli && cargo run --release --bin prover -- beta.orchestrator.nexus.xyz)