Skip to content

A proxy layer to sit in front of GoChain/Ethereum JSON-RPC-API to make it more secure and resilient.

License

Notifications You must be signed in to change notification settings

gochain/rpc-proxy

Folders and files

NameName
Last commit message
Last commit date
Oct 8, 2024
Oct 8, 2024
Oct 8, 2024
Oct 8, 2024
Oct 8, 2024
Mar 29, 2022
Aug 18, 2021
Oct 8, 2024
Aug 25, 2021
Apr 16, 2025
Apr 16, 2025
Jul 1, 2022
Sep 22, 2019
Aug 23, 2021
Apr 8, 2019
Oct 6, 2019
Nov 7, 2024
Mar 4, 2019
Jul 1, 2022
Mar 18, 2025

Repository files navigation

rpc-proxy

A proxy for web3 JSONRPC featuring:

  • rate limiting
  • method filtering
  • stats

Getting Started

Prerequisites

At least Go 1.20. Installation documentation here: https://golang.org/doc/install

How to Use

By default, rpc-proxy will run on port 8545 and redirect requests to http://localhost:8040. These values can be changed with the port and url flags, along with other options:

> rpc-proxy help
NAME:
   rpc-proxy - A proxy for web3 JSONRPC

USAGE:
   rpc-proxy [global options] command [command options] [arguments...]

VERSION:
   0.0.28

COMMANDS:
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --config value, -c value   path to toml config file
   --port value, -p value     port to serve (default: "8545")
   --url value, -u value      redirect url (default: "http://127.0.0.1:8040")
   --allow value, -a value    comma separated list of allowed paths
   --rpm value                limit for number of requests per minute from single IP (default: 1000)
   --nolimit value, -n value  list of ips allowed unlimited requests(separated by commas)
   --verbose                  verbose logging enabled
   --help, -h                 show help
   --version, -v              print the version

Docker

Run our Docker image:

docker run ghcr.io/gochain/rpc-proxy/rpc-proxy:latest

Build Docker image:

make docker

Run it:

make run