Table of Contents
Kakarot RPC is the JSON-RPC server adapter to interact with Kakarot ZK-EVM in a fully EVM-compatible way.
This adapter layer is based on:
The Kakarot RPC layer's goal is to receive and output EVM-compatible JSON-RPC payloads & calls while interacting with the Starknet Blockchain. This enables Kakarot zkEVM to interact with the usual Ethereum tooling: Metamask, Hardhat, Foundry, etc.
Here is a high level overview of the architecture of Kakarot RPC.
TL;DR:
- Run
make build
to build Kakarot RPC. - Test with
make test
. - Run Kakarot RPC in dev mode:
- Run devnet:
make devnet
( or feel free to run your own ) - Run dev RPC:
make run
- Run production RPC
make run-release
- Run devnet:
To build the project from source do make build
(this requires
nightly rustup):
make build
Copy the .env.example
file to a .env
file and populate each variable
cp examples/.env.example .env
Meanwhile you can just use unit tests to dev.
make test
The binaries will be located in target/release/
.
Specify the environment variables and run the binary.
make run-release
Dev mode with starknet-devnet
run starknet-devnet
make devnet
run
make run
Some notes on make devnet
:
-
you can run starknet-devnet, by running
make devnet
at the project root. -
this will run a devnet, with contracts automatically deployed, so you don't have to do them manually (see below for list of contracts and addresses).
-
.env.example
has environment variables corresponding to deployments on this devnet, you can copy it as it to.env
. -
feel free to run your own devnet if you are playing around with some custom changes to Kakarot.
Kakarot RPC is configurable through environment variables.
Here is the list of all the available environment variables:
Name | Default value | Description |
---|---|---|
TARGET_RPC_URL | http://0.0.0.0:5050/rpc | Target Starknet RPC URL |
RUST_LOG | Debug | Log level |
KAKAROT_HTTP_RPC_ADDRESS | 0.0.0.0:3030 | Kakarot RPC URL |
KAKAROT_ADDRESS | see below | Kakarot address |
PROXY_ACCOUNT_CLASS_HASH | see below | Proxy account class hash |
Deployed:
Contract | Address |
---|---|
Kakarot | 0x7a88f6f9d63ccaa5855babb32cbb0230b8588aaaa6bc4ce2d173fa528ce7567 |
EOA | 0x54b288676b749DEF5Fc10Eb17244fe2C87375de1 |
Counter | 0x2e11Ed82f5eC165AB8Ce3cC094f025Fe7527F4D1 |
Declared:
Contract | Class hash |
---|---|
Proxy account class hash | 0x3010a53967fa04842bcbcb6de8817101f047ef0d074b3eacbe714a3fc42a2eb |
The Counter contract implementation can be found here
You can take a look at rpc-call-examples
directory. Please note the following:
sendRawTransaction.hurl
: the raw transaction provided allows to call theinc()
function for the Counter contract. However, given that this transaction is signed for the EOA's nonce at the current devnet state (0x2), the call will only work once. If you want to keep incrementing (or decrementing) the counter, you need to regenerate the payload for the call with an updated nonce using the provided python script.
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 Kakarot RPC:
- Add a GitHub Star to the project.
- Tweet about the Kakarot RPC.
- Write interesting articles about the project on Dev.to, Medium or your personal blog.
Together, we can make Kakarot RPC 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!
For a full list of all authors and contributors, see the contributors page.
Kakarot RPC follows good practices of security, but 100% security cannot be assured. Kakarot RPC 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.
This project is licensed under the MIT license.
See LICENSE for more information.
Thanks goes to these wonderful people (emoji key):
Abdel @ StarkWare π» |
etash π» |
Mentor Reka π» |
Flydexo π» |
Elias Tazartes π» |
||
Add your contributions |
This project follows the all-contributors specification. Contributions of any kind welcome!