Bitcoin Forum

Bitcoin => Mining software (miners) => Topic started by: tuckertz1992 on July 22, 2013, 07:07:29 PM



Title: API for CGMiner
Post by: tuckertz1992 on July 22, 2013, 07:07:29 PM
Struggling to get it to work, anyone got an example .bat file or .conf file with API enabled? :'(


Title: Re: API for CGMiner
Post by: milone on July 22, 2013, 07:24:46 PM
Assuming you're trying to access the miner from the same computer and want full API privileges, the command line arguments would be:

Code:
--api-listen --api-allow W:127.0.0.1

If using a config file, add these two lines:

Code:
"api-listen" : true,
"api-allow" : "W:127.0.0.1"

You may need to add a comma at the end depending on where in your config file you place it.

If you're trying to access the miner from a different computer, give more info and I'll try to help.


Title: Re: API for CGMiner
Post by: tuckertz1992 on July 22, 2013, 07:27:35 PM
Assuming you're trying to access the miner from the same computer and want full API privileges, the command line arguments would be:

Code:
--api-listen --api-allow W:127.0.0.1

If using a config file, add these two lines:

Code:
"api-listen" : true,
"api-allow" : "W:127.0.0.1"

You may need to add a comma at the end depending on where in your config file you place it.

If you're trying to access the miner from a different computer, give more info and I'll try to help.

Please see:   https://bitcointalk.org/index.php?topic=222632.0


Title: Re: API for CGMiner
Post by: milone on July 22, 2013, 07:41:27 PM
If you're trying to host that page on a web server (that isn't the computer cgminer is running on), you'll need to

1.) Enable the API in cgminer and set it to allow connections from your web server's IP address.

2.) If you're mining computer is connected to a router, forward the port cgminer's API is using (default is 4028) to your mining computer. http://portforward.com has a lot of helpful information on how to do this and a free utility to check if the port is forwarded correctly.

3.) Set your mining computer's public IP address in that monitor page's PHP. I don't use that monitor but I'd imagine the IP is either hard-coded or is displayed in a textbox.

That page on your web server is what is connecting to cgminer, so you have to make sure it can connect to your mining computer and to cgminer. If your mining computer's public IP address changes, you'll need to update the PHP with the new IP address.



Title: Re: API for CGMiner
Post by: tuckertz1992 on July 22, 2013, 07:47:16 PM
If you're trying to host that page on a web server (that isn't the computer cgminer is running on), you'll need to

1.) Enable the API in cgminer and set it to allow connections from your web server's IP address.

2.) If you're mining computer is connected to a router, forward the port cgminer's API is using (default is 4028) to your mining computer. http://portforward.com has a lot of helpful information on how to do this and a free utility to check if the port is forwarded correctly.

3.) Set your mining computer's public IP address in that monitor page's PHP. I don't use that monitor but I'd imagine the IP is either hard-coded or is displayed in a textbox.

That page on your web server is what is connecting to cgminer, so you have to make sure it can connect to your mining computer and to cgminer. If your mining computer's public IP address changes, you'll need to update the PHP with the new IP address.



I think it may be my ports, all IP's seem to be setup okay

BT Home Hubs...


Title: Re: API for CGMiner
Post by: tuckertz1992 on July 22, 2013, 08:06:04 PM
Deffo BT Home Hub Problems, Still cant get the bloody port open! Gutted! :(