Skip to content

Commit

Permalink
feat: always wipe config
Browse files Browse the repository at this point in the history
  • Loading branch information
QEDK committed Mar 29, 2024
1 parent 44da877 commit 21f719c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
## Availup
To run an Avail light client, simply run the following command:
```bash
curl -sL1 avail.sh | sh
curl -sL1 avail.sh | bash
```
or, with `wget`:
```bash
wget --https-only --secure-protocol=TLSv1_2 --quiet -O - avail.sh | sh
wget --https-only --secure-protocol=TLSv1_2 --quiet -O - avail.sh | bash
```
You can pass additional flags to the script like:
```bash
curl -sL1 avail.sh | sh -s -- --network goldberg
curl -sL1 avail.sh | bash -s -- --network goldberg
```
Currently available flags are:
* `network`: can be one of the following: [`kate`, `goldberg`, `local`]
* `network`: can be one of the following: [`goldberg`, `local`]
* `config`: path to the configuration file, availup will generate a config if this flag is not specified
* `identity`: path to the identity file, availup will generate a config if this flag is not specified
* `app_id`: application ID to run the light client (defaults to `0`)
* `upgrade`: takes `y` and `yes` as valid arguments, indicating that the `avail-light` binary should be upgraded

You can modify the existing default config by running and rerun `availup` to use the new config:
```bash
# create the config:
touch ~/config.yml
touch ~/.avail/config/config.yml
# edit the config:
nano ~/config.yml
nano ~/.avail/config/config.yml
# and rerunning the script:
curl -sL1 avail.sh | sh -s -- --config ~/config.yml
curl -sL1 avail.sh | bash -s -- --config ~/.avail/config/config.yml
```

Alternatively, you can pass a specific application ID with `availup`:
```bash
rm ~/.avail/goldberg/config.yml
# and rerunning the script with flags:
curl -sL1 avail.sh | sh -s -- --app_id 1
curl -sL1 avail.sh | bash -s -- --app_id 1
```

To upgrade the light client to a latest version, you can simply pass the `--upgrade` flag like:
```bash
curl -sL1 avail.sh | sh -s -- --upgrade y
curl -sL1 avail.sh | bash -s -- --upgrade y
```
4 changes: 2 additions & 2 deletions availup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ if [ "$NETWORK" = "goldberg" ]; then
echo "📄 Configuration file found at $CONFIG."
else
echo "🤷 No configuration file set. This will be automatically generated at startup."
touch $CONFIG
echo -e $CONFIG_PARAMS >>$CONFIG
fi
touch $CONFIG
echo -e $CONFIG_PARAMS >> $CONFIG
else
CONFIG="$config"
fi
Expand Down

0 comments on commit 21f719c

Please sign in to comment.