Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.09 KB

README.md

File metadata and controls

27 lines (20 loc) · 1.09 KB

Day 8: Rust function-like procedural Macros

Day 8 of RareSkills Solana Course.

Setup

  1. Configure Solana to run on localhost: solana config set --url localhost
  2. Run the test validator node on another terminal: solana-test-validator
  3. Run Solana logs on another terminal: solana logs
  4. Build Anchor program: anchor build
  5. Sync program_id with Anchor key: anchor keys sync
  6. Run tests: anchor test --skip-local-validator

Notes

  • Rust functions cannot accept an arbitrary number of arguments.
  • Rust function-like macros are identified by the presence of a ! symbol.
    • examples are:
      • println!()
      • msg!()
  • A Rust macro takes Rust code as input and programatically expands it into more Rust code.

References