Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Cross-Program Invocation (Anchor)

Invoke another program from this one (hand program calls lever program) using CPI.

See also: Cross Program Invocation overview and the repository catalog.

Major concepts

  • Cross-program invocation (CPI)
  • Composing multiple programs in one transaction

Setup

From this directory (basics/cross-program-invocation/anchor/):

anchor build

Prerequisites: Agave CLI (version in Anchor.toml [toolchain]), Anchor.

Testing

Tests run in-process with LiteSVM. No local validator.

anchor test

This runs cargo test as configured in Anchor.toml. Tests call instruction handlers and check onchain state.

Usage

Read the program programs/ source and Anchor.toml for deployed program IDs. For deployment, use anchor build && anchor deploy against your target cluster.