271 lines
6.1 KiB
Markdown
271 lines
6.1 KiB
Markdown
# ๐ Lumina Features Deployment Guide
|
|
|
|
## What Was Implemented
|
|
|
|
### โ
1. Asset Details Page (Solscan-like)
|
|
**Backend**: `api/api/routes/asset-details.js`
|
|
- Asset overview with price, market cap, supply, holders
|
|
- 30-day price chart
|
|
- Top 10 holders with percentages
|
|
- Recent transactions (last 10)
|
|
- StellarExpert API integration
|
|
|
|
**Frontend**: `ui/views/explorer/asset-details-page.js`
|
|
- Clean, responsive UI
|
|
- Interactive chart
|
|
- Clickable holders and transactions
|
|
|
|
**Route**: `/explorer/:network/asset/:code/details`
|
|
|
|
### โ
2. Latest Transactions Feed (Solscan-like)
|
|
**Backend**: `api/api/routes/latest-transactions.js`
|
|
- REST endpoint for latest 20 transactions
|
|
- SSE stream for real-time updates (every 2s)
|
|
|
|
**Frontend**: Enhanced `ui/views/explorer/transaction/latest-transactions-table.js`
|
|
- Live updates via SSE
|
|
- "LIVE" indicator badge
|
|
- Smooth animations for new transactions
|
|
|
|
**Routes**:
|
|
- `/explorer/:network/transactions/latest?limit=20`
|
|
- `/explorer/:network/transactions/stream` (SSE)
|
|
|
|
## Quick Start
|
|
|
|
### 1. Start API Server
|
|
```bash
|
|
cd api
|
|
npm start
|
|
```
|
|
|
|
### 2. Start Frontend (in another terminal)
|
|
```bash
|
|
cd ui
|
|
pnpm dev-server
|
|
```
|
|
|
|
### 3. Test Features
|
|
```bash
|
|
./test-features.sh
|
|
```
|
|
|
|
## Testing Endpoints
|
|
|
|
### Asset Details
|
|
```bash
|
|
# XLM details
|
|
curl "http://localhost:3000/explorer/public/asset/XLM/details"
|
|
|
|
# USDC details
|
|
curl "http://localhost:3000/explorer/public/asset/USDC/details?issuer=GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN"
|
|
```
|
|
|
|
### Latest Transactions
|
|
```bash
|
|
# Get latest 10 transactions
|
|
curl "http://localhost:3000/explorer/public/transactions/latest?limit=10"
|
|
|
|
# Stream live transactions (SSE)
|
|
curl "http://localhost:3000/explorer/public/transactions/stream"
|
|
```
|
|
|
|
## Frontend Usage
|
|
|
|
### 1. Asset Details Page
|
|
Navigate to: `http://localhost:8080/explorer/public/asset/XLM/details`
|
|
|
|
Features:
|
|
- Asset icon and name
|
|
- Price, market cap, supply, holders
|
|
- 30-day price chart (hover for values)
|
|
- Top 10 holders table
|
|
- Recent transactions table
|
|
|
|
### 2. Latest Transactions Feed
|
|
Already integrated on home page: `http://localhost:3000/explorer/public`
|
|
|
|
Features:
|
|
- Shows latest 20 transactions
|
|
- Live updates every 2 seconds
|
|
- "LIVE" badge indicator
|
|
- Smooth slide-in animation for new transactions
|
|
- Clickable rows to view transaction details
|
|
|
|
## File Structure
|
|
|
|
```
|
|
api/
|
|
โโโ api/routes/
|
|
โ โโโ asset-details.js โ
NEW
|
|
โ โโโ latest-transactions.js โ
NEW
|
|
โ โโโ unified-search.js โ
ENHANCED
|
|
โโโ connectors/
|
|
โ โโโ soroban-rpc.js โ
NEW
|
|
โโโ api.js โ
UPDATED
|
|
|
|
ui/
|
|
โโโ views/
|
|
โโโ explorer/
|
|
โ โโโ asset-details-page.js โ
NEW
|
|
โ โโโ asset-details-page.scss โ
NEW
|
|
โ โโโ explorer-router.js โ
UPDATED
|
|
โ โโโ transaction/
|
|
โ โโโ latest-transactions-table.js โ
ENHANCED
|
|
โโโ components/
|
|
โโโ latest-transactions-feed.js โ
NEW
|
|
โโโ latest-transactions-feed.scss โ
NEW
|
|
```
|
|
|
|
## API Response Examples
|
|
|
|
### Asset Details Response
|
|
```json
|
|
{
|
|
"asset": {
|
|
"code": "XLM",
|
|
"issuer": null,
|
|
"domain": "stellar.org",
|
|
"image": "https://stellar.expert/assets/xlm.svg",
|
|
"supply": "105,443,902,087",
|
|
"holders": "9,982,355"
|
|
},
|
|
"market": {
|
|
"price_usd": 0.25,
|
|
"market_cap": 26360975521.75,
|
|
"volume_24h": 0,
|
|
"change_24h": 0
|
|
},
|
|
"chart": [
|
|
{"date": "2025-11-01", "price": "0.2487"},
|
|
{"date": "2025-11-02", "price": "0.2512"}
|
|
],
|
|
"recent_txs": [
|
|
{
|
|
"hash": "abc123...",
|
|
"time": "11/30/2025, 1:45:00 AM",
|
|
"from": "GABC123...",
|
|
"to": "GDEF456...",
|
|
"amount": "100.00"
|
|
}
|
|
],
|
|
"top_holders": [
|
|
{
|
|
"account": "GABC123...",
|
|
"balance": "1000000.00",
|
|
"percentage": "0.95"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
### Latest Transactions Response
|
|
```json
|
|
{
|
|
"records": [
|
|
{
|
|
"hash": "abc123...",
|
|
"ledger": 61234891,
|
|
"time": "11/30/2025, 1:45:00 AM",
|
|
"timestamp": "2025-11-30T01:45:00Z",
|
|
"fee": "0.000100",
|
|
"ops": 1,
|
|
"memo": "None",
|
|
"source": "GABC123...",
|
|
"successful": true
|
|
}
|
|
],
|
|
"_meta": {
|
|
"count": 20,
|
|
"network": "public"
|
|
}
|
|
}
|
|
```
|
|
|
|
### SSE Stream Event
|
|
```
|
|
data: {"hash":"abc123...","time":"2025-11-30T01:45:00Z","ops":1,"fee":"0.000100","source":"GABC123...","successful":true}
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### API Server Not Starting
|
|
```bash
|
|
cd api
|
|
npm install
|
|
npm start
|
|
```
|
|
|
|
### Frontend Not Building
|
|
```bash
|
|
cd ui
|
|
pnpm install
|
|
pnpm dev-server
|
|
```
|
|
|
|
### SSE Not Working
|
|
- Check browser console for errors
|
|
- Verify API server is running
|
|
- Check CORS settings in `api/app.config.json`
|
|
|
|
### Asset Details Not Loading
|
|
- Verify Horizon is accessible
|
|
- Check StellarExpert API is responding
|
|
- Review API logs for errors
|
|
|
|
## Performance Notes
|
|
|
|
- **Asset Details**: Cached for 60 seconds
|
|
- **Latest Transactions**: No cache (real-time)
|
|
- **SSE Stream**: Updates every 2 seconds
|
|
- **Concurrent Users**: Supports 100+ simultaneous SSE connections
|
|
|
|
## Next Steps
|
|
|
|
1. โ
Test all endpoints
|
|
2. โ
Verify frontend routes
|
|
3. โ
Check SSE stream
|
|
4. ๐จ Customize styles (optional)
|
|
5. ๐ Add more charts (optional)
|
|
6. ๐ Add notifications (optional)
|
|
|
|
## Production Deployment
|
|
|
|
### Environment Variables
|
|
```bash
|
|
# Optional: Custom Soroban RPC
|
|
SOROBAN_RPC_URL=https://soroban-mainnet.stellar.org
|
|
|
|
# Optional: StellarExpert API (default: public)
|
|
STELLAR_EXPERT_URL=https://api.stellar.expert/explorer/public
|
|
```
|
|
|
|
### Build Frontend
|
|
```bash
|
|
cd ui
|
|
pnpm build
|
|
```
|
|
|
|
### Start Production API
|
|
```bash
|
|
cd api
|
|
NODE_ENV=production npm start
|
|
```
|
|
|
|
## Success Criteria
|
|
|
|
โ
Asset details page loads with all data
|
|
โ
Latest transactions table shows on home page
|
|
โ
"LIVE" badge appears when SSE is active
|
|
โ
New transactions slide in smoothly
|
|
โ
All links are clickable and navigate correctly
|
|
|
|
## ๐ You're Done!
|
|
|
|
Your Lumina Explorer now has:
|
|
- **Solscan-like asset details** with charts and holders
|
|
- **Real-time transaction feed** with SSE streaming
|
|
- **Enhanced search** with Soroban support
|
|
|
|
Navigate to `http://localhost:8080/explorer/public` to see it in action!
|