mirror of
https://github.com/xmrig/xmrig.git
synced 2026-01-22 14:32:54 -05:00
What I did Repository rules / exclusions I didn’t find repo-specific spelling tooling already in place (no existing codespell config). Given this is a C/C++ repo with vendored sources, I treated src/3rdparty/** as third-party and excluded it from typo fixing (and encoded that in the new .codespellrc). Typos fixed (first-party only) Docs CHANGELOG.md: perfomance -> performance doc/API.md: optionaly -> optionally, Offical -> Official doc/BENCHMARK.md: parameteres -> parameters doc/CPU.md: loosing -> losing, instuctions -> instructions doc/CHANGELOG_OLD.md: multiple obvious text typos like Breaked -> Broken, singal -> signal, previos -> previous, secons -> seconds, automaticaly -> automatically, perfomance -> performance Code comments / doc comments (safe text-only changes) src/base/crypto/sha3.cpp: Inteface -> Interface (comment banner) src/backend/opencl/cl/cn/cryptonight.cl: performe -> perform, crashs -> crashes (comments) src/backend/opencl/cl/kawpow/kawpow.cl: regsters -> registers, intial -> initial (comments) src/crypto/randomx/aes_hash.cpp: intial -> initial (comment) src/crypto/randomx/intrin_portable.h: cant -> can't (comment) src/crypto/randomx/randomx.h: intialization -> initialization (doc comment) src/crypto/cn/c_jh.c: intital -> initial (comment) src/crypto/cn/skein_port.h: varaiable -> variable (comment) src/backend/opencl/cl/cn/wolf-skein.cl: Build-in -> Built-in (comment) What I intentionally did NOT change Anything under src/3rdparty/** (vendored). A few remaining codespell hits are either: Upstream/embedded sources we excluded (groestl256.cl, jh.cl contain Projet) Potentially valid identifier/name (Carmel CPU codename) Low-risk token in codegen comments (vor inside an instruction comment) These are handled via ignore rules in .codespellrc instead of modifying code. Added: .codespellrc Created /.codespellrc with: skip entries for vendored / embedded upstream areas: ./src/3rdparty ./src/crypto/ghostrider ./src/crypto/randomx/blake2 ./src/crypto/cn/sse2neon.h ./src/backend/opencl/cl/cn/groestl256.cl ./src/backend/opencl/cl/cn/jh.cl ignore-words-list for: Carmel vor Verification codespell . --config ./.codespellrc now exits clean (exit code 0). Signed-off-by: rezky_nightky <with.rezky@gmail.com>
67 lines
2.3 KiB
Markdown
67 lines
2.3 KiB
Markdown
# HTTP API
|
|
|
|
If you want use HTTP API you need enable it (`"enabled": true,`) then choice `port` and optionally `host`. API not available if miner built without HTTP support (`-DWITH_HTTP=OFF`).
|
|
|
|
Official HTTP client for API: http://workers.xmrig.info/
|
|
|
|
Example configuration:
|
|
|
|
```json
|
|
"api": {
|
|
"id": null,
|
|
"worker-id": null,
|
|
},
|
|
"http": {
|
|
"enabled": false,
|
|
"host": "127.0.0.1",
|
|
"port": 0,
|
|
"access-token": null,
|
|
"restricted": true
|
|
}
|
|
```
|
|
|
|
#### Global API options
|
|
* **id** Miner ID, if not set created automatically.
|
|
* **worker-id** Optional worker name, if not set will be detected automatically.
|
|
|
|
#### HTTP API options,
|
|
* **enabled** Enable (`true`) or disable (`false`) HTTP API.
|
|
* **host** Host for incoming connections `http://<host>:<port>`, to allow connections from all interfaces use `0.0.0.0` (IPv4) or `::` (IPv4+IPv6).
|
|
* **port** Port for incoming connections `http://<host>:<port>`, zero port is valid option and means random port.
|
|
* **access-token** [Bearer](https://gist.github.com/xmrig/c75fdd1f8e0f3bac05500be2ab718f8e#file-api-html-L54) access token to secure access to API. Miner support this token only via `Authorization` header.
|
|
* **restricted** Use `false` to allow remote configuration.
|
|
|
|
If you prefer use command line options instead of config file, you can use options: `--api-id`, `--api-worker-id`, `--http-enabled`, `--http-host`, `--http-access-token`, `--http-port`, `--http-no-restricted`.
|
|
|
|
Versions before 2.15 was use another options for API https://github.com/xmrig/xmrig/issues/1007
|
|
|
|
## Endpoints
|
|
|
|
### GET /1/summary
|
|
|
|
Get miner summary information. [Example](api/1/summary.json).
|
|
|
|
### GET /1/threads
|
|
|
|
Get detailed information about miner threads. [Example](api/1/threads.json).
|
|
|
|
|
|
## Restricted endpoints
|
|
|
|
All API endpoints below allow access to sensitive information and remote configure miner. You should set `access-token` and allow unrestricted access (`"restricted": false`).
|
|
|
|
### GET /1/config
|
|
|
|
Get current miner configuration. [Example](api/1/config.json).
|
|
|
|
|
|
### PUT /1/config
|
|
|
|
Update current miner configuration. Common use case, get current configuration, make changes, and upload it to miner.
|
|
|
|
Curl example:
|
|
|
|
```
|
|
curl -v --data-binary @config.json -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer SECRET" http://127.0.0.1:44444/1/config
|
|
```
|