Ethproxy
Ethproxy is a websocket reverse proxy for ethereum JsonRPC calls.
Install / Use
/learn @ethersphere/EthproxyREADME
Ethereum Backend Proxy
Ethproxy is a websocket reverse proxy for ethereum JsonRPC calls. It can log response and requests for debugging and observability. It also features an internal state that can be interacted with by running rpc methods listed below.
To locally run the example client, proxy, and backend:
make binary./dist/backendPROXY_BACKEND_ENDPOINT=ws://localhost:7000 ./dist/proxy./dist/client
Env Flags Needed for the proxy
PROXY_API_PORTEndpoint for executing proxy methodsPROXY_BACKEND_ENDPOINTBackend endpoint to proxy requests toPROXY_WS_PORTWebsocket port to connect toPROXY_LOG_LEVEL"info" is default, "debug" prints alljsonRPCrequests and responses
Proxy RPC Methods
Methods can be found in /pkg/api/api.go
To interact with the proxy and execute internal commands to, for example,
record or alter the block number of the chain, a json RPC call may be sent to the proxy API as such:
POST /execute
{"method": "blockNumberRecord"}
This command will cause the proxy to start recording the eth block number as responses to block number requests are proxied. This request is required to run before the blockNumberFreeze can be called, otherwise, nodes will be frozen at block number 0.
POST /execute
{"method": "blockNumberFreeze", "params": ["some-ip4-address"]}}
If an IP address is provided, the node with that IP, when it queries the current eth block number, will receive the block number that was recorded at the time when this command was executed. Executing this command without params will cause all nodes to receive the old block number.
To get the ip address of a Bee node, you may query the debug api at /addresses and use the public ip4 address.
To cancel the above executions, grab the id in the response and cancel it as such:
DELETE /cancel/{id}
Example commands:
curl --data '{"method": "blockNumberRecord"}' ethproxy.localhost/execute
curl --data '{"method": "blockNumberFreeze", "params": ["10.42.0.37"]}' ethproxy.localhost/execute
curl -X DELETE ethproxy.localhost/cancel/5
Deployment and Testing Locally
ethersphere/beelocal
OPTS=skip-vet ./beelocal.sh
ethersphere/ethproxy
cd deploy
helmsman -apply -f ethproxy.yaml
ethersphere/beekeeper
Copy beekeeper/config/local.yml to ~/.beekeeper/local.yaml and change swap-endpoint to ws://ethproxy:8546
beekeeper create bee-cluster --cluster-name local
Logs
kubectl get pods -n local
kubectl logs -n local -f {proxy container name}
Related Skills
node-connect
342.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
342.0kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
84.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
342.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
