Bitcoin Forum

Bitcoin => Hardware => Topic started by: tiktoc on March 31, 2013, 11:50:56 PM



Title: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on March 31, 2013, 11:50:56 PM
This is use at your own risk. I'm not a expert. I don't have asic miner so I cant test it on real btc, works on testnet though and gives shares to gpu miner fine and testnet coins fine.
So I am not responsible if you lose your real coins.

Re the major pools.
They seem to be good people and the amount of work they do and investment over the years including writing the software below, should be worth the 1 to 3 percent they ask. But in the name of diversity..

You can do this in virtual box to give it a try out first.

So you have yourself a ubuntu 12.10 32bit (see a post further down on what changes are needed for 64bit) linux server install and you want to setup a pool server for solo mining on it.

I have added a part for ubuntu 12.04 32bit its in blue.

I normally do this from windows box using putty to ssh into the ubuntu box.
Things you need

Make sure your login is in the sudoers list (this will be automatic if you installed from dvd and created your login name with the installer).

Then at the command prompt first thing we are going to do is update and upgrade the system to the latest packages
with all the sudos you have to put your login password in when it asks for it.
with the apt-get installs hit y and enter whenever it asks you.
Code:
sudo apt-get update
once its complete

Code:
sudo apt-get upgrade

now to install bitcoind

make sure git is installed first

Code:
sudo apt-get install git

now make directory under you home one called like so

Code:
mkdir git

change the directory you just made

Code:
cd git

get the source for bitcoind instructions to build it are also here

Code:
git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
git checkout v0.8.6

Install the build dependencies
Code:
sudo apt-get install build-essential
sudo apt-get install libssl-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libminiupnpc-dev

wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8_4.8.30-quantal2_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8-dev_4.8.30-quantal2_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8%2B%2B_4.8.30-quantal2_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8%2B%2B-dev_4.8.30-quantal2_i386.deb

sudo dpkg -i libdb4.8_4.8.30-quantal2_i386.deb
sudo dpkg -i libdb4.8-dev_4.8.30-quantal2_i386.deb
sudo dpkg -i libdb4.8++_4.8.30-quantal2_i386.deb
sudo dpkg -i libdb4.8++-dev_4.8.30-quantal2_i386.deb

*********************
This is the libdb4.8 packages for only fo ubuntu 12.04  dont use these if you are using ubuntu 12.10

wget https://launchpad.net/ubuntu/+source/db4.8/4.8.30-11ubuntu1/+build/3392254/+files/libdb4.8-dev_4.8.30-11ubuntu1_i386.deb
wget https://launchpad.net/ubuntu/+source/db4.8/4.8.30-11ubuntu1/+build/3392254/+files/libdb4.8_4.8.30-11ubuntu1_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8%2B%2B_4.8.30-10precise1_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8%2B%2B-dev_4.8.30-10precise1_i386.deb


sudo dpkg -i libdb4.8_4.8.30-11ubuntu1_i386.deb
sudo dpkg -i libdb4.8-dev_4.8.30-11ubuntu1_i386.deb
sudo dpkg -i libdb4.8++_4.8.30--10-precise1_i386.deb
sudo dpkg -i libdb4.8++-dev_4.8.30-10precise1_i386.deb
*********************

then to build
Code:
cd src/
make -f makefile.unix
once its finished building without errors, copy it into /usr/local/bin
Code:
sudo cp ./bitcoind /usr/local/bin/

then run it by typing
Code:
bitcoind
it will output

Code:
Error: To use bitcoind, you must set a rpcpassword in the configuration file:
/home/yourusername/.bitcoin/bitcoin.conf
It is recommended you use the following random password:
rpcuser=bitcoinrpc
rpcpassword=EjkjenJHJhhfdkwemkjmnkk37883njn37hfdkjn38n
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
cut and past the rpcuser and rpcpassword lines to a temporary text file and save it for later.

now create the bitcoin.conf file
Code:
cd
cd .bitcoin
open up bitcoin.conf in a text editor like pico
Code:
pico bitcoin.conf
add the lines



and cut and past the two lines from above that you saved from above from the temporary text file into the bitcoin.conf

server=1
rpcport=8332
rpctimeout=30

so it should look like this once finsihed

server=1
rpcport=8332
rpctimeout=30
rpcuser=bitcoinrpc
rpcpassword=EjkjenJHJhhfdkwemkjmnkk37883njn37hfdkjn38n

Code:
then press cntrl x
hit y to save
hit enter to save it to bitcoin.conf
then change the permissions on bitcoin.conf to user only read permissions

Code:
chmod go-rwx bitcoin.conf

now start bitcoind  on the testnet

Code:
bitcoind -testnet -daemon

it should show

Bitcoin server starting
hit enter again to get back to shell prompt

after a couple of minutes

on the command line type
Code:
bitcoind getinfo
you get something similar to

Code:
blah@ks3098647:~$ bitcoind getinfo
{
    "version" : 80000,
    "protocolversion" : 70001,
    "walletversion" : 60000,
    "balance" : 0.00000000,
    "blocks" : 32935,
    "timeoffset" : -5,
    "connections" : 17,
    "proxy" : "",
    "difficulty" : 11.90472507,
    "testnet" : True,
    "keypoololdest" : 1364506205,
    "keypoolsize" : 101,
    "paytxfee" : 0.00000000,
    "errors" : ""
}
it will take about 10 to 20 minutes to download the testnet coin chain.

Now onto the pool server which is at https://github.com/generalfault/stratum-mining/blob/master/INSTALL

Code:
cd
cd git
git clone https://github.com/slush0/stratum.git
git clone https://github.com/generalfault/stratum-mining.git

sudo apt-get install python-dev
sudo apt-get install python-setuptools
sudo apt-get install python-crypto
sudo easy_install -U distribute
sudo easy_install stratum
sudo easy_install simplejson

cd stratum-mining/conf
cp config_sample.py config.py

now get the testnet wallet address from bitcoind

Code:
bitcoind getaccountaddress "" 
copy this adddress to the clipboard

now edit the config.py file by

Code:
pico config.py
edit the line that says central wallet

delete the text between the ' '

then past you key from the clipboard inbetween the ' '

so it should look like this

CENTRAL_WALLET = 'mv9mpc6xLEZNYpXJtodRrfjbyF3kbbr7CL'   # local bitcoin address where money goes

this has to be correct as this is where your coins that you mine go not so bad for the testnet ones we do first, very bad if you get it wrong and you mine real

btc.

The BITCOIN_TRUSTED_USER = 'bitcoinrpc' should be the same as in the trusted user you saved to a text file ealier if you lost it its the same on as in the

bitcoin.conf file.

The BITCOIN_TRUSTED_PASSWORD = 'some password'  line should be edited to become BITCOIN_TRUSTED_PASSWORD = ''  then paste your trusted password from the tempory

text file from earlier if you lost it its the same on as in the bitcoin.conf file.

it should look something like this

BITCOIN_TRUSTED_PASSWORD = 'BRqw9gB78hcm6qSZ7DHvuTPWxCPVHzE9BY9gkFTddBNH'

Code:
cntrl x and hit y to save then enter to save to that file name
then

Code:
cd ..

start the server by running this on the command line

Code:
twistd -ny launcher.tac -l -
the output should be like this

Code:
2013-03-31 00:04:32,584 INFO mining # Connecting to bitcoind...
2013-03-31 00:04:32+0100 [-] Log opened.
2013-03-31 00:04:32+0100 [-] twistd 12.3.0 (/usr/bin/python 2.7.3) starting up.
2013-03-31 00:04:32+0100 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2013-03-31 00:04:33,353 INFO mining # Connected to bitcoind - Ready to GO!
2013-03-31 00:04:33,372 INFO coinbaser # Coinbase address 'yourwalletkeyhere' is valid
2013-03-31 00:04:33,375 INFO mining # MINING SERVICE IS READY
2013-03-31 00:04:33+0100 [HTTPPageGetter,client] Loading of signing key 'None' failed, protocol messages cannot be signed.
2013-03-31 00:04:33+0100 [HTTPPageGetter,client] Cannot initiate SSL context, are SSL_PRIVKEY or SSL_CACERT missing?
2013-03-31 00:04:33+0100 [HTTPPageGetter,client] This will skip all SSL-based transports.
2013-03-31 00:04:33+0100 [HTTPPageGetter,client] SocketTransportFactory starting on 3333
2013-03-31 00:04:33+0100 [HTTPPageGetter,client] Starting factory <stratum.socket_transport.SocketTransportFactory instance at 0x8c94cec>
2013-03-31 00:04:33+0100 [HTTPPageGetter,client] Site starting on 8889
2013-03-31 00:04:33+0100 [HTTPPageGetter,client] Starting factory <lib.basic_stats.Site instance at 0x8ce8b2c>
2013-03-31 00:04:34,107 INFO template_registry # New template for 00000000000000e272aaab8803cb27f73563f3accd373f6cc838be7e10d886ae
2013-03-31 00:04:34,108 INFO subscription # BROADCASTED to 0 connections in 0.000 sec
2013-03-31 00:04:34,108 INFO template_registry # Update finished, 0.256 sec, 297 txes
you should be able to point your miner at

http://YOURHOSTNAMEORIPADDRESS:3333

eg cgminer -o yourhostnameORIPADRESS:3333 -u guest -p guest

(the guest can bereplaced by any username/password you want)

you should see it connect and be given work

Once your miner has mined some blocks check the transactions are showing in the wallet by running this

Code:
bitcoind listtransactions

it should show the incoming blocks you have mined (the testnet balamce wont show in getinfo till they are confirmed 120 times)

Now to setup blocknofity so bitcoind will tell the pool software when a new block is deteced instead of having the pool server poll bitciond every 5 seconds.

there is script to generate the hash of the password to put in the pool servers config.py generate it by using the command below replace somepassword with the password you wish to use.

Code:
./scripts/generateAdminHash.sh somepassword
it should outsomething like this
Code:
blah@ks3098644:~/git/stratum-mining$ ./scripts/generateAdminHash.sh somepassword1
37bc885f08c043f1cb9852956e01ca0d07ba664a5eee14fc417408c01aae063d
copy the hash(the long sequence of letters and numbers) and past it into the config.py file

by editing via
Code:
pico ./conf/config.py
then find the

ADMIN_PASSWORD_SHA256 = none

line in the config.py file

and change that line to

ADMIN_PASSWORD_SHA256 = 'youhashhere'

so using the hash i made above I  should end up with something like this below, the hash you paste in must be surround by these ' '

ADMIN_PASSWORD_SHA256 = '37bc885f08c043f1cb9852956e01ca0d07ba664a5eee14fc417408c01aae063d'

Code:
save it by hitting cntrl x then y then enter
now to test it

restart the pool server or run it again if you stopped it before

to start it again run

Code:
twistd -ny launcher.tac -l -
at a new command prompt

Code:
./scripts/blocknotify.sh --password somepassword1 --host localhost --port 3333
if its working it should display something like below (the amount of time it takes to notify will change each time)

blocknotify: done in 0.012 sec

now to add blocknotify to bitcoind
stop the bitcoin server by

Code:
bitcoind stop
wait for it to stop then type in the following line replace yourusername with your username you log into ubuntu with and replace somepassword1 with the password you used to create the admin hash before.

Code:
bitcoind -blocknotify="/home/yourusername/git/stratum-mining/scripts/blocknotify.sh --password somepassword1 --host localhost --port 3333" -testnet -daemon

if it starts up check the output from the pool server for and if you see the blocknotify notifications coming in then edit config.py with

Code:
pico ./conf/config.py
and find the line below

PREVHASH_REFRESH_INTERVAL =

edit it to the same as the line below

PREVHASH_REFRESH_INTERVAL = 60

Code:
save it by hitting cntrl x then y then enter
restart the pool again switch to the command prompt that has the pool running  and hit control c which will stop the server.

Then enter to start it again run
Code:
twistd -ny launcher.tac -l -
it should run and it should show when new blocks are found.

If all is working we can change over to the real btc network

first stop the pool server using cntrl c on the command prompt with its output.

Then stop bitcoind with
Code:
bitcoind stop

If you dont want to wait the 8 to 24 hours to download the real bitcoin chain

