====== Ximix Jar Based Installers ======
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 complete process to build the jars can be examined and audited from beginning to end.
- As target systems will be running java, the platform to run the installer would be available.
- Jar files can be signed for later validation and repudiation.
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.
===== Creating an Installer ======
The gradle [[https://www.gradle.org|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.
==== Requirements ====
Before producing an installer you will need to know the file system locations of:
- The mixnet configuration file. (eg. mixnet.xml)
- The configuration files for one or more nodes this installer will deploy.( eg. node1.xml)
These files will be included in the installer for later deployment onto the target systems.
===== Installer Creation on Unix Hosts =====
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 ...
Where the arguments:
- mixnet.xml -- The configuration for the network.
- node1.xml -- Configuration for the first node.
- node2.xml -- Configuration for the second node.
If more than one file is specified then multiple nodes will be created when the executable jar is run.
=== To Create a Multiple Node Installer: ===
./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
=== To Create a Single Node Installer ===
./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.
===== Installer Creation on Windows Hosts =====
Make sure you have installed [[https://www.gradle.org| 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.
- mixnet.xml -- The configuration for the network.
- node1.xml -- Configuration for the first node.
- node2.xml -- Configuration for the second node.
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.
===== Running an Installer Executable Jar =====
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 /XimixNodeInstaller.jar.
For example:
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.
===== Installation Completed =====
At this point you have successfully created and installed a Ximix Executable Jar Installer.