diff --git a/electrumx/lib/util.py b/electrumx/lib/util.py index 82a7daf58..0c0e123cd 100644 --- a/electrumx/lib/util.py +++ b/electrumx/lib/util.py @@ -41,9 +41,14 @@ import rapidjson as json except ImportError: try: - import ujson as json + import orjson as json except ImportError: - import json + try: + import ujson as json + except ImportError: + import json + +print("using", json.__name__) json_deserialize = json.loads json_serialize = json.dumps diff --git a/setup.py b/setup.py index 0668e9e53..c5e3c17cf 100644 --- a/setup.py +++ b/setup.py @@ -12,6 +12,7 @@ 'rapidjson': ['python-rapidjson>=0.4.1,<1.0.0'], 'rocksdb': ['python-rocksdb>=0.6.9'], 'ujson': ['ujson>=2.0.0,<4.0.0'], + 'orjson': ['orjson>=3.2.2'], 'uvloop': ['uvloop>=0.14'], # For various coins 'blake256': ['blake256>=0.1.1'],