You can get a bootstrap chain  bootstrap file which is on  source forge and can  downloaded via a torrent file which you can download and then upload to the ubuntu server and put it in the .bitcoin directory under your home directory before you start bitcoind.

Information here http://sourceforge.net/projects/bitcoin/files/Bitcoin/blockchain/

link to the torrent file below

http://downloads.sourceforge.net/project/bitcoin/Bitcoin/blockchain/bootstrap.dat.torrent

If your downloading it all or using bootstrap file

start bitcoind replace yourusername with your username you log into ubuntu with and replace somepassword1 with the password you used to create the admin hash

before.
Code:
bitcoind -blocknotify="/home/yourusername/git/stratum-mining/scripts/blocknotify.sh --password somepassword1 --host localhost --port 3333" -daemon
*notice the -testnet flag has been removed from the line above

wait for it sync up to the current blocks. (It MUST be synced before you can mine on the pool)

On the command line you can check the current blocks by

Code:
bitcoind getblockcount
you can check the current blocks on the normall bitcoind-qt client by hovering over the green check mark it will pop up the current block. When these two numbers are the same or very close then your wallet on bitcoind is synced up.

Now we have to edit config.py to put a real Bitcoin address in there so you get your coins when you mine them!

on the command line
Code:
cd
cd git/stratum-mining/
pico conf/config.py
find the line
CENTRAL_WALLET = 'mv9mpc6xLEZNYpXJtodRrfjbyF3kbbr7CL'   # local bitcoin address where money goes

replace the wallet address with a real one generated from whatever wallet software you use.

It should look something like this

CENTRAL_WALLET = '1jxc4KgRXCkn2JD7QjmgMrDKqM2yQtPAp'   # local bitcoin address where money goes

(DO NOT USE THE WALLET ADDRESS IN THE ABOVE LINE)

The address MUST have the ' ' chars around it like above.

If this line is not correct you will lose your coins!
(The pool will warn you if its not a valid address, but a vaild one can still be a wrong address i.e not one you own)

further down in the config.py file find this line ALLOW_NONLOCAL_WALLET = True                            # Allow valid, but NON-Local wallet's

change ALLOW_NONLOCAL_WALLET = False
to

ALLOW_NONLOCAL_WALLET = True

Code:
save it by hitting cntrl x then y then enter
start the pool by typing on the command line

Code:
twistd -ny launcher.tac -l -

The pool server will tell you if bitcoind is not synced when you start it as well.

does it show the btc wallet address is valid?
does it show that bitcoin is synced?

if so cntrl c

then started the server again using

twistd -ny launcher.tac -l - &

(On headless servers, You can use screen to run the server in so you can rettach back to screen and see the output of the server. just type screen on the command

line and it will lod up to a new command prompt, start the server as usal. when you done before you disccount or close your ssh session do a cntrl d  which will

detach screen. When you login next and want to look at the pool server output type screen -r on the command line.)
Mine away :)

You can set the config.py to its unwriteable(can be changed by root or your user login) on the command prompt type
Code:
cd
cd git/stratum-mining/conf
chmod a-w config.py
If you find a block it and the wallet address you used is in a bitcoin-qt client it will notify you and show up under the label imature until it has been confirmed 120 times.

You can check some basic server stats at(this works when you are mining testnet as well).

http://yourserveripaddress:8889/

For asic miners you might need to increase the threads in this line in config.py

THREAD_POOL_SIZE = 30

give this a try

THREAD_POOL_SIZE = 150

Dont own a asic miner so I cannot try it out, some of pool owners might be able to give recommendations.

If the machine is rebooted for some reason you will have to start bitcoind and the pool server again. This can be automated if you want.
The blocknotify I assume can be moved from the command line into the bitcoin.conf file.
Eg add this to bitcoin.conf replacing the bits you need.
Code:
blocknotify=/home/yourusername/git/stratum-mining/scripts/blocknotify.sh --password somepassword1 --host localhost --port 3333
then just running bitcoind  like this

Code:
bitcoind -daemon

Cheers and good luck with your mining.

edit: fixed a cut and paste :)
edit:6/4 Removed quotes on line to put in bitcoin.conf
edit:9/4 Changed git repository, and changing to current stable version 0.8.1
edit:9/6 Added part for ubuntu 12.04 also changed bitcoin version to 0.8.2
Tips: 1MivVoqttGDpqK8qZzJcfQdkwUG91bGC7G


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 01, 2013, 04:43:03 AM
i almost had a boner reading this  ;)

this looks to be an extraordinary set of instructions like i've never seen before and i can't wait to try them.  awaiting an ssd and my batch 2 avalons.

congrats on the line by line code and explanations as to what each does.  it all makes sense and is exceedingly clear.  i'll send you a tip once i get everything running.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: BitSyncom on April 01, 2013, 04:55:21 AM
thank you, much appreciated


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: fusion7 on April 01, 2013, 05:48:49 AM
Is this similar to bitcoind + eloipool configuration? Can I run it on virtual machine so I don't need to have a dedicated computer acting as a server? Thanks for the hard work  :)


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: loshia on April 01, 2013, 08:27:24 AM
tiktoc,
I am impressed very nice tutorial

What about merged mining can you put a word on two just basics for guidelines?

10X



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: Miner99er on April 01, 2013, 08:30:29 AM
Nice tutorial but Jesus... this is why Linux isn't mainstream

Yes, my own personal opinion.

/flamesuit on.

Still, good job.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 01, 2013, 01:47:11 PM
install virtualbox it free you can get it from here

http://download.virtualbox.org/virtualbox/4.2.10/VirtualBox-4.2.10-84105-Win.exe
Install virtual box

Then download the extentions pack

http://download.virtualbox.org/virtualbox/4.2.10/Oracle_VM_VirtualBox_Extension_Pack-4.2.10-84104.vbox-extpack

then install that.

http://releases.ubuntu.com/quantal/ubuntu-12.10-server-i386.iso

download ubuntu server iso from here.

run virtualbox

click new

put a name in

under the type drop box select linux

under the version drop box select ubuntu

click next

Memory needs to be 2gig at least move the slider or type 2048 in the box

click next, then click create, then click next and next again.

Change the size of the virtual drive to 20GB, then click create.

You should have a new virtual machine listed, select it then click the the settings button.

Click storage select the cd icon that says emtpy. on the right hand side of this window it will say cd/DVD drive IDE secondary master then a cd icon.

Click the icon, and select choose a virtual disk, in the window that pops up browse to where you saved the ubuntu iso you downloaded. Select the iso then click ok.

Under controller: IDE, next to the first cd icon it should say ubuntu-12.10-server-i386.iso

Under network click the drop down box next to attached to: and select Bridged adapter.
Under the Name: drop downbox select the network adapter that you use to connect to the internet.

Click ok.

Then click the green start arrow.

It should load the virtual machine.

Follow the onscreen prompts to install ubuntu or look at one of the tutorials on ubuntu.com (do make sure you select the openssl server when it lists the packages to install)


Once its installed it will ask to reboot then select unbuntu from the black and white menu when it pops up.

Login with the user name and password you created.

then type
Code:
ifconfig
on the command line

it should display something like this

Code:
eth0      Link encap:Ethernet  HWaddr 08:00:27:d2:75:22
          inet addr:192.168.1.54  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fed2:7522/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:18545 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14016 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:20850978 (20.8 MB)  TX bytes:4551612 (4.5 MB)

the ip after inet addr: is the one you are looking for.

Open up putty a windows ssh client and connect to that ip and login.





Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 01, 2013, 04:17:18 PM
Is this similar to bitcoind + eloipool configuration? Can I run it on virtual machine so I don't need to have a dedicated computer acting as a server? Thanks for the hard work  :)

Similar yes, but different pool server software. Virtual machine instructions are above for virtual box.
Not sure how it will go with  cpu loading/memory etc depends on what pc your running it on.

Works ok on testnet with a two gpu setup connected to it.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 01, 2013, 04:33:42 PM
Just a note on security, its  out of the depth of this tute.
But if the machine is a virtual one or a real one on your home network behind a router running nat and its on a internal ip address, its not a huge problem. If its directly connected to the internet with a real ip. You at least want to use ssh keys for login.

Some information below.
 
https://help.ubuntu.com/community/SSH/OpenSSH/Keys
http://www.electrictoolbox.com/putty-rsa-dsa-keys/

Once you get them working, there is a option in sshd config file to turn of password logins..

You may want to encrypt the bitcoind wallet on the server as well even though its not used to store coins

Code:
bitcoind encryptwallet <passphrase>
Write your passphrase down somwhere :)

On the linux not being mainstream if you looking for a desktop try Linux mint or Ubuntu Desktop.
Shrug, each to their own for their needs.

Because the mining server is written in python it "may" be able to be run on windows.





Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 01, 2013, 04:58:36 PM
quick question.

everything you posted should go well on a new server specifically for solo pool mining with Ubuntu 12.10, ssd=64GB, and 8MiB RAM, correct?

you sir are a gentleman and a blessing to this community.  thank you.  :D


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 01, 2013, 05:20:02 PM
If you mean 8gig of ram, then yes should be fine, most probably over kill for a couple of avalons :)


To the above person who asked about merged mining, I dont know anything about namecoin. Someone posted in the stratum pool software thread that they got it working on litecoin and were going to re-release the software. Maybe post in that thread?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: loshia on April 01, 2013, 06:04:22 PM
If you mean 8gig of ram, then yes should be fine, most probably over kill for a couple of avalons :)


To the above person who asked about merged mining, I dont know anything about namecoin. Someone posted in the stratum pool software thread that they got it working on litecoin and were going to re-release the software. Maybe post in that thread?


10X
I will check


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 01, 2013, 10:26:10 PM
If you mean 8gig of ram, then yes should be fine, most probably over kill for a couple of avalons :)


To the above person who asked about merged mining, I dont know anything about namecoin. Someone posted in the stratum pool software thread that they got it working on litecoin and were going to re-release the software. Maybe post in that thread?


do you think i could point 3 Avalons at this one server with 8G of ram?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 02, 2013, 03:52:45 PM
Just guessing, but searching the forums to see what some of the pools were using for their hardware. From what I can find it will be fine. Id assume slush's server has 48 to 64gig of ram in it and that has about 20k connections to it.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 03, 2013, 03:28:01 AM
is this a problem?

Code:
joe@cypher:~/git$ sudo dpkg -i libdb4.8_4.8.30-quantal2_i386.debsudo dkpg
dpkg: error processing libdb4.8_4.8.30-quantal2_i386.debsudo (--install):
 cannot access archive: No such file or directory
dpkg: error processing dkpg (--install):
 cannot access archive: No such file or directory
Errors were encountered while processing:
 libdb4.8_4.8.30-quantal2_i386.debsudo
 dkpg


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: oakpacific on April 03, 2013, 05:13:34 AM
is this a problem?

Code:
joe@cypher:~/git$ sudo dpkg -i libdb4.8_4.8.30-quantal2_i386.debsudo dkpg
dpkg: error processing libdb4.8_4.8.30-quantal2_i386.debsudo (--install):
 cannot access archive: No such file or directory
dpkg: error processing dkpg (--install):
 cannot access archive: No such file or directory
Errors were encountered while processing:
 libdb4.8_4.8.30-quantal2_i386.debsudo
 dkpg

Come on, the"sudo dpkg" after "deb" is redundant, remove them, it's just a copy/paste problem.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 03, 2013, 10:16:32 AM
is this a problem?

Code:
joe@cypher:~/git$ sudo dpkg -i libdb4.8_4.8.30-quantal2_i386.debsudo dkpg
dpkg: error processing libdb4.8_4.8.30-quantal2_i386.debsudo (--install):
 cannot access archive: No such file or directory
dpkg: error processing dkpg (--install):
 cannot access archive: No such file or directory
Errors were encountered while processing:
 libdb4.8_4.8.30-quantal2_i386.debsudo
 dkpg

Come on, the"sudo dpkg" after "deb" is redundant, remove them, it's just a copy/paste problem.

Actually, I copied and pasted perfectly.  ;)

S'all Greek to me  ;D


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 03, 2013, 06:29:24 PM
Yeah its wrong ment to be

