Issues with Rust tutorials
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Domain
- documentation
Research direction
The issue lists specific compilation errors in tutorials 1, 4, 5, 10, and 11. Start by checking the referenced tutorial source files in the repository. For each error, locate the exact code snippet (e.g., note script syntax, create_library usage, StorageMapKey import, pragma oracle argument, relative import paths) and update it to match the 0.14 API. Verify fixes by ensuring the tutorial code compiles. Also clean up unnecessary Cargo.toml dependencies and consolidate imports as noted.
Written by the indexing model from the issue text.
Description
Packages versions
0.14
Bug description
Not compiling due to not using @note_script
In tutorials 4 (iterative notes), 5 (hash preimage note), 11 (network accounts) compiling notes WILL panic because notes are not up to date with 0.14 version are are not using @note_script notation. The panic message does not convey that so users have no way of knowing that.
# Instead of
begin
# ...
end
# note script should use
@note_script
pub proc main
# ...
end
Tutorial 1 - using create_library
create_library should not be used like that, it should use code builder from client or use a persisted source manager. Using it like this WILL lead to un-explainable and misformed errors down the line like from issue: https://github.com/0xMiden/miden-vm/issues/2778, also referenced here: https://github.com/0xMiden/tutorials/issues/188
Tutorial 10 - pragma oracle
- does not compile,
StorageMapKeyreferenced frommiden_client::rpc::domain::accountis a private struct. It should be referenced frommiden_client::account::StorageMapKey - When point 1 is fixed it still dies with: thread 'main' (44407) panicked at src/main.rs:156:10:
Usage: oracle_data_query <ORACLE_BECH32_ID>, it would be better perhaps to just hardcode it into the code example or leave a comment at that line (156), we learn we need to pass it as an argument only at the end of the tutorial even though it asks us to run the code before that point - It seems no pragma oracles are online on the current testnet, i couldnt find a live oracle address from their offish docs (which point to their github)
Relative imports
Even though in tutorial we create the project, folders and files - masm imports in the code are relative to the directory one above root dir. Running the tutorial code will error out with: Result::unwrap() on an Err value: Os { code: 2, kind: NotFound, message: "No such file or directory" }. This might be confusing for some users. I would suggest creating separate crates for tutorial maybe and referencing env!("CARGO_MANIFEST_DIR") when loading paths, this way you can keep a monorepo of tutorials and it will still work with --bin tutorial_name if referenced in a workspace Cargo.toml as members.
Nits / General
Cargo.tomlimports libs not needed in the tutorials:serde,serde_jsonandrand_chacha- a lot of types are referenced in the long format like std::sync::Arc and std::Path even though they are imported in the header making code unnecessarily bloated
- imports could be compacted, they import from miden_client on multiple lines instead in one single import
- Dominant language
- Rust
- Stars
- 18
- Forks
- 34
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from 0xMiden/tutorials
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
docs(web-client): Add Private Note Transfer tutorial with Note Transport Service and fetchPrivate() Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
All issues in 0xMiden/tutorials
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·