Bitcoin Forum

Bitcoin => Mining support => Topic started by: Morescratch on March 08, 2019, 04:04:06 AM



Title: Access denied to 'switchpool' command on Antminer
Post by: Morescratch on March 08, 2019, 04:04:06 AM
I am trying to switch the pool on a machine that I am connecting to through a VPN. I ssh'd in and edited my bmminer.conf file as follows and rebooted:

Code:
{
"bitmain-freq": "550",
"multi-version": "1",
"bitmain-use-vil": true,
"api-groups": "A:stats:pools:devs:summary:version:noncenum",
"pools": [{"url": "antpool.com:3333", "user": ... }],
"api-listen": true,
"api-allow": "A:0/0,W:0/0",
"api-network": true
}

I understand that W:0/0 will allow any machine with network access privileged commands. That's okay for now. I've read that R:0/0 might be safer. In any case, I just want to get it to work so that I can write a script to set privileged access to all of my machines. Any help would be appreciated.


Title: Re: Access denied to 'switchpool' command on Antminer
Post by: BitMaxz on March 08, 2019, 10:00:53 PM
It's not recommended to use W:0/0 settings because you're enabled access online and it can scan through the internet.
Please read this post https://bitcointalk.org/index.php?topic=1567692.msg15833403#msg15833403

Also, there is someone studying this code so I'd like to add it here to get some better idea about this from here https://bitcointalk.org/index.php?topic=4564890.0

Have you heard about Awesomeminer? Why not use this software instead to configure your API access and enable some API privileges? It is much safer than manually editing the bmminer.conf for API access.


Title: Re: Access denied to 'switchpool' command on Antminer
Post by: Morescratch on March 09, 2019, 04:28:39 PM
Thanks for those references. I understand that W:0/0 is not recommended but at this point I just need to get something to work. I am familiar with Awesome Miner but I want to build my own software and I plan on open sourcing it. In any case, I did exactly what was recommended in the last resource you pointed me to and I still get denied access to the switchpool command. Very frustrating. Any other ideas? Again I am accessing the network where the miner resides through a VPN. My software so far works perfectly with this setup. It's just the switchpool command that is giving me issues. Here is my bmminer.conf:

Code:
{
"bitmain-freq": "550",
"multi-version": "1",
"bitmain-use-vil": true,
"api-groups": "A:stats:pools:devs:summary:version:noncenum",
"pools": [{...}],
"api-listen": true,
"api-allow": "W:0/0, W:*",
"api-network": true
}


Title: Re: Access denied to 'switchpool' command on Antminer
Post by: Biffa on March 09, 2019, 04:55:16 PM
Don't you have to add the switchpool command in the api-groups?

e.g.:

"api-groups" : "A:stats:pools:devs:summary:version:switchpool,P:switchpool",


Title: Re: Access denied to 'switchpool' command on Antminer
Post by: Morescratch on March 18, 2019, 02:52:05 AM
Can someone explain to me what I need to do to enable privileged mode? I understand that in privileged mode I can access "privileged" commands via the API. I have changed my "api-allow" to "A:0/0,W:* but when I send the privileged command to check if it's enabled I get STATUS 'E' which indicates that's it's not privileged. What is going on?


Title: Re: Access denied to 'switchpool' command on Antminer
Post by: kano on April 02, 2019, 05:52:52 AM
You are in the A group so it never gets to the W group.
So you are limited to what A can do.

Read the API-README I wrote :P

As for "W:*"
That is an error - bitmain got it wrong and have never fixed it for almost 3 years - it is ignored.