check-idl command checks each program for an on-chain Anchor IDL account, supporting both old and new Anchor IDL derivation methods.
Overview
Anchor programs can store their IDL on-chain in a deterministic account. Thecheck-idl command:
- Checks for IDL using both old and new Anchor derivation methods
- Verifies account existence without downloading the full IDL
- Outputs results to a CSV with IDL status for each program
Basic Usage
Required Options
| Option | Description |
|---|---|
--rpc-url <url> | Solana RPC endpoint URL (or set SOLANA_RPC_URL env) |
Optional Flags
| Option | Description | Default |
|---|---|---|
--out-dir <dir> | Output directory for CSV files | ./output |
--input-file <path> | Custom JSON file with program IDs | <out-dir>/.program-list.json |
--batch-size <n> | Number of programs to check per batch | 50 |
--concurrency <n> | Concurrent RPC calls per batch | 10 |
--rps <n> | Max requests per second (rate limit) | 10 |
--resume | Resume from checkpoint if available | false |
Examples
IDL Derivation Methods
The tool checks for IDL using both Anchor derivation methods to ensure compatibility with all Anchor versions.Old Anchor (before v0.30)
Older Anchor versions usedcreateWithSeed for IDL accounts:
- Find PDA with empty seeds:
base = PDA([], programId) - Create account with seed:
createWithSeed(base, "anchor:idl", programId)
New Anchor (≥0.30)
Newer Anchor versions use a direct PDA derivation:- Find PDA:
PDA(["anchor:idl", programId], programId)
Detection Strategy
The checker:- Derives both possible IDL account addresses
- Checks if either account exists using
getMultipleAccounts - Marks program as having IDL if any account exists
- Records which address was found in the CSV
This dual-method approach ensures compatibility with all Anchor versions without requiring prior knowledge of which version was used.
Output Format
The check produces a CSV file namedprogram_idl_status.csv in the specified output directory.
program_idl_status.csv Structure
| Column | Description |
|---|---|
program_id | Base58-encoded program public key |
has_onchain_idl | true if IDL account exists, false otherwise |
idl_account | The IDL account address that was found (or attempted) |
error | Error message if check failed (empty if successful) |
Result Interpretation
- Has IDL
- No IDL
- Error
- Program has on-chain IDL
idl_accountcontains the found address- Can be imported into Orquestra automatically
Additional Files Created
| File | Description | Purpose |
|---|---|---|
.checkpoint-idl.json | Resume checkpoint data | Enables --resume functionality |
Input Sources
Thecheck-idl command can read programs from two sources:
1. From Previous Scan (Default)
After runningscan, the program list is saved as .program-list.json:
2. Custom Program List
Provide a JSON file with an array of program IDs:Checkpointing and Resume
IDL checks can be interrupted and resumed:How Checkpointing Works
- Progress is saved to
.checkpoint-idl.jsonafter each batch - On resume, the tool:
- Loads the full program list
- Skips programs already processed (from checkpoint)
- Continues with remaining programs
- Results are appended to
program_idl_status.csv - The checkpoint file is deleted on successful completion
Checkpoints are specific to the output directory. Use the same
--out-dir when resuming.Batch Processing
The checker processes programs in batches for optimal performance:Batch Configuration
- Programs are divided into batches of
--batch-size(default: 50) - Within each batch, up to
--concurrency(default: 10) concurrent RPC calls are made - After each batch completes, results are written to CSV and checkpoint is updated
Optimizing Batch Size
- Public RPC
- Smaller batches reduce rate limit errors
- Lower concurrency prevents overwhelming the RPC
- Conservative rate limit
getMultipleAccounts Optimization
The tool usesgetMultipleAccounts RPC method to check multiple IDL accounts in a single call:
- Checks both old and new IDL addresses per program
- Batches up to 100 addresses per
getMultipleAccountscall - Falls back to individual
getAccountInfocalls if batch fails
Performance Considerations
Checking Speed
Checking 10,000 programs typically takes:- Public RPC: 30-60 minutes (with rate limiting)
- Premium RPC: 5-15 minutes (higher throughput)
Rate Limiting
Adjust rate limits based on your RPC provider:Filtering Results
After checking, you can filter the CSV to find programs of interest:Programs with IDL
Programs without IDL
Programs with Errors
Troubleshooting
”Error: Program list not found”
Problem: Runningcheck-idl before scan.
Solution: Run scan first or provide a custom list:
“429 Too Many Requests”
Problem: RPC is rate-limiting your requests. Solutions:- Lower
--rpsvalue:--rps 2 - Reduce
--batch-size:--batch-size 25 - Lower
--concurrency:--concurrency 5 - Use premium RPC with higher limits
- Use
--resumeto continue after waiting
High Error Rate
Problem: Many programs showing errors in CSV. Solutions:- Check RPC endpoint is healthy
- Reduce rate limiting to prevent 429 errors
- Retry failed programs from error CSV
Slow Performance
Problem: IDL check takes too long. Solutions:- Use premium RPC with higher throughput
- Increase
--batch-sizeand--concurrency - Increase
--rpsif RPC supports it - Process in chunks with custom program lists
Integration with Orquestra
Programs with on-chain IDL can be automatically imported into Orquestra:- Run check-idl to identify programs with on-chain IDL
- Filter results to get programs with
has_onchain_idl=true - Import to Orquestra via dashboard or API
- Auto-generate APIs without manual IDL upload
Future versions may include direct integration to automatically import discovered programs into Orquestra.
Next Steps
CLI Overview
Back to CLI overview and getting started
Scanning Programs
Learn about program discovery