kaspa-miner
is a command-line tool for mining Kaspa cryptocurrency. It provides functionalities to connect to the Kaspa network, participate in mining activities, and manage mining operations. This document provides a comprehensive guide on configuring, managing, and interacting with the kaspa-miner
binary within the GridRustyKaspa project.
- Configuration
- Running Kaspa Miner
- Interacting with Kaspa Miner
- Logs and Monitoring
- Troubleshooting
- Appendix
The kaspa-miner
binary can be configured using command-line arguments or a configuration file. Below is an example configuration file:
network:
address: "http://localhost:16110"
username: "yourusername"
password: "yourpassword"
miner:
data-dir: "/path/to/miner/data"
log-level: "info"
gpu:
enable: true
type: "cuda" # or "opencl"
device: 0
- network: Configuration for the Kaspa network.
- address: The address of the Kaspa node's RPC server.
- username: Username for RPC authentication.
- password: Password for RPC authentication.
- miner: Configuration for the miner.
- data-dir: Directory to store miner data.
- log-level: Sets the logging level (
debug
,info
,warn
,error
).
- gpu: GPU mining configuration.
- enable: Enable or disable GPU mining.
- type: Type of GPU to use (
cuda
oropencl
). - device: GPU device index.
To start kaspa-miner
, use the following command:
kaspa-miner --config /path/to/kaspa-miner-config.yaml
Alternatively, if you are using Zinit for process management, you can start the miner using the Zinit configuration file (kaspa-miner.yaml
):
exec: /usr/local/bin/kaspa-miner --config /etc/kaspa-miner/kaspa-miner-config.yaml
log: stdout
Start the service using Zinit:
zinit start kaspa-miner
To stop kaspa-miner
, use the following command:
zinit stop kaspa-miner
To restart kaspa-miner
, use the following command:
zinit restart kaspa-miner
kaspa-miner
provides a command-line interface for managing the mining operations. Below are some useful commands:
-
Check version:
kaspa-miner --version
-
Start in foreground:
kaspa-miner --config /path/to/kaspa-miner-config.yaml
-
Display help:
kaspa-miner --help
-
Create a new configuration file:
kaspa-miner config --create --output /path/to/kaspa-miner-config.yaml
In addition to the CLI, kaspa-miner
can interact with the Kaspa node via API endpoints. Here are some key endpoints:
-
Get Mining Status:
curl -u yourusername:yourpassword http://localhost:16110/api/v1/miner/status
-
Submit Mining Result:
curl -u yourusername:yourpassword -X POST -H "Content-Type: application/json" -d '{"result":"miningresult"}' http://localhost:16110/api/v1/miner/submit
Refer to the API documentation for a complete list of available endpoints and their usage.
Logs are essential for monitoring the status and activities of the kaspa-miner
. By default, logs are output to stdout
. You can redirect logs to a file by configuring the log
option in the Zinit configuration file:
log:
path: "/var/log/kaspa-miner.log"
level: "info"
To view the logs:
tail -f /var/log/kaspa-miner.log
Here are some common issues and solutions for kaspa-miner
:
- Miner not starting: Check the configuration file for errors and ensure all required fields are set correctly.
- Connection issues: Verify network settings and ensure the miner has access to the Kaspa node's RPC server.
- RPC authentication errors: Ensure the
username
andpassword
in the RPC configuration match those used in your API requests. - GPU not detected: Ensure the correct GPU drivers are installed and the
gpu
configuration in the configuration file is correct.
-
Check mining status:
kaspa-miner status --config /path/to/kaspa-miner-config.yaml
-
Submit mining result:
kaspa-miner submit --result miningresult --config /path/to/kaspa-miner-config.yaml
Refer to the kaspa-miner
documentation for a detailed list of all configuration options and their descriptions.