ShrouDB
Getting started

Installation

Moat is the ShrouDB server. Every engine is built into it.

Homebrew (macOS and Linux)

terminal
$ brew install shroudb/tap/shroudb-moat
$ shroudb-moat --config moat.toml

Moat reads moat.tomlfrom the current directory if you don't pass --config. You can also set the path with MOAT_CONFIG.

Docker

The shroudb/moat image on Docker Hub stores data in the /data volume. Mount your config file and tell Moat where it is:

terminal
$ docker run --rm \
    -p 8200:8200 -p 8201:8201 \
    -v "$(pwd)/moat.toml:/etc/moat/moat.toml:ro" \
    -v moat-data:/data \
    -e MOAT_CONFIG=/etc/moat/moat.toml \
    -e SHROUDB_MASTER_KEY \
    -e MOAT_ADMIN_TOKEN \
    shroudb/moat:latest

In the config, set data_dir = "/data" under [storage] and bind to 0.0.0.0 so the ports are reachable from outside the container.

docker-compose.yml
services:
  moat:
    image: shroudb/moat:latest
    ports:
      - "8200:8200"
      - "8201:8201"
    volumes:
      - ./moat.toml:/etc/moat/moat.toml:ro
      - moat-data:/data
    environment:
      MOAT_CONFIG: /etc/moat/moat.toml
      SHROUDB_MASTER_KEY_FILE: /run/secrets/shroudb_master_key
      MOAT_ADMIN_TOKEN: ${MOAT_ADMIN_TOKEN}
    secrets:
      - shroudb_master_key

secrets:
  shroudb_master_key:
    file: ./master_key

volumes:
  moat-data:

Check that it's running

terminal
$ curl -s localhost:8200/health

/healthdoesn't need a token. Every other endpoint does.

Next