peercoin / electrumx-docker

Dockerized ElectrumX server
BSD 3-Clause "New" or "Revised" License
4 stars 6 forks source link

ERROR:FakeEstimateFeeDaemon:connection problem - check your daemon is running. #4

Closed lorenz10 closed 3 years ago

lorenz10 commented 3 years ago

I'm successfully running docker-peercoind with testnet (curl test provides a result):

docker run -p 9904:9904 --name testnet-peercoind -d peercoin/peercoind \
  -rpcallowip=0.0.0.0/0 \
  -rpcpassword=user \
  -rpcuser=pass \
  -testnet=1

but when I try to run also electrumx-docker:

docker run --name electrumx \
  -v $HOME/electrumx:/data \
  -e DAEMON_URL=user:pass@peercoind:9904 \
  -e COIN=Peercoin \
  -p 50002:50002 \
  peercoin/electrumx

I get this error:

INFO:electrumx:ElectrumX server starting
INFO:electrumx:logging level: INFO
INFO:Controller:Python version: 3.8.8 (default, Mar 26 2021, 08:58:54) [GCC 9.3.0]
INFO:Controller:software version: ElectrumX 1.16.0
INFO:Controller:aiorpcX version: 0.18.7
INFO:Controller:supported protocol versions: 1.4-1.4.2
INFO:Controller:event loop policy: None
INFO:Controller:reorg limit is 5,000 blocks
INFO:FakeEstimateFeeDaemon:daemon #1 at peercoind:9904/ (current)
INFO:DB:switching current directory to /data
INFO:DB:using leveldb for DB backend
ERROR:FakeEstimateFeeDaemon:connection problem - check your daemon is running. Retrying occasionally... 
ihavenoface commented 3 years ago

Electrum and peercoind aren't bound to the same network, so you'll have a bad time trying to reach a hostname (user:pass@peercoind).
You should be using docker-compose.

lorenz10 commented 3 years ago

ok now Testnet started, however the blockchain does not syncronize.

"verificationprogress": 1.002227318266335e-06,
"initialblockdownload": true,
ERROR:Prefetcher:ignoring unexpected exception
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/e_x-1.16.0-py3.8.egg/electrumx/server/block_processor.py", line 64, in main_loop
if not await self._prefetch_blocks():
File "/usr/local/lib/python3.8/site-packages/e_x-1.16.0-py3.8.egg/electrumx/server/block_processor.py", line 134, in _prefetch_blocks
blocks[0] = self.coin.genesis_block(blocks[0])
File "/usr/local/lib/python3.8/site-packages/e_x-1.16.0-py3.8.egg/electrumx/lib/coins.py", line 159, in genesis_block
raise CoinError(f'genesis block has hash {header_hex_hash} '
electrumx.lib.coins.CoinError: genesis block has hash 00000001f757bb737f6596503e17cd17b0658ce630cc727c0cca81aec47c9f06 expected 0000000032fe677166d54963b62a4677d8957e87c508eaa4fd7eb1c880cd27e3

could it be because of this error in electrumx?

willyfromtheblock commented 3 years ago

you're running the wrong coin on electrum. here is my docker-compose.yaml

version: '3.5'
services:
  peercoind-testnet:
    image: peercoin/peercoind:latest
    restart: always
    environment:
      - RPC_USER=bitcoinrpc
      - RPC_PASSWORD=asdf
    volumes:
      - type: bind
        source: /opt/testnet-electrum/peercoin/
        target: /data
    command:
      -nominting
      -printtoconsole
      -testnet
      -rpcbind=0.0.0.0
    logging:
      driver: "json-file"
      options:
        max-size: 100m
    ports: 
      - "9903:9903"
  electrumx-testnet:
    image: peercoin/electrumx:latest
    environment:
      - DAEMON_URL=bitcoinrpc:asdf@peercoind-testnet:9904
      - COIN=PeercoinTestnet
      - NET=testnet
      - DB_DIRECTORY=/data
      - CACHE_MB=400
      - SERVICES=tcp://:50007,ssl://:50008,wss://:50009
      - DONATION_ADDRESS=PPXMXETHJE3E8k6s8vmpDC18b7y5eKAudS
      - SSL_CERTFILE=/data/fullchain.pem
      - SSL_KEYFILE=/data/privkey.pem
    volumes:
      - type: bind
        source: /opt/testnet-electrum/db/
        target: /data
    ports:
      - "50007:50007" # comment out to disable TCP port (plaintext)
#      - "0.0.0.0:50001:50001" # comment out to disable TCP port (plaintext)
      - "50008:50008"
#      - "0.0.0.0:50002:50002"
      - "50009:50009"
#      - "0.0.0.0:50004:50004"
#      - "8000:8000"
    restart: always
    logging:
      driver: "json-file"
      options:
        max-size: 100m  
    depends_on:
      - peercoind-testnet

Quick side note: You will need valid SSL certs for the WSS connection to work.

lorenz10 commented 3 years ago

1) The chain still does not sync.

INFO:PeerManager:accepted new peer electrum.peercoinexplorer.net from coins.py
INFO:PeerManager:no proxy detected, will try later
INFO:PeerManager:[electrum.peercoinexplorer.net:50002 SSL]
INFO:PeerManager:[electrum.peercoinexplorer.net:50002 SSL] [Errno -2] Name does not resolve
INFO:MemPool:0 txs 0.00 MB touching 0 addresses
INFO:MemPool:0 txs 0.00 MB touching 0 addresses

is this due to your quick note?

Quick side note: You will need valid SSL certs for the WSS connection to work.

2) And before going on solving problems, given what you said about valid SSL certs, is it possible for me to setup on my pc peercoind + electrumx and contact them using my wallet peercoin_flutter or do I need a server with a domain name, static IP etc. ?

willyfromtheblock commented 3 years ago

peercoin_flutter will enforce a valid SSL cert and I don't think we should change that.

lorenz10 commented 3 years ago

I'm not saying you should change it, I'm just tring to understand how everything works since I am a student and I have no experience in this... My goal is to fork my own blockchain from Peercoin, so what I had planned to do was: first forking peercoin_flutter, then setup on my pc my own electrumx + peercoind kind of server and finally change the parameters of peercoind (genesis block for example) to have my own new blockchain. Do you think this is feasible ? Or do I need a "real" server ?

willyfromtheblock commented 3 years ago

No it's certainly possible that you run this from home. You don't need a static IP address for SSL to work properly.

I use letsencrypt certs for this and I think you can too.

lorenz10 commented 3 years ago

ok thanks, I'll try to figure it out.