Post
Topic
Board Mining (Altcoins)
Re: miniZ v1.8y3 Equihash 144,5 125,4 192,7 210,9 150,5 BeamHash3 ProgPoW Ethash
by
miniZ
on 11/07/2021, 16:45:41 UTC
...
  • Added HTTP headers to json api.
...

How do I access stat information using the API in v1.8y3?

For older versions I could use (PowerShell based on https://miniz.ch/2018/07/28/trouble-running-miniz/#comment-138):

Code:
        $Request = '{ "id":"0", "method":"getstat" }'
        $Timeout = 5
        $Response = ""
        $Port = 4004

        Try {
            $Response = Invoke-TcpRequest "localhost" -Port $Port -Request $Request -Timeout $Timeout -ErrorAction Stop
            $Data = $Response | ConvertFrom-Json -ErrorAction Stop
        }
        Catch {
            Return $null
        }


All I get now is:

Code:
HTTP/1.0 200 OK



Hi UselessGuru,

Thank you for the feedback.

We added the headers to be more compatible, if the request is http then the answer should also be http.

Try this modification inside your Try {} response code:

Code:
Try {
  $Response = Invoke-TcpRequest "localhost" -Port $Port -Request $Request -Timeout $Timeout -ReadToEnd 1 -ErrorAction Stop
  $Data = $Response.Substring($Response.IndexOf("{")) | ConvertFrom-Json -ErrorAction Stop
}

Let us know if this solved your issue.
Cheers,
miniZ