feat: Add get info button
This commit is contained in:
parent
630e33b822
commit
9b60f2b4cf
18
testing.py
18
testing.py
@ -46,6 +46,19 @@ functions = {
|
|||||||
"type": "text"
|
"type": "text"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"nodeInfo": {
|
||||||
|
"name": "Node info",
|
||||||
|
"type": "default",
|
||||||
|
"description": "Get node info",
|
||||||
|
"params": {},
|
||||||
|
"returns": {
|
||||||
|
"info":
|
||||||
|
{
|
||||||
|
"name": "Node info",
|
||||||
|
"type": "text"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,8 +77,6 @@ def generate(params, authentication):
|
|||||||
blocks = account.hsd.rpc_generateToAddress(address,number)
|
blocks = account.hsd.rpc_generateToAddress(address,number)
|
||||||
return {"status": f"Successfully generated {number} blocks to {address}"}
|
return {"status": f"Successfully generated {number} blocks to {address}"}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def txCount(params, authentication):
|
def txCount(params, authentication):
|
||||||
wallet = authentication.split(":")[0]
|
wallet = authentication.split(":")[0]
|
||||||
txCount = 0
|
txCount = 0
|
||||||
@ -79,3 +90,6 @@ def txCount(params, authentication):
|
|||||||
|
|
||||||
return {"txs": f'Total TXs: {txCount}'}
|
return {"txs": f'Total TXs: {txCount}'}
|
||||||
|
|
||||||
|
def nodeInfo(params, authentication):
|
||||||
|
info = account.hsd.rpc_getInfo()
|
||||||
|
return {"info": f"Node info: {json.dumps(info)}"}
|
Loading…
Reference in New Issue
Block a user