Skip to main content
4 of 4
deleted 81 characters in body

Bigger projects typically use the multiple files template added in Anchor 0.29. You can do this for new projects with:

anchor init counter --template=multiple

This splits up state/ and instructions/. Under these folders, you can create files for each account type and instruction handler.

For example, a simple counter program might look like:

src/
  instructions/
    decrement.rs
    increment.rs
    initialize.rs
    mod.rs
  state/
    counter.rs
    mod.rs
  lib.rs
  errors.rs
Cargo.toml
README.md