Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customizing the Build Rust Machine text #122

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Rust_State_Machine/en/Section_0/Lesson_1_What_Are_We_Building.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Introduction to the Rust State Machine
Welcome to the Rust State Machine tutorial.

You've made it — hell yeah! Welcome to the Rust state machine tutorial :)
This is Dani (@danicuki) and Yan (@nomadbitcoin) and we'll be your instructors.
This project is for devs that want to get more into cryptography technology.

This is a guided tutorial intended to teach readers the basics of Rust, Blockchain, and eventually the inner workings of the [Polkadot SDK](https://github.com/paritytech/polkadot-sdk).

Expand Down Expand Up @@ -67,3 +70,11 @@ If we look at what has been generated, in that folder, you will see the followin
- `target/*` - You might also see a target folder if you did `cargo run`. This is a folder where all the build artifacts are placed during compilation. We do not commit this folder into our git history.

All of this should be pretty familiar to you if you have already had some minimal experience with Rust. If any of this is new, I would suggest you first walk through the [Rust Book](https://doc.rust-lang.org/book/) and [Rust by Example](https://doc.rust-lang.org/rust-by-example/), as this is already an indication that this guide might not be targeted at your level of knowledge.

## 🤘 See an issue? Want to improve something? Fix it yourself ;)

**[All this content is completely open-source](https://github.com/w3b3d3v/buildspace-projects/tree/web3dev-version)**. If you see an issue, typo, etc — you can fix it yourself easily and make a PR! If you need help doing this, DM `@nomadbitcoin` in the Discord :).

Let's get you some open-source rep!!

And last but not least, give the repository a ⭐ so we feel important!
6 changes: 5 additions & 1 deletion Rust_State_Machine/en/Section_0/Lesson_2_Requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,8 @@ However, to provide the full functionality that it does, Rust Analyzer needs to
It is my personal recommendation that Rust Analyzer is not needed in this workshop, and generally you should not use it for Substrate development. However, this section might be updated in the future to include special configurations of Rust Analyzer which will work well with Polkadot SDK in the future.

However, if you would like to use it anyway, now is the right time to set it up.
ht

### 🎉 First Step
YOU'RE ON YOUR WAY.

You've successfully completed section 0! Great start :).
8 changes: 7 additions & 1 deletion Rust_State_Machine/en/Section_1/Lesson_1_Balances_Pallet.md

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? organized how?

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
I've seen a lot of complicated tutorials, so let's try to keep this one simple and organized. :) I hope you enjoy it!

# The Balances Pallet

In this section, we will build the very first logic for our state machine: a Balances Pallet.
Expand Down Expand Up @@ -76,4 +78,8 @@ On `main.rs`:
fn main() {
println!("Hello, world!");
}
```
```

If you have a question you're curious about, feel free to ask it in [🆘・section-1](https://discord.com/channels/898706705779687435/980904325763186788) on Discord.

Normally, I start to really understand things when I start programming. So, let's start building some code. :)
2 changes: 1 addition & 1 deletion Rust_State_Machine/en/Section_1/Lesson_3_Store_And_Read.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,4 @@ impl Pallet {
}
```

Next we will write our first test and actually interact with our balances module.
Next we will write our first test and actually interact with our balances module. Excited for the next step? We are!
4 changes: 3 additions & 1 deletion Rust_State_Machine/en/Section_1/Lesson_4_Basic_Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,6 @@ mod tests {
/* TODO: Assert the balance of `bob` has not changed and is 0. */
}
}
```
```

Share your [#progress](https://discord.com/channels/898706705779687435/980906289968345128) on Discord and make Yan's day!
9 changes: 8 additions & 1 deletion Rust_State_Machine/en/Section_1/Lesson_5_Transfer_Balance.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,11 @@ mod tests {
*/
}
}
```
```

And remember, we're available to answer any questions on [Discord](https://discord.com/channels/898706705779687435/980904325763186788).

### 🌱 Growing Strong
YOU'RE GETTING THERE.

Section 1 is done! You're building a solid foundation. Well done :).
5 changes: 4 additions & 1 deletion Rust_State_Machine/en/Section_2/Lesson_1_System_Pallet.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
You can find the [solution for the previous step here](https://gist.github.com/nomadbitcoin/afd212bee56108f0cd87c712ad5d3fdf).
Before moving on, you can find the [solution for the previous step here](https://gist.github.com/nomadbitcoin/afd212bee56108f0cd87c712ad5d3fdf).

Congratulations on reaching section 2! ;)

# The System and Runtime

Expand Down Expand Up @@ -63,3 +65,4 @@ fn main() {
}
```

It's going to be epic. :) Let's do this!
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,8 @@ mod test {
*/
}
}
```
```

## 🚨Progress report

Did you manage to create some cool code? Don't forget to share a screenshot in the [#progress](https://discord.com/channels/898706705779687435/980906289968345128) channel on Discord!
6 changes: 5 additions & 1 deletion Rust_State_Machine/en/Section_2/Lesson_3_Runtime.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,8 @@ impl Runtime {
fn main() {
println!("Hello, world!");
}
```
```

That's it :). Let's move on! I'm amazed by your progress!

If you need assistance or have any questions about integrating your pallets into the Runtime, feel free to ask for help in the [#🆘・section-2](https://discord.com/channels/898706705779687435/980905562566967427) channel on Discord. We're here to support you on your journey!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's too much aahahhaha

Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,6 @@ fn main() {
/* TODO: Increment the nonce of `alice` again. */
/* TODO: Execute another balance transfer, this time from `alice` to `charlie` for 20. */
}
```
```

Now that you've mastered simulating your first block, you're on your way to blockchain wizardry! Get ready for the exciting adventures ahead!
8 changes: 7 additions & 1 deletion Rust_State_Machine/en/Section_2/Lesson_5_Runtime_Debug.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,10 @@ pub struct Pallet {
/// A map from an account to their nonce.
nonce: BTreeMap<String, u32>,
}
```
```

### 👑 You dropped this
YOU DID IT.

This is a big deal, we've officially finished section 2!
Good stuff :).
4 changes: 3 additions & 1 deletion Rust_State_Machine/en/Section_3/Lesson_1_Generic_Types.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
You can find the [solution for the previous step here](https://gist.github.com/nomadbitcoin/fe73ad648ad4cd64c782fdc85ceb5791).
Before you go any further, if you want to check that your answer matches [solution for the previous step here](https://gist.github.com/nomadbitcoin/fe73ad648ad4cd64c782fdc85ceb5791).

Fantastic! You now understand the importance of the Genesis State and are ready to take the first steps in your blockchain!

# Generic and Configurable Types

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,8 @@ pub struct Runtime {
/* TODO: Use your type definitions for your new generic `balances::Pallet`. */
balances: balances::Pallet,
}
```
```

Making the Balances Pallet generic is a crucial skill for creating flexible and scalable blockchain solutions. Great work on completing this lesson! 🌟

Post a screenshot in [#progress](https://discord.com/channels/898706705779687435/980906289968345128) showing your runtime with the new generic Balances Pallet in action. It better not still be using &'static str!
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,7 @@ mod test {

/// ... previous code.
}
```
```

If you have any questions or need further assistance with implementing custom traits or configuring your System, feel free to reach out for support in the [#🆘・section-3](https://discord.com/channels/898706705779687435/980905695689998366) channel on Discord.
We're here to support you! 🌟
7 changes: 6 additions & 1 deletion Rust_State_Machine/en/Section_3/Lesson_7_Tight_Coupling.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,4 +136,9 @@ mod tests {
/// ... previous code.

}
```
```

### 🌟 You're a Star
YOU NAILED IT.

You've successfully completed section 3! Fantastic job :).
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
You can find the [solution for the previous step here](https://gist.github.com/nomadbitcoin/2b3beb37b376732e6c000053e04f07ff).

Amazing! You've mastered another important stage and you're already halfway there. You're about to add an outstanding achievement to your portfolio!

# Executing Blocks and Dispatching Calls

In this next section, you will construct the core pipeline used to interact with your state machine.
Expand Down
6 changes: 5 additions & 1 deletion Rust_State_Machine/en/Section_4/Lesson_3_Executing_Blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,8 @@ impl crate::support::Dispatch for Runtime {
}

/// ... previous code.
```
```

Executing blocks is a fundamental aspect of blockchain functionality, and you've now taken a significant step towards mastering this process. Well done on reaching this milestone!

If you have any questions or run into issues, don't hesitate to ask for help in the [#🆘・section-4](https://discord.com/channels/898706705779687435/980905761783832637) channel on Discord. We're here to support you! 🚀
5 changes: 5 additions & 0 deletions Rust_State_Machine/en/Section_4/Lesson_7_Nested_Dispatch.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,8 @@ fn main() {
/// ... previous code.
}
```

### 🚀 Keep Soaring
YOU'RE DOING GREAT.

Section 4 is finished! The final stretch has begun. Excellent job :).
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
You can find the [solution for the previous step here](https://gist.github.com/nomadbitcoin/1883ed94b8c8439df4264024af3e31c2).

Congratulations! Your determination to push forward and tackle programming challenges is truly commendable!

# The Proof of Existence Pallet

In this section, we will create a Proof of Existence Pallet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,8 @@ mod test {
*/
}
}
```
```

Implementing the Proof of Existence functions is a critical step in building a functional blockchain module. Great work on completing this lesson!

If you get stuck or feel lost with creating, getting, or revoking claims, don't be shy to ask for help in the [#🆘・section-5](https://discord.com/channels/898706705779687435/1261079360341934161) channel on Discord. Even superheroes need a hand sometimes! 🦸‍♂️🦸‍♀️
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,11 @@ impl<T: Config> crate::support::Dispatch for Pallet<T> {
}

/// ... previous code.
```
```

Hey! Great job on adding the Proof of Existence dispatch logic!

If you don't post a screenshot in [#progress](https://discord.com/channels/898706705779687435/980906289968345128) showing your new CreateClaim and RevokeClaim calls in action, all of humanity will collectively jump and disrupt the Earth's orbit causing it to collide with Venus.

BTW -- if you want to make a tweet telling the world that you've just implemented Proof of Existence on your blockchain and tag [@web3dev_](https://x.com/web3dev_)
That tweet could inspire someone else to join web3 and it supports us!
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,9 @@ fn main() {
// Simply print the debug format of our runtime state.
println!("{:#?}", runtime);
}
```
```

### 🔥 On Fire
YOU DID IT AGAIN.

Section 5 is complete! Your hard work is paying off. Keep going :).
2 changes: 2 additions & 0 deletions Rust_State_Machine/en/Section_6/Lesson_1_Rust_Macros.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
You can find the [solution for the previous step here](https://gist.github.com/nomadbitcoin/6a7506ad26d4bdcf9db1f7f358b687ff).

Sensational! Few have reached this point, making you exceptionally persistent. Great opportunities await those who complete all the lessons!

# Rust Macros

In this section, we will introduce Rust Macros to our project to reduce boilerplate code and automate implementations.
Expand Down

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"streamline" exposes you're using GPT 😆 Try to avoid.

Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,10 @@ fn main() {
// Simply print the debug format of our runtime state.
println!("{:#?}", runtime);
}
```
```

Adding the #[macros::runtime] attribute is the final step to clean up and streamline your runtime code. Well done on reaching the end of this tutorial!

If you have questions or need assistance, feel free to ask in the [#🆘・section-6](https://discord.com/channels/898706705779687435/1261079463731662959) channel on Discord.

And remember, helping others with their questions can strengthen your own understanding too. Sharing knowledge is a great way to solidify what you've learned! 🚀
8 changes: 4 additions & 4 deletions Rust_State_Machine/en/Section_6/Lesson_5_Course_Completed.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Now that you've laid a solid foundation, you're ready to dive deeper into the [P

To advance further, consider enrolling in the [Polkadot Blockchain Academy](https://polkadot.network/development/blockchain-academy/). This rigorous and competitive program will elevate your skills, making you a sought-after Rust and blockchain developer. With guidance from industry leaders like Gavin Wood, you'll delve into modules on Polkadot, parachains, Frame, and more, preparing you for a stellar career in the blockchain space. Register your interest and join the next cohort to continue your journey towards becoming a Polkadot expert.

### 🏆 Champion
YOU DID IT!

The big day is here! You've earned a completion NFT and now have a standout portfolio in the market. We're proud of you! 🎉





Note: To receive your NFT, make sure to connect your wallet on the course platform.
Loading