{"id":19952886,"url":"https://github.com/ethersphere/ethproxy","last_synced_at":"2025-05-03T19:31:02.218Z","repository":{"id":57618413,"uuid":"386349187","full_name":"ethersphere/ethproxy","owner":"ethersphere","description":"Ethproxy is a websocket reverse proxy for ethereum JsonRPC calls.","archived":true,"fork":false,"pushed_at":"2022-10-12T10:09:35.000Z","size":9570,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-08T18:50:35.599Z","etag":null,"topics":["ethereum","golang","jrpc","proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ethersphere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-15T16:03:40.000Z","updated_at":"2025-02-11T15:32:53.000Z","dependencies_parsed_at":"2022-09-14T12:52:18.686Z","dependency_job_id":null,"html_url":"https://github.com/ethersphere/ethproxy","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethersphere%2Fethproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethersphere%2Fethproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethersphere%2Fethproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ethersphere%2Fethproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ethersphere","download_url":"https://codeload.github.com/ethersphere/ethproxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252241963,"owners_count":21717080,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","golang","jrpc","proxy"],"created_at":"2024-11-13T01:14:41.413Z","updated_at":"2025-05-03T19:31:01.864Z","avatar_url":"https://github.com/ethersphere.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ethereum Backend Proxy\n\nEthproxy 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.  \n\nTo locally run the example client, proxy, and backend:\n\n- `make binary`\n- `./dist/backend`\n- `PROXY_BACKEND_ENDPOINT=ws://localhost:7000 ./dist/proxy`\n- `./dist/client`\n\nEnv Flags Needed for the proxy\n\n- `PROXY_API_PORT` Endpoint for executing proxy methods \n- `PROXY_BACKEND_ENDPOINT` Backend endpoint to proxy requests to\n- `PROXY_WS_PORT` Websocket port to connect to\n- `PROXY_LOG_LEVEL` \"info\" is default, \"debug\" prints all `jsonRPC` requests and responses\n\n\n## Proxy RPC Methods\n\nMethods can be found in /pkg/api/api.go\n\nTo interact with the proxy and execute internal commands to, for example,\nrecord or alter the `block number` of the chain, a json RPC call may be sent to the proxy API as such:\n\n```\nPOST /execute\n{\"method\": \"blockNumberRecord\"}\n```\n\nThis 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`. \n\n```\nPOST /execute\n{\"method\": \"blockNumberFreeze\", \"params\": [\"some-ip4-address\"]}}\n```\n\nIf 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.\n\nTo get the ip address of a Bee node, you may query the debug api at `/addresses` and use the public ip4 address.\n\nTo cancel the above executions, grab the id in the response and cancel it as such:\n```\nDELETE /cancel/{id}\n```\n\nExample commands:\n```bash\ncurl --data '{\"method\": \"blockNumberRecord\"}' ethproxy.localhost/execute\ncurl --data '{\"method\": \"blockNumberFreeze\", \"params\": [\"10.42.0.37\"]}' ethproxy.localhost/execute\ncurl -X DELETE ethproxy.localhost/cancel/5\n```\n\n\n## Deployment and Testing Locally\n\n### ethersphere/beelocal\n```bash\nOPTS=skip-vet ./beelocal.sh\n```\n\n### ethersphere/ethproxy\n```bash\ncd deploy\nhelmsman -apply -f ethproxy.yaml\n```\n\n### ethersphere/beekeeper\n\nCopy `beekeeper/config/local.yml` to `~/.beekeeper/local.yaml` and change `swap-endpoint` to `ws://ethproxy:8546`\n\n```bash\nbeekeeper create bee-cluster --cluster-name local\n```\n### Logs\n\n```bash\nkubectl get pods -n local\nkubectl logs -n local -f {proxy container name}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethersphere%2Fethproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethersphere%2Fethproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethersphere%2Fethproxy/lists"}