Closed visvirial closed 9 years ago
We prefix it with a ':' because that's how siad
accepts the flag (for better or worse). I think ideally the software would correctly accept either -P 9980
or -P :9980
, and would also be agnostic to the presence of quotes.
It looks like you forgot to update the switch statement. There is no -H
in your code, and if you pass -P
anything longer than 6 chars it'll return an error.
I'm happy to merge this once it's working
Oh, sorry. I forgot to commit some files. I updated my branch. Please review it.
Except for the comment for set_host
, this looks good.
There is an issue where passing in an invalid hostname causes the miner to hang/get stuck. I'm not sure if there's an easy fix for that.
I changed the comment for get_host()
in network.c
.
There is an issue where passing in an invalid hostname causes the miner to hang/get stuck. I'm not sure if there's an easy fix for that.
In my environment, Sia miner reports that the host name could not be resolved as follows.
$ ./sia-gpu-miner -I 20 -H @@@
Intensity set to 20
Host name set to @@@
Initializing...
Failed to get header from @@@:9980/miner/headerforwork, curl_easy_perform() failed: Couldn't resolve host name
Are you sure that siad is running?
^C
Caught kill signal, quitting...
HTTP error 0
Currently the host name of Sia daemon is pre-defined as
localhost
. If a miner want to run a multiple mining nodes that is connected to a single parent node that serves Sia daemon (siad
), one should modify the source code to point the host name (or IP address) of siad host.In this pull request, you can specify a host name of siad node by command line argument (
-H
option), which hopefully useful for miners running multiple mining nodes.Additionally, I am suggesting that you should not prefix with
:
to port number.-P :9880
should be-P 9880
which is easy to verify the validity of port number (useatoi(argv[i])
instead).