Hash Auger features a built-in web service to host an HTTP-based API that can be accessed via nearly all modern web browsers as well as utilized by third party applications and services. Since this web service is hosted on the user's mining rig, it will be available as long as the Hash Auger software is running. It also provides users with more control over how their data is used since a centralized server is not used for hosting - avoiding many privacy concerns.

However, users will most likely have to configure their network settings in order to access this web service from outside their network. This process involves enabling the API server in Hash Auger, creating a firewall exception and allowing access to the port from outside the local network if a router is being used.

The list of API commands currently supported by Hash Auger is described in the API Reference document included within the software's installation directory.

Enabling the API Server

The web server is disabled by default in Hash Auger, but can be easily enabled by going to the Setup => Config => API tab. To enable the API, simply checkmark the Enable Web API setting.

Hash Auger will default the API port number to 4059 to avoid conflicts with other software running on the rig. For added security and privacy, users can specify a different port number. One exception is that a block of port numbers starting at 4060 are reserved for communicating with the mining processes via their APIs. Hash Auger assigns each process a unique port number based on the GPU number beginning at 4060. For example, on a rig with five GPUs, Hash Auger will assign ports 4060 through 4064 to the mining processes. The software will show a warning if the user enters a reserved port number.

In addition to the ports that Hash Auger reserves for the mining processes, users should also verify that any port number they wish to use is not already being used by the operating system or other software running on that rig. Wikipedia has a list of well known port assignments.

Once the web service has been enabled and the port number set, users can verify that it is running by accessing the API via either localhost:<port> or 127.0.0.1:<port> in a web browser. For example, http://localhost:4059/api/summary/all should return a list of GPU work summaries when the default port number is used. When using a custom port number, replace 4059 with the appropriate port.

Creating a Firewall Exception

If Windows Defender or another firewall application is running on the mining rig, it will most likely prevent any requests from outside the computer from accessing the port. It is not necessary or recommended to completely disable the firewall. Rather, an inbound port rule should be created to allow other computers to access the API.

To create such a rule with Windows Defender, search for Windows Defender with Advanced Security, start that application and then follow these steps:

  1. Click on Inbound Rules in the leftmost column.
  2. In the Actions column on the right, click on New Rule…. A new rule wizard window will appear.
  3. For the Rule Type, select Custom and press Next.
  4. Browse to the location of the HashAuger.exe file in the This program path option on the Program tab and press Next.
  5. On the Protocols and Ports tab, provide access to the API port by:
    • Select TCP as the Protocol type.
    • Select Specific Ports as the Local Port
    • Enter the same port number as defined as the API port in Hash Auger
    • Leave All Ports as the Remote Port unless you prefer to place further restrictions on access to this particular port.
    • Press the Next button.
  6. If you are comfortable adjusting network configuration settings, the Scope tab can be used to limit access to the port to specific IP addresses, such as your router or certain remote devices. Press Next when finished to move to the next tab.
  7. On the Action tab, make sure Allow the Connection is selected. Since most mining rigs do not have the necessary SSL certificates, it is not recommended to require secure connections. Press Next.
  8. The Profile tab may be used to limit the use of this rule to certain network configurations. For most mining rigs, leaving all three profile types selected is okay. Press Next.
  9. On the last tab, provide a unique Name such as Hash Auger API and maybe a Description before pressing Finish.
  10. After the wizard window closes, find the new rule using its name in the list of inbound rules in the center column. Verify that the rule is enabled.
  11. To verify that the firewall software is allowing access to the API, use a web browser another computer or other device on the same network to connect to the port. Use the mining rig's IP address and the appropriate port number as the web address in the command: http://<ipaddress>:<port>/api/summary/all to verify that current work stats are returned. The current IP address of the mining rig can be found by typing ipconfig in a Command Prompt window. A Firewall Rule will not permit access across a router; only perform this test using a device on the same network as the mining rig.

Accessing the API Through a Router

Similar to firewall software, routers will also block access to ports that have not been explicitly opened. The router's configuration software will have to be used to enable port forwarding or NAT transversal to allow access to the API port on the mining rig. While various brands of routers have different configuration software, the process is similar for most routers:

  1. In the router's configuration utility, look for port forwarding or a similarly named option.
  2. Create a rule that will direct incoming requests on one port and forward them to the Hash Auger API port on the mining rig's IP address. While the port number set on the router does not have to match the port number assigned to the API on the mining rig, most users find it more convenient to use the same port number in both cases. As an example, port 4059 on the router would be opened as the external port and all incoming traffic would be forwarded to port 4059 on the mining rig's IP address.
  3. The router may reboot itself to reflect the new settings once they are saved.

Since routers act as a single access point for all devices on a network, it is important to note that the router's IP address and not the mining rig's IP address must be used when accessing the API from outside the network. Therefore to test the connection from outside the network, the url would be: http://<router IP>:<port>/api/summary/all.

General URL Rule Summary

  • On the mining rig: http://localhost:<port>/api/<command> or http://127.0.0.1:<port>/api/<command> - no firewall or router configuration settings are required.
  • On the local network: http://<rig IP address>:<port>/api/<command> - if firewall software is running, an inbound rule will need to be defined, but the router configuration does not need to be modified.
  • From outside a router: http://<router IP address>:<port>/api/<command> - port forwarding on the router must be configured to redirect incoming traffic to the mining rig's IP address. If firewall software is running on the mining rig, an inbound rule must also be defined to allow the redirected traffic to access that port on the rig.