Merge pull request 'linea-mainnet: add engine-API healthcheck script' (#37) from issue-1049 into main
Reviewed-on: #37
This commit was merged in pull request #37.
This commit is contained in:
12
linea/scripts/engine-healthcheck.sh
Executable file
12
linea/scripts/engine-healthcheck.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
apk add --no-cache openssl wget >/dev/null 2>&1 || true
|
||||||
|
SECRET=$(tr -d '\n' </jwtsecret | sed 's/^0x//')
|
||||||
|
H=$(printf '{"alg":"HS256","typ":"JWT"}' | openssl base64 -e -A | tr '+/' '-_' | tr -d '=')
|
||||||
|
P=$(printf '{"iat":%s}' "$(date +%s)" | openssl base64 -e -A | tr '+/' '-_' | tr -d '=')
|
||||||
|
SIG=$(printf '%s' "$H.$P" | openssl dgst -sha256 -mac HMAC -macopt hexkey:"$SECRET" -binary | openssl base64 -e -A | tr '+/' '-_' | tr -d '=')
|
||||||
|
wget -q -O /dev/null \
|
||||||
|
--header="Content-Type: application/json" \
|
||||||
|
--header="Authorization: Bearer $H.$P.$SIG" \
|
||||||
|
--post-data='{"jsonrpc":"2.0","method":"engine_exchangeCapabilities","params":[],"id":1}' \
|
||||||
|
http://127.0.0.1:8551
|
||||||
Reference in New Issue
Block a user