{"action":"created","issue":{"url":"https://api.github.com/repos/bitpay/insight/issues/555","labels_url":"https://api.github.com/repos/bitpay/insight/issues/555/labels{/name}","comments_url":"https://api.github.com/repos/bitpay/insight/issues/555/comments","events_url":"https://api.github.com/repos/bitpay/insight/issues/555/events","html_url":"https://github.com/bitpay/insight/issues/555","id":44093569,"number":555,"title":"Minerals (X11 POW/POS) crashing Insight at synchronization","user":{"login":"AkiraTakizawa","id":8864848,"avatar_url":"https://avatars.githubusercontent.com/u/8864848?v=3","gravatar_id":"","url":"https://api.github.com/users/AkiraTakizawa","html_url":"https://github.com/AkiraTakizawa","followers_url":"https://api.github.com/users/AkiraTakizawa/followers","following_url":"https://api.github.com/users/AkiraTakizawa/following{/other_user}","gists_url":"https://api.github.com/users/AkiraTakizawa/gists{/gist_id}","starred_url":"https://api.github.com/users/AkiraTakizawa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AkiraTakizawa/subscriptions","organizations_url":"https://api.github.com/users/AkiraTakizawa/orgs","repos_url":"https://api.github.com/users/AkiraTakizawa/repos","events_url":"https://api.github.com/users/AkiraTakizawa/events{/privacy}","received_events_url":"https://api.github.com/users/AkiraTakizawa/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2014-09-26T18:42:11Z","updated_at":"2015-11-18T01:02:22Z","closed_at":"2015-05-18T15:37:53Z","body":"Hello\r\n\r\nI've been trying in vain to get a insight up & running for an altcoin called Minerals. It's a regular X11 POW/POS crypto. Using your original release at first, I noticed that it does not support POS transactions. SDCDev made the required modifications for that, saving a lot of work. I forked his release and started modifying things here & there to make it suitable for Minerals (no commits yet).\r\n\r\nUnfortunately for me, it's not working as expected. The settings in the API's networks.js are correct and reflect the settings for Minerals.\r\n\r\nWhen firing up insight the first time with `INSIGHT_NETWORK=livenet npm start`, it reads the genesisblock from blk0001.dat, but halts on a transaction that doesn't exist, right away:\r\n\r\n`info: starting...`\r\n`insight server listening on port 3000 in development mode`\r\n`info: Seeking file to:00000c639b0fbf250ba63c6ef2952dbb44bb1051324a27383b8a56fb833d8137`\r\n`        FOUND Starting Block!`\r\n`info: Got 0 blocks in current DB, out of 458999 block at bitcoind`\r\n`info: bitcoind dataDir configured...importing blocks from .dat files`\r\n`info: First file index: 0`\r\n`info: Starting from:  00000c639b0fbf250ba63c6ef2952dbb44bb1051324a27383b8a56fb833d8137`\r\n`info: status: [0%]`\r\n`Reading Blockfile /home/akira/.Minerals/blk0001.dat [236 MB]`\r\n`{ '0': '0 of 1 peers connected' }`\r\n`{ '0': 'connecting to 127.0.0.1:33442' }`\r\n`{ '0': '[127.0.0.1:33442] Sending message version (99 bytes)' }`\r\n`error: NEED_SYNC Ignoring block with non existing` `prev:25e695d4b9ecfbbdde3320bafdf5cb9eb24cb232527bbabd8642a1d1a783d91d`\r\n`[historic_sync] ABORTED with error: NEED_SYNC Ignoring block with non existing` `prev:25e695d4b9ecfbbdde3320bafdf5cb9eb24cb232527bbabd8642a1d1a783d91d`\r\n`{ '0': '[127.0.0.1:33442] Recieved 148 bytes of data:' }`\r\n`{ '0': '... a1a0a2a376657273696f6e0000000000640000007bf2b1d66dea000001000000000000...' }`\r\n`{ '0': '[127.0.0.1:33442] Received message version (100 bytes)' }`\r\n`{ '0': '[127.0.0.1:33442] Sending message verack (0 bytes)' }`\r\n`{ '0': '[127.0.0.1:33442] Received message verack (0 bytes)' }`\r\n`{ '0': 'connected to 127.0.0.1:33442' }`\r\n`[p2p_sync] Connected to 1 peer`\r\n`{ '0': '1 of 1 peers connected' }`\r\n`{ '0': '1 of 1 peers connected' }`\r\n\r\nWhen I go to /api/sync in confirms the error: `{\"status\":\"error\",\"blockChainHeight\":458999,\"syncPercentage\":\"0.000\",\"height\":0,\"error\":\"NEED_SYNC Ignoring block with non existing prev:25e695d4b9ecfbbdde3320bafdf5cb9eb24cb232527bbabd8642a1d1a783d91d\",\"type\":\"from .dat Files\",\"startTs\":1411718866793,\"endTs\":null}`\r\n\r\nI do not know where this 25e695d4b9ecfbbdde3320bafdf5cb9eb24cb232527bbabd8642a1d1a783d91d comes from, but it definitely does not exist. I also think it's highly unlikely that it even comes from the blockchain, or that this is some kind of obscure hidden transaction.\r\n\r\nThus, there is nothing left for me to do but kill the process.\r\nWhen restarting it, with a fictive location for the blk0001.dat to avoid loading from file, it crashes as well:\r\n\r\n`info: starting...`\r\n`insight server listening on port 3000 in development mode`\r\n`info: Previous TIP is now orphan. Back to:undefined`\r\n\r\n`/home/akira/insight/node_modules/insight-bitcore-api/lib/BlockDb.js:119`\r\n`      throw new Error('unable to get info for block:'+ hash);`\r\n`            ^`\r\n`Error: unable to get info for`\r\n` block:29e63cc1679a47f2623404b2be13e8302f3e301ae51166d56bae186e2d325c42`\r\n`    at /home/akira/insight/node_modules/insight-bitcore-api/lib/BlockDb.js:119:13`\r\n`    at /home/akira/insight/node_modules/insight-bitcore-api/lib/BlockDb.js:280:30`\r\n`    at /home/akira/insight/node_modules/insight-bitcore-api/lib/Rpc.js:98:40`\r\n`    at IncomingMessage.<anonymous> (/home/akira/insight/node_modules/insight-bitcore-api/node_modules/bitcore/lib/RpcClient.js:203:7)`\r\n`    at IncomingMessage.EventEmitter.emit (events.js:117:20)`\r\n`    at _stream_readable.js:920:16`\r\n`    at process._tickCallback (node.js:415:13)`\r\n`npm ERR! weird error 8`\r\n`npm WARN This failure might be due to the use of legacy binary \"node\"`\r\n`npm WARN For further explanations, please read`\r\n`/usr/share/doc/nodejs/README.Debian`\r\n` `\r\n`npm ERR! not ok code 0`\r\n\r\nBlock 29e63cc1679a47f2623404b2be13e8302f3e301ae51166d56bae186e2d325c42 doesn't exist either.\r\n\r\nOn the other hand, when I disable its means to read the blockfile, forcing it to use RPC to sync, everything goes fine on the initial synchronization of what Mineralsd already downloaded:\r\n\r\n`info: status: [100%]`\r\n`Done Syncing { status: 'finished',`\r\n`  blockChainHeight: 10241,`\r\n`  syncPercentage: '100.000',`\r\n`  height: 10241,`\r\n`  syncTipHash: undefined,`\r\n`  error: null,`\r\n`  type: 'from RPC calls',`\r\n`  startTs: 1411754805592,`\r\n`  endTs: 1411755139384 }`\r\n`info: status: [100%]`\r\n\r\nFor testing, I tried the following situations:\r\n* ^C to kill the npm while having loaded a few blocks: Insight resumes as if nothing happened when started\r\n* Disconnected the internet `sudo ifdown eth1` to stop the Minerals daemon from getting new blocks after I had 100% synchronized (of ~400k blocks):  you can kill and restart Insight at will: it keeps running as expected.\r\n* Reconnect the internet, so that it can continue loading, it crashes:\r\n\r\n`## Retrying storeTipBlock with: 23398e684f0b1df2d1021b7b32c215f9445bdd23b623638d15f0981fa1f457f5`\r\n`## Storing a block already. Delaying storeTipBlock with:23398e684f0b1df2d1021b7b32c215f9445bdd23b623638d15f0981fa1f457f5`\r\n`## Retrying storeTipBlock with: 14e129f15c49bb6c206b0d8057c82d63696bdeb1a9ddb758b73209d83a0b3862`\r\n`## Storing a block already. Delaying storeTipBlock with:14e129f15c49bb6c206b0d8057c82d63696bdeb1a9ddb758b73209d83a0b3862`\r\n`## Retrying storeTipBlock with: 5cd02652427e7274755c6ebb36a9e0d4072cb35af99405456c011a24b934dd84`\r\n`GET /status 200 169ms`\r\n`[p2p_sync] Orphan block received. Triggering sync`\r\n`GET /css/main.min.css 304 57ms`\r\n`GET /js/vendors.min.js 304 35ms`\r\n`GET /js/angularjs-all.min.js 304 39ms`\r\n`GET /js/main.min.js 304 40ms`\r\n`## Retrying storeTipBlock with: 6f03e555dee08f7c31e5bceda6aa7202a428c62858591588cd3a3cc26d77ec0a`\r\n`[p2p_sync] Orphan block received. Triggering sync`\r\n`error: ## Wont start to sync while status is starting`\r\n`[p2p_sync] Done resync.`\r\n`info: Previous TIP is now orphan. Back to:undefined`\r\n`## Retrying storeTipBlock with: 5da9af2126d7c0ebcdb1c8d8b1739513b54d6c3d89e527e0580b55bdc02f6a53`\r\n` `\r\n`/home/akira/insight/node_modules/insight-bitcore-api/lib/BlockDb.js:119`\r\n`      throw new Error('unable to get info for block:'+ hash);`\r\n`            ^`\r\n`Error: unable to get info for block:beeafac7a8b9697246665251215fda6c22d2410dc2cd82004e6ef2c462f3f431`\r\n`    at /home/akira/insight/node_modules/insight-bitcore-api/lib/BlockDb.js:119:13`\r\n`    at /home/akira/insight/node_modules/insight-bitcore-api/lib/BlockDb.js:280:30`\r\n`    at /home/akira/insight/node_modules/insight-bitcore-api/lib/Rpc.js:98:40`\r\n`    at IncomingMessage.<anonymous> (/home/akira/insight/node_modules/insight-bitcore-api/node_modules/bitcore/lib/RpcClient.js:203:7)`\r\n`    at IncomingMessage.EventEmitter.emit (events.js:117:20)`\r\n`    at _stream_readable.js:920:16`\r\n`    at process._tickCallback (node.js:415:13)`\r\n`npm ERR! weird error 8`\r\n`npm WARN This failure might be due to the use of legacy binary \"node\"`\r\n`npm WARN For further explanations, please read`\r\n`/usr/share/doc/nodejs/README.Debian`\r\n` `\r\n`npm ERR! not ok code 0`\r\n\r\n* ^C to kill npm and restart it to sync, like in the first situation above: crash on a transaction/block:\r\n\r\nI tried with different blk0001.dat snapshots I made over time, they all result in the same.\r\nA copy of the latest copy of block chain file is available here should you need it: https://dl.dropboxusercontent.com/u/2780744/blk0001.tar.xz (141 MB) It's from a few hours ago.\r\n\r\nAs far as I can see, Darkcoin's fork doesn't work either. Is there something specific I didn't pay attention to? SDCDev's fork is for a Scrypt POW/POS coin. Is there a difference in the way a blockchain is stored, depending on the currencies algorithm? bitcoin-abe seems to accept anything, but python is so resource hungry I can't host it myself on a modest server.\r\n\r\nDoes this require a (sub-)component to be thoroughly rewritten/redesigned to support X11?\r\n\r\nThank you in advance for your time reading this."},"comment":{"url":"https://api.github.com/repos/bitpay/insight/issues/comments/157563368","html_url":"https://github.com/bitpay/insight/issues/555#issuecomment-157563368","issue_url":"https://api.github.com/repos/bitpay/insight/issues/555","id":157563368,"user":{"login":"justinvforvendetta","id":8443713,"avatar_url":"https://avatars.githubusercontent.com/u/8443713?v=3","gravatar_id":"","url":"https://api.github.com/users/justinvforvendetta","html_url":"https://github.com/justinvforvendetta","followers_url":"https://api.github.com/users/justinvforvendetta/followers","following_url":"https://api.github.com/users/justinvforvendetta/following{/other_user}","gists_url":"https://api.github.com/users/justinvforvendetta/gists{/gist_id}","starred_url":"https://api.github.com/users/justinvforvendetta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justinvforvendetta/subscriptions","organizations_url":"https://api.github.com/users/justinvforvendetta/orgs","repos_url":"https://api.github.com/users/justinvforvendetta/repos","events_url":"https://api.github.com/users/justinvforvendetta/events{/privacy}","received_events_url":"https://api.github.com/users/justinvforvendetta/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T01:02:22Z","updated_at":"2015-11-18T01:02:22Z","body":"@neurocis after alot of tinkering i got it working.. its live at http://darkchain.link\r\n"}}