import json
import account
import requests
# Plugin Data
info = {
"name": "Public Node Dashboard",
"description": "Dashboard modules for public nodes",
"version": "1.0",
"author": "Nathan.Woodburn/"
}
# Functions
functions = {
"main":{
"name": "Info Dashboard widget",
"type": "dashboard",
"description": "This creates the widget that shows on the dashboard",
"params": {},
"returns": {
"status":
{
"name": "Status of Node",
"type": "text"
}
}
}
}
def main(params, authentication):
info = account.hsd.getInfo()
status = f"Version: {info['version']}
Inbound Connections: {info['pool']['inbound']}
Outbound Connections: {info['pool']['outbound']}
"
if info['pool']['public']['listen']:
status += f"Public Node: Yes
Host: {info['pool']['public']['host']}
Port: {info['pool']['public']['port']}
"
else:
status += f"Public Node: No
"
status += f"Agent: {info['pool']['agent']}
Services: {info['pool']['services']}
"
return {"status": status}