Dashd as Windows service (NSSM)

Matthew Millar

New Member
Jan 10, 2018
1
0
1
32
I'm attempting to run Dashd as a Windows service using NSSM. I'm happy to consider an alternative service wrapper if the issue resides with NSSM, but I've chosen it due to it's comprehensive features and use it for wrapping other services.

The issue I'm experiencing is that the blockchain isn't being saved when the service is stopped, as demonstrated below:

(1) Service start and stop (getblockchaininfo)
17:39 10/01/2018 - 17:57 10/01/2018
"chain": "main", "chain": "main"
"blocks": 800955, "blocks": 801959
"headers": 801653, "headers": 801959

(2) Service start and stop (getblockchaininfo)
18:07:00 & 18:07:30 10/01/2018
"chain": "main", "chain": "main"
"blocks": 801653, "blocks": 801965
"headers": 801653, "headers": 801965

(3) Service start and stop (getblockchaininfo)
18:11:30 & 18:12:00 10/01/2018
"chain": "main", "chain": "main"
"blocks": 801776, "blocks": 801967
"headers": 801967, "headers": 801967

I've attached the service registry as a txt.
The significant values are:
Application=C:\Program Files\Cryptocurrencies\Dashcore\daemon\dashd.exe
AppParameters=-datadir=C:\ProgramData\Cryptocurrencies\Dash
AppStopMethodSkip=10
AppStopMethodConsole=60000
AppStopMethodThreads=60000

The AppStopMethod values are explained under "Service Shutdown" at:
nssm.cc/usage#shutdown

I anticipate two possible solutions, either
(a) a service wrapper which sends a terminate request to dashd which causes a clean stop before exiting, or
(b) a service wrapper which executes a command before stopping (i.e 'dash-cli.exe -rpcuser=user -rpcpassword=password stop')

Many thanks
 

Attachments

Last edited:

UdjinM6

Official Dash Dev
Core Developer
Dash Core Team
May 20, 2014
3,639
3,537
1,183
Blockchain is flushed on a regular basis or on a clean shutdown. By a clean shutdown I mean a "dash-cli stop" way btw, not a "kill" one or other ways of termination.

PS. if it's a local instance you don't need rpcuser/rpcpassword in dash.conf/rpc command btw