|
cypherdoc
Legendary
Offline
Activity: 1764
Merit: 1002
|
|
April 07, 2013, 12:17:27 AM |
|
yep. to 60 like you said.
|
|
|
|
cypherdoc
Legendary
Offline
Activity: 1764
Merit: 1002
|
|
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.
|
|
|
|
tiktoc (OP)
|
|
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 Ill have a look at second part when I finish work there is a script somewhere already on he forums.
|
|
|
|
tiktoc (OP)
|
|
April 07, 2013, 07:28:05 PM |
|
This is from this thread https://bitcointalk.org/index.php?topic=965.0Thanks to phungus and gigavps sudo pico /etc/init/bitcoind.conf
Then paste this into the file # 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 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.
|
|
|
|
jspielberg
|
|
April 08, 2013, 04:09:46 AM |
|
I have been playing around with an upstart script for the pool tonight. 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.
|
|
|
|
tiktoc (OP)
|
|
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 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 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.
|
|
|
|
cypherdoc
Legendary
Offline
Activity: 1764
Merit: 1002
|
|
April 09, 2013, 04:33:37 PM |
|
i'm reinstalling on new ssd. when i try to build with: i get this: 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$
|
|
|
|
tiktoc (OP)
|
|
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 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.
|
|
|
|
cypherdoc
Legendary
Offline
Activity: 1764
Merit: 1002
|
|
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)"
|
|
|
|
tiktoc (OP)
|
|
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
|
|
|
|
humble
Member
Offline
Activity: 91
Merit: 11
|
|
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: root@avalon:/home/jack# easy_install -U distribute Searching for distribute Reading http://pypi.python.org/simple/distribute/Reading http://packages.python.org/distributeBest 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/stratumBest match: stratum 0.2.12 Downloading http://pypi.python.org/packages/source/s/stratum/stratum-0.2.12.tar.gz#md5=a685da0dce43263db08ae949568b0f54Processing 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
|
|
|
|
cypherdoc
Legendary
Offline
Activity: 1764
Merit: 1002
|
|
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?
|
|
|
|
tiktoc (OP)
|
|
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: root@avalon:/home/jack# easy_install -U distribute Searching for distribute Reading http://pypi.python.org/simple/distribute/Reading http://packages.python.org/distributeBest 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/stratumBest match: stratum 0.2.12 Downloading http://pypi.python.org/packages/source/s/stratum/stratum-0.2.12.tar.gz#md5=a685da0dce43263db08ae949568b0f54Processing 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 sudo python setup.py install
|
|
|
|
tiktoc (OP)
|
|
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.
|
|
|
|
humble
Member
Offline
Activity: 91
Merit: 11
|
|
April 21, 2013, 01:13:50 AM |
|
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.
|
|
|
|
furball
|
|
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.
|
|
|
|
tiktoc (OP)
|
|
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.
|
|
|
|
jspielberg
|
|
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. 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: 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.
|
|
|
|
tiktoc (OP)
|
|
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.
|
|
|
|
|