Skip to content
radomir-sebek edited this page Mar 16, 2018 · 32 revisions

Usage

You can check out our video how to import the data.

Run the servers

OT node consists of two servers IPC and RPC. Run both servers a single command.

npm start

If you are having trouble in execution of this commands, than check this link and do automatic installation and setup again. There can be a problem during installation process if the Ubuntu server has small amount of RAM memory assigned (512mb for example).

Import data

In order to import data it has to be properly formatted. Further description of XML schema can be found in Data Structure Guidelines on our wiki. Sample file can also be found in installation folder of the node ( /ot-node/importers/example_v1.5.xml ).

We included and example file in the project for your reference and testing. Please take a look here for an example of XML schema.

IMPORTANT Make sure to modify example_v1.5.xml at least to set the unique data provider ID. The first part of the file contains the ID of the data provider, which is the ParticipantID. This value should be unique for each participant of the chain. During the test phase you can obtain your unique provider ID here.

To import data from the XML file into OriginTrail, send a HTTP POST request containing the XML file to the following endpoint:

http://YOUR_RPC_NODE_URL:YOUR_RPC_NODE_PORT/import

The example cURL request is:

curl -v  -F importfile=@example_v1.5.xml http://YOUR_RPC_NODE_URL:YOUR_RPC_NODE_PORT/import

Depending on the use case, it might make sense to set up a periodic import of the data into OriginTrail (i.e. a daily cronjob exporting the data from your ERP in the XML format requested, with a POST to your OT node).