Code:
sudo dpkg -i libdb4.8_4.8.30-quantal2_i386.deb

Was a bit tired when i was doing the final edit of it on bt talk.

Sorry :)

I have edited the main post to fix it, let me know if you have any more trouble, some reason I am not getting notifications for the thread.

Also if you installing something you have download you can always type part of the file name and hit tab and it will auto fill on the command line if it can.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 04, 2013, 11:59:43 AM
Someone asked me in pm about installing it on the 64bit version of ubuntu.

You just download and install the 64bit version of the libdb libraries.

Code:
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8_4.8.30-quantal2_amd64.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8-dev_4.8.30-quantal2_amd64.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8%2B%2B_4.8.30-quantal2_amd64.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8%2B%2B-dev_4.8.30-quantal2_amd64.deb


sudo dkpg -i libdb4.8_4.8.30-quantal2_amd64.deb
sudo dkpg -i libdb4.8-dev_4.8.30-quantal2_amd64.deb
sudo dkpg -i libdb4.8%2B%2B_4.8.30-quantal2_amd64.deb
sudo dkpg -i libdb4.8%2B%2B-dev_4.8.30-quantal2_amd64.deb


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 04, 2013, 04:50:09 PM
great.  i've gotten all the way down to connecting to testnet.

now i need to point one of my gpu miners at it to see if i can get any blocks when i get a chance.

how do i run bitcoind now and from what directory?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 04, 2013, 06:06:40 PM
you should be able to run it from anywhere if you copied it to /user/local/bin in the instructions.

just type bitcoind flags you need here

eg to test on testnet

Code:
bitcoind -testnet -daemon


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 05, 2013, 12:57:49 AM
why am i seeing "unexpected operator"?

Code:
joe@cypher:~/git/stratum-mining$ ./scripts/generateAdminHash.sh password
./scripts/generateAdminHash.sh: 3: [: xpassword: unexpected operator
5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8
joe@cypher:~/git/stratum-mining$


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 05, 2013, 05:34:46 AM
Don't know ignore it. It still works.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 05, 2013, 03:03:31 PM
would this work also in 12.04 LTS which might arguably be a  little more stable?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: bitcoindaddy on April 05, 2013, 03:31:51 PM
Why is the stratum proxy necessary. Can't you mine directly against the bitcoind (with getwork)? What benefit does the stratum bit do if bitcoind is on a local network?

Edit:  Also, can you use the regular bitcoind binaries instead of the latest git?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 05, 2013, 03:47:21 PM
Why is the stratum proxy necessary. Can't you mine directly against the bitcoind (with getwork)? What benefit does the stratum bit do if bitcoind is on a local network?

Edit:  Also, can you use the regular bitcoind binaries instead of the latest git?

regular getwork can't handle the load from what i understand.  the speed of the asics is too much for the standard bitcoind/getwork system so slush designed stratum.  if you look at the code tictok has provided above, you see that you are installing stratum software locally to enable this process.

someone who knows the specifics could explain more thoroughly.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: bitcoindaddy on April 05, 2013, 04:25:45 PM
But the proxy is communicating with bitcoind using getworks, what's the difference? This makes sense for a remote installation, but I don't see how it makes sense for a local install?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: bitcoindaddy on April 05, 2013, 05:05:44 PM
Seems to work,

I'm getting this though from the status web page (port 8889):

stratum-mining/lib/basic_stats.py, line 99 in render_GET
97                  wc = "#0A0"
98                r+="<tr bgcolor=\"%s\"><td>%s</td><td>%s/%s</td><td>%s/%s</td><td>%s</td><tr>"%(
99                        wc,wi,format(int(wd["speed"]),"n"),wd["difficulty"],format(int(wd["total_shares"]),"n"),
100                        format(int(wd["total_rejects"]),"n"),format(int(wd["total_found"]),"n"))

<type 'exceptions.TypeError'>: int() argument must be a string or a number, not 'NoneType'
It's complaining about line 99.


Does this require Python3?

Edit:  Also getting untracked shares - what does that mean?

[2013-04-05 13:09:27] Accepted untracked stratum share from pool 0
[2013-04-05 13:09:32] Stratum from pool 0 detected new block
[2013-04-05 13:09:57] Accepted untracked stratum share from pool 0
[2013-04-05 13:10:34] Accepted 0da078b4 Diff 18/6 GPU 1 pool 0


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 05, 2013, 05:06:05 PM
Bitcoind packages are available fro the same places as the libdb libraries, I have not tried them I assume they work, someone in the other thread for the eloipool said they were having trouble with binaries.

32bit

https://launchpad.net/~bitcoin/+archive/bitcoin/+files/bitcoind_0.8.1-quantal1_i386.deb

64bit

https://launchpad.net/~bitcoin/+archive/bitcoin/+files/bitcoind_0.8.1-quantal1_amd64.deb



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 05, 2013, 05:12:21 PM
Thats a no to python3 as far as  I know, I havent seen the error before, did the stats still display?

Maybe ask in this https://bitcointalk.org/index.php?topic=108533.0

Its the forum for the pool software.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: bitcoindaddy on April 05, 2013, 05:14:05 PM
Thats a no to python3 as far as  I know, I havent seen the error before, did the stats still display?

Maybe ask in this https://bitcointalk.org/index.php?topic=108533.0

Its the forum for the pool software.

The stats screen displayed before I actually started mining (and it had no shares to display)


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: bitcoindaddy on April 05, 2013, 05:30:21 PM
I didn't see this note in the writeup:  "PREVHASH_REFRESH_INTERVAL = to the same value as MERKLE_REFRESH_INTERVAL". I had mine set to 300 instead of the recommended 60. The web display is working now. Still getting mostly untracked shares though.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 05, 2013, 05:57:30 PM
Its in there.. its not in a code block though.

edit: the reason stats may not have been working properly before you mined, could be there was no values in the database for it to read and this was causing the error?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 06, 2013, 09:35:04 PM
per your instructions here:

at a new command prompt

Code:
./git/stratum-mining/scripts/blocknotify.sh --password somepassword1 --host localhost --port 3333

if its working it should display something like below (the amount of time it takes to notify will change each time)

blocknotify: done in 0.012 sec

i instead get this while server is running:

Code:
joe@cypher:~/git/stratum-mining$ ./git/stratum-mining/scripts/blocknotify.sh --password somepassword1 --host localhost --port 3333
bash: ./git/stratum-mining/scripts/blocknotify.sh: No such file or directory
joe@cypher:~/git/stratum-mining$


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 06, 2013, 09:45:12 PM
I have edited it to fix it. How it is was written will work from your home directory, but following the tute means you  are already in the stratum mining directory.

This should work as well
Code:
/home/joe/git/stratum-mining/scripts/blocknotify.sh --password somepassword1 --host localhost --port 3333

This will be needed in the end if you put it in the bitcoin.conf file anyway.

Just remember on most linux distributions the user home directories are nearly always in the format of /home/username


I


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 06, 2013, 11:40:48 PM
i think you have an inconsistency in the passwords used in tute; "somepassword" & "somepassword1"

messed me up since i am just testing right now cutting and pasting everything. :P


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 06, 2013, 11:55:34 PM
this looks good does it not?

Code:
9aea940cefe1faf5549840da80 (1) valid bitcoinrpc
2013-04-06 16:54:48,236 INFO interfaces # 00000000f8400ebc85c8eb041171b2d000a3930a52c46d4c69b0ecfbcdf6ec0b (1) valid bitcoinrpc
2013-04-06 16:55:19,929 INFO interfaces # 00000000505b58c68d9fc08ae1f87401fa6558dba4365bf72c6d4b132a491172 (3) valid bitcoinrpc
2013-04-06 16:55:21,250 INFO template_registry # We found a block candidate! 000000000179cce0c344803c172878b87a6ce63c8508b7c673e7564e78687040
2013-04-06 16:55:21,253 INFO interfaces # 000000000179cce0c344803c172878b87a6ce63c8508b7c673e7564e78687040 (173) valid bitcoinrpc
2013-04-06 16:55:21,486 INFO interfaces # Block 000000000179cce0c344803c172878b87a6ce63c8508b7c673e7564e78687040 ACCEPTED
2013-04-06 16:55:21,486 INFO DBInterface # Updating Found Block Share Record
2013-04-06 16:55:21,487 INFO DBInterface # Inserting 5 Share Records
2013-04-06 16:55:21,924 INFO stats # 2 peers connected, state changed 1 times
2013-04-06 16:55:21,925 INFO mining # New block notification received
2013-04-06 16:55:21,928 INFO stats # 1 peers connected, state changed 1 times
2013-04-06 16:55:21,934 INFO template_registry # New template for 000000000179cce0c344803c172878b87a6ce63c8508b7c673e7564e78687040
2013-04-06 16:55:21,934 INFO subscription # BROADCASTED to 1 connections in 0.000 sec
2013-04-06 16:55:21,934 INFO template_registry # Update finished, 0.002 sec, 1 txes


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 07, 2013, 12:09:56 AM
can you help me decipher these times from bitcoind listtransactions?:

Code:
"time" : 1365293126,
        "timereceived" : 1365293162


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 07, 2013, 12:10:28 AM
looks ok, when the blocknotify runs from bitcoind does the out put say the same as when tested ? eg blocknotify done in 0.20 (the time changes)seconds?

Also the passwords are different as you are meant to be using your passwords that you choose, not the ones in the tute.

You didnt use the rpc password from the tute ? you used the one bitcoind generated when you first ran it ?

If its the one from the tute page I would change it.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 07, 2013, 12:14:34 AM
looks ok, when the blocknotify runs from bitcoind does the out put say the same as when tested ? eg blocknotify done in 0.20 (the time changes)seconds?

joe@cypher:~/git/stratum-mining$ blocknotify: done in 0.397 sec
blocknotify: done in 0.436 sec
blocknotify: done in 0.338 sec
blocknotify: done in 0.404 sec
blocknotify: done in 0.393 sec
blocknotify: done in 0.350 sec
blocknotify: done in 0.310 sec
blocknotify: done in 0.412 sec
blocknotify: done in 0.424 sec
blocknotify: done in 0.473 sec
blocknotify: done in 0.395 sec
blocknotify: done in 0.361 sec
blocknotify: done in 0.385 sec

Quote
Also the passwords are different as you are meant to be using your passwords that you choose, not the ones in the tute.

You didnt use the rpc password from the tute ? you used the one bitcoind generated when you first ran it ?

If its the one from the tute page I would change it.

as i said, i'm just testing right now so i will change pwd's when my avalons come  :D


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 07, 2013, 12:16:04 AM
They are in the unix timestamp format

You can use this to decode them.
http://www.unixtimestamp.com/index.php


more info http://en.wikipedia.org/wiki/Unix_time

blocknotify looks good, you change the prev_hash check time ?


edit:testnet coins if you dont have any use for them send them here http://tpfaucet.appspot.com/

Also a list of the bitcoind api calls https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 07, 2013, 12:17:27 AM
They are in the unix timestamp format

You can use this to decode them.
http://www.unixtimestamp.com/index.php


more info http://en.wikipedia.org/wiki/Unix_time

blocknotify looks good, you change the prev_hash check time ?

yep.  to 60 like you said.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 07, 2013, 12:41:00 AM
can you clarify these parts in the OP, please?:

"further down in the config.py file find this line ALLOW_NONLOCAL_WALLET = True                            # Allow valid, but NON-Local wallet's

change ALLOW_NONLOCAL_WALLET = False
to

ALLOW_NONLOCAL_WALLET = True"

"(On headless servers, You can use screen to run the server in so you can rettach back to screen and see the output of the server. just type screen on the command

line and it will lod up to a new command prompt, start the server as usal. when you done before you disccount or close your ssh session do a cntrl d  which will

detach screen. When you login next and want to look at the pool server output type screen -r on the command line.)"

"If the machine is rebooted for some reason you will have to start bitcoind and the pool server again. This can be automated if you want."

It would be cool if you could show us how to auto start bitcoind and the pool server in the event of a temporary power outage.

