add highload wallet
This commit is contained in:
1 parent
0b309c5eb4
commit
b8a5cf4965
8 files changed
+101
-5
No files matched your search
@@ -38,6 +38,27 @@ async def s_api_v1_node(request): # /api/v1/node
|
||||
}
|
||||
})
|
||||
|
||||
async def s_api_v1_node_friendly(request):
|
||||
last_known_index = request.ctx.db_session.query(StoredContent).filter(
|
||||
StoredContent.onchain_index != None
|
||||
).order_by(StoredContent.onchain_index.desc()).first()
|
||||
last_known_index = last_known_index.onchain_index if last_known_index else 0
|
||||
last_known_index = max(last_known_index, 0)
|
||||
response_plain_text = f"""
|
||||
Node address: {service_wallet.address.to_string(1, 1, 1)}
|
||||
Node ID: {b58encode(hot_pubkey).decode()}
|
||||
Master address: {platform.address.to_string(1, 1, 1)}
|
||||
Indexer height: {last_known_index}
|
||||
Services:
|
||||
"""
|
||||
for service_key, service in request.app.ctx.memory.known_states.items():
|
||||
response_plain_text += f"""
|
||||
{service_key}:
|
||||
status: {service['status'] if (service['timestamp'] and (datetime.now() - service['timestamp']).total_seconds() < 30) else 'not working: timeout'}
|
||||
delay: {round((datetime.now() - service['timestamp']).total_seconds(), 3) if service['timestamp'] else -1}
|
||||
"""
|
||||
return response.text(response_plain_text, content_type='text/plain')
|
||||
|
||||
|
||||
async def s_api_system_send_status(request):
|
||||
if not request.json:
|
||||
|
||||
Reference in new issue
Block a user