Skip to content

status-im/eth-rpc-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ethereum RPC Proxy

The Ethereum RPC Proxy System provides a robust solution for managing and monitoring Ethereum RPC providers. It consists of two main components:

  1. RPC Health Checker: Monitors and validates RPC provider health
  2. nginx-proxy: Acts as a reverse proxy with provider failover capabilities

Running on the local machine

Run the complete system:

  1. Generate provider configuration files and store them in the secrets folder:

    # Create secrets directory if it doesn't exist
    mkdir -p secrets
    
    # Generate default_providers.json 
    python3 rpc-health-checker/generate_providers.py \
      --providers infura:YOUR_INFURA_TOKEN \
      --networks mainnet sepolia \
      --chains ethereum optimism arbitrum base \
      --output secrets/default_providers.json
      
    # Generate reference_providers.json
    python3 rpc-health-checker/generate_providers.py \
      --single-provider \
      --providers infura:YOUR_INFURA_TOKEN_REFERENCE  \
      --networks mainnet sepolia \
      --chains ethereum optimism arbitrum base \
      --output secrets/reference_providers.json

    Please replace YOUR_INFURA_TOKEN and YOUR_INFURA_TOKEN_REFERENCE with your Infura API tokens. You can also add more providers (infura or grove), see --providers flag help.

  2. Create .htpasswd file for nginx proxy authentication:

    htpasswd -c secrets/.htpasswd dev
  3. Execute the following commands to start the system:

    docker-compose up --build
  4. Run test requests:

    curl -u dev:<password> -X POST http://localhost:8080/ethereum/mainnet \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

The services will be accessible under:

Sub projects

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published