diff --git a/Makefile b/Makefile index 01af978..2f5c16a 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,7 @@ setup-venv: $(SOLC_SELECT) install 0.8.24 $(SOLC_SELECT) use 0.8.24 $(VENV_BIN)/solc --version + ensure-asdf: @if [ ! -f "$(HOME_DIR)/.asdf/asdf.sh" ]; then \ echo "Error: ASDF not found in $(HOME_DIR)/.asdf/"; \ @@ -138,7 +139,6 @@ build-contracts: make braavos-account-cairo make argent-contracts-starknet - artifacts-linux: make setup-linux make build-contracts diff --git a/Readme.md b/Readme.md index fdf5d1f..dae1c15 100644 --- a/Readme.md +++ b/Readme.md @@ -101,6 +101,87 @@ RUST_LOG=info cargo run -- --dev **IMP 🚨** : It will store all the addresses in [data/addresses.json](data/addresses.json) +### Ubuntu Setup 🐧 + +To run the Madara Bootstrapper on an Ubuntu machine with AMD architecture, please follow these steps: + +1. **Clone the Repository**: Start by cloning the Madara Bootstrapper repository. + ```shell + git clone https://github.com/madara-alliance/madara-bootstrapper.git + cd madara-bootstrapper + ``` + +2. **Install Build Essentials**: Ensure you have the necessary build tools. + ```shell + sudo apt update + sudo apt install build-essential + ``` + +3. **Install Docker**: Docker should be installed and running. + ```shell + sudo apt install docker.io + sudo systemctl start docker + sudo systemctl enable docker + ``` + +4. **Install Python**: Python3 and its virtual environment package are required. + ```shell + sudo apt install python3 python3-venv + ``` + +5. **Install Node.js and npm**: These are required for JavaScript dependencies. + ```shell + sudo apt install nodejs npm + ``` + +6. **Install asdf**: Use asdf for managing runtime versions. + ```shell + git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1 + ``` + +7. **Install Rust**: Use rustup to install Rust. + ```shell + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + rustup show + ``` + +8. **Create a Python Virtual Environment**: Set up a virtual environment for Python dependencies. + ```shell + python3 -m venv venv + source venv/bin/activate + ``` + +9. **Build Artifacts**: Use the `make` command to build the necessary artifacts within the Madara Bootstrapper repository. + ```shell + make artifacts-linux + ``` + +10. **Build the Rust Binary**: Compile the Rust project. + ```shell + cargo build --release + ``` + +11. **Run the Setup Command for L1**: Execute the following command to set up the L1 environment. Make sure to update the `devnet.json` file as per your needs. + ```shell + RUST_LOG=debug cargo run --release -- --mode setup-l1 --config src/configs/devnet.json + ``` + + > **Note**: The default configuration file is located at `src/configs/devnet.json`. Please update it according to your requirements. + +12. **Update Configuration**: After running the `setup-l1` command, you will receive a response similar to the following: + ```json + { + "starknet_contract_address": "STARKNET_CONTRACT_ADDRESS", + "starknet_contract_implementation_address": "STARKNET_CONTRACT_IMPLEMENTATION_ADDRESS" + } + ``` + Update these values in your `devnet.json` or your specific configuration file before proceeding. + +13. **Run the Setup Command for L2**: Now, execute the following command to set up the L2 environment. + ```shell + RUST_LOG=debug cargo run --release -- --mode setup-l2 --config src/configs/devnet.json + ``` + ## Info ℹī¸ ### Contract Descriptions 🗒ī¸ diff --git a/src/configs/devnet.json b/src/configs/devnet.json index 97eeb6f..50331f3 100644 --- a/src/configs/devnet.json +++ b/src/configs/devnet.json @@ -19,5 +19,6 @@ "operator_address": "0x000000000000000000000000000000000000abcd", "dev": false, "core_contract_address": "0xe7f1725e7734ce288f8367e1bb143e90bb3f0512", - "core_contract_implementation_address": "0x5fbdb2315678afecb367f032d93f642f64180aa3" + "core_contract_implementation_address": "0x5fbdb2315678afecb367f032d93f642f64180aa3", + "core_contract_mode": "Dev" }