Substrate JSON RPC Gateway.
This is a generalized JSON RPC proxy server with features specifically designed for Substrate RPC and Ethereum RPC.

Pull vendors: git submodule update --init --recursive
Quick start: cargo run -- --config configs/config.yml
This will run a proxy server with config.yml as the configuration file.
Run with RUSTFLAGS="--cfg tokio_unstable" to enable tokio-console
RUST_LOGinfo.LOG_FORMATfull.full, pretty, json, compactIn addition, you can refer env variables in config.yml by using following syntax:
${variable}${variable:-word} indicates that if variable is set then the result will be that value. If variable is not set then word will be the result.${variable:+word} indicates that if variable is set then word will be the result, otherwise the result is the empty string.Subway is build with middleware pattern.
Method Middlewares
blockAt or blockHash params to requests to ensure downstream middleware such as cache can work properly.defaultBlock parameter to requests to ensure downstream middleware such as cache can work properly.To run all benchmarks:
cargo bench
It's also possible to run individual benchmarks by:
cargo bench --bench bench ws_round_trip
This middleware will intercept all method request/responses and compare the result directly with healthy endpoint responses. This is useful for debugging to make sure the returned values are as expected. You can enable validate middleware on your config file.
middlewares:
methods:
- validate
NOTE: Keep in mind that if you place validate middleware before inject_params you may get false positive errors because the request will not be the same.
Ignored methods can be defined in extension config:
extensions:
validator:
ignore_methods:
- system_health
- system_name
- system_version
- author_pendingExtrinsics
$ claude mcp add subway \
-- python -m otcore.mcp_server <graph>