Miden Rust Project Structure #646
Replies: 6 comments 21 replies
-
|
cc @Dominik1999 and @mmagician as this would also be relevant to how we set up projects for things like faucet, multisig etc. |
Beta Was this translation helpful? Give feedback.
-
|
Here is how I might organize it (very similar to @partylikeits1983's layout - though there are some small differences): |
Beta Was this translation helpful? Give feedback.
-
|
Hey all, just came out of a call with @partylikeits1983 about this, here's our thoughts. We propose the following structure: A few thoughts on this approach: We deliberately omitted a Similarly, we've excluded a Regarding the contracts directory, we're not proposing an opinionated sub-folder structure (like separate Most importantly though, there's a need to get a project structure out as soon as possible to publish a Quick Start Guide for our developers. Some aspects of the structure outlined above cannot be implemented yet (the Unfortunately, as of right now the miden client and its files live directly inside the root of the project, which is why we won't have a For now, I think this is fine. I will work on refactoring the miden-client to 1) allow for a global config in a home directory and 2) allow for a local config inside a |
Beta Was this translation helpful? Give feedback.
-
|
Hey again all, I just came out of a call with @greenhat where we discussed the Rust project structure in more detail. Overall, we agreed on the structure I outlined above, but with some small modifications. Most importantly, because of the pressing need to update the project structure for the Quick Start Guide, we'll have two iterations for the project structure. Temporary iteration / V1Key changes from previous proposal:
Artifacts placement changed: We've moved the compiled miden new command needed: Each contract is its own individual crate. We need to standardize how to create crates for accounts, notes, tx scripts, and auth scripts. Theoretically we could add all four types to the base template and rely on people copying everything, but that would blow up the project environment unnecessarily. Timeline: Mid next week Note: In order for those changes to be implemented / work, we'll make an "emergency release" on the Rust compiler, so that the artifacts folder placement changes. Furthermore, this will allow developers to install cargo-miden normally, without having to specify the next branch. Next iteration / V2What changes from V1 to V2: The V2 structure removes the temporary Profile configuration needs to be finalized before we can add the Helper utilities currently in the temporary Rust client CLI support for local Timeline: Next few weeks Let me know your thoughts! |
Beta Was this translation helpful? Give feedback.
-
|
I would like to clarify the terminology. We're starting to use the term "Miden project", referring to the workspace we are discussing here, which consists of the contracts code and some off-chain code. Since we used the "Miden project" term for contracts up to this point I think we might add to the confusion. How do we want to call an individual Miden contract project, like |
Beta Was this translation helpful? Give feedback.
-
|
FYI everyone, I created this repository for our template workspace / project: https://github.com/Keinberger/miden-project-environment There is an open PR here to bind the "cargo miden new" command to instantiating a workspace with this github repository. Reason for deviating from original approach: In the last approach that I outlined - which I agreed upon with Alex and Denys - the scripts/ and tests/ folder would have been in the root of the repository. Unfortunately having the tests and the scripts in the root does not really work. If having both in the root there are two options:
That's why I opted to move both the scripts and the tests inside of an |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Opening this discussion to propose a consistent layout for a Miden-Rust workspace.
Below is a sketch of how a simple “counter” project could be organized. The repository would not include a frontend; a separate app can consume the compiled package artifacts for the note, account, and transaction scripts produced here. The structure is loosely inspired by how Foundry organizes a Solidity project.
Each subdirectory under
accounts/,notes/, andtx-scripts/is a standalone Rust crate (with its own Cargo.toml). The goal is to keep account, note, and transaction scrip logic modular and independently testable.Beta Was this translation helpful? Give feedback.
All reactions