This tool benchmarks multiple Solana nodes GRPC geyser by detecting transactions and calculating which node is the fastest in detecting transactions for a specific address.
-
Go Environment:
- Ensure you have Go 1.22 or later installed.
- Download and install from https://go.dev/dl/.
-
Dependencies:
- The program requires some libraries:
grpc
protobuf
- Run the following command to install dependencies:
go mod tidy
- The program requires some libraries:
-
Configuration File:
- Update the
config.json
file in the root directory using the following format:{ "nodes": [ "http://grpc.node1.com:10000", "http://grpc.node2.com:10000" ], "benchmarkDuration": 30, "detectionAddress": "675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8" }
- nodes: An array of Solana node addresses.
- benchmarkDuration: Duration of the benchmark in seconds, defaults to 30 seconds.
- detectionAddress: A valid Solana address to detect transactions, default one is Raydium V4 program.
- Update the
-
Build the program:
- Linux/MacOS:
go build -o benchmark
- Windows:
go build -o benchmark.exe
- Linux/MacOS:
-
Run the program:
- Linux/MacOS:
./benchmark
- Windows:
benchmark.exe
- Linux/MacOS:
Starting benchmark, duration 10 seconds...
Time left: 10s, 15 transactions detected
Time left: 9s, 124 transactions detected
...
Benchmark completed, calculating results...
Detected 2623 transactions
The winner is http://grpc.node1.com:10000
Ranking:
1) http://grpc.node1.com:10000 detected first 2966 transactions with a winrate of 86.30%
2) http://grpc.node2.com:10000 detected first 471 transactions with a winrate of 13.70%
-
"Failed to open file":
- Ensure the
config.json
file exists in the same directory as the program.
- Ensure the
-
"Failed to unmarshal JSON":
- Verify the
config.json
file is correctly formatted.
- Verify the
-
"There gotta be at least 2 nodes in the config.json":
- Provide at least two Solana nodes in the
nodes
array.
- Provide at least two Solana nodes in the
-
"Detection address is not a valid Solana address":
- Provide a valid Solana address in the
detectionAddress
field.
- Provide a valid Solana address in the
- This tool is designed to benchmark Solana nodes. Ensure the nodes provided in
config.json
are accessible and functional, nodes often require ip whitelisting. - The benchmark detects new transactions on the "processed" level ignoring vote and failed transactions
- The benchmark program doesn't currently support x-token based GRPC geysers, feel free to make a pull request if you want to add support
- The benchmark program doesn't currently reconnect in case of disconnection, that would be useful in case geysers tested struggle to maintain a stable connection, again feel free make a pull request if you want to add support