Find answers instantly with AI search. Start typing your prompt below and let AI do the digging for you!

Running a Local EthProxy

EthProxy is a service that sits in front of your chainlet and can pay for gas fees for all transactions submitted to it.

Prerequisite - To keep the setup simple, we will be using docker.

Note: The info in the docker file can be extended to Kubernetes or any other orchestration engine.

Instructions:

  1. Copy the code snippet below to docker-compose.yml file in a local folder.

version: '3.8'

services:
  # Main ethproxy service
  ethproxy:
    image: sagaxyz/ethproxy:0.5.0-beta.2
    container_name: ethproxy
    restart: unless-stopped
    ports:
      - "8545:8545"  # JSON-RPC HTTP
      - "8546:8546"  # JSON-RPC WebSocket (if configured)
      - "9090:9090"  # Prometheus metrics (if enabled)
      - "6060:6060"  # Profiler (if enabled)
    volumes:
      - ./ethproxy.yml:/etc/saga/ethproxy/ethproxy.yml      
    environment:
      # Fee payer private keys should be comma separated. You can also set these keys via an environment variable and passing it to docker compose parm ETHPROXY_SERVICES_FEE_PAYER_PRIVATE_KEYS
      # Private keys should belong to account(s) on your chainlet using which you wish to pay for gas fees
      - ETHPROXY_SERVICES_FEE_PAYER_PRIVATE_KEYS=
    networks:
      - ethproxy-network
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8545"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

networks:
  ethproxy-network:
    driver: bridge
    ipam:
      driver: default
      config:
        -
          subnet: 192.168.0.0/16

volumes:
  ethproxy:

  1. Copy the contents below to ethproxy.yml in a local folder (same folder as you copied docker-compose.yml). Please be sure to update the template (below) with actual values for node_rpc, node_json_rpc, chain_id and broadcast_node_rpc

  1. Provide a comma separated list of private keys for env var ETHPROXY_SERVICES_FEE_PAYER_PRIVATE_KEYS. If you are using a single account to pay transaction gas fees, a single private key is sufficient (omit the comma from the end if using a single key).

  2. Ensure that the fee payer account (whose private key you are using) is funded.

  3. Start the ethproxy service by typing docker-compose up. Once the service starts, they can test by sending transactions to the feepayer proxy.

Last updated