Skip to content

Commit

Permalink
feat: update LC version
Browse files Browse the repository at this point in the history
  • Loading branch information
QEDK committed Nov 30, 2023
1 parent a88755d commit 3fbec62
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,27 @@ or, with `wget`:
```bash
wget --https-only --secure-protocol=TLSv1_2 --quiet -O - avail.sh | sh
```
You can pass additional flags to the script like:
```bash
curl -sL1 avail.sh | sh -s -- --network goldberg
```
Currently available flags are:
* `network`: can be one of the following: [`kate`, `goldberg`, `local`]
* `config`: path to the configuration file, availup will generate a config if this flag is not specified
* `app_id`: application ID to run the light client (defaults to `0`)

Flags are defined once for each network in the config file. If a default configuration already exists, the flags are
ignored unless the configuration for that network does not exist.

You can modify the existing default config by running and rerun `availup` to use the new config:
```bash
nano ~/.avail/goldberg/config.yml
# and rerunning the script:
curl -sL1 avail.sh | sh
```
Alternatively, you can delete the existing config and generate a new config with `availup`:
```bash
rm ~/.avail/goldberg/config.yml
# and rerunning the script with flags:
curl -sL1 avail.sh | sh -s -- --app_id 1
```
17 changes: 12 additions & 5 deletions availup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ else
fi
if [ "$NETWORK" = "goldberg" ]; then
echo "📌 Goldberg network selected."
VERSION="v1.7.3"
VERSION="v1.7.4"
elif [ "$NETWORK" = "kate" ]; then
echo "📌 Kate network selected."
VERSION="v1.7.3-rc1"
VERSION="v1.7.4"
elif [ "$NETWORK" = "local" ]; then
echo "📌 Local network selected."
VERSION="v1.7.3"
VERSION="v1.7.4"
else
echo "🚫 Invalid network selected. Please select one of the following: goldberg, kate, local."
exit 1
fi
if [ -z "$app_id" ]; then
echo "ℹ️ No app ID specified. Defaulting to 0."
APPID="0"
else
APPID="$app_id"
fi
if [ ! -d "$HOME/.avail" ]; then
mkdir $HOME/.avail
fi
Expand All @@ -43,10 +49,11 @@ if [ -z "$config" ]; then
echo "ℹ️ No config file selected. Defaulting to $HOME/.avail/$NETWORK/config.yml."
CONFIG="$HOME/.avail/$NETWORK/config.yml"
touch $CONFIG
SEED=$(hexdump -vn32 -e'8/8 "%0X"' /dev/urandom)
if [ "$NETWORK" = "goldberg" ]; then
echo "log_level = \"info\"\nhttp_server_host = \"0.0.0.0\"\nhttp_server_port = 7001\n\nsecret_key = { seed = \"$RANDOM-avail-$RANDOM\" }\nlibp2p_port = \"37000\"\nfull_node_ws = [\"wss://goldberg.avail.tools:443/ws\"]\napp_id = 0\nconfidence = 99.0\navail_path = \"$HOME/.avail-light/$NETWORK\"\nbootstraps = [[\"12D3KooWBkLsNGaD3SpMaRWtAmWVuiZg1afdNSPbtJ8M8r9ArGRT\",\"/dns/bootnode.1.lightclient.goldberg.avail.tools/udp/37000/quic-v1\"]]" >~/.avail/$NETWORK/config.yml
echo "log_level = \"info\"\nhttp_server_host = \"0.0.0.0\"\nhttp_server_port = 7001\n\nsecret_key = { seed = \"$SEED\" }\nlibp2p_port = \"37000\"\nfull_node_ws = [\"wss://goldberg.avail.tools:443/ws\"]\napp_id = $APPID\nconfidence = 99.0\navail_path = \"$HOME/.avail-light/$NETWORK\"\nbootstraps = [[\"12D3KooWBkLsNGaD3SpMaRWtAmWVuiZg1afdNSPbtJ8M8r9ArGRT\",\"/dns/bootnode.1.lightclient.goldberg.avail.tools/udp/37000/quic-v1\"]]" >~/.avail/$NETWORK/config.yml
elif [ "$NETWORK" = "kate" ]; then
echo "log_level = \"info\"\nhttp_server_host = \"0.0.0.0\"\nhttp_server_port = 7001\n\nsecret_key = { seed = \"$RANDOM-avail-$RANDOM\" }\nlibp2p_port = \"37000\"\nfull_node_ws = [\"wss://kate.avail.tools:443/ws\"]\napp_id = 0\nconfidence = 99.0\navail_path = \"$HOME/.avail-light/$NETWORK\"\nbootstraps = [\"/ip4/127.0.0.1/tcp/39000/quic-v1/12D3KooWMm1c4pzeLPGkkCJMAgFbsfQ8xmVDusg272icWsaNHWzN\"]" >~/.avail/$NETWORK/config.yml
echo "log_level = \"info\"\nhttp_server_host = \"0.0.0.0\"\nhttp_server_port = 7001\n\nsecret_key = { seed = \"$SEED\" }\nlibp2p_port = \"37000\"\nfull_node_ws = [\"wss://kate.avail.tools:443/ws\"]\napp_id = $APPID\nconfidence = 99.0\navail_path = \"$HOME/.avail-light/$NETWORK\"\nbootstraps = [\"/ip4/127.0.0.1/tcp/39000/quic-v1/12D3KooWMm1c4pzeLPGkkCJMAgFbsfQ8xmVDusg272icWsaNHWzN\"]" >~/.avail/$NETWORK/config.yml
fi
else
CONFIG=$config
Expand Down

0 comments on commit 3fbec62

Please sign in to comment.