0.5 BTC tip sent.  Thanks.  :D


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 07, 2013, 09:55:32 AM
The first part is so you can send the btc you mine straight to another valid wallet of yours. Leave is as False and use the local bitcoind wallet if you want.

 But if you don't understand how to send btc out of bitcoind and its also more secure in the end to send them to another wallet address YOU own(as it says in the the tute don't use the address listed there). Whether that is a windows/mac bitcoin client wallet or something like a block chain wallet or cold storage one?(don't know much about cold storage). Then set it to True

When you finished testing on testnet and you go to mine real btc you have to make sure you have one of your btc wallet addresses in the first line of config.py

Thanks for the tip :D

Ill have a look at second part when I finish work there is a script somewhere already on he forums.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 07, 2013, 07:28:05 PM


This is from this thread https://bitcointalk.org/index.php?topic=965.0

Thanks to  phungus and gigavps

Code:
sudo pico /etc/init/bitcoind.conf

Then paste this into the file
Code:
# bitcoind upstart script for Ubuntu

description "Bitcoin daemon"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
exec su -c "/usr/local/bin/bitcoind" - joe

For a testnet version replace  the above exec line
with this
Code:
exec su -c "/usr/local/bin/bitcoind -testnet" - joe

For anyone else wanting to use this replace joe with your username.

If you want to start, stop or restart it is one of the following commands, it should start it self automatically when the machine boots.

sudo start bitcoind
sudo stop bitcoind
sudo restart bitcoind


If you use bitcoind stop , the upstart script will auto restart it so if you want to stop it must use the above stop command.

For the pool server, I am not sure as it depends on how the include directories are set in launcher.tac, someone else might be able to help with that. I will have a poke at it over this week.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jspielberg on April 08, 2013, 04:09:46 AM
I have been playing around with an upstart script for the pool tonight.

Code:
description "Start and stop slush on bitcoind start"

respawn
expect fork

start on started bitcoind
stop on stopped bitcoind

pre-start script
   sleep 30
end script

chdir /pool/build/slushbuild/stratum-mining
exec twistd --syslog -ny launcher.tac &


You will need to change the "chdir" to the path to your stratum mining directory to have this work for you.
Copy the edited content into /etc/init/slushpool.conf

I put in a 30 second delay in the pre-start, so bitcoind has a opportunity to get started enough to accept the RCP calls.  I was finding that slushpool was starting up too early and not able to communicate with bitcoind.

Feel free to see if it works for you guys too.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 09, 2013, 06:37:56 AM
I have changed the git repo from gavins to the bitcoin one and changed the version to currrent release 0.8.1

You may wish to to rebuild,
once logged in
Code:

cd git
rm -rf bitcoind-git

git clone https://github.com/bitcoin/bitcoin.git
git checkout 0.8.1

cd bitcoin/src
make -f makefile.unix

once it has done copy it over the current bitcoind

Code:
sudo cp bitcoind /usr/local/bin/bitcoind

cool thanks for the script for the pool server, its running it as root though. People may want to change that when they use it.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 09, 2013, 04:33:37 PM
i'm reinstalling on new ssd.  when i try to build with:

Code:
make -f makefile.unix

i get this:

Code:
In file included from db.cpp:6:0:
db.h:14:20: fatal error: db_cxx.h: No such file or directory
compilation terminated.
make: *** [obj/db.o] Error 1
cypher@server:~/git/bitcoin/src$



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 09, 2013, 06:02:48 PM
The database libraries havent been installed, more then likely this one libdb4.8++-dev

its one of the .deb packages you download and installed with sudo dpkg -i

You will have to install libdb4.8++ first

Just double check all the dependencies are installed

Code:
sudo apt-get install build-essential
sudo apt-get install libssl-dev
sudo apt-get install libboost-all-dev
sudo apt-get install libminiupnpc-dev

wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8_4.8.30-quantal2_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8-dev_4.8.30-quantal2_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8%2B%2B_4.8.30-quantal2_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8%2B%2B-dev_4.8.30-quantal2_i386.deb

sudo dpkg -i libdb4.8_4.8.30-quantal2_i386.deb
sudo dpkg -i libdb4.8-dev_4.8.30-quantal2_i386.deb
sudo dpkg -i libdb4.8++_4.8.30-quantal2_i386.deb
sudo dpkg -i libdb4.8++-dev_4.8.30-quantal2_i386.deb

If its a 64bit install use the 64bit libraries in the other post.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 09, 2013, 11:54:52 PM
so in this part doesn't the username and password have to match that in the bitcoin.conf file?

"you should be able to point your miner at

http://YOURHOSTNAMEORIPADDRESS:3333

eg cgminer -o yourhostnameORIPADRESS:3333 -u guest -p guest

(the guest can bereplaced by any username/password you want)"


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 10, 2013, 08:40:43 AM
Nope it's any password and username you want the pool software will add it automatically. Like the worker username and password you make for other pools


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: humble on April 20, 2013, 05:11:26 PM
Trying to get this setup in preparation for impending Avalon arrival.

Machine is running 64 bit version of Ubuntu 12.10.

Here is a transcript of my pain:

Quote
root@avalon:/home/jack# easy_install -U distribute
Searching for distribute
Reading http://pypi.python.org/simple/distribute/
Reading http://packages.python.org/distribute
Best match: distribute 0.6.36
Processing distribute-0.6.36-py2.7.egg
distribute 0.6.36 is already the active version in easy-install.pth
Installing easy_install script to /usr/local/bin
Installing easy_install-2.7 script to /usr/local/bin
Using /usr/local/lib/python2.7/dist-packages/distribute-0.6.36-py2.7.egg
Processing dependencies for distribute
Finished processing dependencies for distribute


root@avalon:/home/jack# easy_install stratum
Searching for stratum
Reading http://pypi.python.org/simple/stratum/
Reading http://blog.bitcoin.cz/stratum
Best match: stratum 0.2.12
Downloading http://pypi.python.org/packages/source/s/stratum/stratum-0.2.12.tar.gz#md5=a685da0dce43263db08ae949568b0f54
Processing stratum-0.2.12.tar.gz
Running stratum-0.2.12/setup.py -q bdist_egg --dist-dir /tmp/easy_install-VMEAZ0/stratum-0.2.12/egg-dist-tmp-RDHzmk
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.24dev-r0 (/usr/lib/python2.7/dist-packages))
error: Setup script exited with 2

It looks like Stratum is demanding a version of distribute of >=0.6.28 and doesn't recognize distribute 0.6.36.

Any suggested workarounds?

thanks,

humble


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on April 20, 2013, 05:54:36 PM
if i put up a ufw firewall on this 12.10 server, what ports would i have to open?

8332 and 8333 come to mind but what about 3333?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 20, 2013, 07:28:10 PM
Trying to get this setup in preparation for impending Avalon arrival.

Machine is running 64 bit version of Ubuntu 12.10.

Here is a transcript of my pain:

Quote
root@avalon:/home/jack# easy_install -U distribute
Searching for distribute
Reading http://pypi.python.org/simple/distribute/
Reading http://packages.python.org/distribute
Best match: distribute 0.6.36
Processing distribute-0.6.36-py2.7.egg
distribute 0.6.36 is already the active version in easy-install.pth
Installing easy_install script to /usr/local/bin
Installing easy_install-2.7 script to /usr/local/bin
Using /usr/local/lib/python2.7/dist-packages/distribute-0.6.36-py2.7.egg
Processing dependencies for distribute
Finished processing dependencies for distribute


root@avalon:/home/jack# easy_install stratum
Searching for stratum
Reading http://pypi.python.org/simple/stratum/
Reading http://blog.bitcoin.cz/stratum
Best match: stratum 0.2.12
Downloading http://pypi.python.org/packages/source/s/stratum/stratum-0.2.12.tar.gz#md5=a685da0dce43263db08ae949568b0f54
Processing stratum-0.2.12.tar.gz
Running stratum-0.2.12/setup.py -q bdist_egg --dist-dir /tmp/easy_install-VMEAZ0/stratum-0.2.12/egg-dist-tmp-RDHzmk
The required version of distribute (>=0.6.28) is not available,
and can't be installed while this script is running. Please
install a more recent version first, using
'easy_install -U distribute'.
(Currently using distribute 0.6.24dev-r0 (/usr/lib/python2.7/dist-packages))
error: Setup script exited with 2

It looks like Stratum is demanding a version of distribute of >=0.6.28 and doesn't recognize distribute 0.6.36.

Any suggested workarounds?

thanks,

humble

Maybe follow the actual instructions? I dont install it as root. sudo carries some path environment variables across.

Which might be causing what happens. Also you are not in the git directory, when you do the easy_install stratum  be in the directory before the stratum directory.

If both of those dont work.

change directory to inside the stratum directory.

then
Code:
sudo python setup.py install



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 20, 2013, 07:48:17 PM
if i put up a ufw firewall on this 12.10 server, what ports would i have to open?

8332 and 8333 come to mind but what about 3333?

Depends what you are doing? and where is the server. (e.g. is it at home or live on the net somewhere)

But you will need to add the pool server 3333 also its stats port if you wish to use it 8889
Also the 8333 bitcoind port.
JSON port isn't needed unless you have software outside accessing it.

If the server is hosted somewhere you will have open up ssh port to allow access to ip from where you are accessing the server from(if you don't have a static ip at home this gets complicated).
Make sure you create ssh keys and turn off password authentication. (google open ssh keys ubuntu) for how to do it. Make sure you test it or have easy access to the machine before you disable password auth.
If its live on the net somewhere please make sure that the pool and bitcoind are running under their own nologin usernames and definitely not root.

Id recheck the payout address on a regular basis as well. Don't use a address from the local wallet on the machine, use  cold wallet with a watch only address.

The list is semi endless on securing it. If its for mining for others as well get help.




Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: humble on April 21, 2013, 01:13:50 AM
 
Quote
Also you are not in the git directory, when you do the easy_install stratum  be in the directory before the stratum directory.

Thanks, that did it.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: furball on April 23, 2013, 10:37:37 AM
First of all can I just say a huge thanks to tiktoc for one of the best tutorials I've ever seen for building software. I've seen some good tutorials in my time but nearly all needed some sort of tweaking; this one worked first time for me...thanks so much.

Just wanted to expand the discussion, to adding a web frontend for pool management and adding users. Has anybody set up a frontend after following this setup. I've tried SimpleCoin but having issues linking it to the data that Stratum has gathered.

There seems to be loads of frontends that will link in with pushpool and poolserverj but they don't support Stratum right now afaik. I would like to continue with Stratum as that looks to be the way to go and a frontend that would bolt onto this setup from tiktoc would be great.

Any help that anybody could give would be greatly appreciated.





Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 23, 2013, 01:52:28 PM
Thanks :)

I fiddled with simple coin and mining farm. Got simplecoin to kinda work. You need to change the pool conf file to write to MySQL and setup MySQL.

But a MAJOR warning. Simple coin currently apparently had major security flaws. So it needs work and code review and maybe even design review on how payments are processed. There are some chose changes in pull request that haven't been applied.

So currently I don't think it is safe to use. As there has been a fair few cases of pools who used it when it was first released being hacked.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jspielberg on May 17, 2013, 12:19:57 PM
The easiest way to debug upstart is to use initctl to emit the events on demand... but I have found upstart to be a bit of a pain.

I have moved away from upstart and instead now have a user cron script that runs every minute and checks if bitcoind and slush are running.  A bit less elegant, but it gets the job done.

I found that in my setup, bitcoind (0.81) crashes every couple of days... so really this was to deal with that problem.

Code:
foreman@camelot:~$ crontab -l
# Edit this file to introduce tasks to be run by cron.
#
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h  dom mon dow   command
  * *   *  *    *     /home/foreman/bin/mining_watchdog.sh

and the watchdog:
Code:
foreman@camelot:~$ cat bin/mining_watchdog.sh 
#!/bin/bash

BITCOIND_PID=$(ps auxww |grep bitcoind |grep daemon | awk '{print $2}')
if [ -z "$BITCOIND_PID" ]; then
    logger "no bitcoind found - start it up"
    trickle -s -u 100 /usr/bin/bitcoind -daemon -datadir=/pool/data -blocknotify=/pool/data/newblock.sh

    SLUSH_PID=$(ps auxww |grep launcher.tac |grep python | awk '{print $2}')
    if [ -n "$SLUSH_PID" ]; then
