Skip to content
This repository has been archived by the owner on Jul 2, 2019. It is now read-only.

Quick Guide Setup

Vitor Silva edited this page Nov 24, 2016 · 6 revisions

From source code

NOTE: We recommend the nvm installation to use node without sudo command.

Required:

npm install -g karma-cli gulp-cli browserify

To setup the Hyperty development (starter project), make sure you have nodeJS available in your environment, perform the steps below. In case you want to use Hyperties in your Application please read this tutorial. NOTE for Windows Users: You should use "Windows PowerShell" and not the standard command line.

  1. download the latest release; NOTE: this repository is read only. Your Hyperties Source Code should be hosted somewhere else (see below step 2);

  2. run the command npm install (this may take some minutes)

  3. Create the folder that will contain your Hyperty source code Side by side with toolkit folder. We strongly recommend you to use the "official" Hyperty repository by cloning dev-hyperty. IN case you prefer to use something else, you must create a sub-folder "src" where your Hyperty source code will be stored (<foldername>/src) and a sub-folder "examples" containing demos/tests for your hyperties.

  4. run the local http-server and catalogue with npm run start:browser or npm run start:node in case you are developing Hyperties for NodeJS. A list of folders that are side by side with the toolkit folder will be presented. Select the one you have created in previous step to contain your hyperty source. You also have an mode which can start the toolkit without environment restrictions with npm run start:all

    Note:

    If you are in linux, probably you will have problems running the npm run start:browser or npm run start:node because you will need the sudo privileges, so, you can solve this problem with this command:

    sudo setcap 'cap_net_bind_service=+ep' `which node`
  5. Check the following url's to allow the certificates:

  1. Open https://localhost with your favorite browser and select your Hyperty to execute.

With docker and docker-compose

In case you already have docker installed you can use it together with docker-compose.

  1. install docker - see here

  2. install docker-compose - see here, if you are using windows or Mac OS you can install docker-toolbox, see here

  3. You can configure the service on docker-compose.yml file

    IP - by default the service run on ip 172.18.0.32 on port 443

    ENVIRONMENT VARIABLES

    ​ by default the environment variables are:

    Toolkit develoment mode - true when used in a local development environment, false when used at the backend.

      `- DEVELOPMENT=true`
    

    RUNTIME_URL - where the Runtime is loaded from

      - RUNTIME_URL=hyperty-catalogue://hysmart.rethink.ptinovacao.pt/.well-known/runtime/Runtime
    

    Domain - the domain where Message Node and Domain Registry services are hosted

      - DOMAIN=localhost
    

    Hyperty Repo - variable with the Hyperty source code repository.

      - HYPERTY_REPO=/tmp/dev-hyperty
    

    VOLUMES - define here is your dev-hyperty repository

    ../dev-hyperty:/tmp/dev-hyperty | note if you need, change only the first part of configuration;

  4. After all instalation process and configuration, go to your command line and run:

    docker-compose up hyperty-toolkit

    Usage: docker-compose up [options] [SERVICE...]
    OPTIONS:
    	-d 				   Detached mode: Run containers in the background,
                           print new container names.
  5. Some usefull commands

    docker-compose logs -f hyperty-toolkit - to see all the logs of service

    docker-compose build hyperty-toolkit - to rebuild the service

    docker images - list all images

    docker rmi <id> - remove image with ;

Clone this wiki locally