Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to sync without any error (Altcoin) #608

Closed
project-qmc opened this issue Oct 4, 2018 · 6 comments

Comments

@project-qmc
Copy link

commented Oct 4, 2018

Oct  4 13:25:21 guest electrumx_server[6505]: INFO:Controller:Python version: 3.6.6 (default, Sep 12 2018, 18:26:19)
Oct  4 13:25:21 guest electrumx_server[6505]: [GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:Controller:software version: ElectrumX 1.8.7
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:Controller:aiorpcX version: 0.8.2
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:Controller:supported protocol versions: 1.1-1.4
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:Controller:event loop policy: None
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:Controller:reorg limit is 200 blocks
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:Daemon:daemon #1 at localhost:55777/ (current)
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:switching current directory to /eldb
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:using leveldb for DB backend
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:opened UTXO DB (for sync: True)
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:DB version: 6
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:coin: QMCoin
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:network: mainnet
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:height: -1
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:tip: 0000000000000000000000000000000000000000000000000000000000000000
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:tx count: 0
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:flushing DB cache at 1,200 MB
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:DB:sync time so far: 00s
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:History:history DB version: 0
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:History:flush count: 0
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:SessionManager:RPC server listening on localhost:8000
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:Prefetcher:catching up to daemon height 13,125 (13,126 blocks behind)
Oct  4 13:25:21 guest electrumx_server[6505]: INFO:BlockProcessor:flushing to DB for a clean shutdown...```

and then nothing else, ever...any ideas on this ?

@project-qmc project-qmc changed the title Fails to sync without any error Fails to sync without any error (Altcoin) Oct 4, 2018

@kyuupichan

This comment has been minimized.

Copy link
Owner

commented Oct 4, 2018

Sorry, I have no idea. QMCoin is not in the distribution so you must have added it yourself. If you're doing that it's up to you to understand what's going on.

However it shouldn't be letting an exception past without a backtrace; maybe you can add something to print an exception?

@kyuupichan kyuupichan added the altcoin label Oct 4, 2018

@kyuupichan

This comment has been minimized.

Copy link
Owner

commented Oct 4, 2018

Most likely the connection to your daemon isn't working as it should

@project-qmc

This comment has been minimized.

Copy link
Author

commented Oct 4, 2018

Figured it out - actually, the issue was I forgot to add a classmethod for our hashing algo.
Know you probably hate dealing with altcoin posts - so sorry for that :)

@kyuupichan

This comment has been minimized.

Copy link
Owner

commented Oct 4, 2018

So why no backtrace?

@kyuupichan

This comment has been minimized.

Copy link
Owner

commented Oct 4, 2018

Can you name what function you were missing; I should be able to reproduce then

@project-qmc

This comment has been minimized.

Copy link
Author

commented Oct 4, 2018

What we had was basically this:

class QMCoin(Coin):
    NAME = "QMCoin"
    SHORTNAME = "QMC"
    NET = "mainnet"
    XPUB_VERBYTES = bytes.fromhex("0488B21E")
    XPRV_VERBYTES = bytes.fromhex("0488ADE4")
    P2PKH_VERBYTE = bytes.fromhex("3A")
    P2SH_VERBYTES = [bytes.fromhex("78")]
    WIF_BYTE = bytes.fromhex("01")
    GENESIS_HASH = ('00000f52317b93c7c9b7be721fedbfcc'
                    'ea556a041605faa9b5e26a382428c23a')
    TX_COUNT = 13227
    TX_COUNT_HEIGHT = 29269
    TX_PER_BLOCK = 2
    RPC_PORT = 55777
    REORG_LIMIT = 1000

without this:

    @classmethod
    def header_hash(cls, header):

        version, = util.unpack_le_uint32_from(header)

        import xevan_hash

        if version == 4:
            return xevan_hash.getPoWHash(header[:80])
        else:
            return xevan_hash.getPoWHash(header)

    @classmethod
    def electrum_header(cls, header, height):
        h = super().electrum_header(header, height)
        if h['version'] > 1:
            h['nAccumulatorCheckpoint'] = hash_to_hex_str(header[80:])
        return h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.