Closed seanjmcm closed 3 years ago
Which coin are you trying to sync?
Also, how do you know a few hundred blocks were processed if you cannot see them? Do you get an error msg when trying to run the blockchain sync manually from the terminal (cd /path/to/explorer && /usr/bin/nodejs scripts/sync.js index update
)?
Hi
Sorry for the delay. I called the coin cryptcoin -- https://www.cryptcoin.digital/
I did a Udemy course and managed to get the core and wallet working fine. I discovered that the commands in crontab were not executed and when I ran manually it seemed to sync.
cd ~/explorer && node scripts/sync.js index update > /dev/null 2>&1
cd ~/explorer && node scripts/sync.js market > /dev/null 2>&1
cd ~/explorer && node scripts/peers.js > /dev/null 2>&1
Unfortunately on closer inspection, it didn't work properly.
You can see at the above it works ok to block 602 but then skips ahead to 2713.
When I attempt to run the command you gave I get the following:
sean@server2:~/cryptcoin/src$ cd ~/explorer && /usr/bin/nodejs scripts/sync.js index update
-bash: /usr/bin/nodejs: No such file or directory
sean@server2:~/explorer$ sudo find / -name nodejs
/snap/google-cloud-sdk/187/platform/ext-runtime/nodejs
/snap/google-cloud-sdk/186/platform/ext-runtime/nodejs
sean@server2:~/explorer$ cd ~/explorer && /snap/google-cloud-sdk/187/platform/ext-runtime/nodejs scripts/sync.js index update
-bash: /snap/google-cloud-sdk/187/platform/ext-runtime/nodejs: Is a directory
On the same server I get:
@server2:~/cryptcoin/src$ ./cryptcoin-cli getinfo
{
"version": 140200,
"protocolversion": 70015,
"walletversion": 130000,
"balance": 0.00000000,
"blocks": 7694,
"timeoffset": 0,
"connections": 3,
"proxy": "",
"difficulty": 0.0002441371325370145,
"testnet": false,
"keypoololdest": 1623972580,
"keypoolsize": 100,
"paytxfee": 0.00000000,
"relayfee": 0.00100000,
"errors": ""
}
Any pointers you could give would be really helpful as would prefer to debug rather than reinstall in case it happens again.
After deleting index.pid and running node scripts/sync.js index reindex
it gets as far as 2193 and then gives the following:
2192: 0e4770a6987f63c5b25e86d9bdb9ced1dd6103154b3ea0274b3da0e039213491
2193: 685b3a314d2d692a5690fe30399666a08f9030d2559aa88b2e5800ffc09f4d37
/home/XXXX/explorer/node_modules/bluebird/js/release/async.js:49
fn = function () { throw arg; };
^
TypeError: Cannot read property 'length' of undefined
at /home/XXXX/explorer/lib/explorer.js:557:43
at /home/XXXX/explorer/lib/explorer.js:207:16
at Client.<anonymous> (/home/XXXX/explorer/lib/explorer.js:27:16)
at Client.tryCatcher (/home/XXXX/explorer/node_modules/bluebird/js/release/util.js:16:23)
at Promise.successAdapter (/home/XXXX/explorer/node_modules/bluebird/js/release/nodeify.js:23:30)
at Promise._settlePromise (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:601:21)
at Promise._settlePromise0 (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:729:18)
at Promise._fulfill (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:673:18)
at Promise._resolveCallback (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:466:57)
at Promise._settlePromiseFromHandler (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:559:17)
at Promise._settlePromise (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:729:18)
at Promise._fulfill (/home/XXXX/explorer/node_modules/bluebird/js/release/promise.js:673:18)
at Request._callback (/home/XXXX/explorer/node_modules/bluebird/js/release/nodeback.js:45:21)
at Request.self.callback (/home/XXXX/explorer/node_modules/request/request.js:185:22)
at Request.emit (events.js:215:7)
at Request.<anonymous> (/home/XXXX/explorer/node_modules/request/request.js:1154:10)
at Request.emit (events.js:210:5)
at IncomingMessage.<anonymous> (/home/XXXX/explorer/node_modules/request/request.js:1076:12)
at Object.onceWrapper (events.js:299:28)
Sorry for all this I haven't been working in linux environments for a while. Seems like I'm getting closer...
rename nodejs to node for /usr/bin/node "which node"
@seanjmcm
You're definitely right about there. The last issue you posted about length is a common issues with these altcoins and iquidus. My guess is you have non-standard txes in block 2193/2194.
Line 557 is telling you that your vout is empty which is not standard for a transaction (you should have inputs and outputs).
I'll have to update this comment with the respected issue that has a workaround, but the workaround is not a "solution", it just won't fail at that point.
(Not sure what c4pt000 comment is for, it's unrelated to your issue)
Sorry for the slow reply.
In the end, I deleted the blockchain on the server and ran node scripts/sync.js index update
or possibly reindex
. It went past the problem block seems to be working fine apart from the crontab. (but that's another story). I'm going to close the issue now as resolved.
TLDR
Deleted blockchain in .crytpcoin/blocks folder and resynced explorer
There's a few hundred blocks processed but explorer isn't seeing those blocks at all.
I'm running using pm2.
The error log is empty and npm-out.log shows the following:
Any ideas why it is not connecting to the blockchain and not reporting any errors?