Merge branch 'RPC' into develop
This commit is contained in:
commit
a4750f0474
@ -177,7 +177,10 @@ class JSONRPC(asyncio.Protocol, LoggedClass):
|
|||||||
return 'unknown'
|
return 'unknown'
|
||||||
if for_log and self.anon_logs:
|
if for_log and self.anon_logs:
|
||||||
return 'xx.xx.xx.xx:xx'
|
return 'xx.xx.xx.xx:xx'
|
||||||
return '{}:{}'.format(self.peer_info[0], self.peer_info[1])
|
if ':' in self.peer_info[0]:
|
||||||
|
return '[{}]:{}'.format(self.peer_info[0], self.peer_info[1])
|
||||||
|
else:
|
||||||
|
return '{}:{}'.format(self.peer_info[0], self.peer_info[1])
|
||||||
|
|
||||||
def connection_made(self, transport):
|
def connection_made(self, transport):
|
||||||
'''Handle an incoming client connection.'''
|
'''Handle an incoming client connection.'''
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import codecs
|
import codecs
|
||||||
import json
|
import json
|
||||||
|
import os
|
||||||
import ssl
|
import ssl
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
@ -224,10 +225,9 @@ class ServerManager(util.LoggedClass):
|
|||||||
|
|
||||||
async def start_servers(self, caught_up):
|
async def start_servers(self, caught_up):
|
||||||
'''Start RPC, TCP and SSL servers once caught up.'''
|
'''Start RPC, TCP and SSL servers once caught up.'''
|
||||||
await caught_up.wait()
|
|
||||||
|
|
||||||
if self.env.rpc_port is not None:
|
if self.env.rpc_port is not None:
|
||||||
await self.start_server('RPC', 'localhost', self.env.rpc_port)
|
await self.start_server('RPC', 'localhost', self.env.rpc_port)
|
||||||
|
await caught_up.wait()
|
||||||
await self.start_external_servers()
|
await self.start_external_servers()
|
||||||
|
|
||||||
async def start_external_servers(self):
|
async def start_external_servers(self):
|
||||||
@ -408,16 +408,18 @@ class ServerManager(util.LoggedClass):
|
|||||||
def server_summary(self):
|
def server_summary(self):
|
||||||
'''A one-line summary of server state.'''
|
'''A one-line summary of server state.'''
|
||||||
return {
|
return {
|
||||||
'blocks': self.bp.db_height,
|
'daemon_height': self.bp.daemon.cached_height(),
|
||||||
|
'db_height': self.bp.db_height,
|
||||||
'closing': len([s for s in self.sessions if s.is_closing()]),
|
'closing': len([s for s in self.sessions if s.is_closing()]),
|
||||||
'errors': sum(s.error_count for s in self.sessions),
|
'errors': sum(s.error_count for s in self.sessions),
|
||||||
'groups': len(self.groups),
|
'groups': len(self.groups),
|
||||||
'logged': len([s for s in self.sessions if s.log_me]),
|
'logged': len([s for s in self.sessions if s.log_me]),
|
||||||
|
'pid': os.getpid(),
|
||||||
'peers': len(self.irc.peers),
|
'peers': len(self.irc.peers),
|
||||||
'requests': sum(s.requests_remaining() for s in self.sessions),
|
'requests': sum(s.requests_remaining() for s in self.sessions),
|
||||||
'sessions': self.session_count(),
|
'sessions': self.session_count(),
|
||||||
|
'subs': self.subscription_count,
|
||||||
'txs_sent': self.txs_sent,
|
'txs_sent': self.txs_sent,
|
||||||
'watched': self.subscription_count,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user