logger "bitcoind died but slush running - killing slush"
kill -HUP $SLUSH_PID
sleep 3
SLUSH_PID=$(ps auxww |grep launcher.tac |grep python | awk '{print $2}')
if [ -n "$SLUSH_PID" ]; then
    logger "slush still running after kill - one last try"
    kill -9 $(ps auxww |grep launcher.tac |grep python | awk '{print $2}')
fi
    fi
fi

sleep 45
SLUSH_PID=$(ps auxww |grep launcher.tac |grep python | awk '{print $2}')
if [ -z "$SLUSH_PID" ]; then
    logger "Starting Slush"
    ( cd  /home/foreman/build/stratum-mining; twistd --syslog -ny launcher.tac & )   
fi

All the absolute pathing needs to be changed to reflect your home and bitcoind data dirs.

Note... I am using trickle on my bitcoind so it doesn't eat up all the bandwidth. 
If the wife can't watch "Dancing with the stars" on hulu, then my bitcoin hobby is put in jeopardy.

Hope that is useful for the unix literate in the thread.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on May 17, 2013, 12:36:57 PM
There is also logs for upstart in the /var/log directory.
I have a modified version for both but they are on a machine I cant access at the moment, I will post them when I get home.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on May 17, 2013, 05:18:44 PM
Replace the bits you need to

Code:
# bitcoind upstart script for Ubuntu

description "Bitcoin daemon"

start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 60
setuid yourusernameforbitcoinhere
expect fork
exec /usr/local/bin/bitcoind -datadir=/home/yourusernameforbitcoinhere/.bitcoin


Code:
description "Start and stop slush on bitcoind start"

respawn
respawn limit 10 60
expect fork

start on started bitcoind
stop on stopped bitcoind
setuid poolusernamehere
pre-start script
   sleep 30
end script

chdir /home/poolocation/git/stratum-mining
exec twistd --syslog -ny /home/poollocation/git/stratum-mining/launcher.tac &



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jspielberg on May 17, 2013, 07:15:41 PM
I didn't notice that setuid option.... that is so much cleaner than trying to run the command through a su -c.

Anyone else seeing instability with bitcoind?
I see it crash every couple of days.

It restarts fast enough that I haven't bothered to look any further.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on May 17, 2013, 07:26:42 PM
could be memory related ? seems a lot of transactions that pools wont accept are floating around at the moment and staying in memory permanently check the p2pool thread has more information.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tempt on May 18, 2013, 06:35:08 PM
I have a problem with the mysql set up...
I've got it all done, it connected obviously, even got a entry at poolworker. but now I dont get any further? It does not update anything.GUIMiner says shares accepted, but DB is still empty except for the poolworker name.

Any experience?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on May 19, 2013, 10:16:13 PM
Played with it briefly it seemed to work not never looked at it very closely, maybe ask in the stratum pool thread in the pools sub forum.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: libertybuck on May 24, 2013, 04:12:50 AM
Thanks tiktok. This is the best tutorial related with bitcoin. I have bookmarked it.

During installation I got the following error message, please help me check it:

Code:
mypoolroot@ubuntu:~/git/stratum-mining$ twistd -ny launcher.tac -l -
2013-05-23 22:56:08,199 INFO mining # Connecting to bitcoind...
2013-05-23 22:56:08-0500 [-] Log opened.
2013-05-23 22:56:08-0500 [-] twistd 13.0.0 (/usr/bin/python 2.7.3) starting up.
2013-05-23 22:56:08-0500 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2013-05-23 22:56:22-0500 [-] Unhandled Error
        Traceback (most recent call last):
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/application/app.py", line 402, in startReactor
            self.config, oldstdout, oldstderr, self.profiler, reactor)
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/application/app.py", line 323, in runReactorWithLogging
            reactor.run()
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/base.py", line 1192, in run
            self.mainLoop()
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/base.py", line 1201, in mainLoop
            self.runUntilCurrent()
        --- <exception caught here> ---
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/base.py", line 824, in runUntilCurrent
            call.func(*call.args, **call.kw)
          File "/home/mypoolroot/git/stratum-mining/mining/DBInterface.py", line 80, in run_import
            d = self.bitcoinrpc.getinfo()
        exceptions.AttributeError: DBInterface instance has no attribute 'bitcoinrpc'

2013-05-23 22:57:23,541 INFO mining # Connected to bitcoind - Ready to GO!



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on May 24, 2013, 08:24:29 PM
Are you using a external database like mysql?
What section of the tute did you get the error in?
I havent seen the error before you might be able to get more answers in the pools forums there is thread there for stratum pool software.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: libertybuck on May 25, 2013, 11:59:45 AM
Are you using a external database like mysql?
What section of the tute did you get the error in?
I havent seen the error before you might be able to get more answers in the pools forums there is thread there for stratum pool software.

Sir. Thanks for your reply. I have fixed the issue. It was because I did not install sqlite on that fresh ubuntu.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jspielberg on May 25, 2013, 01:45:44 PM
Libertybuck -

I believe you have received your avalons already no?

Would you care to comment on your experience with this setup of using slush and the avalon?  A number of folks are using eloipool since Jeff posted a rough howto earlier.

I have been tempted to wrestle with eloipool again, but slush worked much better out of the box.  Mine is happily setup and running fine with my testing GPUs... (28 days in and 3.4% of the round completed!  :o ).  I really like that slush has the little status webpage.

Thanks!


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: libertybuck on May 26, 2013, 02:17:15 AM
I believe you have received your avalons already no?

Yes. Already.


Would you care to comment on your experience with this setup of using slush and the avalon?  A number of folks are using eloipool since Jeff posted a rough howto earlier.

I have been tempted to wrestle with eloipool again, but slush worked much better out of the box.  Mine is happily setup and running fine with my testing GPUs... (28 days in and 3.4% of the round completed!  :o ).  I really like that slush has the little status webpage.

I tried https://bitcointalk.org/index.php?topic=158105.60 and https://bitcointalk.org/index.php?topic=172151.0 , but I do not have enough skill to make neither of them work.

To try tiktoc's tutorial, I prepare a fresh ubuntu server under vmware esxi. I do it step by step according to https://bitcointalk.org/index.php?topic=162788.msg1712011#msg1712011 . All are quite smooth. Currently I am testing and studying the pool with icarus. Will point avalon to it later.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jspielberg on May 26, 2013, 02:35:06 AM
Thanks Libertybuck -

I agree this thread was much easier to follow and end up with a functional pool server at the end than the eloipool threads.

I don't have my avalon yet, so I am just testing with my GPUs, but if it works fine with your avalon, then I will probably do the same with mine.

Best of luck to you!


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on May 29, 2013, 12:26:47 AM
Will point avalon to it later.

any news on this?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: fuzzster on May 31, 2013, 09:24:12 AM
Thanks for the original post! I have set it up successfully, just wanted to check something...

the round_progress has gone to 105%. Should it not have found something by 100% or is this just the average?

Basically, is it normal for it to go over 100% or should I be worried??


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on May 31, 2013, 11:37:42 AM
You will have to ask in the stratum pool software thread about that. Is that coming from the statistics page?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: fuzzster on May 31, 2013, 12:19:51 PM
Thanks for replying tiktoc! I have posted on the stratum page but with no reply :( So thought I'd try my luck here. Have you experienced it at all? Or do you always find the block under 100%?

I am getting the progress value from the pool table in the database, which does display on the stats page, yes.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jspielberg on May 31, 2013, 12:23:21 PM
I was under the impression that under 100% means your round was lucky and over 100% means you weren't.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jspielberg on June 03, 2013, 01:45:16 PM
While I can't confirm that this solo setup works with avalon asic miners (yet), I can confirm that if properly configured as stated in this thread that it does properly credit an external wallet address with a few humble GPU miners configured as stratum when a block is found.  ;D


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: fuzzster on June 03, 2013, 03:49:50 PM
Quick update:

Everything was working fine, it was just me being paranoid. It found the block at about 106%.

I think jspielberg hit the nail on the head!

Thanks for your replies!


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on June 03, 2013, 04:13:30 PM
While I can't confirm that this solo setup works with avalon asic miners (yet), I can confirm that if properly configured as stated in this thread that it does properly credit an external wallet address with a few humble GPU miners configured as stratum when a block is found.  ;D

was this on the real Bitcoin network or test net?

for me, it worked perfectly on test net and i've left it running for over a month and a half w/o mining and bitcoind/blocknotify is updating perfectly w/o any lapses.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jspielberg on June 03, 2013, 05:25:22 PM
The block my setup found yesterday was on mainnet.  I also tested briefly on test (about a month ago).


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on June 03, 2013, 06:38:49 PM
Congrats :), saw kano's reply in the stratum thread. Assumed something like he said, but he can explain it properly :)

edit: I will have a look at 8.2 next few days and change the tute for it.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: zulu83465 on June 07, 2013, 02:34:19 PM
Hi

run "twistd-ny launcher.tac-l -"

get the response:

2013-06-07 18:18:27,407 INFO mining # Waiting for bitcoin RPC...
2013-06-07 18:18:27+0400 [-] Log opened.
2013-06-07 18:18:27+0400 [-] twistd 13.0.0 (/usr/bin/python 2.7.3) starting up.
2013-06-07 18:18:27+0400 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2013-06-07 18:18:58,184 INFO mining # Response from bitcoin RPC OK
2013-06-07 18:18:58+0400 [HTTPPageGetter,client] Starting factory <HTTPClientFactory: http://localhost:8332>
2013-06-07 18:18:58+0400 [HTTPPageGetter,client] Stopping factory <HTTPClientFactory: http://localhost:8332>
2013-06-07 18:19:18,516 INFO coinbaser # Coinbase address '1MYwS2ASuwrucQtVM1VdFYnX4DR7E8WwYr' is valid
2013-06-07 18:19:18+0400 [HTTPPageGetter,client] Starting factory <HTTPClientFactory: http://localhost:8332>
2013-06-07 18:19:18,518 INFO mining # MINING SERVICE IS READY
2013-06-07 18:19:18+0400 [HTTPPageGetter,client] Loading of signing key 'None' failed, protocol messages cannot be signed.
2013-06-07 18:19:18+0400 [HTTPPageGetter,client] Cannot initiate SSL context, are SSL_PRIVKEY or SSL_CACERT missing?
2013-06-07 18:19:18+0400 [HTTPPageGetter,client] This will skip all SSL-based transports.
2013-06-07 18:19:18+0400 [HTTPPageGetter,client] Unhandled error in Deferred:
2013-06-07 18:19:18+0400 [HTTPPageGetter,client] Unhandled Error
   Traceback (most recent call last):
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 1070, in _inlineCallbacks
       result = g.send(result)
     File "/home/zulu/stratum/mining/__init__.py", line 66, in setup
       on_startup.callback(True)
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 380, in callback
       self._startRunCallbacks(result)
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 488, in _startRunCallbacks
       self._runCallbacks()
   --- <exception caught here> ---
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 575, in _runCallbacks
       current.result = callback(current.result, *args, **kw)
     File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.12-py2.7.egg/stratum/server.py", line 77, in setup_finalize
       socket.setServiceParent(application)
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/application/service.py", line 186, in setServiceParent
       self.parent.addService(self)
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/application/service.py", line 308, in addService
       service.privilegedStartService()
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/application/internet.py", line 103, in privilegedStartService
       self._port = self._getPort()
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/application/internet.py", line 131, in _getPort
       'listen%s' % (self.method,))(*self.args, **self.kwargs)
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/posixbase.py", line 489, in listenTCP
       p.startListening()
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/tcp.py", line 980, in startListening
       raise CannotListenError(self.interface, self.port, le)
   twisted.internet.error.CannotListenError: Couldn't listen on any:3333: [Errno 98] Address already in use.

I need to update Twisted or something else?
thanks for any advice and assistance


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on June 07, 2013, 07:28:02 PM

     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/posixbase.py", line 489, in listenTCP
       p.startListening()
     File "/usr/local/lib/python2.7/dist-packages/Twisted-13.0.0-py2.7-linux-i686.egg/twisted/internet/tcp.py", line 980, in startListening
       raise CannotListenError(self.interface, self.port, le)
   twisted.internet.error.CannotListenError: Couldn't listen on any:3333: [Errno 98] Address already in use.

