Installation

As a policy expert, you will write policies and then manage them in the node's brane-chk-service.

To do the former, you need a development environment for the reasoner backend you will be using. See the Installing the eFLINT Interpreter-section to find out how to setup a local environment for eFLINT.

For the latter, you can choose between the Policy Reasoner GUI, a visual interface, or branectl, a command-line interface. Installing either of these is explained in Installing management tools-section.

Installing the eFLINT Interpreter

To develop and test your policies, it is recommended to have an offline environment available where you can iteratively test your policies as you construct them.

The most mature eFLINT interpreter is the Haskell implementation. This version is up-to-date with the most recent eFLINT edition, and supports a human-friendly REPL to examine and change a knowledge base for testing purposes.

To install it, download and install Haskell as described in the README of the project. In short, open a terminal and run:

# On Ubuntu
apt-get install cabal-install ghc
cabal update

Once installed, clone the repository with the interpreter and build it with cabal:

git clone https://gitlab.com/eflint/haskell-implementation ./eflint
cd eflint
cabal configure
cabal build
cabal install

After completion, you should be able to run the interactive eFLINT prompt by running:

eflint-repl

Use eflint-repl --help to see more options, or type :help when you are in the REPL.

Also consider adding syntax highlighting for your favourite code editor. There are syntax highlighters for Visual Studio Code and Sublime.

Installing management tools

To manage the local Brane node, you need to use a tool that can interface with the reasoner and push/pull policies, change the active policy and test drive your changes. Currently, there are two tools available that can do this:

  1. The official Policy Reasoner GUI, which provides a visual interface; and
  2. The Brane CTL management tool, which provides a terminal interface.

Installing the first is recommended in most cases, except when you're in need of a quick way to manage them (e.g., in scenarios where the system administrator also takes the role of the policy expert) or are more comfortable with terminals in general.

The Policy Reasoner GUI

The most up-to-date instructions for installing the policy reasoner GUI are described here. Below follows a summary for convenience.

First, clone the repository to your machine using Git:

git clone https://github.com/epi-project/policy-reasoner-gui && cd ./policy-reasoner-gui

Then, you can either install the GUI natively or in a Docker container.

For the former, install Rust (rustup is usually the easiest) and NPM. Then, open two terminals in the repository directory, and run

cd client
npx parcel

in one to launch the HTML client, and

cargo run

in the other to launch the client's backend.


For the latter, install Docker (macOS, Ubuntu, Debian or Arch Linux) (don't forget to enable sudoless access if you're on Linux). Then, run:

docker compose up -d

to build & run both the client and the client's backend.

The branectl management tool

To install the management tool, you can download the binary from the repository or compile it from scratch.

To download, you simply go to the release and download the branectl binary of your choice. There are options to download it for Linux (branectl-linux-x86_64), Intel Macs (branectl-darwin-x86_64) or M1/M2/M3 Macs (branectl-darwin-aarch64).

To compile the binary yourself, install GCC's gcc and g++, CMake and Rust (rustup is usually the easiest) first if you haven't already. Then, clone the repository and run the make.py script:

git clone https://github.com/epi-project/brane && cd ./brane
./make.py ctl

The resulting binary can be found under target/release/branectl.

Either way, it's nice if you add the binary to your PATH to make executing it easier. To do so, you can copy it to /usr/local/bin on Linux or macOS:

sudo cp <BINARY_PATH> /usr/local/bin/branectl

If you can execute branectl --help without problems, you know the installation succeeded.

Next

Now that you have the management client of your choice installed, move to the next chapter to learn how to use it.

You can also consult chapters on how to write eFLINT policies, if that's the language of your node, or else how to write new backends.