From 75d5643c76944f51a2f6e90f7f49b89da13b00e6 Mon Sep 17 00:00:00 2001 From: mroxso <24775431+mroxso@users.noreply.github.com> Date: Sun, 17 Mar 2024 20:38:16 +0100 Subject: [PATCH] add API section to readme.md (#135) --- readme.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/readme.md b/readme.md index 1811bcbc..fdcbd2b8 100755 --- a/readme.md +++ b/readme.md @@ -77,3 +77,35 @@ The bitaxetool requires a config.cvs preloaded file and the appropiate firmware. ``` bitaxetool --config ./config.cvs --firmware ./esp-miner-factory-v2.0.3.bin ``` + +## API +Bitaxe provides an API to expose actions and information. + +For more details take a look at `main/http_server/http_server.c`. + +Things that can be done are: + + - Get System Info + - Get Swarm Info + - Update Swarm + - Swarm Options + - System Restart Action + - Update System Settings Action + - System Options + - Update OTA Firmware + - Update OTA WWW + - WebSocket + +Some API examples in curl: + ```bash + # Get system information + curl http://YOUR-BITAXE-IP/api/system/info + ``` + ```bash + # Get swarm information + curl http://YOUR-BITAXE-IP/api/swarm/info + ``` + ```bash + # System restart action + curl -X POST http://YOUR-BITAXE-IP/api/system/restart + ``` \ No newline at end of file