> ## 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.

# 빠른 시작

> LiteSVM으로 Solana 프로그램을 테스트하는 방법을 알아보세요

## 설정

프로그램을 테스트하기 전에 다음 사항을 확인하세요:

1. 프로그램을 빌드하여 `.so` 파일을 생성합니다
2. `Cargo.toml` 파일에 `litesvm`을 개발 의존성(dev dependency)으로 추가합니다
3. `solana-sdk@4`, `litesvm-token`처럼 필요할 수 있는 다른 개발 의존성도
   추가합니다
4. `tests` 디렉터리에 테스트 파일을 생성합니다

## 기본 프로그램 테스트 구조

다음은 Solana 프로그램의 instruction을 호출하고 실행하는 데 필요한 모든 기본
단계입니다.

```rust tests/program_test.rs
use litesvm::LiteSVM;
use solana_sdk::{
    instruction::{AccountMeta, Instruction},
    pubkey::Pubkey,
    signature::{Keypair, Signer},
    transaction::Transaction,
};

use my_program;

#[test]
fn test_my_program() {
    // Initialize the test environment
    let mut svm = LiteSVM::new();

    // Deploy your program to the test environment. If your program uses an
    // older solana-program (such as 2.2), its ID is a different Pubkey type,
    // so convert it through its bytes.
    let program_id = Pubkey::new_from_array(my_program::ID.to_bytes());
    let program_bytes = include_bytes!("../../../target/deploy/my_program.so");
    svm.add_program(program_id, program_bytes).unwrap();

    // Create and fund test accounts
    let payer = Keypair::new();
    svm.airdrop(&payer.pubkey(), 10_000_000_000).unwrap();

    // Create your instruction
    let instruction = Instruction {
        program_id,
        accounts: vec![
            AccountMeta::new(payer.pubkey(), true),
        ],
        data: vec![],
    };

    // Build transaction
    let tx = Transaction::new_signed_with_payer(
        &[instruction],
        Some(&payer.pubkey()),
        &[&payer],
        svm.latest_blockhash(),
    );

    // Send transaction
    let result = svm.send_transaction(tx).unwrap();

    // Check transaction succeeded
    println!("Transaction logs: {:?}", result.logs);

    println!("Program executed successfully!");
}
```

`LiteSVM::new()`로 생성되는 기본 테스트 환경에는 현재 mainnet-beta에서 활성화된
런타임 기능, 기본 sysvar, spl 프로그램, sigverify, 그리고 system program과 같은
모든 내장 프로그램이 활성화되어 있습니다. 프리컴파일(ed25519, secp256k1,
secp256r1)은 `litesvm`의 `precompiles` 기능을 활성화하면 포함됩니다.

`agave-feature-set` 크레이트의 `FeatureSet::all_enabled()`와 같은 다른 기능 세트로
전체 환경을 구성하려면, sysvar와 기능 계정이 일치하도록 `LiteSVM::default()`에서
시작하세요:

```rust
use agave_feature_set::FeatureSet;
use litesvm::LiteSVM;
use solana_sdk::native_token::LAMPORTS_PER_SOL;

let mut svm = LiteSVM::default()
    .with_feature_set(FeatureSet::all_enabled())
    .with_builtins()
    .with_lamports(1_000_000 * LAMPORTS_PER_SOL)
    .with_sysvars()
    .with_feature_accounts()
    .with_default_programs()
    .with_sigverify(true)
    .with_blockhash_check(true);
```

`LiteSVM::new()`에 `with_feature_set`을 체이닝하면 기능 세트만 교체됩니다.
Rent sysvar와 기능 계정은 `new()`가 mainnet 기능에 맞게 설정한 상태로 유지됩니다.

<Info>
  기본 테스트 환경에 포함되지 않은 프로그램과 상호작용하려면, 해당 프로그램을 테스트 환경에
  배포해야 합니다.
</Info>

## 다음 단계

다음 섹션에서는 litesvm 테스트 환경에 프로그램을 배포하는 방법에 대해 자세히
알아보겠습니다.
