Skip to content

carbonable-labs/merkle-tree-builder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Merkle Tree Builder

Merkle Tree Implementation for Carbonable on Starknet


Report a Bug - Request a Feature

About

Merkle Tree Builder for Carbonable in Rust and Cairo compatible.

Project Setup

📦 Requirements

⛏️ Compile Rust Code

cargo build

💄 Code Style

cargo fmt

🌡️ Test Rust Code

cargo test

Compile Cairo Code

scarb build

Test Cairo Code

scarb test

Automating Cairo Constants Generation

Overview

The automation script (script.py) simplifies converting .txt files generated by the Rust code in merkle_tree_rust/data into a properly formatted constants.cairo file for Cairo tests.

Features

  • Reads .txt files from the output directory.
  • Generates constants.cairo in the merkle_tree_cairo/tests directory.
  • Supports the first and second waves of allocations.
  • Handles errors (e.g., missing files or invalid formats).

Requirements

  • Python 3.6 or higher.

Usage

Run the script with the following command: python3 <relative_path_to_script.py> <relative_path_to_output_folder> <relative_path_to_test_folder>

Arguments

  • <relative_path_to_script.py>: Path to the Python script.
  • <relative_path_to_output_folder>: Path to the folder containing .txt files generated by the Rust code.
  • <relative_path_to_test_folder>: Path to the merkle_tree_cairo/tests directory where constants.cairo will be generated.

Example

From project root:

python3 merkle_tree_rust/script.py merkle_tree_rust/output/ merkle_tree_cairo/tests/

To show your support:

Add a GitHub Star ⭐ to the project. Share your experience and write about it on platforms like Medium or Dev.to.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

License

Merkle Tree Builder follows best security practices but is provided as-is without any warranty. This project is licensed under the Apache License 2.0.

CI/CD codecov

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published