Browse Source

Upgrade to aiorpcX 0.16.0

patch-2
Neil Booth 6 years ago
parent
commit
4120596fb8
  1. 4
      electrumx/server/controller.py
  2. 10
      electrumx/server/session.py
  3. 3
      setup.py

4
electrumx/server/controller.py

@ -82,8 +82,8 @@ class Controller(ServerBase):
'''Start the RPC server and wait for the mempool to synchronize. Then '''Start the RPC server and wait for the mempool to synchronize. Then
start serving external clients. start serving external clients.
''' '''
if not (0, 15, 0) <= aiorpcx_version < (0, 16): if not (0, 16, 0) <= aiorpcx_version < (0, 17):
raise RuntimeError('aiorpcX version 0.15.x is required') raise RuntimeError('aiorpcX version 0.16.x is required')
env = self.env env = self.env
min_str, max_str = env.coin.SESSIONCLS.protocol_min_max_strings() min_str, max_str = env.coin.SESSIONCLS.protocol_min_max_strings()

10
electrumx/server/session.py

@ -25,7 +25,7 @@ import attr
from aiorpcx import ( from aiorpcx import (
RPCSession, JSONRPCAutoDetect, JSONRPCConnection, RPCSession, JSONRPCAutoDetect, JSONRPCConnection,
TaskGroup, handler_invocation, RPCError, Request, sleep, Event, TaskGroup, handler_invocation, RPCError, Request, sleep, Event,
ExcessiveSessionCostError, FinalRPCError ExcessiveSessionCostError, ReplyAndDisconnect
) )
import electrumx import electrumx
@ -1257,8 +1257,8 @@ class ElectrumX(SessionBase):
client_name = str(client_name) client_name = str(client_name)
if self.env.drop_client is not None and \ if self.env.drop_client is not None and \
self.env.drop_client.match(client_name): self.env.drop_client.match(client_name):
raise FinalRPCError(BAD_REQUEST, raise ReplyAndDisconnect(RPCError(
f'unsupported client: {client_name}') BAD_REQUEST, f'unsupported client: {client_name}'))
self.client = client_name[:17] self.client = client_name[:17]
# Find the highest common protocol version. Disconnect if # Find the highest common protocol version. Disconnect if
@ -1273,8 +1273,8 @@ class ElectrumX(SessionBase):
self.logger.info(f'client requested future protocol version ' self.logger.info(f'client requested future protocol version '
f'{util.version_string(client_min)} ' f'{util.version_string(client_min)} '
f'- is your software out of date?') f'- is your software out of date?')
raise FinalRPCError(BAD_REQUEST, raise ReplyAndDisconnect(RPCError(
f'unsupported protocol version: {protocol_version}') BAD_REQUEST, f'unsupported protocol version: {protocol_version}'))
self.set_request_handlers(ptuple) self.set_request_handlers(ptuple)
return (electrumx.version, self.protocol_version_string()) return (electrumx.version, self.protocol_version_string())

3
setup.py

@ -6,8 +6,7 @@ setuptools.setup(
version=version, version=version,
scripts=['electrumx_server', 'electrumx_rpc', 'electrumx_compact_history'], scripts=['electrumx_server', 'electrumx_rpc', 'electrumx_compact_history'],
python_requires='>=3.6', python_requires='>=3.6',
# via environment variables, in which case I've tested with 15.0.4 install_requires=['aiorpcX>=0.16.0,<0.17', 'attrs',
install_requires=['aiorpcX>=0.15.0,<0.16', 'attrs',
'plyvel', 'pylru', 'aiohttp>=3.3'], 'plyvel', 'pylru', 'aiohttp>=3.3'],
extras_require={ extras_require={
'rocksdb': ['python-rocksdb>=0.6.9'], 'rocksdb': ['python-rocksdb>=0.6.9'],

Loading…
Cancel
Save