installation - nsip/n3 GitHub Wiki

Installation

Components

A functioning n3 environment neeeds 2 software compnents in order to run succeessfully:

  • the n3w executable - created by nsip
  • a running instance of nats-streaming-server - created by synadia; http://nats.io

Both these components, and a few other optional helper components are bundled as part of the offical download packages from this repository.

Prebuilt Binaries

This is the easiest way to get an n3 installation up and running.

You'll find zip files containing all of the n3 components for Winows, Mac and Linux platforms here.

Extract the zip file to a directory of your choice, and then to create an n3 node open a console and start the components in the following order from the command-line, first:

nats-streaming-server

n3dir $> ./nats-streaming-server

this will start an instance of the nats stremaing server, which the n3 node can then connect to.

The nats-streaming-server communicates with n3 over tcp, and so does not necessarily have to be run in the same location as the n3 services, we just bundle them all together for convenience.

The nats-streaming-server can be installed as a service on your operating system if required, or launched from any directory/folder of your choice.

It is necessary that the server and clients (n3) have access to port 4222 on your system.

n3w

Second, in another commnad-line start the n3 node itself:

n3dir $> ./n3w

this starts the n3 web server which allows you to:

  • create data-exchange contexts
  • publish data to n3 contexts
  • query data from n3 contexts

When n3w starts up it will present api endpoints on the following ports:

http://localhost:1323/admin/newdemocontext - for creating contexts
http://localhost:1323/publish - to add data to a context
http://localhost:1323/graphql - GraphQL query endpoint to query data in a context

the n3w application also hosts a number of demo apps at the following locations, these are optional:

http://localhost:1323/mm1/ - mulit-model1 demo
http://localhost:8002/ - lesson planner tool demo
http://localhost:8003/ - daybook demo applicaiton
http://localhost:1323/mm2/ - multi-model2 demo

(see the main repo readme for details of these demos)

There are a number of other applications included in the distribution:

load

The load tool is a simple binary that can be used to publish data into an n3 node.

load is simply invoked from the command-line:

n3dir $> ./load

curl is the most typical non-programmatic way to send data to an n3w node, but for systems that don't have access to curl the load tool will create contexts and publish json data to the node.

in the default installation the load tool is driven by an input file which can be found in:

[your n3 folder]\sample_data\index.csv

running the load applicaiton, by default, will create a demo context and load all of the sample data-sets included in the download into it.

dc-curriculum-service

This executable is used only by the DigitalClassroom lesson-planner demo, it provides the web-seach capability for that application. This service only needs to be running if you want to use the lesson-planner application.

Building from Source

To build from source you will need a golang development environment on your machine. Follow the instructions for your operating system here: https://golang.org/doc/install.

If you want to include the various demonstration applications in the build you will also need to have node/npm installed to build the javascript web applicaitons. To install node/npm for your platform follow the instructions here: https://nodejs.org/en/download/

Build a full distribution

First you can build from this repository by running the build script which will create a full distribution in the /build folder

invoke the build script:

n3dir $> ./build.sh

and all binaries and support files will be created in the /build folder.