Beerus
Beerus is a Starknet Light Client inspired by and using helios. It is designed to be simple, modular, and fast, supporting the Starknet v0.6.0 OpenRPC spec.
Copy the configuration file from etc/conf/beerus.toml
and set up the RPC provider URLs in the copy. Make sure that providers are compatible. Read more about providers here.
Run the following command to start Beerus:
cargo run --release -- -c ./path/to/config.toml
To verify that Beerus is up and running, try this request:
curl -H 'Content-type: application/json' -d '{
"jsonrpc": "2.0",
"method": "starknet_getStateRoot",
"params": [],
"id": 1
}' http://127.0.0.1:3030
{
"jsonrpc": "2.0",
"result": "0x539895aff28be4958188c1d4e8e68ee6772bdd49dd9362a4fbb189e61c54ff1",
"id": 1
}
Field | Example | Description |
---|---|---|
network | MAINNET or SEPOLIA | Network to query |
eth_execution_rpc | https://eth-mainnet.g.alchemy.com/v2/{YOUR_API_KEY} | Untrusted L1 node provider URL |
starknet_rpc | https://starknet-mainnet.g.alchemy.com/starknet/version/rpc/v0.6/{YOUR_API_KEY} | Untrusted L2 node provider URL |
data_dir | tmp | OPTIONAL: Location to store both L1 and L2 data |
poll_secs | 5 | OPTIONAL: Seconds to wait for querying SN state (min: 1, max: 3600) |
rpc_addr | 127.0.0.1:3030 | OPTIONAL: Local address to listen for RPC requests |
fee_token_addr | 0x049d36...e004dc7 | OPTIONAL: Fee token to check for getBalance |
Ensure that eth_execution_rpc
and starknet_rpc
URLs correspond to the selected network (MAINNET or SEPOLIA).
Beerus relies on two untrusted RPC endpoints:
cargo build --all --release
cargo test --all
Build the Docker image:
docker build . -t beerus
Run the Docker container:
docker run -e NETWORK=<arg> -e ETH_EXECUTION_RPC=<arg> -e STARKNET_RPC=<arg> -it beerus
Run examples with:
ALCHEMY_API_KEY='YOURAPIKEY' cargo run --example basic
ALCHEMY_API_KEY='YOURAPIKEY' cargo run --example call