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:
Copy the code snippet below to
docker-compose.ymlfile 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:Copy the contents below to
ethproxy.ymlin a local folder (same folder as you copieddocker-compose.yml). Please be sure to update the template (below) with actual values fornode_rpc,node_json_rpc,chain_idandbroadcast_node_rpc
Provide a comma separated list of private keys for
env varETHPROXY_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).Ensure that the fee payer account (whose private key you are using) is funded.
Start the
ethproxyservice by typingdocker-compose up. Once the service starts, they can test by sending transactions to the feepayer proxy.
Last updated