I need to update Twisted or something else?
thanks for any advice and assistance

Something or another running instance of the server is running already and using the 3333 port. Check that the mining server isnt already running.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: zulu83465 on June 07, 2013, 09:37:13 PM
Thank you very much for your help
now it works )

[/quote]

Something or another running instance of the server is running already and using the 3333 port. Check that the mining server isnt already running.
[/quote]


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on June 13, 2013, 02:14:54 AM
questions:

1.  to upgrade from 0.8.1 to 0.8.2 are the commands simply "sudo apt-get update" followed by "sudo apt-get upgrade"?
2.  how do i check bitcoind version # from the command line?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: fuzzster on June 13, 2013, 06:59:28 AM
questions:

1.  to upgrade from 0.8.1 to 0.8.2 are the commands simply "sudo apt-get update" followed by "sudo apt-get upgrade"?
2.  how do i check bitcoind version # from the command line?

For point two, run
Code:
bitcoind getinfo
. The version will be listed at the top of your output.

Re point one, not 100% on this myself. Am looking into it and will let you know what I find - unless someone else here could help??


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on June 13, 2013, 07:31:46 AM
I have changed the top post for 0.8.2. To install 0.8.2 delete the git/bitcoin directory and start again from the clone bitcoin command. When it has finished building bitcoind and you have copied it to /use/local/bin and restart bitcoind. You should be on the new version. You don't have to change anything in bitcoin.conf.  If you are using a local wallet make sure you backup your .bitcoin directory before you install the new version.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on June 14, 2013, 11:19:58 PM
is the "&" part of the command correct in the tute?:

Code:
then started the server again using

twistd -ny launcher.tac -l - &


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jspielberg on June 15, 2013, 12:33:42 AM
The & throws the process into the background.   If you want to keep it in the foreground, leave it out.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on June 15, 2013, 01:01:08 AM
I didn't notice that setuid option.... that is so much cleaner than trying to run the command through a su -c.

Anyone else seeing instability with bitcoind?
I see it crash every couple of days.

It restarts fast enough that I haven't bothered to look any further.

did we ever agree as to the best way to restart bitcoind and stratum pool in case of a crash?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on June 15, 2013, 07:25:30 PM
If you use the last version of the init scripts i posted they should restart either bitcoind or the pool software if they crash, unless its reoccurring error after a set number of times it wont try to restart them.

There is more you can do to monitor them, one of the linux forums might get more results, or asking nicely in the pools thread. Its not something I have examples for as I havent needed to do it.

googling linux process monitoring comes up with a few hit to have a read about eg http://www.unix.com/shell-programming-scripting/17866-script-monitor-process-running-server-posting-mail-if-any-process-dead.html


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on June 17, 2013, 08:50:55 PM
Replace the bits you need to

Code:
# bitcoind upstart script for Ubuntu

description "Bitcoin daemon"

start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 60
setuid yourusernameforbitcoinhere
expect fork
exec /usr/local/bin/bitcoind -datadir=/home/yourusernameforbitcoinhere/.bitcoin


Code:
description "Start and stop slush on bitcoind start"

respawn
respawn limit 10 60
expect fork

start on started bitcoind
stop on stopped bitcoind
setuid poolusernamehere
pre-start script
   sleep 30
end script

chdir /home/poolocation/git/stratum-mining
exec twistd --syslog -ny /home/poollocation/git/stratum-mining/launcher.tac &



so do these 2 bits of code go into the bitcoin.conf and stratum-mining.conf files respectively?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on June 18, 2013, 05:03:01 PM
nope, they go in /etc/init/ directory, create them as root

mine looks like this

-rw-r--r-- 1 root root 228 Apr 12 08:03 bitcoind.conf

the bitcoind info goes in the above one and the pool one below

-rw-r--r-- 1 root root 305 Apr 12 08:12 slushpool.conf

Code:

sudo su root

cd /etc/init/

pico bitcoind.conf


cut and past the above bitcoind init script into pico

cntrl x
then hit y to save


Code:
pico slushpool.conf


cut and past the above pool  init script into pico

cntrl x
then hit y to save


Init is the automatic program startup system for linux.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on June 29, 2013, 11:13:04 PM
Code:
cypher@server:~$ bitcoind -blocknotify="/home/username/git/stratum-mining/scripts/blocknotify.sh --password x --host localhost --port 3333" -daemon
cypher@server:~$ Bitcoin server starting
: Error opening block database.
Do you want to rebuild the block database now?
y
y: command not found

how do i respond to this?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on June 29, 2013, 11:31:15 PM
Try starting it without the -daemon

Once it has finished rebuilding start it adding with the -daemon


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on June 29, 2013, 11:44:30 PM
Try starting it without the -daemon

Once it has finished rebuilding start it adding with the -daemon

same error w/o -daemon


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on June 30, 2013, 07:38:07 AM
Code:
cypher@server:~$ bitcoind -blocknotify="/home/username/git/stratum-mining/scripts/blocknotify.sh --password x --host localhost --port 3333" -daemon
cypher@server:~$ Bitcoin server starting
: Error opening block database.
Do you want to rebuild the block database now?
y
y: command not found

how do i respond to this?

btw, this happened while i was away on vacation.  came back and server shutdown.  wasn't actively mining; just running bitcoind daemon and slush server anyway.  got this error when trying to restart.

should be a simple fix?  anxious to get it working again as my avalons arrived and want to point them at this solo setup to see if they work.  ;D


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on June 30, 2013, 08:03:24 AM
When it us not running in daemon mode it should except keyboard input so it should rebuild when you hit enter.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 01, 2013, 05:42:01 PM
i think i just noted an inconsistency in the tute:

Quote
CENTRAL_WALLET = '1jxc4KgRXCkn2JD7QjmgMrDKqM2yQtPAp'   # local bitcoin address where money goes

(DO NOT USE THE WALLET ADDRESS IN THE ABOVE LINE)[/font]

The address MUST have the '' chars around it like above.

should the address be bounded by ' or " ?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jspielberg on July 01, 2013, 07:12:59 PM
i think i just noted an inconsistency in the tute:

Quote
CENTRAL_WALLET = '1jxc4KgRXCkn2JD7QjmgMrDKqM2yQtPAp'   # local bitcoin address where money goes

(DO NOT USE THE WALLET ADDRESS IN THE ABOVE LINE)[/font]

The address MUST have the '' chars around it like above.

should the address be bounded by ' or " ?

No inconsistency... just misleading with a proportional space font... the '' is actually two single 's real close together.

Personally I found this pool easier to setup than eligius... plus slush has a status webpage which is nice.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 01, 2013, 08:17:08 PM
i think i just noted an inconsistency in the tute:

Quote
CENTRAL_WALLET = '1jxc4KgRXCkn2JD7QjmgMrDKqM2yQtPAp'   # local bitcoin address where money goes

(DO NOT USE THE WALLET ADDRESS IN THE ABOVE LINE)[/font]

The address MUST have the '' chars around it like above.

should the address be bounded by ' or " ?

No inconsistency... just misleading with a proportional space font... the '' is actually two single 's real close together.

Personally I found this pool easier to setup than eligius... plus slush has a status webpage which is nice.

have you recv'd your asic's yet and started solo mining?

just finished my -reindex of blockchain (arrgghh) and will be pointing the avalons at the pool very soon.  will let you know how it goes.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on July 02, 2013, 07:05:45 AM
I have put a space between some of the ' ' let me know if this makes it easier to understand. :) So far from what I have seen this works to compile 0.8.3 just replace the git checkout v0.8.2 with git checkout 0.8.3



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 02, 2013, 10:00:37 AM
Tiltoc,

When you get a chance could you add a small section at the end of the tute detailing the exact steps when upgrading both the bitcoind and stratum software versions?

This is happening a lot. Thanks.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 02, 2013, 02:22:23 PM
getting stuck here:

Code:
home@server:~/git/bitcoin$ git checkout -b 0.8.3Switched to a new branch '0.8.3'
home@server:~/git/bitcoin$ git checkout v0.8.3
Note: checking out 'v0.8.3'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at 40809ae... Bump version numbers for 0.8.3 release
home@server:~/git/bitcoin$ git checkout v0.8.3
HEAD is now at 40809ae... Bump version numbers for 0.8.3 release


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on July 02, 2013, 05:43:14 PM
If the libraries match in the build docs are the same for the new version as they were for the old then


Code:
cd
cd git
rm -rf bitcoin

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
git checkout v0.8.3
cd src/

make -f makefile.unix

once its finished recompiling
sudo cp bitcoind /usr/local/bin/

you can change the git checkout command to the new version when it comes out if the libraries match


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 02, 2013, 05:50:28 PM
If the libraries match in the build docs are the same for the new version as they were for the old then


Code:
cd
cd git
rm -rf bitcoin

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin
git checkout v0.8.3
cd bitcoind/src/

make makefile.unix

once its finished recompiling
sudo cp bitcoind /usr/local/bin/

you can change the git checkout command to the new version when it comes out if the libraries match

that's exactly what i've done but have still gotten hung up as above at the git checkout v0.8.3.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on July 02, 2013, 05:58:21 PM
Its meant to say that.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 02, 2013, 06:06:25 PM
Its meant to say that.

if so, this is what happens when i continue:

Code:
home@server:~/git/bitcoin$ git checkout v0.8.3
HEAD is now at 40809ae... Bump version numbers for 0.8.3 release
home@server:~/git/bitcoin$ cd bitcoind/src/
bash: cd: bitcoind/src/: No such file or directory
home@server:~/git/bitcoin$


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on July 02, 2013, 08:31:35 PM
it should be just cd src

I changed the top part when I rewrote it to delete the bitcoin directory and re clone instead of updating it the git again.

Ive edited it now.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 02, 2013, 09:10:09 PM
it should be just cd src

I changed the top part when I rewrote it to delete the bitcoin directory and re clone instead of updating it the git again.

Ive edited it now.

actually, you need to edit it again.

use make -f makefile.unix instead. :P


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 02, 2013, 10:17:33 PM
lookin good.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on July 02, 2013, 10:23:22 PM
Done :) I was in a rush :p


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 02, 2013, 10:34:21 PM
Done :) I was in a rush :p

its up and running.  i got my fingers crossed.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 02, 2013, 10:40:24 PM
https://i.imgur.com/WJW2mMi.png?2


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on July 08, 2013, 08:00:49 PM
just hit my first solo mining block!

thank you tiktoc.  you da Man!



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: fuzzster on July 09, 2013, 08:58:37 AM
Hi all,

I was wondering if anyone could shed some light on the following lines of output I am receiving from stratum-mining (I have removed sensitive info):

Code:
2013-07-09 08:32:18,600 WARNING protocol # Failed message: Cannot decode message '{"params": ["<username>", "j", "í000000", "1d000000", "f6e56e5f"], "id": 5, "method": "mining.submit"}' from <ip_address>

The parameters change every faulty message, however they all seem to include a "strange" character: í, ï, ®.

All miners are using cgminer. Any idea a way to fix these?

Everything seems to be running fine, but I periodically get these messages.

Thanks!


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: elasticband on July 09, 2013, 09:02:18 AM
would anyone be able to help me set up solo mining on my machines and computer? me and a friend(who has it setup) have tried but failed several times....


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on July 09, 2013, 09:56:43 AM
If you are following the tute can you tell me where you get stuck? Can give you a hand to sort it out.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: defcon23 on August 09, 2013, 08:20:24 AM
waww  !  great work ! thank you so much for this super guide !  ;D


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: af_newbie on August 30, 2013, 12:51:11 AM
if you get:

ImportError: Entry point ('console_scripts', 'easy_install') not found

after running "sudo easy_install stratum"

You need to do the following:

sudo rm /usr/bin/easy_install*
sudo rm /usr/local/bin/easy_install*
curl -O http://python-distribute.org/distribute_setup.py
sudo python distribute_setup.py
sudo rm distribute_setup.py



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: af_newbie on August 30, 2013, 01:52:08 PM
tiktoc and other solo miners,

