Smart Router
The Smart Router is an open source infrastructure layer that supports any RPC (Lava, Alchemy, self-hosted etc.) and chooses the best nodes for you with automatic failover, error recovery, smart caching, fast TXs and more.
Features
- Routes requests to the best nodes based on reliability, speed, and sync
- Automatically retries and fallbacks when providers face errors or downtime
- Delivers faster transaction propagation by broadcasting to all providers at once
- Has two layers of smart caching
- Samples and checks data accuracy
Get Started
Follow the steps to get started with Smart Router:
- Clone the repository:
git clone https://github.com/lavanet/lava.git
- Navigate to the Smart Router directory:
cd lava/protocol/rpcconsumer
- Install all dependencies:
make install-all
- Create a configuration file with the following format:
endpoints:
- network-address: <network-address>
chain-id: <chain-id>
api-interface: <api-interface>
- network-address: <network-address>
chain-id: <chain-id>
api-interface: <api-interface>
The network-address
specifies the IP address and port number of the node, chain-id
specifies the unique identifier of the blockchain, and api-interface
specifies the API interface used by the node.
- Start the consumer using the command:
rpcconsumer --config <path/to/config/file>