Bitcoin Forum
November 18, 2024, 12:31:45 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin Service Wrapper - Run Bitcoind as NT Service  (Read 2429 times)
mb300sd (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1000

Drunk Posts


View Profile WWW
September 11, 2011, 06:23:30 PM
 #1

I wrote a simple wrapper program that runs bitcoind as a NT service so that you don't have to be logged on for it to be running. Useful for any web server that needs to access it, and allows it to be auto started.

Put BitcoinServiceWrapper.exe somewhere that your Local Service account has access to it. Put your bitcoin.conf in C:\Windows\ServiceProfiles\LocalService\AppData\Roaming\Bitcoin. Run BitcoinServiceWrapper.exe install and then sc start bitcoind to install the service and start it.

http://www.mediafire.com/?cyy1lqp6xo9042h

Donations welcome if you find it useful, 5BTC required if you use it commercially.

1D7FJWRzeKa4SLmTznd3JpeNU13L1ErEco
nhodges
Sr. Member
****
Offline Offline

Activity: 322
Merit: 251


View Profile
September 11, 2011, 10:06:12 PM
 #2

Why not just use instsrv.exe / srvany.exe?

mb300sd (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1000

Drunk Posts


View Profile WWW
September 11, 2011, 10:20:20 PM
 #3

I have code in OnStop() that shuts down bitcoind, and just find this to be a cleaner approach. Using this for myself and may add other bitcoin specific features if needed.

1D7FJWRzeKa4SLmTznd3JpeNU13L1ErEco
nhodges
Sr. Member
****
Offline Offline

Activity: 322
Merit: 251


View Profile
September 11, 2011, 11:09:37 PM
 #4

I thought that's the sort of functionality the combination of those two executables provide: the ability to start/stop any .exe via Windows Service controls.

mb300sd (OP)
Legendary
*
Offline Offline

Activity: 1260
Merit: 1000

Drunk Posts


View Profile WWW
September 12, 2011, 12:06:50 AM
 #5

I meant shut down as in calling bitcoind stop, rather than just killing the process. Not sure if it does anything different though.

1D7FJWRzeKa4SLmTznd3JpeNU13L1ErEco
rjk
Sr. Member
****
Offline Offline

Activity: 448
Merit: 250


1ngldh


View Profile
February 16, 2012, 11:19:22 PM
 #6

Here are some mods I made so that this could work with other coins. At the moment, it is set up for Bitcoin, Namecoin, and Litecoin. Using the included file structure, it is pretty simple to modify for other altchains, just copy one folder and then find/replace all references from Bitcoin to whatever else you want to run.

Why use this instead of instsrv/srvany? As mentioned in the previous post, srvany terminates bitcoind uncleanly, which isn't very nice. Unfortunately, bitcoind (and any variants based on it) don't seem to understand standard shutdown signals - and instead force you to send it the command "stop". That's what these service wrappers do: when you click Stop (or do "net stop bitcoind"), it sends bitcoind the command "stop", and then waits for it to exit before quitting.

Unfortunately I don't have the necessary code chops to make this work with P2Pool - it requires modifications so that you can pass arguments - however, P2Pool is OK to kill and not try any graceful termination (according to forrestv, its author). So Instsrv/Srvany work just fine with it.

The binaries have been pre-compiled for you, but I always encourage everyone to compile it themselves to be sure. It really is only 2 or 3 clicks to compile once VS 2010 is installed - instructions are in the README.txt in the archive.

http://www.mediafire.com/file/qenfz6ctvez2lkv/ServiceWrappers.7z

Code:
  File: ServiceWrappers.7z
CRC-32: 62a30307
   MD4: 11d89c5fd6895a7e1f0d706deb62ec97
   MD5: 90022cf69c804a34de99b63cd3bb80fd
 SHA-1: f0e04800699e4ccf94e4c491796ad5941d3fc292

Enjoy!

Mining Rig Extraordinaire - the Trenton BPX6806 18-slot PCIe backplane [PICS] Dead project is dead, all hail the coming of the mighty ASIC!
MasterX
Member
**
Offline Offline

Activity: 88
Merit: 10



View Profile
November 14, 2012, 08:59:08 AM
 #7

Is there a mirror for this file?
The link above seems broken.

| Donations: 1MegaXG1bd6mTEQCdAMjVzGexcYrF5LJKv |
Kiaya
Newbie
*
Offline Offline

Activity: 33
Merit: 0



View Profile
August 02, 2013, 10:56:24 AM
 #8

Anyone playing around with this, don't forget to give LocalService appropriate permissions over the Bitcoin directory.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!