I'm not sure if this is the right thread to ask this question, but since there are many solo miners reading it, I'll ask anyway.

I've read somewhere that the optimal "share per minute" is 12/min when working with a pool.
I was wondering if that is true here in this solo setup.

I see VDIFF_TARGET in the config.py set to 30 (1 share every 30 seconds) which is 2 shares/min.

When I run my miners with this setup, some devices work, but don't submit any shares because the share difficulty has been increased to 3.84k
by the pool.  I don't know if this is optimal for solo mining.

VDIFF_TARGET=5

would be a better setting.

Or it does not matter for solo mining.



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on September 01, 2013, 07:28:22 PM
The devices using different login names ?

change the setting and see how it goes :)


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: Xelpherpolis on September 14, 2013, 10:34:28 PM
Great guide. What I used to start up my pool. Currently wishing there was a nice clean website front end for this too.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on September 15, 2013, 12:13:54 AM
The devices using different login names ?

change the setting and see how it goes :)

Yes.  All clients use different names.  When I used VDIFF_TARGET=5  I got the correct share/min, but after it goes into checking client diff it re-evaluates and diff goes up to 1k+ then down to 300.  The variable diff does not work too well for me.

I set POOL_TARGET=600 and disabled the variable diff functionality.  Works ok now.  Might need to hack the diff for each client during subscription once I get clients with different hashing rates.

With 600 I get mini rig going at ~11 shares/min.



any feedback on this strategy?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: drkurubit on October 24, 2013, 01:53:18 AM
Hi, can someone help me here i cant seem to figure out why i keep getting the following error,

https://gist.github.com/drkyro/2d0e04ab0506a07141dc


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on October 25, 2013, 12:27:05 PM
Hi, can someone help me here i cant seem to figure out why i keep getting the following error,

https://gist.github.com/drkyro/2d0e04ab0506a07141dc

At a guess it is trying to access and element that doesnt exist, ask in the mining pool software thread in pools someone might be able to help there. Does it do it when you are not using mysql for the database ?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: drkurubit on October 25, 2013, 03:23:57 PM
Hi, can someone help me here i cant seem to figure out why i keep getting the following error,

https://gist.github.com/drkyro/2d0e04ab0506a07141dc

At a guess it is trying to access and element that doesnt exist, ask in the mining pool software thread in pools someone might be able to help there. Does it do it when you are not using mysql for the database ?


Thanks for the reply. i tried the other databases and it still does it.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on October 25, 2013, 05:49:33 PM
You tried the one it uses by default the built in one and are all the dependencies installed ?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: Blisk on December 04, 2013, 11:41:22 AM
I have setup my ovn mining pool but when client connect to it I get error
Most likely you put wrong  URL, forgotten to add port, or not setup a workers

Also when starting stratum
twistd -ny launcher.tac -l log/twistd.log


2013-12-04 12:35:29,021 DEBUG DBInterface # run_import_thread current size: 0
2013-12-04 12:35:29,022 DEBUG DBInterface # DB_Mysql INIT
2013-12-04 12:35:29,022 DEBUG DB_Mysql # Connecting to DB
2013-12-04 12:35:29,025 DEBUG DBInterface # DBInterface.do_import called. force: no, queue size: 0


Please some pointers what I did wrong?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on December 04, 2013, 03:52:27 PM
Why use mysql?

Is that all the startup log?

You need to post more of it. Is the pool server actually starting up ? or does it fall back to command line after failing?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: cypherdoc on December 13, 2013, 05:18:00 PM
just tried a new install but getting errors with compiling.

are the packages or dependencies up to date?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on December 13, 2013, 07:31:48 PM
Ill have look after some sleep and double check them.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on December 14, 2013, 07:58:28 AM
Just tried it and seems to work for me

move the old clone of the bitcoin git to bitcoinold
in the git directory
Code:

cd git
mv bitcoin bitcoinold

git clone https://github.com/bitcoin/bitcoin.git
cd bitcoin

git checkout v0.8.6

cd src

make -f makefile.unix


If it still doesnt work post the error.

or you can use the pre-built binaries

from here

http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.6/bitcoin-0.8.6-linux.tar.gz/download

Code:
cd
wget http://sourceforge.net/projects/bitcoin/files/Bitcoin/bitcoin-0.8.6/bitcoin-0.8.6-linux.tar.gz/download

tar zvf bitcoin-0.8.6-linux.tar.gz
cd bitcoin-0.8.6-linux/bin/32/

killall -TERM bitcoind

./bitcoind -daemon


check it with ./bitcoind getinfo

and also the logs in your home directory under .bitcoin

to see if its working ok, if so start with options you normally use eg ./bitcoind -blah blah blah

test it out if it works then backup the old bitcoind binary in /usr/local/bin

Code:
sudo mv /usr/local/bin/bitcoind /usr/local/bin/bitcoin85
sudo mv ./bitcoind /usr/local/bin/bitcoind
killall -TERM bitcoind

Run it like normal



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: semzor on January 03, 2014, 06:14:07 PM
Hello, I've followed this awesome guide the other day and installed the pool software and bitcoind with no problems. They were running and my miners could connect to pool and also web stats were running as well.

Anyway my computer froze some hours later and I couldn't get the bitcoind to load blockchain again. I don't know if it was corrupted or not. I've decided to do a fresh install. Removed my virtual machine, created new one and started again. I've done everything same but this time I get an error quoted below:

Code:
2014-01-03 18:30:48+0200 [-] twistd 13.2.0 (/usr/bin/python 2.7.3) starting up.
2014-01-03 18:30:48+0200 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2014-01-03 18:30:52,007 INFO mining # Connected to bitcoind - Ready to GO!
2014-01-03 18:30:52,033 WARNING coinbaser # !!! Coinbase address 'mybtcaddress' is valid BUT it is not local
2014-01-03 18:30:52,034 INFO mining # MINING SERVICE IS READY
2014-01-03 18:30:52+0200 [HTTPPageGetter,client] Unhandled error in Deferred:
2014-01-03 18:30:52+0200 [HTTPPageGetter,client] Unhandled Error
        Traceback (most recent call last):
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.2.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 1099, in _inlineCallbacks
            result = g.send(result)
          File "/root/git/stratum-mining/mining/__init__.py", line 83, in setup
            on_startup.callback(True)
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.2.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 382, in callback
            self._startRunCallbacks(result)
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.2.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 490, in _startRunCallbacks
            self._runCallbacks()
        --- <exception caught here> ---
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.2.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 577, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.13-py2.7.egg/stratum/server.py", line 46, in setup_finalize
            import websocket_transport
          File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.13-py2.7.egg/stratum/websocket_transport.py", line 1, in <module>
            from autobahn.websocket import WebSocketServerProtocol, WebSocketServerFactory
        exceptions.ImportError: cannot import name WebSocketServerProtocol

2014-01-03 18:30:52,212 INFO template_registry # New template for 0000000000000001da1455a71d9c0d7a7d3d3a2c3cf9ae98e631eb706ade7850
2014-01-03 18:30:52,213 INFO subscription # BROADCASTED to 0 connections in 0.000 sec
2014-01-03 18:30:52,213 INFO template_registry # Update finished, 0.056 sec, 356 txes

Now I cannot connect to the pool and and web stats are not working. I am using Ubuntu 12.04 32Bit. I am not that experienced with linux environment. Any help appreciated.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on January 04, 2014, 02:15:32 AM
Try bitcoind -reindex if it wont load the blockchain normally fixes it.

On the other error havent seen it before but, but one of the python modules is missing I think.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: ktbken on January 06, 2014, 03:01:40 AM
Hello, I've followed this awesome guide the other day and installed the pool software and bitcoind with no problems. They were running and my miners could connect to pool and also web stats were running as well.

Anyway my computer froze some hours later and I couldn't get the bitcoind to load blockchain again. I don't know if it was corrupted or not. I've decided to do a fresh install. Removed my virtual machine, created new one and started again. I've done everything same but this time I get an error quoted below:

Code:
2014-01-03 18:30:48+0200 [-] twistd 13.2.0 (/usr/bin/python 2.7.3) starting up.
2014-01-03 18:30:48+0200 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2014-01-03 18:30:52,007 INFO mining # Connected to bitcoind - Ready to GO!
2014-01-03 18:30:52,033 WARNING coinbaser # !!! Coinbase address 'mybtcaddress' is valid BUT it is not local
2014-01-03 18:30:52,034 INFO mining # MINING SERVICE IS READY
2014-01-03 18:30:52+0200 [HTTPPageGetter,client] Unhandled error in Deferred:
2014-01-03 18:30:52+0200 [HTTPPageGetter,client] Unhandled Error
        Traceback (most recent call last):
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.2.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 1099, in _inlineCallbacks
            result = g.send(result)
          File "/root/git/stratum-mining/mining/__init__.py", line 83, in setup
            on_startup.callback(True)
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.2.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 382, in callback
            self._startRunCallbacks(result)
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.2.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 490, in _startRunCallbacks
            self._runCallbacks()
        --- <exception caught here> ---
          File "/usr/local/lib/python2.7/dist-packages/Twisted-13.2.0-py2.7-linux-i686.egg/twisted/internet/defer.py", line 577, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.13-py2.7.egg/stratum/server.py", line 46, in setup_finalize
            import websocket_transport
          File "/usr/local/lib/python2.7/dist-packages/stratum-0.2.13-py2.7.egg/stratum/websocket_transport.py", line 1, in <module>
            from autobahn.websocket import WebSocketServerProtocol, WebSocketServerFactory
        exceptions.ImportError: cannot import name WebSocketServerProtocol

2014-01-03 18:30:52,212 INFO template_registry # New template for 0000000000000001da1455a71d9c0d7a7d3d3a2c3cf9ae98e631eb706ade7850
2014-01-03 18:30:52,213 INFO subscription # BROADCASTED to 0 connections in 0.000 sec
2014-01-03 18:30:52,213 INFO template_registry # Update finished, 0.056 sec, 356 txes

Now I cannot connect to the pool and and web stats are not working. I am using Ubuntu 12.04 32Bit. I am not that experienced with linux environment. Any help appreciated.

The fix is edit

/usr/local/lib/python2.7/dist-packages/stratum-0.2.13-py2.7.egg/stratum/websocket_transport.py

change the first line from autobahn.websocket import

to autobahn.twisted.websocket import


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: semzor on January 07, 2014, 11:23:44 PM
The fix is edit

/usr/local/lib/python2.7/dist-packages/stratum-0.2.13-py2.7.egg/stratum/websocket_transport.py

change the first line from autobahn.websocket import

to autobahn.twisted.websocket import

Thanks a lot ktbken. That did the trick. Works like a charm now :)


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: deado on February 01, 2014, 07:46:54 AM
Hey first off would like to say I love the guide, its pretty damn simple but i've run into a problem.
Installing on ubuntu-13.10-server-amd64

I ran the command
Code:
sudo easy_install -U distribute

everything looked like it completed successfully however then i went on to the next one and got the following:

Code:
jeremy@MineCamp:~/git$ sudo easy_install stratum
Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 9, in <module>
    load_entry_point('distribute', 'console_scripts', 'easy_install')()
  File "/usr/local/lib/python2.7/dist-packages/setuptools-2.1-py2.7.egg/pkg_resources.py", line 353, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/setuptools-2.1-py2.7.egg/pkg_resources.py", line 2301, in load_entry_point
    raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'easy_install') not found

and now thats what i get if i try to sudo easy_install anything.... thoughts?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: Blisk on February 01, 2014, 04:05:47 PM
try to install with pip


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: deado on February 02, 2014, 09:32:03 AM
Thanks I fixed that and was about to get the stratum started, but it also gave me an error after it started, looks like its working but miners unable to connect, saying connection refused. read out from the server is as follows:

