From b2c22b7f522834c9f0b88d9aaa868e93cd2d5e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juli=C3=A1n=20Gonz=C3=A1lez=20Calder=C3=B3n?= Date: Mon, 8 Jul 2024 11:11:30 -0300 Subject: [PATCH] Update README.md --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index 28a0a25..19d60aa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,43 @@ # starknet-replay Provides a way of reading a real Starknet State, so you can re-execute an existing transaction in any of the Starknet networks in an easy way +## Getting Started + +### Prerequisites + +- Linux or macOS (aarch64 included) only for now +- LLVM 18 with MLIR +- Rust 1.78.0 or later, since cairo-native makes use of the u128 abi change. +- Git + +### Setup + +Run the following make target to install dependencies: +```bash +make deps +``` +It will automatically install LLVM 18 with MLIR on macos, if you are using linux you must do it manually. On debian, you can use `apt.llvm.org`, or build it from source. + +This project is integrated with Cairo Native, see [Cairo Native Setup](#cairo-native-setup) to set it up correctly + +Some environment variable are needed, you can automatically set them by sourcing `env.sh`. If the script doesn't adjust to your specific environment you can `cp` it into `.env` or `.envrc` and modify it. +```bash +# Cairo Native +export MLIR_SYS_180_PREFIX=/path/to/llvm-18 +export LLVM_SYS_180_PREFIX=/path/to/llvm-18 +export TABLEGEN_180_PREFIX=/path/to/llvm-18 +export CAIRO_NATIVE_RUNTIME_LIBRARY=/path/to/cairo_native/target/release/libcairo_native_runtime.a +# RPC +export RPC_ENDPOINT_MAINNET=rpc.endpoint.mainnet.com +export RPC_ENDPOINT_TESTNET=rpc.endpoint.testnet.com +``` + +Once you have installed dependencies and set the needed environment variables, you can build the project and run the tests: +```bash +make build +make test +``` + ### Cairo Native Setup Starknet Replay is currenlty integrated with [Cairo Native](https://github.com/lambdaclass/cairo_native), which makes the execution of sierra programs possible through native machine code. To use it, the following needs to be setup: