Util and Dashboard API
Tip
To enable the Util and/or Dashboard RPC API on the node, add the "util" and/or "dashboard" namespaces to "PublicModules" in node_config.json.
util_getPoWNonce
Calculate the PoW nonce based on the difficulty. See here for more details.
- Parameters:
difficulty:bigint stringPoW difficulty.hash:hash32-byte $Blake2b(address + previousHash)$ hash.
For example, if the address is "vite_ab24ef68b84e642c0ddca06beec81c9acb1977bbd7da27a87a" and the previousHash is "0000000000000000000000000000000000000000000000000000000000000000", then the hash is "8689fc3e7d0bcad0a1213fd90ab53437ce745408750f7303a16c75bad28da8c3".
- Returns:
base64: Nonce.
Example
dashboard_processInfo
Get go-vite information
-
Parameters:
id:stringOptional request id
-
Returns:
reqId:stringRequest idbuild_version:stringGo-vite versioncommit_version:stringGo-vite commit idnodeName:stringNode namerewardAddress:stringIf the node has registered for full node reward program, this field is the address to receive rewards, otherwise returns an empty string.pid:intGo-vite process id
Example
dashboard_runtimeInfo
Get go-vite runtime information
-
Parameters:
id:stringOptional request id
-
Returns:
reqId:stringRequest idpeersNum:intNumber of connected peerssnapshotPendingNum:uint64 stringNumber of snapshot blocks in mempoolaccountPendingNum:bigint stringNumber of account blocks in mempoollatestSnapshot:hashHeightTimeHash:stringCurrent snapshot block hashHeight:uint64Current snapshot block heightTime:int64Current snapshot block timestamp. In milliseconds.
updateTime:int64Node's time. In milliseconds.delayTime:Array<int>Block Propagate Latency. Seenet_nodeInfofor detailsproducer:addressBlock creation address if the node is SBP. OptionalsignData:hex64 byte signature of the current snapshot block hash signed by node's PeerKey
Example
{
"jsonrpc": "2.0",
"id": 0,
"result": {
"accountPendingNum": "0",
"delayTime": [
11659,
12311,
0,
0
],
"latestSnapshot": {
"Hash": "405ff8f0c48b838e293a640eccc13e3ce150fe7e472d8ccf6c87c09ff448a816",
"Height": 22655149,
"Time": 1661708711000
},
"peersNum": 2,
"producer": "vite_360232b0378111b122685a15e612143dc9a89cfa7e803f4b5a",
"reqId": "56678abcd",
"signData": "0x30b146b755c1b29ff3492df0ab079875a585fb4aa3080306149cfa1ef997f39f412f592058ed6b561f860300997c8620828d4830041a58177c760faed14af808",
"snapshotPendingNum": 0,
"updateTime": 1661708719144
}
}
dashboard_osInfo
Get node's operating system information
-
Parameters:
id:stringOptional request id
-
Returns:
reqId:stringRequest idos:stringNode's operating systemplatform:stringOperating system platformplatformFamily:stringOperating system familyplatformVersion:stringOperating system versionkernelVersion:stringOperating system kernel versionmemTotal:uint64Total memory. In bytesmemFree:uint64Free memory. In bytescpuNum:intNumber of CPU coresgorountine:intNumber of Go routines
Example
dashboard_netId
Get network id
-
Parameters: none
-
Returns:
stringVite Network id. 1 is the mainnet.