> ## Documentation Index
> Fetch the complete documentation index at: https://base-a060aa97-mux-basectl-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Inspect blocks and sync status with basectl

> Read a single Base block, check how far your node is behind the network, and stream Flashblocks as JSON using basectl.

Use these commands to look at chain data and confirm your node is keeping up with the network.

## basectl block

Fetches a single L2 block and prints it either as an easy-to-read table (default) or as full JSON (`--json`). Short alias: `b`.

`<REF>` can be any of the following:

* A block number in decimal (for example `42417649`)
* A block number in hex (for example `0x2871c71`)
* A tag: `latest`, `safe`, `finalized`, or `earliest`
* A 32-byte block hash

Looking up a block by hash works even for blocks that are no longer on the canonical chain, such as orphaned or reorged-out blocks. The `pending` tag is not supported.

| Flag     | Description                                                                                                                                                                                       |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--json` | Print JSON with values decoded for you (decimal numbers, readable timestamps, and context fields for the network and the block you asked for).                                                    |
| `--raw`  | Add to `--json` to print the block exactly as the node returns it (hex values, original field names). This matches the output of `cast block --json`. Using `--raw` without `--json` is an error. |

The default table converts hex values to decimal and Unix timestamps to `YYYY-MM-DD HH:MM:SS UTC`. With `--json`, timestamps come back as an object with `unix`, `utc`, and `local` fields so you don't have to do any timezone math.

```bash Inspect a block theme={null}
# Inspect the latest block on Sepolia
basectl -c sepolia block latest

# Decimal and hex block numbers give the same result
basectl -c sepolia block 42417649
basectl -c sepolia block 0x2871c71

# JSON output pipes cleanly into jq
basectl -c mainnet block --json finalized | jq '{number, hash, gasUsed, baseFeePerGas}'

# Use the short alias `b`
basectl -c mainnet b latest

# Look up a block by hash (works for orphaned or reorged-out blocks too)
basectl -c sepolia block 0x9fa0d82dfdf395d552e92caec6a9d5482c53f1800e8f3ff29994b7a431447148
```

## basectl sync-status

Shows how far your node is behind the network. It reads the sync status from both the consensus layer (CL) and the execution layer (EL), and compares your node's head against a public endpoint. Each request runs in parallel; if either the CL or EL request fails, the command stops early, and the public comparison is skipped if the public endpoint is unreachable.

The CL response lists every L1 and L2 head the node knows about, each with a block number, hash, and timestamp. With `--json`, the output also includes a precomputed safe-head lag (`safeLagSeconds` and `safeLagBlocks`, the difference between the unsafe and safe heads) so you don't have to calculate it yourself.

When the EL is still syncing, the output adds `processedBlocks` (how many blocks it has caught up so far) and `remainingBlocks` (how many are left), so you can see the size of the gap instead of just "syncing: true".

A `tip_reference` row compares your node's head against the network's public endpoint and reports one of:

* `caught_up` — within the tolerance set by `--tip-tolerance` (default 5 blocks)
* `behind` — further behind than the tolerance
* `ahead` — ahead of the public endpoint
* `unavailable` — the public endpoint couldn't be reached

| Flag                       | Description                                                                                                                                                                                            |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `--el-rpc <URL>`           | Use a specific execution-layer RPC URL instead of the one in your config.                                                                                                                              |
| `--cl-rpc <URL>`           | Use a specific consensus-node RPC URL instead of the one in your config.                                                                                                                               |
| `--tip-tolerance <BLOCKS>` | How many blocks your node can be behind and still count as `caught_up`. Default `5` (about 10 seconds at Base's 2-second block time). Use `0` for strict alerting, or a larger number to reduce noise. |
| `--json`                   | Print JSON with decoded values and the extra fields described above.                                                                                                                                   |
| `--raw`                    | Add to `--json` to print the raw sync-status response. Using `--raw` without `--json` is an error.                                                                                                     |

```bash Check sync status theme={null}
# Check sync status on a devnet
basectl -c devnet sync-status

# Check sync status on a local Sepolia node
basectl -c sepolia sync-status

# JSON output includes the precomputed safe-head lag
basectl -c sepolia sync-status --json | jq '{safeLagSeconds, safeLagBlocks, elActivelySyncing}'
```

## basectl flashblocks

Streams live Flashblocks to your terminal as one JSON object per line. For an interactive view instead, use [`basectl monitor flashblocks`](/base-chain/node-operators/basectl/monitor).

```bash Stream Flashblocks as JSON theme={null}
# Stream Flashblocks on Sepolia
basectl -c sepolia flashblocks
```

<Tip>
  To learn more about Flashblocks and 200ms preconfirmations, see the [Flashblocks FAQ](/base-chain/flashblocks/faq).
</Tip>

## Related

* [basectl overview](/base-chain/node-operators/basectl/overview)
* [Diagnose node health](/base-chain/node-operators/basectl/doctor)
* [Interactive dashboard](/base-chain/node-operators/basectl/monitor)
