Skip to content

Commit

Permalink
refactor: readme and makefile updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mohiiit committed Dec 18, 2024
1 parent 1a33d80 commit 17c8b27
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/"; \
Expand Down Expand Up @@ -138,7 +139,6 @@ build-contracts:
make braavos-account-cairo
make argent-contracts-starknet


artifacts-linux:
make setup-linux
make build-contracts
Expand Down
81 changes: 81 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 🗒️
Expand Down
3 changes: 2 additions & 1 deletion src/configs/devnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 17c8b27

Please sign in to comment.