Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation on node debug page #26

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/troubleshooting/common-errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ id: common-errors
title: Common Node Errors and Solutions
sidebar_label: Common Node Errors and Solutions
description: Common Node Errors and Solutions
sidebar_position: 1
---


Expand Down
89 changes: 89 additions & 0 deletions docs/troubleshooting/node-debug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
id: node-debug
title: Node Debug Page
sidebar_label: Node Debug Page
description: How to Use the Node Debug Page
sidebar_position: 2
---

# Node Debug Page

The nearcore 1.27.0 release will introduce a node debug page on your NEAR node which provides detailed info on last blocks, sync info, chain info, and epoch info. Node operators will have the option to enable this node debug page.

### Enable Node Debug Page
To enable this debug page on the node, a modificiation is require on `config.json`. Under `rpc` struct, set `enable_debug_rpc`: true. If this line doesn't exist the node's `config.json`, the node operator may add the following:

```
"rpc": {
...
"enable_debug_rpc": true
...
```

After the node starts, head to `http://<your-node-ip>/debug` to view the Node Debug Page.

![img](/images/node-debug.png)

### Last Blocks
This page displays the most recent 50 blocks on the node. For each block, the following fields are shown:
- Block hash
- Validator who validated the block
- Processing time for the block
- Estimated Next block time
- Gas Price Ratio: How much gas it costs to generate this block. The ratio is the current cost of generating the block in comparison to the cost of genesis block.
- For each shard, the fields are the chunk hash / validator who validated the chunk / Gas / Time (in ms)


### Sync Info
This page displays the current point-in-time status of node's peers.

`Current Sync Status: NoSync (#64817610 DakWGcEUsNpRSXEgBm4FUGEqnJy9qVKouB8V9ek8BqYr)`
- Current Sync Status: NoSync means the node is synced and not syncing. What follows is the block number and block hash. Other status that can be shown are header sync and block sync.

`Number of peers: 30/40`
This means there are 30 active peers. 40 is the max number of peers.

`Validators: 100 Known: 100 Reachable: 100`
- `Validators: 100`: is determined in the last epoch by the network.
- `Known: 100`: is that the current node has the validator accountID present in this node's database.
- `Reachable: 100`: If a validator is not reachable from the current node, it will not be included in the count.

What follows is a table of the node peers.
- `Address`: node IP and port.
- `Validator?`: Shows if the node is a validator. If it is, it shows the pool name.
- `AccountID`: The first line shows the account id for the peer. The second line shows the peer id.
- `Height`: shows the latest block height.
- `Tracked Shards`: shows which shards the node is tracking.
- `Archival`: shows whether the node is archival or not.
- `Route to validators`: List of validators, the paths to which contain this current node as a peer.

### Chain Info
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jc-near we might want to change the naming of the pages a little ;-)

As stuff on this page (orphans, missing chunks etc) - are more related with 'Sync'

And maybe we should rename the 'sync info' page to 'network' (and move current Sync Status here)

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. I will create a PR to do this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jc-near @mm-near. Ok we will do another round of documentation when those are finalized.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jc-near @mm-near What do you think about adding on the Sync Page, which peer has missed a block in the epoch and is a bad peer? Also any updates on the PR, thanks

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some of this data is already there (for example: if a peer missed a block, we show it on the last_blocks page -- but only for the last 50 blocks).

But yes, we could show it more explicitly. Could you create an issue for that?
(preferably with more details - how bad peers should be shown etc etc).

This page displays the current point-in-time status of the node in terms of orphan blocks and missing chunks.

`Current head: 3mivFUczgGWM6RvwvaT2oQ93zRQQTn3riXNtWxByntD1 @ 64818564`: The current head is the latest block of this node.

`Current header head: 3mivFUczgGWM6RvwvaT2oQ93zRQQTn3riXNtWxByntD1 @ 64818564`:
The header_head is the latest 'header' that we know of. If node is up-to-date, then head is equal to header_head. If the node is syncing, the header_head may be larger than the head.

`Orphan Pool`: This table shows a list of orphan blocks for this current node. The block hash and block height are listed. (e.g. It is possible that this node received a block for which its predecessor is unknown. Once the predecessor is known, the orphan block would no longer be in the pool.)

`Missing Chunks Pool`
This table shows a list of blocks that are missing some of its chunks in this node. The block hash and block height are listed. As your node request for missed chunks, you can refresh the page to see the latest status and to see if the chunk has been received and stored. If a chunk has been no longer missing, it will be removed from this table.


### Epoch Info

The epoch displays the current epoch and the most recent five epoches.

- `Epoch id`: block hash of the final block in epoch T-2.
- `Start height`: the first block of the epoch.
- `Protocol version`: The protocol version of the epoch.
- `First block`: Block hash of the first block in the epoch.
- `Epoch start`: How long ago the epoch has started.

The table below displays the validator history in the current epoch and the last five epochs (represented by the epoch hash) with either TRUE or FALSE.


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could also mention, that they can see the example here:
http://34.147.91.25:3030/debug

(but we might want to get a 'better URL' in the future, as this IP can change)

>Got a question?
<a href="https://stackoverflow.com/questions/tagged/nearprotocol">
<h8>Ask it on StackOverflow!</h8></a>
Binary file added website/static/images/node-debug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.