MiningOS Logo
Install MiningOSMiners

Avalon

Avalon worker supports Canaan Avalon model A1346.

Prerequisites

Before installing the Avalon worker, ensure you have:

  • Node.js >= 20.0 (LTS recommended)
  • npm >= 10.0
  • git
  • Network access to your Avalon devices

Install the Avalon 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-miner-avalon) repository:

git clone https://github.com/tetherto/miningos-wrk-miner-avalon.git

After cloning the repository, move into its directory:

cd miningos-wrk-miner-avalon

2. Install Dependencies

Inside the miningos-wrk-miner-avalon 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. Configure the Worker

After generating the configuration files, edit the files in the config/ directory to match your environment:

  • common.json - Worker-wide settings including worker identity
  • base.thing.json - Device-specific configuration for your Avalon miners
  • facs/net.config.json - Network and RPC connection settings
  • facs/store.config.json - Hyperbee persistent storage configuration

Ensure your miner IP addresses are correctly configured and accessible from the worker machine.

5. Enable Debugging and Start the Worker

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

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

6. Start Mock Server (Development Only)

For development and testing without physical miners, use the mock server to simulate an Avalon device:

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

Mock servers are useful for testing the worker without connecting to actual mining hardware.

On this page