README
¶
RPC-Splitter CLI Readme
RPC-Splitter is an Ethereum RPC proxy that splits a request across multiple endpoints and verifies that all of them return the same response.
Table of contents
Installation
To install it, you'll first need Go installed on your machine. Then you can use standard Go
command: go get -u github.com/chronicleprotocol/oracle-suite/cmd/rpc-splitter.
Alternatively, you can build RPC-Splitter using Makefile directly from the repository. This approach is recommended if
you wish to work on RPC-Splitter source.
git clone https://github.com/chronicleprotocol/oracle-suite.git
cd oracle-suite
make
How it works
Using third-party RPC providers is convenient, but for tasks that require a high level of security, it makes the security of the entire system dependent on that one RPC provider. The RPC Splitter helps to solve this problem.
The RPC Splitter works similarly to a proxy, but instead of forwarding the request to one server, it forwards it to multiple servers and compares the results against each other, thereby guaranteeing data integrity. If more than two endpoints are specified then if one of the servers returns a different result or error, it will be ignored.
Supported methods
eth_blockNumber- returns the lowest block number that is equal to or greater than the median of all block numbers minus 3eth_getBlockByHasheth_getBlockByNumbereth_getTransactionByHasheth_getTransactionCounteth_getTransactionReceipteth_sendRawTransactioneth_getBalanceeth_getCodeeth_getStorageAteth_calleth_getLogseth_gasPrice- median value is returnedeth_estimateGas- median value is returnedeth_feeHistoryeth_maxPriorityFeePerGas- median value is returnedeth_chainIdnet_version
If the method requires a block number, for newest and pending tags, the lowest block number that is equal to or
greater than the median of all block numbers minus 3 is returned. The earliest tag is not supported.
CORS
It is possible to enable simple CORS support to allow using RPC-Splitter with tools such as Metamask. When CORS is
enabled, then the Access-Control-Allow-Origin header will always equal the Origin header from the request.
Commands
Usage:
rpc-splitter [command]
Available Commands:
completion generate the autocompletion script for the specified shell
help Help about any command
run Start server
Flags:
-c, --enable-cors enables CORS requests for all origins
--eth-rpc strings list of ethereum nodes
-h, --help help for rpc-splitter
-l, --listen string listen address (default "127.0.0.1:8545")
--log.format text|json log format (default text)
-v, --log.verbosity panic|error|warning|info|debug verbosity level (default warning)
--version version for rpc-splitter
Use "rpc-splitter [command] --help" for more information about a command.
License
Documentation
¶
There is no documentation for this package.