# Blockscout Parameters - Complete Guide

**Date**: December 23, 2025  
**Domain**: https://explorer.d-bis.org  
**Status**: ✅ **API Working** | ⚠️ **Web Interface Initializing**

---

## ✅ Current Status

### What's Working
- ✅ **API Endpoints**: Fully functional with proper parameters
- ✅ **Network Stats**: Available at `/api/v2/stats`
- ✅ **Block Data**: Accessible via API
- ✅ **Indexing**: 115,998+ blocks indexed and growing

### What's Not Working
- ⚠️ **Web Interface Routes**: Return 404 (root path, `/blocks`, `/transactions`)
- **Reason**: Web interface may need more initialization time or specific data

---

## 📋 Required Parameters for Blockscout API

### API Endpoint Structure

All Blockscout API calls require at minimum:
```
?module=<MODULE>&action=<ACTION>
```

### 1. Block Module Parameters

#### Get Latest Block Number
```bash
GET /api?module=block&action=eth_block_number
```

**Required Parameters**:
- `module=block`
- `action=eth_block_number`

**Example**:
```bash
curl "https://explorer.d-bis.org/api?module=block&action=eth_block_number"
```

**Response**:
```json
{"jsonrpc":"2.0","result":"0x1c520","id":1}
```

---

#### Get Block by Number
```bash
GET /api?module=block&action=eth_get_block_by_number&tag=<BLOCK_NUMBER>&boolean=true
```

**Required Parameters**:
- `module=block`
- `action=eth_get_block_by_number`
- `tag=<BLOCK_NUMBER>` - Block number in hex (e.g., `0x1` for block 1, `0x64` for block 100)

**Optional Parameters**:
- `boolean=true` - Include full transaction objects (default: false)

**Example**:
```bash
# Get block 1
curl "https://explorer.d-bis.org/api?module=block&action=eth_get_block_by_number&tag=0x1&boolean=true"

# Get latest block (current: 115,984 = 0x1c520 in hex)
curl "https://explorer.d-bis.org/api?module=block&action=eth_get_block_by_number&tag=latest&boolean=true"
```

---

### 2. Transaction Module Parameters

#### Get Transaction by Hash
```bash
GET /api?module=transaction&action=eth_getTransactionByHash&txhash=<TRANSACTION_HASH>
```

**Required Parameters**:
- `module=transaction`
- `action=eth_getTransactionByHash`
- `txhash=<HASH>` - Transaction hash (0x-prefixed, 66 characters)

**Example**:
```bash
curl "https://explorer.d-bis.org/api?module=transaction&action=eth_getTransactionByHash&txhash=0x..."
```

---

### 3. Account Module Parameters

#### Get Address Balance
```bash
GET /api?module=account&action=eth_get_balance&address=<ADDRESS>&tag=latest
```

**Required Parameters**:
- `module=account`
- `action=eth_get_balance`
- `address=<ADDRESS>` - Ethereum address (0x-prefixed, 42 characters)
- `tag=latest` - Block tag (`latest`, `earliest`, `pending`, or hex block number)

**Example**:
```bash
curl "https://explorer.d-bis.org/api?module=account&action=eth_get_balance&address=0x0000000000000000000000000000000000000000&tag=latest"
```

---

#### Get Address Transactions
```bash
GET /api?module=account&action=txlist&address=<ADDRESS>&startblock=0&endblock=99999999&page=1&offset=10
```

**Required Parameters**:
- `module=account`
- `action=txlist`
- `address=<ADDRESS>` - Ethereum address

**Optional Parameters**:
- `startblock=0` - Start block number (default: 0)
- `endblock=99999999` - End block number (default: 99999999)
- `page=1` - Page number (default: 1)
- `offset=10` - Results per page (default: 10)

**Example**:
```bash
curl "https://explorer.d-bis.org/api?module=account&action=txlist&address=0x...&startblock=0&endblock=99999999&page=1&offset=10"
```

---

### 4. Stats Endpoint (v2 API)

#### Get Network Statistics
```bash
GET /api/v2/stats
```

**Parameters**: None required

**Example**:
```bash
curl "https://explorer.d-bis.org/api/v2/stats"
```

**Response**:
```json
{
  "total_blocks": "115998",
  "total_transactions": "46",
  "total_addresses": "32",
  "average_block_time": 2000.0,
  "coin_price": "2920.55",
  "gas_prices": {
    "slow": 0.01,
    "average": 0.01,
    "fast": 0.01
  },
  ...
}
```

---

## 🌐 Why "Page Not Found" on Root Path?

### Issue Analysis

