> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Anchor-ohjelmien esimerkit

> Tutustu linkitettyihin projekteihin, jotka esittelevät, miten litesvm-työkalua käytetään anchor-ohjelmien testaamiseen

<Note>
Molempien repositorioiden README-tiedostoissa neuvotaan suorittamaan `anchor build && cargo test`. Nykyisillä
Anchor- ja Solana CLI -julkaisuilla suorita sen sijaan nämä vaiheet:

```bash
anchor keys sync
anchor build --arch v0
# Vain Anchor Escrow: sen testit lukevat IDL:n hakemistosta idls/
cp target/idl/anchor_escrow.json idls/
cargo test
```

`anchor keys sync` asettaa ohjelman ID:n vastaamaan paikallista käyttöönoton keypair-avainparia, jonka testit lataavat, jotta ohjelma ei epäonnistu virheeseen `DeclaredProgramIdMismatch`.
`--arch v0` rakentaa SBPF v0 -ohjelman, jonka näiden
repositorioiden käyttämät LiteSVM-versiot osaavat ladata. Jos käytät Anchor 1.1.x -versiota, käytä sen sijaan
[anchor-litesvm-pikaoppaan](/developers/docs/tools/litesvm/additional-crates/testing-with-anchor-litesvm#installation)
build-komentoja.
</Note>

## `litesvm`-crate-esimerkit

<Columns cols={2}>
  <Card title="Anchor CRUD -sovellus" href="https://github.com/brimigs/anchor-crud-litesvm">
    Esimerkki datan käsittelystä
  </Card>
</Columns>

## `litesvm-token`-crate-esimerkit

<Columns cols={2}>
  <Card title="Anchor Escrow -sovellus" href="https://github.com/brimigs/anchor-escrow-with-litesvm">
    Esimerkki tokenien käsittelystä
  </Card>
</Columns>