Code:
jeremy@MineCamp:~/git/stratum-mining$ twistd -ny launcher.tac -l -
2014-02-02 03:21:39,922 INFO mining # Connecting to bitcoind...
2014-02-02 03:21:39-0600 [-] Log opened.
2014-02-02 03:21:39-0600 [-] twistd 13.2.0 (/usr/bin/python 2.7.4) starting up.
2014-02-02 03:21:39-0600 [-] reactor class: twisted.internet.epollreactor.EPollReactor.
2014-02-02 03:21:39,950 INFO mining # Connected to bitcoind - Ready to GO!
2014-02-02 03:21:39,956 INFO coinbaser # Coinbase address 'mxUQAbpu31HyFozsMuY2bVGCsnwC75iNaQ' is valid
2014-02-02 03:21:39,957 INFO mining # MINING SERVICE IS READY
2014-02-02 03:21:39-0600 [HTTPPageGetter,client] Unhandled error in Deferred:
2014-02-02 03:21:39-0600 [HTTPPageGetter,client] Unhandled Error
        Traceback (most recent call last):
          File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 1099, in _inlineCallbacks
            result = g.send(result)
          File "/home/jeremy/git/stratum-mining/mining/__init__.py", line 83, in setup
            on_startup.callback(True)
          File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 382, in callback
            self._startRunCallbacks(result)
          File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 490, in _startRunCallbacks
            self._runCallbacks()
        --- <exception caught here> ---
          File "/usr/local/lib/python2.7/dist-packages/twisted/internet/defer.py", line 577, in _runCallbacks
            current.result = callback(current.result, *args, **kw)
          File "/usr/local/lib/python2.7/dist-packages/stratum/server.py", line 46, in setup_finalize
            import websocket_transport
          File "/usr/local/lib/python2.7/dist-packages/stratum/websocket_transport.py", line 1, in <module>
            from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
          File "/usr/local/lib/python2.7/dist-packages/autobahn/twisted/websocket.py", line 39, in <module>
            from autobahn.wamp import websocket
          File "/usr/local/lib/python2.7/dist-packages/autobahn/wamp/websocket.py", line 34, in <module>
            from autobahn.wamp.serializer import JsonSerializer, MsgPackSerializer
        exceptions.ImportError: cannot import name MsgPackSerializer

2014-02-02 03:21:39,994 INFO template_registry # New template for 00000000e5fb3cb4f20c1e7cd30d3bdafbd1d1418a0c1a9a2d0c6da8c6a0950c
2014-02-02 03:21:39,994 INFO subscription # BROADCASTED to 0 connections in 0.000 sec
2014-02-02 03:21:39,994 INFO template_registry # Update finished, 0.002 sec, 16 txes
2014-02-02 03:21:44,957 INFO block_updater # Checking for new block.
2014-02-02 03:21:49,957 INFO block_updater # Checking for new block.
2014-02-02 03:21:54,956 INFO block_updater # Checking for new block.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: Blisk on February 02, 2014, 09:55:27 AM
install python MsgPackSerializer


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: deado on February 02, 2014, 10:04:42 AM
nevermind. solved issue with
Code:
sudo apt-get install msgpack-python libmsgpack3 libmsgpackc2

everything seems to be up and running so far. was able to connect to it. will be testing it out see how it goes.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: matrixx7777777 on February 10, 2014, 08:09:50 PM
I have a problem with this:  ???


IMAGE LINK
http://zapodaj.net/3aa29501ad7b5.jpg.html





Please help!
Please help!



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on February 12, 2014, 04:20:59 PM
Need a bit more the log posted, what database are you using with it ?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: MatrixKoper on February 14, 2014, 06:05:12 PM
TicTock
My Problem :
http://www.youtube.com/watch?v=Y-3Tw_qiCao&feature=youtu.be

(My Video )

Help My Please


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on February 15, 2014, 03:10:08 AM
says the video is not available in my country.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: MatrixKoper on February 15, 2014, 09:56:50 AM
TicTock  ;)
Ahh the youtube
Video Fixed
Watch Now


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on February 15, 2014, 05:13:29 PM
still a nope to the video, just message me screen shots or a cut and paste.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: MatrixKoper on February 16, 2014, 11:44:23 AM
TicTock :
http://www.youtube.com/watch?v=OKZd9PXfMFk&feature=youtu.be

And ScreenSHot:
Http://www.maxc.cba.pl


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: jesse11 on February 26, 2014, 10:03:32 PM
I've done this 4 times and SSH into the server via putty always gives me "Denied"! I tried to 'open port 22' Denied again. I have followed the instructions to the tee yet no go. 


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on March 25, 2014, 04:32:46 AM
I've done this 4 times and SSH into the server via putty always gives me "Denied"! I tried to 'open port 22' Denied again. I have followed the instructions to the tee yet no go. 

If you are doing this in virtualbox you need to add a local interface in virtual box itself before you can ssh to the virtual machine. If not ill need more detail or ask in the linux support forums on how to get ssh working.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on March 25, 2014, 04:36:09 AM
TicTock :
http://www.youtube.com/watch?v=OKZd9PXfMFk&feature=youtu.be

And ScreenSHot:
Http://www.maxc.cba.pl

At a guess looks like a database issue, what have you specified as the database looks like you have put bitcoinrpc in there ?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: vmfx on April 02, 2014, 12:40:58 AM
For some reason i just cant get past installing stratum ?

osaware@osaware-ub12:/pool$ sudo easy_install stratum
Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 9, in <module>
    load_entry_point('distribute', 'console_scripts', 'easy_install')()
  File "/usr/local/lib/python2.7/dist-packages/setuptools-3.4.1-py2.7.egg/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/setuptools-3.4.1-py2.7.egg/pkg_resources.py", line 2362, in load_entry_point
    raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'easy_install') not found

sudo easy_install also gives errors

have tried on clean ubuntu 12 and clean ubuntu 13 installations in VM's - after doing apt-get update upgrade

any ideas ?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: palawan on April 02, 2014, 01:02:21 AM
For some reason i just cant get past installing stratum ?

osaware@osaware-ub12:/pool$ sudo easy_install stratum
Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 9, in <module>
    load_entry_point('distribute', 'console_scripts', 'easy_install')()
  File "/usr/local/lib/python2.7/dist-packages/setuptools-3.4.1-py2.7.egg/pkg_resources.py", line 351, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/setuptools-3.4.1-py2.7.egg/pkg_resources.py", line 2362, in load_entry_point
    raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'easy_install') not found

sudo easy_install also gives errors

have tried on clean ubuntu 12 and clean ubuntu 13 installations in VM's - after doing apt-get update upgrade

any ideas ?

Try this -->   easy_install not found  (http://goo.gl/4nZaQE)

Pick the top answer - 72 upvotes.  Good luck.







Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: vinstrol on April 02, 2014, 11:23:22 PM
Hi,

As I see all the bitcoin will go to one wallet.

How to automatically share the bitcoin to other ppl who help with mining? is there any script in this stratum?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 03, 2014, 02:03:51 AM
Not that I know of. Best place to do it would be in the bitcoin client itself.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: kashking on April 03, 2014, 01:28:12 PM
Hello everyone:

I've followed the guide and gotten the blockchain synced up, and the pool running without any errors. I'm running a windows 7 64 bit host and an Ubuntu 12.10 32 bit guest in a virtualbox VM.

I'm having a hard time getting connected up to my pool from the windows 7 machine. Can anyone help me configure the network properly for this? Trying to test on the testnet.

Thanks
-Kash


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 03, 2014, 03:28:56 PM
with your vm selected click settings, then click network in the adaptor tab change it from nat to bridged and then it should be assigned a ip by your router. You can check in linux with ifconfig



Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 03, 2014, 03:30:48 PM
Also as of 9.0 the build process has changed and it requires a few new dependencies.

You can always use the bitcoin official binaries and then once it is installed go from there.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: kashking on April 03, 2014, 04:41:47 PM
with your vm selected click settings, then click network in the adaptor tab change it from nat to bridged and then it should be assigned a ip by your router. You can check in linux with ifconfig



OK i'll give this a shot when i get home tonight. The quickest way to verify this works is to use ifconfig and then on the windows machine use

Code:
ping <ip from ifconfig inet4 address>

Right?


Also as of 9.0 the build process has changed and it requires a few new dependencies.

You can always use the bitcoin official binaries and then once it is installed go from there.

It didn't seem to complain about any dependency issues while i was building. How can I make sure?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 03, 2014, 05:06:01 PM

with your vm selected click settings, then click network in the adaptor tab change it from nat to bridged and then it should be assigned a ip by your router. You can check in linux with ifconfig



OK i'll give this a shot when i get home tonight. The quickest way to verify this works is to use ifconfig and then on the windows machine use

Code:
ping <ip from ifconfig inet4 address>

Right?

Yup.


Did you build version 8 then its fine.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: kashking on April 03, 2014, 05:47:56 PM
Looks like i got version 8, i pulled the files from your guide:

wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8_4.8.30-quantal2_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8-dev_4.8.30-quantal2_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8%2B%2B_4.8.30-quantal2_i386.deb
wget https://launchpad.net/~bitcoin/+archive/bitcoin/+files/libdb4.8%2B%2B-dev_4.8.30-quantal2_i386.deb

BTW, thanks a ton for this guide! This is a huge help. Also, appreciate you getting back to me so quickly. I'll be tipping you once this is up and running, without a doubt!

-Kash


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: vinstrol on April 03, 2014, 06:51:23 PM
Not that I know of. Best place to do it would be in the bitcoin client itself.

Do you configure MPOS with bitcoind or/and use the litecoin script from MPOS? what do You think about this?

It is possible to find the bitcoin with start serwer "bitcoind -testnet"?

In bitcoin.conf i use:

Code:
# Set gen=1 to attempt to generate bitcoins
gen=1


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: tiktoc on April 04, 2014, 12:56:14 AM
Not that I know of. Best place to do it would be in the bitcoin client itself.

Do you configure MPOS with bitcoind or/and use the litecoin script from MPOS? what do You think about this?

It is possible to find the bitcoin with start serwer "bitcoind -testnet"?

In bitcoin.conf i use:

Code:
# Set gen=1 to attempt to generate bitcoins
gen=1

I know nothing about MPOS, but there was a security warning for 6 months ago ? I think. So check it out first.

if you use -testnet it doesnt find bitcoin, it finds testnet coins.

you wont generate any bitcoins useing gen=1 with the current difficulty that bitcoin is at.


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: vmfx on April 07, 2014, 12:42:40 AM
Not sure whats going on with the 'difficulty' for my workers...

I have a Block Errupter cube that when I run it on BTC Guild i set the difficulty to 32 as it runs around 32GH and it runs smoothly.

With this script, for some reason, the difficulty for my client slowly gets jacked up and up until its over 200 instead of staying at 32 as it should ?

ie output from BFGminer... here with client difficulty already at 189... it slowly goes up and up...

 [2014-04-06 19:38:08] Accepted 004d77fc PXY 0  Diff 845/189
 [2014-04-06 19:38:26] Accepted 00ba8854 PXY 0  Diff 351/189
 [2014-04-06 19:38:39] Stratum from pool 0 requested work update
 [2014-04-06 19:38:43] Accepted 014f4088 PXY 0  Diff 195/189
 [2014-04-06 19:39:32] Accepted 0131220c PXY 0  Diff 214/189
 [2014-04-06 19:39:32] Accepted 000a4695 PXY 0  Diff 6.38k/189
 [2014-04-06 19:39:39] Accepted 002a120c PXY 0  Diff 1.56k/189
 [2014-04-06 19:39:39] Stratum from pool 0 requested work update

does this translate into my miners taking difficulties they can never work on ? what should I do here ?


Title: Re: Avalon users: bitcoind and slush's/generalfaults mining pool setup
Post by: vmfx on April 07, 2014, 01:56:56 AM
Basically, the variable diff does not work too well for me. I set POOL_TARGET=64 and disabled the variable diff functionality since my miner is running at aprox 32gh

based on feedback here :

Quote
I ended up adding new config variables for different type of workers based on hash rates.  Modified interfaces to set the default difficulty based on the worker name.  I've run mini rigs at 1024, bitfuries h-cards at 64.  Worked well.  I only have one mini rig now so it is no use to run solo, but maybe people with 20-30 KNC Jupiters can test this

However when i turn VARDIFF off I get a error in my bfgminer...

Code:
global name 'settings' is not defined

I found in another post that by adding the following line at the top of interfaces.py with the other imports it fixes this problem and the error goes away:

Code:

Code:
from stratum import settings