Skip to content

Add a new Anchor program example demonstrating cross-program invocations (CPI) #393

@0xTan1319

Description

@0xTan1319

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions