mirror of
https://github.com/luxfi/explorer-v1.git
synced 2026-10-30 19:34:59 +00:00
Introduce dev container for streamlined Blockscout development - Add .devcontainer setup with pre-configured Elixir, Phoenix, and Node.js - Include PostgreSQL service in docker-compose.yml - Configure VS Code extensions and settings in devcontainer.json - Add bs script for common development tasks - Provide .blockscout_config.example for easy configuration - Enable GitHub Codespaces support for cloud-based development This change aims to reduce setup time, ensure consistency across environments, and allow developers to focus on core development tasks.
23 lines
737 B
Plaintext
23 lines
737 B
Plaintext
# Function to check server availability
|
|
check_server_availability() {
|
|
local url=$1
|
|
|
|
curl --connect-timeout 3 --silent ${url} 1>/dev/null
|
|
if [ $? -ne 0 ]; then
|
|
echo "VPN must be enabled to connect to ${url}"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
# Function to check server accessibility with a POST request
|
|
check_server_accessibility() {
|
|
local url=$1
|
|
local payload='[{"id":0,"params":["latest",false],"method":"eth_getBlockByNumber","jsonrpc":"2.0"}]'
|
|
|
|
http_code=$(curl -s -o /dev/null -w "%{http_code}" -X POST ${url} -H "Content-Type: application/json" -d "${payload}")
|
|
if [ "$http_code" -ne 200 ]; then
|
|
echo "VPN must be enabled to access ${url} (HTTP status code: ${http_code})"
|
|
exit 1
|
|
fi
|
|
}
|