Commit 8870c64
feat(tui): Implement REAL blockchain search with indexed data
**CRITICAL FIX:** Search now actually searches local indexed data!
Previous implementation was just a UI shell with no backend.
Now searches WalletGraph nodes, TransferEvents, and TokenVolumes.
π New Search Results Tab (Press '4'):
- Shows actual matches from locally indexed blockchain data
- Displays wallets with balances and transfer counts
- Shows token volumes and symbols
- Lists transactions with timestamps and amounts
- Match reasons explain why each result was found
π§ Real Search Engine:
- search_indexed_data() method searches ALL local data:
* WalletGraph.nodes_iter() for wallet matches
* transfer_events for transaction matches
* token_volumes for token symbol matches
- Fuzzy matching on addresses, labels, symbols, timestamps
- Returns SearchResultsData with categorized results
π Search Results Data Structures:
- SearchResultsData: query, entity_type, total_matches, timestamp
- WalletMatch: address, balance_sol, transfer_count, match_reason
- TransactionMatch: signature, timestamp, amount_sol, from/to, reason
- TokenMatch: symbol, volume, transfer_count, match_reason
β‘ Search Execution Flow:
1. User presses Ctrl+K, types query, selects suggestion
2. execute_search() calls search_indexed_data()
3. Searches WalletGraph, TransferEvents, TokenVolumes
4. Populates SearchResultsData with findings
5. Switches to SearchResults tab (Tab 4)
6. Displays categorized results with icons and stats
π¨ Search Results Tab UI:
- Header: query, entity type, match count, timestamp
- Wallets section: π address, balance, transfers
- Tokens section: πͺ symbol, volume
- Transactions section: π signature, amount, timestamp
- Empty state with helpful hints
- Scrollable results
- Status bar with Ctrl+K reminder
π Tab Navigation Updated:
- Tab 1: Dashboard
- Tab 2: Graph
- Tab 3: Logs
- Tab 4: Search Results (NEW)
- Press '4' or Tab through to access
Technical Implementation:
- Uses WalletGraph.nodes_iter() (respects private fields)
- Mutex-locked access to shared data structures
- Simplified transfer counting (future: use graph connections)
- Case-insensitive substring matching
- Results cloned from Arc<Mutex<>> for rendering
This transforms the search from cosmetic to functional.
Users can now actually find data in their local blockchain index!
π§ Generated with Claude Code
Co-Authored-By: Claude <[email protected]>1 parent 86a4afc commit 8870c64
1 file changed
+306
-16
lines changed
0 commit comments