Skip to content
Sava Daniel edited this page Feb 19, 2019 · 18 revisions

Table of Contents

Prerequisites

Install or update Node to version 8.x.x or newer.

Install and start a CSBWizard Node

First of all, create a local clone of the PrivateSky Github project:

git clone https://github.com/PrivateSky/privatesky
Enter into checkout folder and run the following command:
cd privatesky
npm run install
The Node version is checked and if is all good the installation process begins by downloading the required dependencies. Once the installation process has finished successfully, run the script:
For Linux:
 ./bin/virtualMq.sh [--port=8080] [--folder="../tmp"] 
For Windows:
 bin\virtualMq.bat [--port=8080] [--folder="../tmp"]

The default port that will be used is 8080 and the folder is ../tmp . Once the command is executed and the virtualMq server is running, run the following command:
For Linux:

 ./bin/csbwizard.sh [--port=8080] [--folder="../tmp"] 
For Windows:
 bin\csbwizard.bat [--port=8080] [--folder="../tmp"]

The default port that will be used is 8081 and the folder is ../tmp .

CSBWizard API

CSBWizard exposes the following API:

New transaction

Creates a new transaction and returns it's ID to be used in subsequent requests.

  • URL
/beginCSB
  • Method
POST
  • URL Params
None
  • Data Params
None
  • Success Response
    • Code:200
    • Content-Type: text/plain
    • Content: #transactionId

Add backup

Accepts an URL to a VirtualMQ server where it will send a backup of the CSB when calling build CSB endpoint.

  • URL
/addBackup/:transactionId
  • Method
POST
  • URL Params
Required:
transactionId=[alphanumeric]
  • Data Params
Required:
Content-Type: text/plain
Content: Base URL to VirtualMQ (ex: http://localhost:8080 if default settings were used)
  • Success Response
    • Code: 200 OK
    • Content: None

Attach file

Attaches a reference with specified name to the resulting CSB from current transaction.

  • URL
/attachFile/:transactionId/:fileAlias
  • Method
POST
  • URL Params
Required:
transactionId=[alphanumeric]
fileAlias=[alphanumeric]
  • Data Params
Required:
Content-Type: application/octet-stream
Content: data stream
  • Success Response
    • Code: 200 OK
    • Content: None
  • Error Response
    • Code: 409 CONFLICT
    • Reason: A file with the same #fileAlias already exists

Build CSB

Sends the created CSB to the backups provided previously and return the SEED used to encrypt it.

  • URL
/buildCSB/:transactionId/
  • Method
POST
  • URL Params
Required:
transactionId=[alphanumeric]
  • Data Params
None
  • Success Response
    • Code: 200 OK
    • Content-Type: text/plain
    • Content: #SEED
Clone this wiki locally