# Getting started with damocles

This guide will walk you through how to qiuckly get started with damocles

# Preparation

  1. Install 3rd party dependencies. Please refer to instrcutions here (opens new window).

  2. Download source code.

$ git clone https://github.com/ipfs-force-community/damocles.git
  1. Compile damocles component.
$ cd damocles
$ make all

TIP

After completion, you should be able to find binaries for both damocles-worker and damocles-manager.

  1. Copy the binaries to your machine(s).

  2. Copy ./damocles-worker/create-cgroup.sh to all damocles-worker machine and execute the script under same user which you are going to run damocles-worker.

TIP

The script will generate cgroup for the user, which allows damocles-worker to allocate hardware resources accordingly.

# Mock mode

By default, starting a set of mock instance can be done by a series of commands.

# damocles-manager

For example, start damocles-manager with a dummy miner actor t010000 and schedule sealing jobs with sector size of 2KiB.

$ ./dist/bin/damocles-manager mock --miner=10000 --sector-size=2KiB

TIP

./mock/start_smgr.sh could also be used to do this.

# damocles-worker

  1. Init both sealing and permanent storage.
$ ./dist/bin/damocles-worker store sealing-init -l ./mock-tmp/store1 ./mock-tmp/store2 ./mock-tmp/store3

$ ./dist/bin/damocles-worker store file-init -l ./mock-tmp/remote

TIP

./mock/cleanup_store.sh could also be used to do this.

  1. Start damocles-worker in mock mode.
$ ./dist/bin/damocles-worker daemon -c ./damocles-worker/assets/damocles-worker.mock.toml

TIP

./mock/start_worker.sh could also be used to do this.

# Production mode

# damocles-manager

  1. Init working directories.
$ ./dist/bin/damocles-manager daemon init
  1. Configure ~/.damocles-manager/sector-manager.cfg per your use case.

TIP

For more details on what each configuration does, please refer to this document (opens new window).

  1. Start damocles-manager.
$ ./dist/bin/damocles-manager daemon run

# damocles-worker

  1. Init sealing path for unsealed sector(s).
$ ./dist/bin/damocles-worker store sealing-init -l <dir1> <dir2> <dir3> <...>
  1. Init permanent storage path for sealed sector(s).
$ ./dist/bin/damocles-worker store file-init -l <dir1>
  1. Configure your damocles-worker according to your planning of CPU cores, numa, zone and etc for each sealing phases.

TIP

For more details on what each configuration does, please refer to this document (opens new window).

  1. Start damocles-worker.
$ /path/to/damocles-worker daemon -c /path/to/damocles-worker.toml
Last Updated: 10/25/2023, 2:23:19 AM