Update README.md
This commit is contained in:
40
README.md
40
README.md
@@ -8,25 +8,28 @@
|
|||||||
[](https://github.com/UpstreamData/pyasic/blob/master/LICENSE.txt)
|
[](https://github.com/UpstreamData/pyasic/blob/master/LICENSE.txt)
|
||||||
[](https://www.codefactor.io/repository/github/upstreamdata/pyasic)
|
[](https://www.codefactor.io/repository/github/upstreamdata/pyasic)
|
||||||
## Documentation and Supported Miners
|
## Documentation and Supported Miners
|
||||||
Documentation is located on Read the Docs as [pyasic](https://pyasic.readthedocs.io/en/latest/)
|
Documentation is located on Read the Docs as [pyasic](https://pyasic.readthedocs.io/en/latest/).
|
||||||
|
|
||||||
Supported miners are listed in the docs, [here](https://pyasic.readthedocs.io/en/latest/miners/supported_types/)
|
Supported miners are listed in the docs, [here](https://pyasic.readthedocs.io/en/latest/miners/supported_types/).
|
||||||
|
|
||||||
### Installation
|
## Installation
|
||||||
You can install pyasic directly from pip with the command `pip install pyasic`
|
You can install pyasic directly from pip with the command `pip install pyasic`.
|
||||||
|
|
||||||
For those of you who aren't comfortable with code and developer tools, there are windows builds of GUI applications that use this library here -> (https://drive.google.com/drive/folders/1DjR8UOS_g0ehfiJcgmrV0FFoqFvE9akW?usp=sharing)
|
For those of you who aren't comfortable with code and developer tools, there are windows builds of GUI applications that use this library [here](https://drive.google.com/drive/folders/1DjR8UOS_g0ehfiJcgmrV0FFoqFvE9akW?usp=sharing).
|
||||||
|
|
||||||
### Developer Setup
|
## Developer Setup
|
||||||
This repo uses poetry for dependencies, which can be installed by following the guide on their website [here](https://python-poetry.org/docs/#installation).
|
This repo uses poetry for dependencies, which can be installed by following the guide on their website [here](https://python-poetry.org/docs/#installation).
|
||||||
|
|
||||||
After you have poetry installed, run `poetry install --with dev`, or `poetry install --with dev,docs` if you want to include packages required for documentation.
|
After you have poetry installed, run `poetry install --with dev`, or `poetry install --with dev,docs` if you want to include packages required for documentation.
|
||||||
|
|
||||||
Finally, initialize pre-commit hooks with `poetry run pre-commit install`.
|
Finally, initialize pre-commit hooks with `poetry run pre-commit install`.
|
||||||
|
|
||||||
### Interfacing with miners programmatically
|
### Documentation Testing
|
||||||
|
Testing the documentation can be done by running `poetry run mkdocs serve`, whcih will serve the documentation locally on port 8000.
|
||||||
|
|
||||||
There are 2 main ways to get a miner (and the functions attached to it), via scanning or via the MinerFactory.
|
## Interfacing with miners programmatically
|
||||||
|
|
||||||
|
There are 2 main ways to get a miner (and the functions attached to it), via scanning or via the `MinerFactory()`.
|
||||||
|
|
||||||
#### Scanning for miners
|
#### Scanning for miners
|
||||||
```python
|
```python
|
||||||
@@ -35,11 +38,6 @@ import sys
|
|||||||
|
|
||||||
from pyasic.network import MinerNetwork
|
from pyasic.network import MinerNetwork
|
||||||
|
|
||||||
# Fix whatsminer bug
|
|
||||||
# if the computer is windows, set the event loop policy to a WindowsSelector policy
|
|
||||||
if sys.version_info[0] == 3 and sys.version_info[1] >= 8 and sys.platform.startswith('win'):
|
|
||||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
|
||||||
|
|
||||||
|
|
||||||
# define asynchronous function to scan for miners
|
# define asynchronous function to scan for miners
|
||||||
async def scan_and_get_data():
|
async def scan_and_get_data():
|
||||||
@@ -66,7 +64,6 @@ if __name__ == "__main__":
|
|||||||
asyncio.run(scan_and_get_data())
|
asyncio.run(scan_and_get_data())
|
||||||
```
|
```
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
#### Getting a miner if you know the IP
|
#### Getting a miner if you know the IP
|
||||||
```python
|
```python
|
||||||
@@ -75,11 +72,6 @@ import sys
|
|||||||
|
|
||||||
from pyasic.miners import get_miner
|
from pyasic.miners import get_miner
|
||||||
|
|
||||||
# Fix whatsminer bug
|
|
||||||
# if the computer is windows, set the event loop policy to a WindowsSelector policy
|
|
||||||
if sys.version_info[0] == 3 and sys.version_info[1] >= 8 and sys.platform.startswith('win'):
|
|
||||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
|
||||||
|
|
||||||
|
|
||||||
# define asynchronous function to get miner and data
|
# define asynchronous function to get miner and data
|
||||||
async def get_miner_data(miner_ip: str):
|
async def get_miner_data(miner_ip: str):
|
||||||
@@ -106,11 +98,6 @@ import sys
|
|||||||
|
|
||||||
from pyasic.miners import get_miner
|
from pyasic.miners import get_miner
|
||||||
|
|
||||||
# Fix whatsminer bug
|
|
||||||
# if the computer is windows, set the event loop policy to a WindowsSelector policy
|
|
||||||
if sys.version_info[0] == 3 and sys.version_info[1] >= 8 and sys.platform.startswith('win'):
|
|
||||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
|
||||||
|
|
||||||
|
|
||||||
async def get_api_commands(miner_ip: str):
|
async def get_api_commands(miner_ip: str):
|
||||||
# Get the miner
|
# Get the miner
|
||||||
@@ -134,11 +121,6 @@ import sys
|
|||||||
|
|
||||||
from pyasic.miners import get_miner
|
from pyasic.miners import get_miner
|
||||||
|
|
||||||
# Fix whatsminer bug
|
|
||||||
# if the computer is windows, set the event loop policy to a WindowsSelector policy
|
|
||||||
if sys.version_info[0] == 3 and sys.version_info[1] >= 8 and sys.platform.startswith('win'):
|
|
||||||
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
|
|
||||||
|
|
||||||
|
|
||||||
async def get_api_commands(miner_ip: str):
|
async def get_api_commands(miner_ip: str):
|
||||||
# Get the miner
|
# Get the miner
|
||||||
|
|||||||
Reference in New Issue
Block a user