# Node Debugging & Configuration

## Pharos Block Validation

You can refer to the [Pharos Block Validation](https://silken-muskox-24e.notion.site/Pharos-Block-Validation-2ce8ec314f7580228d47cea4119df371) document for details on the Pharos consensus mechanism and block validation process.

## Block Sync Verification

You can use the RPC API to check whether the node is actively syncing blocks. If the block number is increasing, the node is catching up to the latest chain height.

```sh
curl 127.0.0.1:18100/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}'
```

## Check if the Node has joined as a Validator

### Query the local NodeID

```sh
cat /data/domain.json  | grep "NODE_ID"
```

### Send a transaction to join the Validator

<https://pharosscan.xyz/tx/0xf0045f3551f3d70df2ce5a1b2abe51839c3c2cf4a3e487c89ef6e5a006e16b92?tab=state>

### Check NodeID in Pharos system contract

```sh
curl -X POST --data '{
    "jsonrpc": "2.0",
    "method": "eth_call",
    "params": [{
        "to": "0x4100000000000000000000000000000000000000",
        "data": "0x9de70258"
    }, "latest"],
    "id": 1
}' -H "Content-Type: application/json" https://atlantic.dplabs-internal.com
```

## Log Inspection

All logs are written to the directory:

```sh
cd /data/pharos-node/domain/light/log/
```

To monitor logs in real-time, use:

```sh
tail -f pharos.log
```

## Port Configuration

Ensure that the following ports are open and accessible for proper node operation:

```sh
18100 — RPC
18200 — P2P
19000 — Internal services
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pharos.xyz/node-and-validator-guide/node-debugging-and-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
