Happy Setup

Happy is only supported on Linux due to its strong dependence on Linux network namespaces.

Install

  1. Install required libraries:
    sudo apt-get install python-setuptools bridge-utils python-lockfile python-psutil make
  2. Clone the repository:
    git clone https://github.com/openweave/happy.git
    
  3. Install Happy:
    cd happy
    make
    
    The make command performs two tasks:
    1. Creates a Happy python package at /usr/local/lib/python2.7/dist-packages
    2. Copies Happy shell scripts to /usr/local/bin
  4. Validate the installation by running a Happy command:
    happy-state
    
    State Name:  happy
    
    NETWORKS   Name         Type   State                                     Prefixes
    
    NODES      Name    Interface    Type                                          IPs
    

Weave support

Happy supports Weave via OpenWeave, which requires an OpenWeave build and some additional configuration. The quickest way to integrate OpenWeave with Happy is to build the standalone application.

  1. Install the build toolchain and all dependencies required for OpenWeave:
    sudo apt-get update
    sudo apt-get install -y autotools-dev build-essential git lcov /
                         libdbus-1-dev libglib2.0-dev libssl-dev /
                         libudev-dev python2.7 python-software-properties
    sudo apt-get install -y --force-yes gcc-arm-none-eabi
    sudo apt-get update -qq
  2. Clone the OpenWeave repository:
    git clone https://github.com/openweave/openweave-core.git
    
  3. Build the standalone OpenWeave application:
    cd <path-to-openweave-core>
    make -f Makefile-Standalone
    
  4. Set the Weave path in the Happy configuration:
    happy-configuration weave_path <path-to-openweave-core>/build/x86_64-unknown-linux-gnu/src/test-apps
    
  5. Update the $PATH environment variable so it knows where to find Happy-related binaries for Weave:
    export PATH=$PATH:<path-to-openweave-core>/src/test-apps/happy/bin
    
  6. Test the configuration. You should be able to run Weave commands for Happy:
    weave-state
    
    State Name:  weave
    
    NODES                Name       Weave Node Id    Pairing Code
    
    FABRIC          Fabric Id           Global Prefix
    

Uninstall

  1. Ensure all virtual nodes and networks are deleted:
    happy-state-delete
  2. Uninstall Happy:
    cd <path-to-happy>
    make uninstall
  3. Delete any other remaining Happy files:
    rm -f ~/.happy_state.json
    rm -f ~/.happy_conf.json
    rm -f ~/.happy_state.json.lock
    cd /usr/local/lib/python2.7/dist-packages
    rm -f happy*

If you use an advanced feature like parallel states, each state should be individually deleted. See Uninstall with parallel states for more information.