Table of Contents
We have big plans for Beerus. Check out the Roadmap!
Beerus is a Starknet Light Client inspired by and using helios. The goal is to provide a simple and easy to use client to query Starknet state and interact with contracts.
Here is a high level overview of the architecture of Beerus.
Here is a simple overview of how Beerus work. The example is for querying a storage value of a Starknet contract.
Here are all the endpoints supported by Beerus in tag v0.2.0
Starknet endpoints (20) (in compliance with Starknet specs):
Endpoint | Supported |
---|---|
starknet_getBlockWithTxHashes |
β |
starknet_getBlockWithTxs |
β |
starknet_getStateUpdate |
β |
starknet_getStorageAt |
β |
starknet_getTransactionByHash |
β |
starknet_getTransactionByBlockIdAndIndex |
β |
starknet_getTransactionReceipt |
β |
starknet_getClass |
β |
starknet_getClassHashAt |
β |
starknet_getClassAt |
β |
starknet_getBlockTransactionCount |
β |
starknet_call |
β |
starknet_estimateFee |
β |
starknet_blockNumber |
β |
starknet_blockHashAndNumber |
β |
starknet_chainId |
β |
starknet_pendingTransactions |
β |
starknet_syncing |
β |
starknet_getEvents |
β |
starknet_getNonce |
β |
Ethereum endpoints (21) (in compliance with Helios specs):
Endpoint | Supported |
---|---|
eth_getBalance |
β |
eth_getTransactionCount |
β |
eth_getCode |
β |
eth_call |
β |
eth_estimateGas |
β |
eth_getChainId |
β |
eth_gasPrice |
β |
eth_maxPriorityFeePerGas |
β |
eth_blockNumber |
β |
eth_getBlockByNumber |
β |
eth_getBlockByHash |
β |
eth_sendRawTransaction |
β |
eth_getTransactionReceipt |
β |
eth_getLogs |
β |
eth_getStorageAt |
β |
eth_getBlockTransactionCountByHash |
β |
eth_getBlockTransactionCountByNumber |
β |
eth_coinbase |
β |
eth_syncing |
β |
eth_getTransactionByHash |
β |
eth_getTransactionByBlockHashAndIndex |
β |
Additional endpoints (8):
Endpoint | Supported |
---|---|
starknet_l1_to_l2_messages |
β |
starknet_l1_to_l2_message_nonce |
β |
starknet_l1_to_l2_message_cancellations |
β |
starknet_l2_to_l1_messages |
β |
starknet_addDeclareTransaction |
β |
starknet_addDeployAccountTransaction |
β |
starknet_getContractStorageProof |
β |
starknet_addInvokeTransaction |
β |
To install with beerusup
:
curl -sL https://raw.githubusercontent.com/keep-starknet-strange/beerus/main/beerusup | sh
cargo build --all --release
Build beerus-core
for WASM:
cargo build -p beerus-core --no-default-features --target wasm32-unknown-unknown --release
cargo test --all
The project requires an Ethereum node and a Starknet node. For Ethereum nodes you can use Alchemy (not Infura since it does not support getProof endpoint).
Ethereum execution layer RPC URL (must be an Ethereum provider that supports the eth_getProof endpoint).
Ethereum consensus layer RPC URL (must be a consensus node that supports the light client beacon chain api)
For Starknet node for the moment you can use Infura but soon verify proof will be implemented in Pathfinder nodes, and so will these nodes be working as well.
Env Var | TOML | Mainnet | Goerli |
---|---|---|---|
ETHEREUM_NETWORK | ethereum_network | mainnet |
goerli(default) |
ETHEREUM_EXECUTION_RPC_URL | ethereum_consensus_rpc | https://eth-mainnet.g.alchemy.com/v2/XXXXX | https://eth-goerli.g.alchemy.com/v2/XXXXX |
ETHEREUM_CONSENSUS_RPC_URL | ethereum_execution_rpc | https://www.lightclientdata.org | http://testing.prater.beacon-api.nimbus.team |
STARKNET_RPC_URL | starknet_rpc | https://starknet-mainnet.infura.io/v3/XXXXX | https://starknet-goerli.infura.io/v3/XXXXX |
To speed up the launch of the Ethereum client, it is recommended to set a more recent checkpoint. You can find one, for example, at this link: https://sync.invis.tools/.
Env Var | TOML | Mainnet |
---|---|---|
ETHEREUM_CHECKPOINT | ethereum_checkpoint | 0x419347336a423e0ad7ef3a1e8c0ca95f8b4f525122eea0178a11f1527ba38c0f |
Beerus is configurable via a config toml. If you have set the env var
BEERUS_CONFIG
= path/to/config
this will override all other environment
variables and take configuration from values defined herein.
Also the the cli can be directed via beerus --config <path/to/config>
Beerus is configurable through environment variables.
cp examples/.env.example .env
source .env
cargo run -p beerus-core --example basic
Using config from .toml
file
BEERUS_CONFIG=path/to/config.toml cargo run -p beerus-core --example basic
Beerus can be imported into any Rust project.
use beerus_core::{config::Config, lightclient::beerus::BeerusLightClient};
use env_logger::Env;
use eyre::Result;
#[tokio::main]
async fn main() -> Result<()> {
env_logger::Builder::from_env(Env::default().default_filter_or("info")).init();
let config = Config::from_env();
let mut beerus = BeerusLightClient::new(config.clone()).await?;
beerus.start().await?;
let current_starknet_block = beerus.starknet_lightclient.block_number().await?;
println!("{:?}", current_starknet_block);
let current_ethereum_block = beerus
.ethereum_lightclient
.lock()
.await
.get_block_number()
.await?;
println!("{:?}", current_ethereum_block);
Ok(())
}
cargo run --bin beerus-rpc
Dependencies:
- npm
- CORS bypass
- local pathfinder node at
http://localhost:9545
- execution env var -
ETHEREUM_EXECUTION_RPC_URL
cd crates/beerus-js
# install node deps
npm i
# build webpack & wasm modules
npm run build
# run example
./run.sh
# navigate browser to http://localhost:8080
# open developer console
See the open issues for a list of proposed features (and known issues).
- Top Feature Requests (Add your votes using the π reaction)
- Top Bugs (Add your votes using the π reaction)
- Newest Bugs
Reach out to the maintainer at one of the following places:
- GitHub Discussions
- Contact options listed on this GitHub profile
If you want to say thank you or/and support active development of Beerus:
- Add a GitHub Star to the project.
- Tweet about the Beerus.
- Write interesting articles about the project on Dev.to, Medium or your personal blog.
Together, we can make Beerus better!
First off, thanks for taking the time to contribute! Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make will benefit everybody else and are greatly appreciated.
Please read our contribution guidelines, and thank you for being involved!
Beerus follows good practices of security, but 100% security cannot be assured. Beerus is provided "as is" without any warranty. Use at your own risk.
_For more information and to report security issues, please refer to our security documentation.
- Huge props to A16z for their work on helios.
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!