Not able to auto start bitcore


(xorro) #1

After using this command as provided here https://bitcore.io/guides/upstart-daemon
sudo cp /home/admin/.nvm/versions/node/v4.4.4/lib/node_modules/bitcore/etc/init/bitcored.conf /etc/init/

i am not able to start bitcored as system startup

and if i try to start is manually with service bitcored start it gives me this error

start: Rejected send message, 1 matched rules; type=“method_call”, sender=":1.5" (uid=1000 pid=2914 comm="") interface=“com.ubuntu.Upstart0_6.Job” member=“Start” error name="(unset)" requested_reply=“0” destination=“com.ubuntu.Upstart” (uid=0 pid=1 comm="")

Another thing is if i start bitcored manually with just (bitcored) every time it gives me this warning also

[2016-05-15T14:01:58.829Z] warn: Bitcoind does not have our tip (00000000000000000261d646ba2e0eb3a223fe063d21c362b893152d3a483868). Bitcoind may have crashed and needs to catch up.
[2016-05-15T14:01:58.829Z] warn: Retrying in 60 seconds.
and after all this if i am able to run it then i am not able to test bitcoin wallet service (bws) in copay as mentioned here https://bitcore.io/guides/wallet-service/
It gives me error on copay app that network connection error

After copy bitcored.conf for auto startup i tried to start bitcored and got this.

admin@ns361377:~$ bitcored
[2016-05-15T14:01:33.043Z] info: Starting bitcoind
[2016-05-15T14:01:57.937Z] info: Bitcoin Daemon Ready
[2016-05-15T14:01:57.938Z] info: Starting db
[2016-05-15T14:01:58.829Z] warn: Bitcoind does not have our tip (00000000000000000261d646ba2e0eb3a223fe063d21c362b893152d3a483868). Bitcoind may have crashed and needs to catch up.
[2016-05-15T14:01:58.829Z] warn: Retrying in 60 seconds.
[2016-05-15T14:02:52.876Z] info: Bitcoin Height: 411874 Percentage: 99.99745178222656
[2016-05-15T14:03:42.150Z] info: Bitcoin Database Ready
[2016-05-15T14:03:42.151Z] info: Starting address
[2016-05-15T14:03:42.163Z] error: uncaught exception: [TypeError: Cannot read property ‘batch’ of null]
[2016-05-15T14:03:42.167Z] error: TypeError: Cannot read property ‘batch’ of null
at AddressService.updateMempoolIndex (/home/admin/.nvm/versions/node/v4.4.4/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/address/index.js:439:20)
at AddressService.transactionHandler (/home/admin/.nvm/versions/node/v4.4.4/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/address/index.js:272:10)
at emitOne (events.js:82:20)
at Bitcoin.emit (events.js:169:7)
at /home/admin/.nvm/versions/node/v4.4.4/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/bitcoind.js:116:12
[2016-05-15T14:03:42.167Z] info: Beginning shutdown
[2016-05-15T14:03:42.168Z] info: Stopping insight-ui (not started)
[2016-05-15T14:03:42.169Z] info: Stopping insight-api (not started)
[2016-05-15T14:03:42.169Z] info: Stopping web (not started)
[2016-05-15T14:03:42.169Z] info: Stopping address
[2016-05-15T14:03:42.169Z] error: uncaught exception: [TypeError: Cannot read property ‘close’ of null]
[2016-05-15T14:03:42.170Z] error: TypeError: Cannot read property ‘close’ of null
at AddressService.stop (/home/admin/.nvm/versions/node/v4.4.4/lib/node_modules/bitcore/node_modules/bitcore-node/lib/services/address/index.js:112:20)
at /home/admin/.nvm/versions/node/v4.4.4/lib/node_modules/bitcore/node_modules/bitcore-node/lib/node.js:262:37
at /home/admin/.nvm/versions/node/v4.4.4/lib/node_modules/bitcore/node_modules/bitcore-node/node_modules/async/lib/async.js:181:20
at iterate (/home/admin/.nvm/versions/node/v4.4.4/lib/node_modules/bitcore/node_modules/bitcore-node/node_modules/async/lib/async.js:262:13)
at Immediate. (/home/admin/.nvm/versions/node/v4.4.4/lib/node_modules/bitcore/node_modules/bitcore-node/node_modules/async/lib/async.js:274:29)
at Immediate._onImmediate (/home/admin/.nvm/versions/node/v4.4.4/lib/node_modules/bitcore/node_modules/bitcore-node/node_modules/async/lib/async.js:44:16)
at processImmediate [as _immediateCallback] (timers.js:383:17)
[2016-05-15T14:03:42.170Z] info: Beginning shutdown
[2016-05-15T14:03:42.171Z] info: Stopping insight-ui (not started)
[2016-05-15T14:03:42.171Z] info: Stopping insight-api (not started)
[2016-05-15T14:03:42.171Z] info: Stopping web (not started)
[2016-05-15T14:03:42.171Z] info: Stopping address

this is my first time i am trying to use bitcore or tried ti created bitcoin node server so any help would be appreciated Thank you


(Braydon Fuller) #2

Hi @xorro:

Looks like there are several issues posted:

  1. Unable to get upstart script working
  2. The database service is becoming out of sync with bitcoind
  3. There is a timing issue with transaction events that is leading to trying to update the mempool database before the service has fully started.

In the next update, both 2 and 3 should be resolved. The indexes are kept in bitcoind, so they should always be in sync, and subscription to events is made while starting instead of when the service is constructed.


(Lalitpatadiya12) #3

Hello @braydon and @xorro May I know one’s I have executed a command on my cloud-like bitcored and it’ll start working but when I close my putty or console log it stop working, is their any way we execute the bitcored command/script and it’ll working and working.