This is a practice project for Anchor development beginners. If you've learned some theoretical knowledge about Rust and Solana but haven't been able to start coding due to their complexity, I hope the content in this repo can help you take your first steps in coding.
In this project, I implemented a simple counter, which contains a data field to record the number. The owner of the counter can increase the value of data.
It contains two main functions:
- Create and write data accounts as counters with authority checking.
- Create and write PDA accounts as counters.
git clone https://github.com/ACaiSec/create-account-practice.git
cd create-account-practice
# Build project
anchor buildIn addition, I also wrote test code for these two functions. You can run the test cases through anchor test.
In the code examples, some confusing points are annotated with the @note tag. Beginners can pay more attention to these comments.