Bitcoin Forum
December 12, 2017, 11:34:16 AM *
News: Latest stable version of Bitcoin Core: 0.15.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1] 2 »  All
  Print  
Author Topic: Bitmain Antminer step by step how to setup Balance Mining Tutorial  (Read 12173 times)
giletto
Sr. Member
****
Offline Offline

Activity: 420


View Profile
January 02, 2014, 01:55:40 PM
 #1

Ok guys, i guess everybody know that sometime a pool with no luck have blocks with a above-average calculation time? Instead of waiting at one pool to finish this block (and lose much time=money) and instead of change the pool manual you can balance mining.

Balance Mining mean, that you can share your miner power with 3 pools (or even 2 pools if you don't want 3).

How to setup:

First setup your pool data in the miner configuration (if not already done for backup pools) for your 3 pools which you want to use. The setup is similar to the backup pool setup, but however unlike the backup setting is it not importent, which pool is pool 1, pool 2 or pool 3, so you can chose free.

After you setup your 3 pools (2 are even possible) you press safe & apply.

Next Step:

Start puTTY and start to ssh in your miner. Write your miner ip in host name, press enter. Wait for login, accept the ssh if neccessary at first time login. Login as: root, the password is standard root too, if you don't change your miner setup password, otherwise use your changed password.

Now you should see:
Code:
root@antMiner:~#

Enter this command:
Code:
vi /etc/config/cgminer
The cgminer setup will appear. Go to the line:
Code:
option more_options '--quiet'
press i, and change the line to:
Code:
option more_options '--quiet --load-balance'
Press the esc button, and enter :wq for write and quit,
Code:
root@antMiner:~#
should appear again.

Next and last step:
Enter
Code:
vi /etc/init.d/cgminer
Another big menu will appear. Scroll down with arrow down and found the line
Code:
PARAMS="$AOPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-allow $_aa --api-
Important, there are 2 line almost similar, we need to change the line which not begin with #.

Press the i button and change the line to
Code:
PARAMS="$AOPTIONS $POOL1 $POOL2 $POOL3 $_pb $_mo --api-allow $_aa --api-
Press esc button, and :wq for write and quit. Enter reboot.

Well done! Your miner share now your mining power with all pools that you provide above.

Happy mining!





▄████████████████████▄
██████████████████████
██████  ██████████████
██████  ██████████████
██████  ██████████████
██████  ██      ██████
██████  █  ████  █████
██████   ██████  █████
██████  ███████  █████
██████  ███████  █████
██████████████████████
██████████████████████
▀████████████████████▀
HERO.        The Future of Banking in Southeast Asia
  ■ Website   ■ Whitepaper   ■ Bounties   ■ Join our Slack
.    PRE-SALE
   starting soon
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1513078456
Hero Member
*
Offline Offline

Posts: 1513078456

View Profile Personal Message (Offline)

Ignore
1513078456
Reply with quote  #2

1513078456
Report to moderator
BotwinBG
Sr. Member
****
Offline Offline

Activity: 322


View Profile
January 05, 2014, 07:50:48 AM
 #2

How can I add quotas?
giletto
Sr. Member
****
Offline Offline

Activity: 420


View Profile
January 05, 2014, 08:03:39 AM
 #3

What you mean with quotas?

▄████████████████████▄
██████████████████████
██████  ██████████████
██████  ██████████████
██████  ██████████████
██████  ██      ██████
██████  █  ████  █████
██████   ██████  █████
██████  ███████  █████
██████  ███████  █████
██████████████████████
██████████████████████
▀████████████████████▀
HERO.        The Future of Banking in Southeast Asia
  ■ Website   ■ Whitepaper   ■ Bounties   ■ Join our Slack
.    PRE-SALE
   starting soon
BotwinBG
Sr. Member
****
Offline Offline

Activity: 322


View Profile
January 05, 2014, 08:27:34 AM
 #4

I mean the quotas for the load-balance as described here https://raw.github.com/ckolivas/cgminer/master/README.
giletto
Sr. Member
****
Offline Offline

Activity: 420


View Profile
January 05, 2014, 08:37:03 AM
 #5

Why you not use the description as i wrote above? This will load-balance!

▄████████████████████▄
██████████████████████
██████  ██████████████
██████  ██████████████
██████  ██████████████
██████  ██      ██████
██████  █  ████  █████
██████   ██████  █████
██████  ███████  █████
██████  ███████  █████
██████████████████████
██████████████████████
▀████████████████████▀
HERO.        The Future of Banking in Southeast Asia
  ■ Website   ■ Whitepaper   ■ Bounties   ■ Join our Slack
.    PRE-SALE
   starting soon
BotwinBG
Sr. Member
****
Offline Offline

Activity: 322


View Profile
January 05, 2014, 04:58:15 PM
 #6

Oh...alright , this :

Code:
QUOTAS

The load-balance multipool strategy works off a quota based scheduler. The
quotas handed out by default are equal, but the user is allowed to specify any
arbitrary ratio of quotas. For example, if all the quota values add up to 100,
each quota value will be a percentage, but if 2 pools are specified and pool0
is given a quota of 1 and pool1 is given a quota of 9, pool0 will get 10% of
the work and pool1 will get 90%. Quotas can be changed on the fly by the API,
and do not act retrospectively. Setting a quota to zero will effectively
disable that pool unless all other pools are disabled or dead. In that
scenario, load-balance falls back to regular failover priority-based strategy.
While a pool is dead, it loses its quota and no attempt is made to catch up
when it comes back to life.

To specify quotas on the command line, pools should be specified with a
semicolon separated --quota(or -U) entry instead of --url. Pools specified with
--url are given a nominal quota value of 1 and entries can be mixed.

For example:
--url poola:porta -u usernamea -p passa --quota "2;poolb:portb" -u usernameb -p passb
Will give poola 1/3 of the work and poolb 2/3 of the work.

Writing configuration files with quotas is likewise supported. To use the above
quotas in a configuration file they would be specified thus:

"pools" : [
        {
                "url" : "poola:porta",
                "user" : "usernamea",
                "pass" : "passa"
        },
        {
                "quota" : "2;poolb:portb",
                "user" : "usernameb",
                "pass" : "passb"
        }
]
giletto
Sr. Member
****
Offline Offline

Activity: 420


View Profile
January 05, 2014, 06:11:07 PM
 #7

Ah i got the point. Sorry mate, i can't help you how to do. I guess the syntax should be similar, my advice is, just try? If you got it, please post here. I am sure you must change in the first file, /etc/config/cgminer

▄████████████████████▄
██████████████████████
██████  ██████████████
██████  ██████████████
██████  ██████████████
██████  ██      ██████
██████  █  ████  █████
██████   ██████  █████
██████  ███████  █████
██████  ███████  █████
██████████████████████
██████████████████████
▀████████████████████▀
HERO.        The Future of Banking in Southeast Asia
  ■ Website   ■ Whitepaper   ■ Bounties   ■ Join our Slack
.    PRE-SALE
   starting soon
BotwinBG
Sr. Member
****
Offline Offline

Activity: 322


View Profile
January 06, 2014, 07:48:20 AM
 #8

Ah i got the point. Sorry mate, i can't help you how to do. I guess the syntax should be similar, my advice is, just try? If you got it, please post here. I am sure you must change in the first file, /etc/config/cgminer

Seems quite easy actually.

in /etc/config/cgminer

Code:
option pool1url '35;stratum.mining.eligius.st:3334'
        option pool2url '65;eu-stratum.btcguild.com:3333'

the example above will mine 35% on eligius and 65% on btcguild

then in /etc/init.d/cgminer , in addition to your changes , find

Code:
POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"

change to
Code:
POOL1="-U $_pool1url -O $_pool1user:$_pool1pw"
, so change -o to -U.

Repeat for POOL2 and POOL3 .

The interest to play around with quotas came from this post - https://bitcointalk.org/index.php?topic=78031.0 .
giletto
Sr. Member
****
Offline Offline

Activity: 420


View Profile
January 06, 2014, 12:13:45 PM
 #9

I read it, understand it, but don't get the point where is the advantage to equally load-balance?

If i have 1Th/s and share in balance over 3 pool, each pool get 333Gh/s, right?

Why to add this command to share with quota depend on the pool size? I mean right now, if i use load-balance and i see my 1Th/s share over 1 day almost exactly over all 3 pools. So what happen with quota? I guess my mining power will not increase, so what is the exactly advance in the quota example?

▄████████████████████▄
██████████████████████
██████  ██████████████
██████  ██████████████
██████  ██████████████
██████  ██      ██████
██████  █  ████  █████
██████   ██████  █████
██████  ███████  █████
██████  ███████  █████
██████████████████████
██████████████████████
▀████████████████████▀
HERO.        The Future of Banking in Southeast Asia
  ■ Website   ■ Whitepaper   ■ Bounties   ■ Join our Slack
.    PRE-SALE
   starting soon
BotwinBG
Sr. Member
****
Offline Offline

Activity: 322


View Profile
January 06, 2014, 06:21:18 PM
 #10

Check out the link I posted above by Meni Rosenfeld. You lower your variance.
ScaryHash
Hero Member
*****
Offline Offline

Activity: 527


View Profile
January 12, 2014, 12:32:15 AM
 #11

Cool thank you !
lostering
Jr. Member
*
Offline Offline

Activity: 38


View Profile
February 15, 2014, 04:42:18 PM
 #12

Can you update how to balance mining using the latest firmware. It happens that I did not get the line
Code:
PARAMS="$AOPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-allow $_aa --api-

But

Code:
#PARAMS=" --lowmem $AOPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-allow $_aa --api-listen"
Code:
PARAMS="$AOPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-listen --api-network"
giletto
Sr. Member
****
Offline Offline

Activity: 420


View Profile
February 15, 2014, 06:00:26 PM
 #13

Can you update how to balance mining using the latest firmware. It happens that I did not get the line
Code:
PARAMS="$AOPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-allow $_aa --api-

But

Code:
#PARAMS=" --lowmem $AOPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-allow $_aa --api-listen"
Code:
PARAMS="$AOPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-listen --api-network"
You found the right line, the line with the pools and $_pb, even if some commands changed, the line is still the same. Wink

▄████████████████████▄
██████████████████████
██████  ██████████████
██████  ██████████████
██████  ██████████████
██████  ██      ██████
██████  █  ████  █████
██████   ██████  █████
██████  ███████  █████
██████  ███████  █████
██████████████████████
██████████████████████
▀████████████████████▀
HERO.        The Future of Banking in Southeast Asia
  ■ Website   ■ Whitepaper   ■ Bounties   ■ Join our Slack
.    PRE-SALE
   starting soon
palawan
Sr. Member
****
Offline Offline

Activity: 386


View Profile
February 18, 2014, 08:25:26 AM
 #14


Thank you giletto and BotwinBG.   I was reading the cgminer --help options and was looking into doing this but a search found this post and combining both of your information; I now have a working load-balance pool strategy  53% and 47%  for Pool1 and Pool 2, respectively, and Pool3 is 0% absolute failover (only).

[To be honest; I was going to do a crontab shell script to change the /etc/config/cgminer file every 2 hours.  Good thing I found out cgminer supports a multi-pool strategy, lol.]


halu
n4spd
Newbie
*
Offline Offline

Activity: 11


View Profile
March 01, 2014, 08:31:05 PM
 #15

Here's a mod to "/etc/init.d/cgminer" which will allow you to turn on/off load balance with quota using the web interface while still allowing default failover mode.

With this mod, you can still use the web interface to configure the mining pool as normal, using the default failover mode.

However, if enter in quota information for pool1 using web interface, like "65;stratum.mining.eligius.st:3334", then restart will automatically switch to load balance mode.  Note: you need to enter quota info for pool2 or pool3 if not blank.  For example:
65;stratum.mining.eligius.st:3334
35;pool2.xxx.com:3333
0;pool3.xxx.com:3333

In the above case, pool3 will only be used as failover.

To make the change, vi /etc/init.d/cgminer and search for:

        if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; t
            POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
        fi
        if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; t
            POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
        fi
        if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; t
            POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
        fi

Replace it with:

# RMC switch to load balance if quota is found on pool1
pool_switch="-o"
custom_option=
test_load_balance=`expr index "$_pool1url" ";"`
if [ "$test_load_balance" != 0 ]; then
   pool_switch="-U"
   custom_option="--load-balance"
fi

        if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; t
            POOL1="$pool_switch $_pool1url -O $_pool1user:$_pool1pw"
        fi
        if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; t
            POOL2="$pool_switch $_pool2url -O $_pool2user:$_pool2pw"
        fi
        if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; t
            POOL3="$pool_switch $_pool3url -O $_pool3user:$_pool3pw"
        fi

Finally, search for the line that starts with:
PARAMS="$AOPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-listen

and add "$custom_option" into the line like below:

PARAMS="$AOPTIONS $POOL1 $POOL2 $POOL3 $_pb $custom_option --api-listen


Enjoy...
tokarka
Newbie
*
Offline Offline

Activity: 6


View Profile
March 20, 2014, 06:17:30 PM
 #16

hi, I'm doing wrong? walk into the console, changing the line, and I can not save HELP!
DaveF
Hero Member
*****
Offline Offline

Activity: 485


If you can read this you are too close.


View Profile WWW
March 24, 2014, 07:23:08 PM
 #17

Thank you for posting this guide. Saved me a lot of time digging around.   Grin

Quick question. If one of the pools drops off the net for a bit, how long till it recovers if at all? One of my pools is listed as dead, I know it's up because it is working fine with other mining equipment. Will it come back on it's own or do I have to reboot?

Thanks,
Dave

1800bitcoin.com domain for sale. PM me.
giletto
Sr. Member
****
Offline Offline

Activity: 420


View Profile
March 25, 2014, 03:30:51 AM
 #18

If the miner can access to the pool again, you don't have to do anything, the miner will simple start mining again, without reboot.

▄████████████████████▄
██████████████████████
██████  ██████████████
██████  ██████████████
██████  ██████████████
██████  ██      ██████
██████  █  ████  █████
██████   ██████  █████
██████  ███████  █████
██████  ███████  █████
██████████████████████
██████████████████████
▀████████████████████▀
HERO.        The Future of Banking in Southeast Asia
  ■ Website   ■ Whitepaper   ■ Bounties   ■ Join our Slack
.    PRE-SALE
   starting soon
Cy13er007
Newbie
*
Offline Offline

Activity: 7


View Profile
April 27, 2014, 07:55:54 PM
 #19

Here's a mod to "/etc/init.d/cgminer" which will allow you to turn on/off load balance with quota using the web interface while still allowing default failover mode.

With this mod, you can still use the web interface to configure the mining pool as normal, using the default failover mode.

However, if enter in quota information for pool1 using web interface, like "65;stratum.mining.eligius.st:3334", then restart will automatically switch to load balance mode.  Note: you need to enter quota info for pool2 or pool3 if not blank.  For example:
65;stratum.mining.eligius.st:3334
35;pool2.xxx.com:3333
0;pool3.xxx.com:3333

In the above case, pool3 will only be used as failover.

To make the change, vi /etc/init.d/cgminer and search for:

        if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; t
            POOL1="-o $_pool1url -O $_pool1user:$_pool1pw"
        fi
        if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; t
            POOL2="-o $_pool2url -O $_pool2user:$_pool2pw"
        fi
        if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; t
            POOL3="-o $_pool3url -O $_pool3user:$_pool3pw"
        fi

Replace it with:

# RMC switch to load balance if quota is found on pool1
pool_switch="-o"
custom_option=
test_load_balance=`expr index "$_pool1url" ";"`
if [ "$test_load_balance" != 0 ]; then
   pool_switch="-U"
   custom_option="--load-balance"
fi

        if [ "$_pool1url" != "" -a "$_pool1user" != "" -a "$_pool1pw" != "" ]; t
            POOL1="$pool_switch $_pool1url -O $_pool1user:$_pool1pw"
        fi
        if [ "$_pool2url" != "" -a "$_pool2user" != "" -a "$_pool2pw" != "" ]; t
            POOL2="$pool_switch $_pool2url -O $_pool2user:$_pool2pw"
        fi
        if [ "$_pool3url" != "" -a "$_pool3user" != "" -a "$_pool3pw" != "" ]; t
            POOL3="$pool_switch $_pool3url -O $_pool3user:$_pool3pw"
        fi

Finally, search for the line that starts with:
PARAMS="$AOPTIONS $POOL1 $POOL2 $POOL3 $_pb --api-listen

and add "$custom_option" into the line like below:

PARAMS="$AOPTIONS $POOL1 $POOL2 $POOL3 $_pb $custom_option --api-listen


Enjoy...


I'm having a hard time getting this to work.  I followed giletto's instructions, and did end up getting balance mining to work between multiple mining pools but I would like to have the increased control that adding quotas provides.  I have tried leaving the "balance" mod in place while adding n4spd mod...didn't work.  I also removed the "balance" mod and then tried this "quota" mod...again no luck.  Any idea, or does someone have a link to the entire instructions starting from stock?  Thanks in advance for any help provided.
fulanomengano
Newbie
*
Offline Offline

Activity: 28


View Profile
May 24, 2014, 06:44:06 PM
 #20

This post inspired me to experiment with managing more than 3 pools through the web interface. Here's my result https://bitcointalk.org/index.php?topic=623672.

FM

BTC: 1Fd8n26auEzWQSqmf4HU1xyiEpPoJmhXuS
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!