infra/proxyd/proxyd
Matthew Slipper e2e3a622ce proxyd: Use canned response for eth_accounts (#2801)
We never want to expose Geth's accounts to the public internet, so proxyd will now return `[]` for `eth_accounts` RPC calls without hitting the backend.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-06-16 19:02:39 +00:00
..
cmd/proxyd maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
integration_tests proxyd: Use canned response for eth_accounts (#2801) 2022-06-16 19:02:39 +00:00
.gitignore maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
backend.go proxyd: Use canned response for eth_accounts (#2801) 2022-06-16 19:02:39 +00:00
cache_test.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
cache.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
CHANGELOG.md Version Packages 2022-06-08 20:51:10 +00:00
config.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
Dockerfile maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
entrypoint.sh maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
errors.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
example.config.toml maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
go.mod chore(deps): bump github.com/ethereum/go-ethereum in /proxyd (#2607) 2022-05-26 23:35:13 +00:00
go.sum chore(deps): bump github.com/ethereum/go-ethereum in /proxyd (#2607) 2022-05-26 23:35:13 +00:00
lvc.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
Makefile maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
methods.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
metrics.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
package.json Version Packages 2022-06-08 20:51:10 +00:00
proxyd.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
rate_limiter.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
README.md maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
rpc_test.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
rpc.go proxyd: Use canned response for eth_accounts (#2801) 2022-06-16 19:02:39 +00:00
server.go proxyd: Use canned response for eth_accounts (#2801) 2022-06-16 19:02:39 +00:00
string_set.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00
tls.go maint: Move Go packages into root of repo, adopt go.work (#2524) 2022-05-04 21:51:24 +00:00

rpc-proxy

This tool implements proxyd, an RPC request router and proxy. It does the following things:

  1. Whitelists RPC methods.
  2. Routes RPC methods to groups of backend services.
  3. Automatically retries failed backend requests.
  4. Provides metrics the measure request latency, error rates, and the like.

Usage

Run make proxyd to build the binary. No additional dependencies are necessary.

To configure proxyd for use, you'll need to create a configuration file to define your proxy backends and routing rules. Check out example.config.toml for how to do this alongside a full list of all options with commentary.

Once you have a config file, start the daemon via proxyd <path-to-config>.toml.

Metrics

See metrics.go for a list of all available metrics.

The metrics port is configurable via the metrics.port and metrics.host keys in the config.

Adding Backend SSL Certificates in Docker

The Docker image runs on Alpine Linux. If you get SSL errors when connecting to a backend within Docker, you may need to add additional certificates to Alpine's certificate store. To do this, bind mount the certificate bundle into a file in /usr/local/share/ca-certificates. The entrypoint.sh script will then update the store with whatever is in the ca-certificates directory prior to starting proxyd.