added bad board util files, and fixed imports in README.md
This commit is contained in:
20
README.md
20
README.md
@@ -46,7 +46,7 @@ A basic script to find all miners on the network and get the hashrate from them
|
||||
```python
|
||||
import asyncio
|
||||
from network import MinerNetwork
|
||||
from tools.cfg_util import safe_parse_api_data
|
||||
from tools.cfg_util.func.parse_data import safe_parse_api_data
|
||||
|
||||
|
||||
async def get_hashrate():
|
||||
@@ -82,7 +82,7 @@ You can also create your own miner without scanning if you know the IP:
|
||||
import asyncio
|
||||
import ipaddress
|
||||
from miners.miner_factory import MinerFactory
|
||||
from tools.cfg_util import safe_parse_api_data
|
||||
from tools.cfg_util.func.parse_data import safe_parse_api_data
|
||||
|
||||
|
||||
async def get_miner_hashrate(ip: str):
|
||||
@@ -109,13 +109,13 @@ Or generate a miner directly without the factory:
|
||||
|
||||
```python
|
||||
import asyncio
|
||||
from miners.bosminer import BOSminer
|
||||
from tools.cfg_util import safe_parse_api_data
|
||||
from miners.bosminer import BOSMiner
|
||||
from tools.cfg_util.func.parse_data import safe_parse_api_data
|
||||
|
||||
|
||||
async def get_miner_hashrate(ip: str):
|
||||
# Create a BOSminer miner object
|
||||
miner = BOSminer(ip)
|
||||
miner = BOSMiner(ip)
|
||||
# Get the API data
|
||||
summary = await miner.api.summary()
|
||||
# safe_parse_api_data parses the data from a miner API
|
||||
@@ -134,7 +134,7 @@ Or finally, just get the API directly:
|
||||
```python
|
||||
import asyncio
|
||||
from API.bosminer import BOSMinerAPI
|
||||
from tools.cfg_util import safe_parse_api_data
|
||||
from tools.cfg_util.func.parse_data import safe_parse_api_data
|
||||
|
||||
|
||||
async def get_miner_hashrate(ip: str):
|
||||
@@ -163,7 +163,7 @@ Now that you know that, lets move on to some common API functions that you might
|
||||
import asyncio
|
||||
import ipaddress
|
||||
from miners.miner_factory import MinerFactory
|
||||
from tools.cfg_util import safe_parse_api_data
|
||||
from tools.cfg_util.func.parse_data import safe_parse_api_data
|
||||
|
||||
|
||||
async def get_miner_pool_data(ip: str):
|
||||
@@ -202,7 +202,7 @@ A pretty good example of really trying to make this robust is in ```cfg_util.fun
|
||||
import asyncio
|
||||
import ipaddress
|
||||
from miners.miner_factory import MinerFactory
|
||||
from tools.cfg_util import safe_parse_api_data
|
||||
from tools.cfg_util.func.parse_data import safe_parse_api_data
|
||||
|
||||
|
||||
async def get_miner_temperature_data(ip: str):
|
||||
@@ -232,7 +232,7 @@ How about data on the power usage of the miner? This one only works for Whatsmi
|
||||
import asyncio
|
||||
import ipaddress
|
||||
from miners.miner_factory import MinerFactory
|
||||
from tools.cfg_util import safe_parse_api_data
|
||||
from tools.cfg_util.func.parse_data import safe_parse_api_data
|
||||
|
||||
|
||||
async def get_miner_power_data(ip: str):
|
||||
@@ -271,7 +271,7 @@ How about we get the current pool user and hashrate in 1 command?
|
||||
import asyncio
|
||||
import ipaddress
|
||||
from miners.miner_factory import MinerFactory
|
||||
from tools.cfg_util import safe_parse_api_data
|
||||
from tools.cfg_util.func.parse_data import safe_parse_api_data
|
||||
|
||||
|
||||
async def get_miner_hashrate_and_pool(ip: str):
|
||||
|
||||
4
board_util.py
Normal file
4
board_util.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from tools.bad_board_util import main
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
29
make_board_tool_exe.py
Normal file
29
make_board_tool_exe.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""
|
||||
Make a build of the board tool.
|
||||
|
||||
Usage: make_board_tool_exe.py build
|
||||
|
||||
The build will show up in the build directory.
|
||||
"""
|
||||
import datetime
|
||||
import sys
|
||||
import os
|
||||
from cx_Freeze import setup, Executable
|
||||
|
||||
base = None
|
||||
if sys.platform == "win32":
|
||||
base = "Win32GUI"
|
||||
|
||||
version = datetime.datetime.now()
|
||||
version = version.strftime("%y.%m.%d")
|
||||
print(version)
|
||||
|
||||
|
||||
setup(name="UpstreamBoardUtil.exe",
|
||||
version=version,
|
||||
description="Upstream Data Board Utility Build",
|
||||
options={"build_exe": {"build_exe": f"{os.getcwd()}\\build\\board_util\\UpstreamBoardUtil-{version}-{sys.platform}\\"
|
||||
},
|
||||
},
|
||||
executables=[Executable("board_util.py", base=base, icon="icon.ico", target_name="UpstreamBoardUtil.exe")]
|
||||
)
|
||||
Reference in New Issue
Block a user