Chain Proxy is a robust and dynamic proxy service designed for blockchain services. Utilizing the third-party
library pingora, Chain Proxy intelligently routes requests to the healthiest nodes in the network, ensuring high
availability and reliability of blockchain operations.
- Dynamic Node Selection: Chain Proxy monitors the health of downstream nodes and dynamically selects the optimal one for request forwarding.
- High Availability: Designed with fault tolerance in mind, it provides uninterrupted service even when individual nodes experience issues.
- Easy Integration: Seamlessly integrates with existing blockchain services without extensive configuration.
- Powered by Pingora: Leverages the
pingoralibrary for efficient network health checks and load balancing.
To get started with Chain Proxy, follow these steps:
Ensure you have Rust installed on your system. You can install Rust using rustup by following the instructions on
the official Rust website.
-
Clone the repository:
git clone https://github.com/your-username/chain-proxy.git cd chain-proxy -
Build the project:
./build.sh
-
Run the proxy:
./chain-proxy --config path/to/config.yaml
Chain Proxy can be configured by editing the config.yaml file. Here you can specify the nodes, their respective health check intervals, and other relevant settings.
# Example config.toml:
Chains:
- Name: optimism
Listen: 1017
Interval: 5
BlockGap: 50
Nodes:
- Address: https://rpc.ankr.com/optimism
Priority: 1
- Address: https://mainnet.optimism.io/
Priority: 0
HealthCheck:
Path: ""
Method: POSTOnce Chain Proxy is running, it will listen for incoming blockchain requests and forward them to the most suitable node based on the current health status and response times.
Contributions are welcome! Feel free to open a pull request or an issue if you have suggestions or encounter any problems.
Chain Proxy is licensed under the MIT License - see the LICENSE file for details.