-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwalletshield.sh
More file actions
executable file
·33 lines (28 loc) · 1 KB
/
walletshield.sh
File metadata and controls
executable file
·33 lines (28 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
USAGE="USAGE: ${0} <network_id> [platform]\n\n[platform] is one of:\n linux-x64 (default)\n linux-arm64\n windows-x64\n macos"
test -z "${1}" && echo -e "${USAGE}" && exit 1
url="https://test.net.zknet.io/${1}"
dir=$(dirname "$(realpath "${BASH_SOURCE[0]}")")
os="${2:-"linux-x64"}"
app="${dir}/${1}-walletshield-${os}"
cnf="${dir}/${1}-client.toml"
get() {
curl --fail --progress-bar -o "${2}" "${1}"
if [ $? -ne 0 ]; then
echo "ERROR: failed to retrieve $(basename "${2}")."
echo "Please check the network_id and platform, then try again."
echo -e "\n${USAGE}"
exit 1
fi
}
# Retrieve walletshield executable if not exists
if [ ! -f "${app}" ]; then
echo "Retrieving walletshield executable..."
get "${url}/walletshield-${os}" "${app}"
chmod u+x "${app}"
fi
# Retrieve deployed network configuration
echo "Retrieving deployed network configuration..."
get "${url}/client.toml" "${cnf}"
# Run walletshield with the retrieved configuration
"${app}" -config "${cnf}" -listen :7070