Solana Walkthrough - Part 1
Any my experience with it
Continuing onto Part 1
This is cool, he has a program typical structure
├─ src │ ├─ lib.rs -> registering modules │ ├─ entrypoint.rs -> entrypoint to the program │ ├─ instruction.rs -> program API, (de)serializing instruction data │ ├─ processor.rs -> program logic │ ├─ state.rs -> program objects, (de)serializing state │ ├─ error.rs -> program specific errors ├─ .gitignore ├─ Cargo.lock ├─ Cargo.toml ├─ Xargo.toml
- Someone calls the entrypoint
- The entrypoint forwards the arguments to the processor
- The processor asks instruction.rs to decode the instruction_data argument from the entrypoint function.
- Using the decoded data, the processor will now decide which processing function to use to process the request.
- The processor may use state.rs to encode state into or decode the state of an account which has been passed into the entrypoint.
So the API is contained in instruction.rs
Ah, so Solana has a standard reference implementation for token issuance known as the token program in the Solana Program Library (SPL). More on this in the next step.