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

# Cấu hình

> Các phương thức builder để cấu hình LiteSVM trong TypeScript

LiteSVM sử dụng builder pattern để cấu hình. Tất cả các phương thức đều trả về `LiteSVM`
để có thể nối chuỗi (chaining).

## Thiết lập kiểm thử điển hình

```typescript
import { createClient, generateKeyPairSigner } from "@solana/kit";
import { litesvm } from "@solana/kit-plugin-litesvm";
import { signer } from "@solana/kit-plugin-signer";

const mySigner = await generateKeyPairSigner();
const client = createClient().use(signer(mySigner)).use(litesvm());

client.svm
  .withSigverify(false) // Skip signature verification (faster)
  .withBlockhashCheck(false) // Skip blockhash validation (simpler)
  .withTransactionHistory(100n); // Store last 100 transactions
```

Một client `litesvm()` đã được tải sẵn các sysvar, các chương trình builtin, các
precompile và các chương trình mặc định, vì vậy một thiết lập điển hình chỉ cần thay đổi
các bước kiểm tra mà nó cần.

## Chữ ký & Blockhash

### withSigverify

```typescript
withSigverify(sigverify: boolean): LiteSVM
```

Bật hoặc tắt xác minh chữ ký.

```typescript
// Disable for faster tests (default is enabled)
client.svm.withSigverify(false);

// Enable for production-like testing
client.svm.withSigverify(true);
```

<Info>
  Tắt xác minh chữ ký giúp các bài kiểm thử chạy nhanh hơn nhưng kém thực tế hơn.
</Info>

### withBlockhashCheck

```typescript
withBlockhashCheck(check: boolean): LiteSVM
```

Bật hoặc tắt kiểm tra hết hạn của blockhash.

```typescript
// Disable for simpler tests
client.svm.withBlockhashCheck(false);
```

## Chương trình & Sysvar

Các phương thức này tải chương trình và sysvar vào VM. Một client `litesvm()`
đã có sẵn tất cả những thứ này, nên bạn chỉ cần dùng chúng để đặt lại client hoặc để thiết lập
một instance `LiteSVM.default()` trống từ gói `litesvm`.

### withSysvars

```typescript
withSysvars(): LiteSVM
```

Đặt lại Clock, Rent, EpochSchedule và các sysvar khác về giá trị mặc định.
Sysvar đã có sẵn trên client mới, nên bạn chỉ cần dùng phương thức này để hoàn tác
các thay đổi. Gọi nó sau `setClock` hoặc `warpToSlot` sẽ làm mất clock của bạn.

```typescript
client.svm.setClock(myClock);
client.svm.withSysvars(); // the clock is back to its default
```

### withBuiltins

```typescript
withBuiltins(): LiteSVM
```

Thêm các chương trình builtin của runtime: System Program, các BPF loader, Vote
và Compute Budget.

```typescript
client.svm.withBuiltins();
```

### withPrecompiles

```typescript
withPrecompiles(): LiteSVM
```

Thêm các precompile xác minh chữ ký: ed25519, secp256k1 và secp256r1.

```typescript
client.svm.withPrecompiles();
```

### withDefaultPrograms

```typescript
withDefaultPrograms(): LiteSVM
```

Thêm các chương trình mặc định: Token, Token-2022, Associated Token Account, Memo,
Stake và Address Lookup Table.

```typescript
client.svm.withDefaultPrograms();
```

## Giới hạn tài nguyên

### withLamports

```typescript
withLamports(lamports: bigint): LiteSVM
```

Đặt số dư của tài khoản faucet nội bộ mà `airdrop()` lấy tiền từ đó.
Các airdrop lớn hơn số dư này sẽ thất bại.

```typescript
client.svm.withLamports(1_000_000_000n); // the faucet holds 1 SOL
```

### withLogBytesLimit

```typescript
withLogBytesLimit(limit?: bigint): LiteSVM
```

Đặt giới hạn byte cho đầu ra log.

```typescript
client.svm.withLogBytesLimit(10000n);
```

### withTransactionHistory

```typescript
withTransactionHistory(capacity: bigint): LiteSVM
```

Bật lưu trữ lịch sử giao dịch.

```typescript
// Store last 100 transactions
client.svm.withTransactionHistory(100n);
```

## Tập tính năng

### withFeatureSet

```typescript
withFeatureSet(featureSet: FeatureSet): LiteSVM
```

Cấu hình tập tính năng để kiểm thử các phiên bản Solana cụ thể.
