program-examples
program-examples copied to clipboard
Add a new Anchor program example demonstrating cross-program invocations (CPI)
Summary
We’d love to add a new Anchor-based Solana program example that demonstrates cross-program invocations (CPI). This is a key concept for many advanced Solana smart contracts, and a good educational resource for developers learning Anchor.
What should this example do?
- Use Anchor framework
- Include a simple CPI to another Anchor program (e.g. a counter or a token program)
- Include detailed comments explaining each step
- Provide a matching TypeScript client test demonstrating the CPI in action
Why is this valuable?
- CPI is fundamental for advanced Solana contracts
- This would help newcomers understand Anchor patterns
- Expands the coverage of program-examples
How to get started
- Clone the repo
- Add a new folder under
anchor/cpi-example - Follow the structure of other Anchor examples
- Test your code with
anchor test - Open a pull request with your contribution
Labels
good first issue, help wanted, enhancement
We welcome contributors to pick up this issue and ask questions if you get stuck. Thanks for helping grow the Solana developer ecosystem!
Hey, new to SOL dev but I think I can do this.
How long should it take about, I think maybe in the next few days I can finish it for sure but I wanna work through some of these examples first so I can get used to your guys style.
Best!