# Setting up the back end

This page guides you through the steps required to set up the FX Sales Motif back-end systems; including a set of [Integration Adapters,window="_blank"](../../caplin-platform/platform-architecture/putting-data-into-the-platform.md) that provide the data required by the front end.

## Summary

There are six steps in this guide for setting up the back end. Scroll down or see the links below to review the steps.

* [Installing the Deployment Framework](#installing-the-deployment-framework)
* [Setting up the Adapter Suite](#setting-up-the-adapter-suite)
* [Deploying the Adapter Suite](#deploying-the-adapter-suite)
* [Configuring the Adapter blades](#configuring-the-adapter-blades)
* [Setting up Liberator and Transformer](#setting-up-liberator-and-transformer)
* [Running the back end](#running-the-back-end)

## Prerequisites

* It is recommended that you complete the previous guide ([Setting up the front end](st-setting-up-the-front-end.md)) before continuing.
* You need a Java 7 (32-bit) JDK or better installed, with the Java binary on the system path
* The `JAVA_HOME` environment variable must be set to point to the Java Development Kit (JDK) installation directory, see [here,window="_blank"](../../caplin-platform/deployment-framework/cdf-change-server-specific-configuration.md#check-the-java-environment-settings).
* For details on Hardware and Software requirements see [here,window="_blank"](../../caplin-platform/platform-architecture/platform-hardware-and-software-requirements.md).

**<a name="zipfiles"></a>Products and services required:**

1. Deployment Framework
2. FX Integration API
3. Liberator
4. Transformer
5. CPB_RefinerService
6. CPB_PermissioningService
7. CPB_FieldEnricherService
8. Caplin Integration Suite
9. Caplin Eclipse Plugin

**Licenses required:**

* license-rttpd.conf
* license-transformer.conf

## Installing the Deployment Framework

The [Deployment Framework,window="_blank"](../../caplin-platform/deployment-framework/index.md) allows you to swiftly set up and deploy [Caplin Platform,window="_blank"](../../caplin-platform/platform-architecture/index.md) (back-end) components.

To install the Deployment Framework, see [Installing the Deployment Framework,window="_blank"](../../caplin-platform/deployment-framework/cdf-installing-the-deployment-framework.md).

**Once you’ve installed and set up the Deployment Framework...**

You will need to copy and place various back-end components in the form of zipped files, into the newly set up installation directory. Besides the Liberator and Transformer [zip files](#zipfiles), the rest contain what we refer to as [blades,window="_blank"](../../caplin-trader/4/bladerunnerjs/bladerunnerjs-about-blades-and-motifs.md). Any additional zip files supplied to you will also contain blades.

**Copy and paste the following zip files into the _\kits_ folder:**

* Liberator.zip (this is a back-end component)
* Transformer.zip (this is a back-end component)
* CPB_Refiner.zip (this is a blade)
* CPB_PermissioningService.zip (this is a blade)
* Any other additional zip files you have been supplied with

## Setting up the Adapter Suite

The Adapter Suite contains individual zip files known as kits; they contain packaged [Adapter blades,window="_blank"](../../caplin-platform/deployment-framework/cdf-blade-types.md#adapter-blade) which require unpacking and deploying using the Deployment Framework. All Caplin Blades are supplied in kit form (zipped files).

If you were supplied with an **Adapter Suite:**

1. Unzip the suite and copy the individual zip files contained into the _\kits_ directory.
2. Now **skip** the next section (Novo Adapter Suite) and go straight to [Deploying the Adapter Suite](#deploying-the-adapter-suite) (Step 3)

### Novo Adapter Suite

If you haven’t received an Adapter Suite, you can use our example Adapter Suite which consists of [Novo Adapters,window="_blank"](../../fx-professional/the-fx-integration-api.md#novodescription) (_Novo_ is simply an example namespace). There’s two ways to set this up:

#### Copy the Suite directly from the FX Integration API

You can use the _NovoAdapter.zip_ files which come supplied with the _FXIntegrationAPI.zip_:

**Import the Novo Adapter zip files:**

1. Unzip the _FXIntegrationAP.zip_ to a location of your choice
2. Find the zipped Novo adapter project for each Novo prefixed adapter folder under: _\examples\Novo&lt;Adapter_Name>Adapter\distributions_.
3. Copy each Novo adapter zip file to the _\kits_ folder in your Deployment Framework’s root directory.
4. Once complete, skip the next section (Generate the Suite using the FX Integration API) and go straight to [Deploying the Adapter Suite](#deploying-the-adapter-suite) (Step 3).

#### Generate the Suite using the FX Integration API

You can generate the Novo Adapter Suite using example code from the _FXIntegrationAPI.zip_. To do this, you’ll need to generate the following adapter blades using our Novo Adapter example projects:

* NovoCalendarAdapter
* NovoPermissioningAdapter
* NovoRatesAdapter
* NovoTradingAdapter
* NovoClientSearchAdapter

We will import the above adapter examples as Java-based Eclipse projects, and then export these projects as kits, in the form of a zip file. To do this, you’re going to need an [Eclipse IDE](https://www.eclipse.org/downloads/) installed and running.

**Here’s how to do it...**

**Import an adapter example as a Java-based project:**

1. Unzip the _FXIntegrationAPI.zip_ andcopy the contents of the _\examples_ directory to a location of your choice.
2. Run Eclipse and click File > Import > General (Drop-down folder) > Existing Projects into Workspace
3. Now import the contents you copied from step 1, which contain all the Novo Adapter examples.

   **📌 NOTE**\
   The adapter examples will already have a _.class_ and _.project_ file, and are packaged with all the required libraries.

The [Caplin Integration Suite (CIS) Toolkit,window="_blank"](../../caplin-platform/6/cis-toolkit/index.md) enables you to develop Caplin blades. With support for Eclipse integration, the CIS Eclipse Plugin makes the process even easier. You’ll need the _com.caplin.eclipse.site.zip_ (the Eclipse Plugin) file for the step below.

**Install the CIS Toolkit and the CIS Eclipse Plugin:**

1. In Eclipse, select Help > Install New Software... then click **_Add..._ **in the new dialog box that appears
2. Click **_Archive.._**. in the 'Add Repository' dialog box, then find and select the _com.caplin.eclipse.site.zip_ file
3. Give the plugin a name, e.g. 'Caplin Eclipse Plugin' and click ***_OK_ ***
4. In the 'Install' dialog box which appears next, you should now see **Caplin Platform Plugins** in the viewing area for 'Available Software'. Expand this item by clicking the small drop-down arrow on the right. Now ensure that the checkbox for **Caplin Integration Suite plugin for Eclipse** is selected.
5. Keep clicking **_Next_** to continue until you reach the 'Review Licenses' window. Accept the terms by clicking ***_'I accept...'_ **and then click *Finish.** When the install has finished click **_Yes_ **to restart Eclipse.

**Export an adapter project as a kit (zip file):**

1. Select one adapter project in Eclipse and go to File > Export, from the menu bar
2. In the 'Export' window, find and expand the 'Caplin' drop-down folder to select **Caplin Platform Blade,** then click **_Next_**
3. In the next window specify a desired location to output the blade, making sure that **Complete integration adapter blade** is selected under' Export Options'
4. Now click ***_Finish._ **This will now have generated a zip file for the adapter at the desired export location; *repeat** steps 1-4 for each adapter project
5. When you’re done, the last step is to copy all the generated zip files into the _/kits_ folder of the Deployment Framework installation directory

See [here,window="_blank"](../../caplin-platform/6/cis-toolkit/cis-export-my-blade-as-a-kit.md) for more detailed information on exporting Java-based Adapter Blade projects using the CIS Eclipse Plugin.

## Deploying the Adapter Suite

Each Adapter within an Adapter Suite is a zip file containing a Java-based adapter blade project. These zip files are packaged as kits which require unpacking (unzipping) and deployment. We will use the Deployment Framework (DFW) to deploy each kit within the Adapter Suite.

**... two simple steps!**

**Deploy all kits**

(for a Windows-based environment)

1. Run Cygwin, and navigate to the upper-most folder of the Deployment Framework directory.
2. Run the command `./dfw deploy` (this unzips each kit in the \_kits_ directory, activates the contained blade and archives the zip files. For more details on this, see [here,window="_blank"](../../caplin-platform/deployment-framework/cdf-the-deployment-framework-command-utility-dfw.md#deploy))

   **📌 NOTE**\
   You may receive a warning reminding you to update the _hosts-denfs.conf_ file in _\global_config -_ don’t worry! We will do this in the next section.

Now when you look inside the _\active_blades_ folder within your Deployment Framework’s root directory, you will see references to all kits deployed (blades and components). These referenced items are symbolic links (symlinks). Each link corresponds to a blade that has been deployed in the kits folder and is currently active. For more information on active and inactive blades, see [here,window="_blank"](../../caplin-platform/deployment-framework/cdf-active-and-inactive-blades.md).

The _\active_blades_ folder may contain additional references to other blades; additional blades come supplied with the Deployment framework package by default.

For more on this procedure, see [Deploy Platform components to the Framework,window="_blank"](../../caplin-platform/deployment-framework/cdf-deploy-platform-components-to-the-framework.md).

## Configuring the adapter blades

In this section, you’re going to tell the Deployment Framework which blades you want to run from the _/active_blades_ folder, and where to run them! You need to update the _hosts-defns.conf_ file with some new configuration; You will do this by defining a new blade host for the server machine where we will want the adapter blades to run.

**What to do...**

Define a new blade host:

1. Find the _\global_config_ folder in your DFW installation directory, and open the _hosts-defns.conf_ file
2. Look under **# Blade hosts** and remove the following lines of code:

   ```
   define DemoDataSource_PRIMARY_HOST            localhost
   define DemoDataSource_SECONDARY_HOST          localhost
   ```
3. Configure a new blade host definition for each adapter blade in the _\active_blades_ folder:

   ```
   define <ADAPTER_NAME>_PRIMARY_HOST            localhost
   ```

   For example:

   ```
   define NovoCalendarAdapter_PRIMARY_HOST       localhost
   ```

   **Important note:** Only do this for the adapter blades belonging to a supplied Adapter Suite or any adapter blades generated using the Novo Adapter examples previously (Creating an Adapter suite). Disregard any additional blades contained within the _\active_blades_ folder.

**...All done!**

The next time we start up the Deployment Framework, all new configuration defined in _hosts-defns.conf_ will be copied to a file named _hosts.conf_. **Warning**: Never directly edit or modify the contents of _hosts.conf_.

The Deployment Framework documentation contains advanced information on facilitating failover across multiple machines, configuring hostnames for multiple server machines and troubleshooting adapter blades.

* [Troubleshoot an adapter blade,window="_blank"](../../caplin-platform/deployment-framework/cdf-troubleshoot-an-adapter-blade.md)
* [Set up server failover capability,window="_blank"](../../caplin-platform/deployment-framework/cdf-set-up-server-failover-capability.md)

## Setting up Liberator and Transformer

[Liberator,window="_blank"](../../caplin-platform/liberator/index.md) is a powerful streaming server used to deliver messages and financial data across network connections and platforms. Alongside Liberator, [Transformer,window="_blank"](../../caplin-platform/transformer/index.md) provides real time data processing using a high-speed data transformation engine; enabling you to filter and modify incoming market data streamed through Liberator.

### Licensing

Without licensing Liberator and Transformer, the components will operate in a temporary evaluation mode; where both components automatically shut down after 30 minutes of operation. Set up the following licenses to remove the time-limit and fully activate Liberator and Transformer:

* license-rttpd.conf (for Liberator)
* license-transformer.conf (for Transformer)

Place both license files into your Deployment Framework installation directory under: _&lt;Framework-root>\global_config\licenses._ These license files will have been provided to you by [Caplin Support](/account/).

### Deploying both components

If you previously followed the [Installing the Deployment Framework](#installing-the-deployment-framework) and [Deploying the Adapter Suite](#deploying-the-adapter-suite) guides, you will have automatically deployed Liberator and Transformer as the `./dfw` command deploys all kits within the _\kits_ folder before archiving the unpacked kits to another location. Otherwise, see the following detailed guides on installing Liberator and Transformer which provide plenty of information, including Linux installations (disregard any steps already completed):

* [Installing Liberator,window="_blank"](../../caplin-platform/liberator/liberator-installing-liberator.md)
* [Installing Transformer,window="_blank"](../../caplin-platform/transformer/transformer-installing-transformer.md)

When you have deployed all kits and configured the _hosts-defns.conf_ file from previous steps, you can begin initiating all components and blades, see below.

## Running the back end

You are now going to use the Deployment Framework’s start and stop commands to start up Liberator, Transformer, the Adapter Blades and any additional blades contained within the _\active_blades_ folder.

**Let’s begin...**

**Start and stop all components and blades:**

1. Open Cygwin and navigate to the upper-most level of your Deployment Framework installation directory. Run the following command:

   ```
   ./dfw start
   ```

   **📌 NOTE**\
   If in a Windows-based environment, you may receive a firewall warning for rttpd.exe and transformer.exe. Allow them access to continue.

+
This command will simultaneously start- up all deployed components and blades; whenever this command is entered, any previous instances of components and
+
blades that may already be running will be shut down, and re-started. Upon execution of this command, a list of items depicting the components and blades that have been
+
activated will be displayed in the Cygwin console.
. Now access the Liberator home page and check if Liberator is running correctly by opening a Web browser and navigating to _localhost:18080._
. On the homepage, select 'View Status' under **Status**. When prompted for user log in details, enter:
+
Username `admin`
+
Password `admin`
. The Liberator’s status page should now be displayed in your browser window. Check to see if all services and their corresponding adapters are up and running.
. To shut- down all blades and components, run the following command:
+
```
./dfw stop
```

**...Finished!**

For additional information on these steps, see the [Start and stop components and blades,window="_blank"](../../caplin-platform/deployment-framework/cdf-start-and-stop-components-and-blades.md) guide. For a full list of all DFW commands see [here,window="_blank"](../../caplin-platform/deployment-framework/cdf-the-deployment-framework-command-utility-dfw.md).

Now go to [Configuring the end-to-end connection](st-configuring-the-end-to-end-connection.md).
