spesmilo / electrumx

Alternative implementation of spesmilo/electrum-server
MIT License
436 stars 349 forks source link

electrumx fails to serve transaction data to electrum client #86

Closed Niehztog closed 3 years ago

Niehztog commented 3 years ago

Hello, I recently set up my own private electrumx server in Docker (using this Dockerfile). I intend to run electrumx to serve Bitcoin (original) blockchaindata only, thats why I switched from kyuupichan's github repository to this one. Here is my setup (environment variables):

DAEMON_URL=http://[user]:[password]@bitcoind-node:8332/
COIN=Bitcoin
SERVICES=tcp://:50001,ssl://:50002,wss://:50004,rpc://
LOG_LEVEL=debug
PEER_DISCOVERY=self

I am using the latest official Electrum 4.0.6 Client for Windows 10, which works fine when connecting to other servers. However, when connecting to my own electrumx server only and after creating a new wallet and importing my private keys, the transaction history remains empty. The Electrum logfile has the following errors:

20201208T221439.173758Z |  WARNING | interface.[127.0.0.1:50002] | disconnecting due to RPCError(2, "daemon error: DaemonError({'code': -5, 'message': 'No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions.'})")
20201208T221439.174771Z |    DEBUG | interface.[127.0.0.1:50002] | (disconnect) trace for RPCError(2, "daemon error: DaemonError({'code': -5, 'message': 'No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions.'})")
Traceback (most recent call last):
  File "electrum\interface.py", line 480, in wrapper_func
  File "electrum\interface.py", line 504, in run
  File "electrum\interface.py", line 647, in open_session
  File "aiorpcx\curio.py", line 242, in __aexit__
  File "aiorpcx\curio.py", line 211, in join
  File "electrum\synchronizer.py", line 81, in _start_tasks
  File "aiorpcx\curio.py", line 242, in __aexit__
  File "aiorpcx\curio.py", line 211, in join
  File "electrum\synchronizer.py", line 188, in _on_address_status
  File "electrum\synchronizer.py", line 208, in _request_missing_txs
  File "aiorpcx\curio.py", line 242, in __aexit__
  File "aiorpcx\curio.py", line 211, in join
  File "electrum\synchronizer.py", line 213, in _get_transaction
  File "electrum\interface.py", line 914, in get_transaction
  File "electrum\interface.py", line 172, in send_request
  File "asyncio\tasks.py", line 414, in wait_for
  File "aiorpcx\session.py", line 529, in send_request
  File "aiorpcx\session.py", line 499, in _send_concurrent
aiorpcx.jsonrpc.RPCError: (2, "daemon error: DaemonError({'code': -5, 'message': 'No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions.'})")

My electrumx server is up and running, the blockchain appears to be fully synced with my bitcoind full node (currently 660546 Blocks) and all necessary ports are open.

Here is an excerpt from my electrumx log output:

electrumx_1      | INFO:Prefetcher:new block height 660,547 hash 0000000000000000000b6d28b329b449dab7f1d994eb2dee46efaf4031b1133c
electrumx_1      | DEBUG:MemPool:waiting for DB to sync
electrumx_1      | INFO:DB:flush #1,003 took 0.1s.  Height 660,547 txs: 594,365,652 (+2,582)
electrumx_1      | INFO:BlockProcessor:processed 1 block size 1.35 MB in 0.7s
electrumx_1      | INFO:MemPool:16,161 txs 12.96 MB touching 95,507 addresses
electrumx_1      | INFO:MemPool:compact fee histogram: [(68.3, 100881), (58.8, 110962), (39.6, 123444), (29.9, 133492), (23.0, 147888), (21.9, 186221), (21.1, 255896), (21.0, 197979), (20.1, 146372), (20.0, 869830), (19.7, 287961), (17.3, 293590), (15.1, 334200), (12.3, 356225), (11.0, 393677), (10.0, 457659), (8.7, 485773), (7.5, 517204), (6.0, 737039), (5.0, 1059147), (4.0, 766306), (3.1, 531671), (3.0, 1867263), (2.0, 904623), (1.0, 1697338)]
electrumx_1      | INFO:MemPool:16,400 txs 13.06 MB touching 96,388 addresses

I have no idea how to continue from here. I've already tried deleting the whole database and indexing the whole blockchain again, with same results. Please give me some advice.

SomberNight commented 3 years ago

20201208T221439.173758Z | WARNING | interface.[127.0.0.1:50002] | disconnecting due to RPCError(2, "daemon error: DaemonError({'code': -5, 'message': 'No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions.'})")

do you have txindex enabled in bitcoind?

see https://electrumx-spesmilo.readthedocs.io/en/latest/HOWTO.html

Niehztog commented 3 years ago

20201208T221439.173758Z | WARNING | interface.[127.0.0.1:50002] | disconnecting due to RPCError(2, "daemon error: DaemonError({'code': -5, 'message': 'No such mempool transaction. Use -txindex or provide a block hash to enable blockchain transaction queries. Use gettransaction for wallet transactions.'})")

do you have txindex enabled in bitcoind?

see https://electrumx-spesmilo.readthedocs.io/en/latest/HOWTO.html

@SomberNight You were right, my bitcoind was not configured "right" as described in electrumx documentation. My fault. Thank you for pointing that out. After fixing and re-indexing it worked. (I would appreciate if electrumx could report problems with bitcoind like this one as error message on the console.)