To install the MultiChain daemon ("multichaind.exe") as a windows service with AlwaysUp:
-
If you don't already have MultiChain set up, download the MultiChain zip file and extract it to a folder on your hard drive.
We extracted to "C:\MultiChain" and that folder will appear throughout this tutorial.
Please ensure that you can run MultiChain from the command line (with the appropriate runtime parameters).
If MultiChain doesn't work now, it will not magically work as a windows service later on!
-
Download and install AlwaysUp, if necessary.
-
Start AlwaysUp.
-
Select Application > Add to open the Add Application window:
-
On the General tab:
-
In the Application field, enter the full path to the MultiChain daemon executable, multichaind.exe. You will find it in your MultiChain installation directory.
Since we have installed MultiChain in C:\MultiChain, we'll enter C:\MultiChain\multichaind.exe.
-
In the Arguments field, enter your parameters to multichaind.exe.
Since we're initializing a blockchain called "chain1", we will enter "chain1 -daemon".
-
In the Name field, enter a name for this application in AlwaysUp.
We have used MultiChain but you can specify something else if you like.
-
Click over to the Logon tab and enter the user name and password of the windows account where you created the blockchain you wish to use.
-
Next, switch to the Startup tab and check the Ensure that the Windows Networking components have started box.
This informs AlwaysUp that MultiChain needs the TCP/IP networking stack to start and operate properly.
-
And finally, switch to the Extras tab. Since multichaind will be running in the background as a service and we won't be able to see its console window, let's capture its output to a file.
You can check this file if MultiChain fails to isn't functioning properly.
Check the Capture output to this log file box and enter the full path to a new file.
The log file shouldn't grow too large but feel free to check the box below to auto-trim the contents if you know otherwise.
-
We're now done configuring MultiChain to run as a windows service, so click the Save button. In a couple of seconds, an application called MultiChain will show up in the AlwaysUp window.
It is not yet running though (the state will be Stopped):
-
To start MultiChain, choose Application > Start "MultiChain". The state will transition to Running. Check the log file (configured in step 8) to confirm that startup was successful:
-
That's it! Next time your computer boots, MultiChain will start up immediately, before anyone logs on.
We encourage you to edit MultiChain in AlwaysUp and check out the many other settings that may be appropriate for your environment.
For example, boost priority to give multichaind more CPU time,
hide the console window and avoid the Interactive Services popup,
send email whenever the daemon stops, and much more.