2

We are trying to set up bitcore-node to work with other cryptocurrency core. Lets say that everything in core is pretty much the same like in bitcoin core so everything should work.

After resolving some problems we stuck on starting and exiting node process. It looks like this:

[2017-11-09T12:20:29.239Z] info: Using config: /Users/gitsad/GIT/bitcore-node/ourcoinNode/bitcore-node.json [2017-11-09T12:20:29.241Z] info: Using network: testnet [2017-11-09T12:20:29.242Z] info: Starting bitcoind [2017-11-09T12:20:29.244Z] info: Using bitcoin config file: /Users/gitsad/GIT/bitcore-node/ourcoinNode/data/dash.conf [2017-11-09T12:20:29.249Z] info: Starting dash process OurCoin Core server starting [2017-11-09T12:20:29.294Z] warn: Dash process unexpectedly exited with code: 0 [2017-11-09T12:20:29.295Z] warn: Restarting dash child process in 5000ms [2017-11-09T12:20:29.315Z] info: Dash Height: 0 Percentage: 0.01 [2017-11-09T12:20:29.324Z] info: Dash Daemon Ready [2017-11-09T12:20:29.325Z] info: Starting web [2017-11-09T12:20:29.369Z] info: Bitcore Node ready [2017-11-09T12:20:29.802Z] warn: ZMQ connection delay: tcp://127.0.0.1:28332 [2017-11-09T12:20:29.802Z] info: ZMQ connected to: tcp://127.0.0.1:28332

Process exits and starts again:

[2017-11-09T12:20:34.301Z] info: Using bitcoin config file: /Users/gitsad/GIT/bitcore-node/ourcoinNode/data/dash.conf . . . the same stuff

We found in lib code in bitcore-node/lib/services/bitcoind.js

self.spawn.process.once('exit', function(code) { if (!self.node.stopping) { log.warn('Bitcoin process unexpectedly exited with code:', code); log.warn('Restarting bitcoin child process in ' + self.spawnRestartTime + 'ms'); setTimeout(function() { self._spawnChildProcess(function(err) { if (err) { return self.emit('error', err); } log.warn('Bitcoin process restarted'); }); }, self.spawnRestartTime); } });

We changed it by adding return; at the end of line:

self.spawn.process.once('exit', function(code) { return;

And this resolved our problem with the restarting process.

The question is:

Where can we find the conditions on which this function checks the process and how we can change it?

Every help will be appreciated. Thanks!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.