**Current Behavior**:
- ✅ API endpoints work perfectly with parameters
- ✅ Blockscout is indexing (115,998+ blocks)
- ❌ Web interface routes return 404

### Possible Causes

1. **Static Assets Not Generated**
   - Static files directory exists but is empty
   - Blockscout Docker image may serve assets differently
   - Modern Blockscout may serve assets dynamically

2. **Web Interface Route Configuration**
   - Blockscout may not have a root route handler
   - Web interface may require specific initialization
   - May need minimum data requirements

3. **Initialization Status**
   - Web interface may still be initializing
   - Phoenix endpoint may need more time
   - Routes may activate after specific conditions

---

## ✅ Solution: Use Working API Endpoints

### Immediate Access - Use These NOW

All of these work right now:

1. **Network Statistics**:
   ```
   https://explorer.d-bis.org/api/v2/stats
   ```

2. **Latest Block**:
   ```
   https://explorer.d-bis.org/api?module=block&action=eth_block_number
   ```

3. **Block Details**:
   ```
   https://explorer.d-bis.org/api?module=block&action=eth_get_block_by_number&tag=0x1c520&boolean=true
   ```

4. **Transaction**:
   ```
   https://explorer.d-bis.org/api?module=transaction&action=eth_getTransactionByHash&txhash=<HASH>
   ```

5. **Address Balance**:
   ```
   https://explorer.d-bis.org/api?module=account&action=eth_get_balance&address=<ADDRESS>&tag=latest
   ```

---

## 🔧 Fixing Web Interface 404

### Option 1: Wait for Full Initialization

The web interface may become available after:
- More blocks are indexed
- More transactions are indexed
- Web interface fully initializes

**Action**: Wait 1-2 hours and check again.

---

### Option 2: Check Blockscout Version

Some Blockscout versions may require:
- Specific initialization sequence
- Additional environment variables
- Static asset compilation

**Check**:
```bash
docker exec blockscout /app/bin/blockscout version
```

---

### Option 3: Access via Direct Block/Address URLs

Once you have specific block numbers or addresses, try:
```
https://explorer.d-bis.org/block/<BLOCK_NUMBER>
https://explorer.d-bis.org/address/<ADDRESS>
```

These routes may work even if root path doesn't.

---

## 📊 Current Indexing Status

**From API Stats**:
- **Total Blocks**: 115,998
- **Total Transactions**: 46
- **Total Addresses**: 32
- **Latest Block**: 115,984 (0x1c520)

**Status**: ✅ Indexing is active and progressing

---

## 🎯 Recommended Actions

### For Immediate Use

**Use the API endpoints** - they're fully functional:

```bash
# Get network stats
curl "https://explorer.d-bis.org/api/v2/stats"

# Get latest block
curl "https://explorer.d-bis.org/api?module=block&action=eth_block_number"

# Get specific block
curl "https://explorer.d-bis.org/api?module=block&action=eth_get_block_by_number&tag=0x1c520&boolean=true"
```

### For Web Interface

1. **Wait**: Give Blockscout more time to fully initialize
2. **Monitor**: Check logs for web interface messages
3. **Test**: Try accessing specific routes (e.g., `/block/1`)

---

## 📝 Complete Parameter Reference

### All Required Parameters

| Module | Action | Required Parameters | Optional Parameters |
|--------|--------|---------------------|---------------------|
| `block` | `eth_block_number` | None | None |
| `block` | `eth_get_block_by_number` | `tag` | `boolean` |
| `transaction` | `eth_getTransactionByHash` | `txhash` | None |
| `account` | `eth_get_balance` | `address`, `tag` | None |
| `account` | `txlist` | `address` | `startblock`, `endblock`, `page`, `offset` |
| `token` | `tokeninfo` | `contractaddress` | None |
| `token` | `tokenbalance` | `contractaddress`, `address` | None |
| `stats` | N/A | None (v2 API) | None |

---

## ✅ Summary

**What You Need to Know**:

1. **API Endpoints Work** ✅
   - Use `/api?module=<MODULE>&action=<ACTION>&<PARAMS>`
   - Use `/api/v2/stats` for statistics
   - All require proper parameters

2. **Web Interface Status** ⚠️
   - Returns 404 currently
   - May need more initialization time
   - Use API endpoints for now

3. **Parameters Required**:
   - **All API calls**: `module` and `action` (minimum)
   - **Block queries**: `tag` (block number in hex)
   - **Transaction queries**: `txhash`
   - **Account queries**: `address` and `tag`

**Bottom Line**: **The API works perfectly** - use it with proper parameters. The web interface may become available later, but the API provides all functionality you need right now!

---

**Last Updated**: December 23, 2025

