The Ximix build system can package Ximix Nodes into a executable jar (Java ARchive) file that can install the necessary files onto a target system. Executable Jar files were chosen because:
The executable installer can deploy one or more nodes. A multi-node installer could be used for testing purposes where the nodes of a test network can be deployed on one host where a single node installer could be digitally signed and used as part of a production deployment across different hosts.
The gradle Gradle build system is used to produce the executable ximix installer jar and for unix systems (Linux, OSX) there is a shell script to coordinate the process, for non unix systems the steps are discussed Installer below in Installer Creation on Windows.
Before producing an installer you will need to know the file system locations of:
These files will be included in the installer for later deployment onto the target systems.
Find and change into ('cd') into the location where the Ximix project is located on your local file system, the following subsections assume the commands are entered via the command line, cmd or shell.
The basic format for using this script is:
./scripts/mkinstaller.sh <mixnet.xml> <node1.xml> <node2.xml> ... <nodeX.xml>
Where the arguments:
If more than one <node.xml> file is specified then multiple nodes will be created when the executable jar is run.
./scripts/mkinstaller.sh mixnet.xml node1.xml node2.xml
For example:
./scripts/mkinstaller.sh demo/conf/mixnet.xml demo/conf/node1/node1.xml demo/conf/node2/node2.xml
./scripts/mkinstaller.sh mixnet.xml node1.xml
For example:
./scripts/mkinstaller.sh demo/conf/mixnet.xml demo/conf/node1/node1.xml
Note: For a single node installer only define one node configuration, For example: node1.xml.
When the script runs it will produce output similar to:
:clean :common:clean :console:clean :crypto:clean :demo:clean //Output removed for brevity.// :make_node_installer Making Node Installer Jar Installer Jar: /Users/mw/crypto-workshop/ximix/repo/ximix/build/installers/XimixNodeInstaller.jar The installer jar can run using: java -jar /Users/mw/crypto-workshop/ximix/repo/ximix/build/installers/XimixNodeInstaller.jar BUILD SUCCESSFUL
After producing the executable installer jar, the script the will report the location of the jar file.
This jar file is self contained and may be copied and run where Java 1.7 is installed.
Make sure you have installed Gradle on your system..
From a “Command Prompt (cmd)” prompt, change (cd) into the location where the Ximix project source is located on your system then type the following:
gradle clean jar make_node_installer -Dnetwork=mixnet.xml,node1.xml,node2.xml
Where '-Dnetwork=' defines the configuration files to include in the installer.
The list of configuration files must be comma separated and any spaces must be escaped.
If this is successful it will produce output similar to that shown for installer creation on Unix hosts with the output location shown specifically for the Windows file system.
To run the installer executable jar file type the following from a command prompt, you will need to know the location of the XimixNodeInstaller.jar.
To install:
java -jar <path to>/XimixNodeInstaller.jar. <code> For example: <code> java -jar /Users/mw/crypto-workshop/ximix/repo/ximix/build/installers/XimixNodeInstaller.jar
You will be prompted for the installation directory.
Enter Install Directory [/private/tmp/ximix] >/tmp/ximix/ Confirm Install to '/private/tmp/ximix' Yes or [No] >y
The installer will unpack the nodes into the “Install Directory”.
Unpacking: /tmp/ximix/ximix/bin/run.sh Unpacking: /tmp/ximix/ximix/libs/bcpkix-jdk15on-150b03.jar Unpacking: /tmp/ximix/ximix/libs/bcprov-jdk15on-150b03.jar Unpacking: /tmp/ximix/ximix/libs/common.jar Unpacking: /tmp/ximix/ximix/libs/crypto.jar Unpacking: /tmp/ximix/ximix/libs/mixnet.jar Unpacking: /tmp/ximix/ximix/libs/node.jar Unpacking: /tmp/ximix/ximix/node1/conf/mixnet.xml Unpacking: /tmp/ximix/ximix/node1/conf/node.xml Unpacking: /tmp/ximix/ximix/node2/conf/mixnet.xml Unpacking: /tmp/ximix/ximix/node2/conf/node.xml Setting posix file permissions on 'ximix/bin/run.sh' to 'rwxr-xr-x' Finished..
Congratulations installation is completed.
At this point you have successfully created and installed a Ximix Executable Jar Installer.