Quick Start

This quick start section will help you get going with a HAT microserver and start testing the API in a matter of minutes. There are a few ways to get a running HAT and the approach will depend on your skills level, available time and the actual purpose.

Get a sandbox HAT from HATLAB

HAT sandbox cluster is currently being run and maintained by HATLAB - an academic innovation hub for developing and testing new applications and experimental features on the HATDeX Platform. Anyone can get access to the testing environment by filling out developer registration form and being issued a HAT.

The registration process is quick and straightforward. Normally, you should be able to get up and running with a new HAT in a matter of minutes. During the process, you will be asked to provide a username.

Username page in the sandbox signup sequence

Provided username is then used to create individual HAT's subdomain in the sandbox cluster. In this case, testing HAT can be accessed under the lovetesting.hubat.net domain.

That's it! You have live sandbox HAT running in the cloud. Now is a good time to start testing the API (docs here) or getting deeper understanding of the technology through the available guides.

Run locally from source code

HAT is an open-source project with the full project codebase available on GitHub. With a bit of technical knowledge, it should be relatively easy to follow the steps below to setup the project and run it on a localhost (if it's not, please let us know how we can improve!).

Before starting make sure that the following pre-requisites are installed:

  • Java SDK 8
  • Scala Runtime 2.12
  • Scala Build Tool (SBT) 1.0
  • PostgreSQL 9.6

To launch HAT instance, follow these steps:

  1. Clone HAT repository and its submodules:

    git clone https://github.com/Hub-of-all-Things/HAT2.0.git
    cd HAT2.0
    git submodule init
    git submodule update
  2. Create the database:

    createdb testhatdb1
    createuser testhatdb1
    psql postgres -c "GRANT CREATE ON DATABASE testhatdb1 TO testhatdb1"
  3. Compile the project:

    sbt compile
  4. Add custom local domain mapping to your /etc/hosts file. This will make sure that when you go to the defined address from your machine, you will be pointed back to your own machine. E.g.:

    127.0.0.1   bobtheplumber.hat.org
  5. Run the project:

    sbt "project hat" "run -Dconfig.resource=dev.conf"
  6. Go to http://bobtheplumber.hat.org:9000

You're all set! Now is a good time to start getting a deeper understanding of the technology through the available guides.

© 2017 - 2019 HAT Data Exchange Ltd.