Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update entrypoint.sh to require mainnet RPC environment variables #34

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@
set -e

# Check if required environment variables are set
if [ -z "$ETH_SEPOLIA_RPC" ] || [ -z "$OP_SEPOLIA_RPC" ] || [ -z "$BASE_SEPOLIA_RPC" ] || [ -z "$PEPTIDE_RPC" ]; then
if [ -z "$ETH_MAINNET_RPC" ] || [ -z "$OP_MAINNET_RPC" ] || [ -z "$BASE_MAINNET_RPC" ] || \
[ -z "$ETH_SEPOLIA_RPC" ] || [ -z "$OP_SEPOLIA_RPC" ] || [ -z "$BASE_SEPOLIA_RPC" ] || \
[ -z "$PEPTIDE_RPC" ]; then
echo "Error: One or more required environment variables are not set."
echo "Please set ETH_SEPOLIA_RPC, OP_SEPOLIA_RPC, BASE_SEPOLIA_RPC, and PEPTIDE_RPC."
echo "Please set ETH_MAINNET_RPC, OP_MAINNET_RPC, BASE_MAINNET_RPC,"
echo "ETH_SEPOLIA_RPC, OP_SEPOLIA_RPC, BASE_SEPOLIA_RPC, and PEPTIDE_RPC."
exit 1
fi

# Run the cached-eth-rpc command with environment variables
exec /app/cached-eth-rpc \
--endpoint=eth-mainnet="$ETH_MAINNET_RPC" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like we should somehow generate the endpoint parameters. This will load rpcs we don't need into different environments and doesn't allow us to easily set new endpoints

--endpoint=op-mainnet="$OP_MAINNET_RPC" \
--endpoint=base-mainnet="$BASE_MAINNET_RPC" \
--endpoint=eth-sepolia="$ETH_SEPOLIA_RPC" \
--endpoint=op-sepolia="$OP_SEPOLIA_RPC" \
--endpoint=base-sepolia="$BASE_SEPOLIA_RPC" \
Expand Down
Loading