Table of Contents
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 (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 (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 |
✅ |
Additional endpoints:
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 |
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 --bin beerus starknet query-state-root
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):
Abdel @ StarkWare |
Lucas @ StarkWare 💻 |
danilowhk 💻 |
Clément Walter 💻 |
Elias Tazartes 💻 |
drspacemn 💻 |
Mathieu 💻 |
TurcFort07 📖 |
Florian Bellotti 💻 |
Tom Brand 💻 |
ftupas 💻 |
pscott 💻 |
||
Add your contributions |
This project follows the all-contributors specification. Contributions of any kind welcome!