Pages:
Author

Topic: Avalon users: bitcoind + eloipool configuration - page 6. (Read 36184 times)

sr. member
Activity: 336
Merit: 251
Avalon ASIC Team
much appreciated
legendary
Activity: 1596
Merit: 1100
Reserved.
legendary
Activity: 1596
Merit: 1100
Here is the simple solo mining and mining farm configuration used here.  At current difficulty, ignoring variance, an Avalon should, on average, generate a block every...

Quote
The average time to generate a block at 68000.0 Mhps, given difficulty of 6695826.2826, is 4 days, 21 hours, 28 minutes, and 43 seconds

Pool is probably preferable to most, as you might have incredibly bad luck and not generate a block for a couple weeks.  In any case, here is the bitcoind + eloipool configuration on Linux.

If you like these instructions, there is a donation address in the sig.




bitcoind setup

1) Obtain a compiled bitcoind somehow.  Compiling your own is outside the scope of these instructions.  I'm told there is an Ubuntu PPA somewhere.

2) Decide on a data directory location.  It must be on a fast hard drive, preferably SSD, and have at least 10GB of free space.

3) In this directory, create bitcoin.conf text file, with the following contents:

Code:
rpcuser=MY_RPC_USERNAME
rpcpassword=MY_RPC_PASSWORD
logtimestamps=1

Obviously, change the MY_RPC_xxx to a username and password.

4) Create a newblock.sh script, with the following contents:

Code:
#!/bin/sh

killall -USR1 eloipool.py

Mark it executeable via "chmod 0755 newblock.sh"

5) Create a run-bitcoind.sh script, with the following contents:

Code:
#!/bin/sh

/spare/repo/bitcoin/src/bitcoind \
-datadir=/spare/bitcoin/data -daemon \
-blocknotify=/garz/repo/eloipool/newblock.sh

Mark it executeable via "chmod 0755 run-bitcoind.sh"

You must modify the (a) bitcoind path, (b) -datadir path, and (c) -blocknotify path to fit your local computer.

6) Run bitcoind via the run-bitcoind.sh script.  Watch debug.log in the data directory, to make sure it started the Initial Block Download (bitcoin network sync).  This might take a few hours, to download all the blocks.  If you are technically minded and motivated, you may download the blockchain torrent to give this process a jump-start.



eloipool setup

1) Download eloipool dependencies, either from your Linux packager, or directly:

Python 3                        http://python.org
python-bitcoinrpc       https://github.com/jgarzik/python-bitcoinrpc
python-base58           https://gitorious.org/bitcoin/python-base58
midstate                        http://gitorious.org/midstate/midstate

2) For python-bitcoinrpc, check out an older release,

Code:
$ cd /repo/python-bitcoinrpc
$ git checkout -b solo-mining 770881c8bd9b1f92427290270b37a28751cf9df0

3) Check out eloipool,

Code:
$ git clone git://gitorious.org/bitcoin/eloipool.git

4) Copy config.py.example to config.py, and make the following several edits,

a) change ServerName to something unique

b) increase share target (note increased '0' and decreased 'f'):
Code:
-ShareTarget = 0x00000000ffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ShareTarget = 0x000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffff

c) DynamicTargetting = 2

d) DynamicTargetGoal = 6

e) change TrackerAddr to YOUR bitcoin address

f) comment out CoinbaserCmd,

Code:
-CoinbaserCmd = 'echo -e "1\\n$((%d / 100))\\n1579aXhdwvKZEMrAKoCZhzGuqMa8EonuXU"'
+#CoinbaserCmd = 'echo -e "1\\n$((%d / 100))\\n1579aXhdwvKZEMrAKoCZhzGuqMa8EonuXU"'

g) update TemplateSources to point to your local bitcoind RPC, including chosen username/password, and comment out the secondary source:

Code:
@@ -57,41 +57,41 @@
 TemplateSources = (
        {
                'name': 'primary',
-               'uri': 'http://user:pass@localhost:8332',
+               'uri': 'http://MY_RPC_USERNAME:[email protected]:8332',
                'priority': 0,
                'weight': 1,
        },
-       {
-               'name': 'secondary',
-               'uri': 'http://user:pass@localhost:18332',
-               'priority': 1,
-               'weight': 1,
-       },
+#      {
+#              'name': 'secondary',
+#              'uri': 'http://user:pass@localhost:18332',
+#              'priority': 1,
+#              'weight': 1,
+#      },
 )

g) empty TemplateChecks (or comment out 100%),

Code:
 TemplateChecks = (
 )

h) comment out or delete BlockSubmissions

i) change log settings, and switch from testnet3 mining to mainnet:

Code:
-DelayLogForUpstream = False
+DelayLogForUpstream = True
 
 # Bitcoin p2p server for announcing blocks found
-UpstreamBitcoindNode = ('127.0.0.1', 18333)  # testnet
+UpstreamBitcoindNode = ('127.0.0.1', 8333)
 
 # Network ID for the primary blockchain
 # Other known network IDs can be found at:
 #     https://en.bitcoin.it/wiki/Protocol_specification#Message_structure
-UpstreamNetworkId = b'\xFA\xBF\xB5\xDA'  # testnet
+UpstreamNetworkId = b'\xF9\xBE\xB4\xD9'

j) disable transaction-related bug workaround:

Code:
-POT = 2
+#POT = 2

k) update ShareLogging to reflect your desires.  The simplest is to delete all the SQL-related entries, leaving only the textfile logfile.  With solo mining, you don't care so much about shares.

Code:
ShareLogging = (
        {
                'type': 'logfile',
                'filename': 'share-logfile',
                'format': "{time} {Q(remoteHost)} {username} {YN(not(rejectReason))} {dash(YN(upstreamResult))} {dash(rejectReason)} {solution}\n",
        },
)

l) change log filename to something useful,

Code:
 LogFile = {
-       'filename': 'filename.log',
+       'filename': 'eloipool.log',

m) Create a runit.sh script for eloipool, with the contents,

Code:
#!/bin/sh

PYTHONPATH=/spare/repo/python-bitcoinrpc:/garz/repo/python-base58:/garz/repo/midstate \
     nohup ./eloipool.py 2>&1 >/dev/null &

You must change the paths to suit your local system.

n) Run eloipool with runit.sh script

o) Let's assume you are running the pool software on 192.168.1.40 IP address.  Set up your miner configuration like this:

Pool X: stratum+tcp://192.168.1.40:3334
Pool X username: 1NqqjQWXDLAoNycAS2ZryueuhNLJtcjvGy
Pool X password: x

Pages:
Jump to: