INDEX

Develop mode

Sandboxed applications and spacelets (apps) can be run in so called develop mode (a.k.a. debug mode). In develop mode the apps are not running inside sandboxed environment and the possibilities for debugging them are better. App developers are free to come up with their own debugging methods. As an example and suggestion, output lines to the console to see the applications execution in real time (no more studying log files).

The develop mode can be utilized quite flexibly but for it to work the app must be installed on the edge. So, before trying the develop mode build the basic framework of the applications and install it to the edge. The develop mode installation is a lightweight installation where the sandboxed environment (Docker container) is not created for the app. It is therefore not possible to run develop mode installation like the normal installation can be (e.g. with the spm run command). Install app to the edge in develop mode like this.

spm install develop <package>

After the application is installed it can be run in develop mode simply by changing to the applications directory and by starting the application manually.

There are no other prerequisite for the develop mode. The applications can be developed as they would be developed for the sandboxed environment.

After all the conditions listed above are met, try to start the application in the develop mode. Below is an example.

$ cd /var/lib/spaceify/data/sandboxed/spaceify/eventchannel/volume/application
$ node eventchannel.js

After Spaceify has initialized the application, the output to the console could be something like this. In the printout some of the lines are printed by Spaceify and some of them are printed by the app.

[i] WebSocketServer::listen() protocol: ws, subprotocol: json-rpc, hostname: null, port: 0
[i] WebSocketServer::listen() protocol: wss, subprotocol: json-rpc, hostname: null, port: 0
  LISTEN -----> spaceify.org/services/eventchannel - port: 42527, secure port: 36341
  LISTEN -----> http - port: 37994, secure port: 36901
EventChannel::start()
EventChannel::start() got provided service
EventChannel::start() rpc methods exposed
EventChannel::start() end
*** application initialized *** --- spaceify/eventchannel
[i] WebSocketServer::request(42527) protocol: ws, remoteAddress: ::ffff:172.17.0.4, remotePort:-, origin:-, id: 19030827
[i] WebSocketServer::request(36341) protocol: wss, remoteAddress: ::ffff:172.17.0.4, remotePort:-, origin:-, id: 3064669479
[i] WebSocketServer::request(42527) protocol: ws, remoteAddress: ::ffff:172.17.0.2, remotePort:-, origin:-, id: 272386892
[i] WebSocketServer::request(36341) protocol: wss, remoteAddress: ::ffff:172.17.0.2, remotePort:-, origin:-, id: 2612632193
Close
copyright © Spaceify.org 2014