Skip to content
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
80 lines (52 sloc) 3.06 KB

Running Openchain

Deploying Openchain server can be done :ref:`through Docker <docker-deployment>`.

This document explains how to deploy Openchain directly on a machine without using docker.

Prerequisites

Install the .NET Command Line Interface . This is cross-platform and runs on Windows, Linux and OS X.

Download the project files

Download the project.json, Program.cs and config.json files from GitHub, then restore the NuGet dependencies. On Linux:

$ wget https://raw.githubusercontent.com/openchain/openchain/v0.6.2/src/Openchain/project.json
$ wget https://raw.githubusercontent.com/openchain/openchain/v0.6.2/src/Openchain/Program.cs
$ wget https://raw.githubusercontent.com/openchain/openchain/v0.6.2/src/Openchain/data/config.json -P data
$ dotnet restore

Note

On Windows, simply download the files manually using your browser, then run dotnet restore.

Run Openchain Server

Run openchain server using the following command:

$ dotnet run

Configuration

The dependencies section of the project.json file references the external providers pulled from NuGet:

By defaut, this imports the Sqlite storage engine (Openchain.Sqlite), the SQL Server storage engine (Openchain.SqlServer), the permission-based validation module (Openchain.Validation.PermissionBased), and the Blockchain anchoring module (Openchain.Anchoring.Blockchain). Update this list with the modules (and versions) you want to import.

You can then edit the data/config.json file to reference the :ref:`providers you want to use <configuration>`.

Tip

For example, if you want to use the SQLite provider as a storage engine, you will need to make sure the Openchain.Sqlite module is listed in the dependencies.

Make sure you run dotnet restore again after modifying project.json.

Note

The Openchain.Server dependency is the only one that is always required. The version of the Openchain.Server package is the version of Openchain you will be running.

Updating the target platform

The frameworks section of the project.json file lists the available target frameworks:

"frameworks": {
  "netcoreapp1.0": {},
  "net451": {}
}

By default .NET Core (cross-platform) and the .NET Framework (Windows only) are both targeted. Some providers run only on a subset of frameworks. In that case, remove the unsupported frameworks from the list to ensure the project runs.

You can’t perform that action at this time.