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

# 프로그램 배포

> 간단한 프로그램을 배포하고 호출하는 방법

## 전체 테스트

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

#[test]
fn test_program_deployment() {
    let mut svm = LiteSVM::new();

    // Deploy the program
    let program_id = Pubkey::new_unique();
    let program_bytes = include_bytes!("../target/deploy/hello_world.so");
    svm.add_program(program_id, program_bytes).unwrap();

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

    // Create instruction to call program
    let instruction = Instruction {
        program_id,
        accounts: vec![
            AccountMeta::new(payer.pubkey(), true),
        ],
        data: vec![], // Program-specific data
    };

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

    let result = svm.send_transaction(tx).unwrap();

    // Verify program was called
    assert!(result.logs.iter().any(|log|
        log.contains(&format!("Program {} invoke", program_id))
    ));

    println!("Program called successfully!");
    println!("Logs:\n{}", result.pretty_logs());
}
```

## 핵심 사항

1. **프로그램 배포**: `add_program()`을 사용하여 바이트로부터 프로그램을 배포합니다
2. **include_bytes!**: 컴파일 시점에 컴파일된 프로그램을 포함시킵니다
3. **프로그램 ID**: `target/deploy/`에 있는 keypair를 사용합니다
4. **인스트럭션**: 프로그램 ID, 계정, 데이터로 사용자 지정 인스트럭션을 생성합니다
5. **로그 검증**: 트랜잭션 로그를 확인하여 프로그램 실행을 검증합니다

배포에 관한 더 자세한 내용은
[이 섹션](/developers/docs/tools/litesvm/testing-your-program/deploy)을 참고하세요.
