From 425065051e818ce551702f16aa76cc28ae99ceb5 Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sat, 8 Oct 2016 17:59:07 +0900 Subject: [PATCH 1/5] Add stat --- HOWTO.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HOWTO.rst b/HOWTO.rst index 0abd542..d8dea71 100644 --- a/HOWTO.rst +++ b/HOWTO.rst @@ -139,7 +139,7 @@ wall-time:: 100,000 2m 30s 0 (unflushed) 150,000 35m 4m 30s 0.2 GB 180,000 1h 5m 9m 0.4 GB - 245,800 3h + 245,800 3h 1h 30m 2.7 GB 290,000 13h 15m 3.3 GB Machine A: a low-spec 2011 1.6GHz AMD E-350 dual-core fanless CPU, 8GB From 0774fbeb5e65a9b14cf70a0c41fca0cffce531fe Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sat, 8 Oct 2016 18:13:48 +0900 Subject: [PATCH 2/5] Add another stat --- HOWTO.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HOWTO.rst b/HOWTO.rst index d8dea71..3231ce8 100644 --- a/HOWTO.rst +++ b/HOWTO.rst @@ -140,7 +140,7 @@ wall-time:: 150,000 35m 4m 30s 0.2 GB 180,000 1h 5m 9m 0.4 GB 245,800 3h 1h 30m 2.7 GB - 290,000 13h 15m 3.3 GB + 290,000 13h 15m 3h 5m 3.3 GB Machine A: a low-spec 2011 1.6GHz AMD E-350 dual-core fanless CPU, 8GB RAM and a DragonFlyBSD HAMMER fileystem on an SSD. It requests blocks From 0c565b92bc94359ae4be96cb83d01400f9e4476c Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 9 Oct 2016 00:05:23 +0900 Subject: [PATCH 3/5] Update stats --- HOWTO.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/HOWTO.rst b/HOWTO.rst index 3231ce8..15c83ca 100644 --- a/HOWTO.rst +++ b/HOWTO.rst @@ -137,10 +137,12 @@ wall-time:: Machine A Machine B DB + Metadata 100,000 2m 30s 0 (unflushed) - 150,000 35m 4m 30s 0.2 GB - 180,000 1h 5m 9m 0.4 GB - 245,800 3h 1h 30m 2.7 GB - 290,000 13h 15m 3h 5m 3.3 GB + 150,000 35m 4m 30s 0.2 GiB + 180,000 1h 5m 9m 0.4 GiB + 245,800 3h 1h 30m 2.7 GiB + 290,000 13h 15m 3h 5m 3.3 GiB + 307,000 17h 16m 3h 50m 4.1 GiB + 343,000 6h 54m 6.0 GiB Machine A: a low-spec 2011 1.6GHz AMD E-350 dual-core fanless CPU, 8GB RAM and a DragonFlyBSD HAMMER fileystem on an SSD. It requests blocks From b66e8242cd6f69867876188e2a2298e857483f4e Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 9 Oct 2016 08:15:53 +0900 Subject: [PATCH 4/5] Add stat --- HOWTO.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HOWTO.rst b/HOWTO.rst index 15c83ca..e9d510a 100644 --- a/HOWTO.rst +++ b/HOWTO.rst @@ -143,6 +143,7 @@ wall-time:: 290,000 13h 15m 3h 5m 3.3 GiB 307,000 17h 16m 3h 50m 4.1 GiB 343,000 6h 54m 6.0 GiB + 386,600 17h 07m 7.0 GiB Machine A: a low-spec 2011 1.6GHz AMD E-350 dual-core fanless CPU, 8GB RAM and a DragonFlyBSD HAMMER fileystem on an SSD. It requests blocks @@ -220,7 +221,6 @@ You can see the logs usefully like so:: Here is typical log output on startup:: - 2016-10-08 14:46:48.088516500 Launching ElectrumX server... 2016-10-08 14:46:49.145281500 INFO:root:ElectrumX server starting 2016-10-08 14:46:49.147215500 INFO:root:switching current directory to /var/nohist/server-test @@ -259,7 +259,7 @@ After flush-to-disk you may see an aiohttp error; this is the daemon timing out the connection while the disk flush was in progress. This is harmless; I intend to fix this soon by yielding whilst flushing. -You may see one or two logs about ambiguous UTXOs or hash160s:: +You may see one or two logs about UTXOs or hash160 key collisions:: 2016-10-08 07:24:34.068609500 INFO:DB:UTXO compressed key collision at height 252943 utxo 115cc1408e5321636675a8fcecd204661a6f27b4b7482b1b7c4402ca4b94b72f / 1 From 1e97686c5f96394d63dbc002186dc5f3057324df Mon Sep 17 00:00:00 2001 From: Neil Booth Date: Sun, 9 Oct 2016 08:26:46 +0900 Subject: [PATCH 5/5] Add a simple query for debugging --- query.py | 33 +++++++++++++++++++++++++++++++++ server/server.py | 29 ----------------------------- 2 files changed, 33 insertions(+), 29 deletions(-) create mode 100644 query.py diff --git a/query.py b/query.py new file mode 100644 index 0000000..f445d06 --- /dev/null +++ b/query.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python3 + +# See the file "LICENSE" for information about the copyright +# and warranty status of this software. + +import asyncio +import os +import sys + +from server.env import Env +from server.server import Server + + +def main(): + env = Env() + os.chdir(env.db_dir) + loop = asyncio.get_event_loop() + server = Server(env, loop) + db = server.db + coin = db.coin + for addr in sys.argv[1:]: + print('Address: ', addr) + hash160 = coin.address_to_hash160(addr) + for n, (tx_hash, height) in enumerate(db.get_history(hash160)): + print('History #{:d}: hash: {} height: {:d}' + .format(n + 1, bytes(reversed(tx_hash)).hex(), height)) + for n, utxo in enumerate(db.get_utxos(hash160)): + print('UTXOs #{:d}: hash: {} pos: {:d} height: {:d} value: {:d}' + .format(n, bytes(reversed(utxo.tx_hash)).hex(), + utxo.tx_pos, utxo.height, utxo.value)) + +if __name__ == '__main__': + main() diff --git a/server/server.py b/server/server.py index 2618d2b..e6a7bbc 100644 --- a/server/server.py +++ b/server/server.py @@ -201,32 +201,3 @@ class RPC(object): self.logger.info('sleeping 1 second and trying again...') await asyncio.sleep(1) - - # for addr in [ - # # '1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp', - # # '1HYBcza9tVquCCvCN1hUZkYT9RcM6GfLot', - # # '1BNwxHGaFbeUBitpjy2AsKpJ29Ybxntqvb', - # # '1ARanTkswPiVM6tUEYvbskyqDsZpweiciu', - # # '1VayNert3x1KzbpzMGt2qdqrAThiRovi8', - # # '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa', - # # '1XPTgDRhN8RFnzniWCddobD9iKZatrvH4', - # # '153h6eE6xRhXuN3pE53gWVfXacAtfyBF8g', - # ]: - # print('Address: ', addr) - # hash160 = coin.address_to_hash160(addr) - # utxos = self.db.get_utxos(hash160) - # for n, utxo in enumerate(utxos): - # print('UTXOs #{:d}: hash: {} pos: {:d} height: {:d} value: {:d}' - # .format(n, bytes(reversed(utxo.tx_hash)).hex(), - # utxo.tx_pos, utxo.height, utxo.value)) - - # for addr in [ - # '19k8nToWwMGuF4HkNpzgoVAYk4viBnEs5D', - # '1HaHTfmvoUW6i6nhJf8jJs6tU4cHNmBQHQ', - # '1XPTgDRhN8RFnzniWCddobD9iKZatrvH4', - # ]: - # print('Address: ', addr) - # hash160 = coin.address_to_hash160(addr) - # for n, (tx_hash, height) in enumerate(self.db.get_history(hash160)): - # print('History #{:d}: hash: {} height: {:d}' - # .format(n + 1, bytes(reversed(tx_hash)).hex(), height))