Skip to content

6.3.2 How to deploy manually?

1. Copy release files to /opt/cpu_gpu_sentry/

After build process, a release can be found here in project root: _build/prod/rel/cpu_gpu_sentry.

To avoid permission to overclock/undervolt/, using root is prefered.

2. Run test script

export CPU_GPU_SENTRY_INSTALLATION_PATH=/opt/cpu_gpu_sentry
export MININIG_RIG_COMMANDER_API_URL=http://192.168.0.103:4000/api/v1
export API_CODE=changeme
export MINING_RIG_MONITOR_SERVER_NAME=mrm.hexalink.xyz

/opt/cpu_gpu_sentry/bin/cpu_gpu_sentry start

MINING_RIG_MONITOR_SERVER_NAME is optional if mining rig monitor is using homebrew Certified Authority.

This is an output example:

root@cpu-gpu-sentry-1:/opt# /opt/cpu_gpu_sentry/bin/cpu_gpu_sentry start
17:41:36.946 [info] [CpuGpuSentry.EventStash] PID:<0.932.0> Started
17:41:36.946 [info] [CpuGpuSentry.TemporaryMiningPlaybookStash] PID:<0.933.0> Started
17:41:36.946 [info] [CpuGpuSentry.MiningPlaybookStash] PID:<0.934.0> Started
17:41:36.946 [info] [MainWorkflow] Started
17:41:36.946 [info] [CpuGpuSentry.LogStash] Started
17:41:36.946 [info] [CpuGpuSentry.LogUpdater] Started
17:41:36.946 [info] [CpuGpuSentry.LogSender] Started
17:41:37.947 [info] [Workflow.SetupWrapperScript] Skip making miner_software_directory
17:41:37.947 [info] [Workflow.SetupWrapperScript] Skip writing wrapper.sh
17:41:37.990 [info] [Workflow.SendMachineSpecs] Send machine specs to http://192.168.0.103:4000/api/v1/cpu_gpu_miners/specs
17:41:38.992 [info] [Workflow.FetchMiningPlaybookList] Mining playbook list fetched

3. Create environment file /etc/cpu_gpu_sentry/cpu_gpu_sentry.env

CPU_GPU_SENTRY_INSTALLATION_PATH=/opt/cpu_gpu_sentry
MININIG_RIG_COMMANDER_API_URL=http://192.168.0.103:4000/api/v1
API_CODE=changeme

4. Create systemd file /etc/systemd/system/cpu_gpu_sentry.service

[Unit]
Description=CPU/GPU Sentry
After=network.target

[Service]
WorkingDirectory=/opt/cpu_gpu_sentry
EnvironmentFile=/etc/cpu_gpu_sentry/cpu_gpu_sentry.env
ExecStart=/opt/cpu_gpu_sentry/bin/cpu_gpu_sentry start
ExecStop=/opt/cpu_gpu_sentry/bin/cpu_gpu_sentry stop
User=root
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Then, run:

  • systemctl daemon-reload

5. Start systemd service named cpu_gpu_sentry

systemctl enable --now cpu_gpu_sentry

6. To view log

journalctl -f -u cpu_gpu_sentry