MiningOS Logo
Install MiningOS

Electricity Base

Electricity base is generic worker to fetch and store electricity data.

Install Electricity Base Worker

1. Clone the Repository

Use the same working directory for all the workers.

Inside your working directory, run the following command to clone the (miningos-wrk-electricity-base) repository:

git clone https://github.com/tetherto/miningos-wrk-electricity-base.git

After cloning the repository, move into its directory:

cd miningos-wrk-electricity-base

2. Install Dependencies

Inside the miningos-wrk-electricity-base directory, run the following command to install dependencies using npm:

npm ci

3. Generate Configuration Files

Next, run the following script to scan the config/ directory, copy each .example file into an active configuration file by removing the .example suffix.

sh setup-config.sh

4. Enable Debugging and Start the Worker

You can now start the worker by running the following commands:

DEBUG="miningos:*" pm2 -s start worker.js --name 'electricity-1' --  --wtype wrk-electricity-base --env development --rack rack-1

5. Start a Mock Server

You can use the following commands to start a mock server:

DEBUG="miningos:*" pm2 -s start mock/server.js --name 'mock-electricity-1' -- --env development --port 8000

On this page