Navigate / search

Mining bitcoins with p2pool

Here is my experience and testimonial with mining bitcoins with p2pool, I don’t know all that much about it’s inner workings but I assume that I have worked out a somewhat reasonable formula for success. You need to have a few things in line for this to be a profitable venture guaranteed. First off is the cost of electricity. If you have to pay for it you need to look at wattage vs gigahash closely. If power is not an issue then any old antminer will add a few gigahash to your pool and hence further your chances of hashing shares concurrently into the sharechain and hence earning a payout when a block is solved. Bitcoin is pretty deep and you can learn a lot from mining it. You will be exposed to it. Once you start doing it you will try to refine your approach and hence will become more familiar with it’s workings which I won’t go into much here. There are a ton of good videos on youtube for that. The focus here mainly is mining bitcoins with p2pool. I am not sure what the usage would cost for a few antminers so, I would say approach with some caution.

ASIC miners can be cheap when the power efficiency of them is slightly outdated. An ASIC miner is the only real way to mine BTC now. Mining p2pool with a hundred next gen Xeon processors wouldn’t compare to modern ASIC miners. That is why some coins have chosen to be ASIC resistant like Dash. I grabbed a few Antminer S1‘s this year (2015) for $100 CDN each and bough a PSU for each of them on sale for $50 CDN and had a mini mining operation on my hands. I had no idea how to make it work and finally feel like I can make a few common sense suggestions to make sure you can be profitable. First things first you need a good PSU for mining you can’t cheap out and you need to be sure to have a good amperage on your PCI-E 12V rails. You also want 2 of them for an Antminer but the main focus here is amperage. On average an Antminer S1 is going to run at about 4 amps. That is just a rough guestimation. You need 2 PSU’s for an Antminer S3 for overclocking. The big thing is what Amperage can run on that 12V PCI-E rail. The Corsair 500w single rail PSU with a 30A PCI-E 12V rail is perfect. They are great for stability. I use a 500W Corsair 80 Bronze rated PSU. The main thing to be careful of is the number of PCI-E rails. Single is better with high amperage. Some PSU’s just can’t cut it under the load and I find these Corsair PSUs to be reliable, here they are presently a good price. You don’t want the cables to get warm to the touch. So far my 3 PSUs (one made by EVGA) are holding up great with no scorching or heat on the lines. Cheap PSU’s just won’t do if they pose any risk.

Next, you’ll need a computer that you can run day in and day out with a good CPU in it and 4 gigs of RAM and an SSD in it; on which you store the blockchain. This SSD needs to fit the blockchain data files which presently weigh in at about 43 Gb and will constantly grow. So leave a good amount of breathing room on this disk. This machine is going to have to have a few packages installed. First get Python 2.7 and python-argparse as well as Twisted or python-twisted on linux They all pertain to python and different libraries that necessary to make P2Pool work. Python 2.6 is one of the first things you will need. This is assuming you are using a Windows installation. I took this all from this initlal post on bitcoin talk. First download the Bitcoin Core, this is the wallet that your miners will be getting transactions from and will be the link to the p2p BTC backbone via a node. Running your own node requires you to download the blockchain and index it. This requires a good while from scratch so downloading the bootstrap and placing it where it needs to go. This can speed up indexing the entire blockchain which is every transaction every made using BTC. It needs to download and slowly verify and it can take a day or so on a good connection with your firewall port forwarded for your node at port 8332. You also want to find the Bitcoin folder in the program files folder and configure the wallet into server mode. Create a file called bitcoin.conf in notepad and enter the following:

server=1
daemon=1
rpcuser=somethinghere
rpcpassword=somethingherehardtocrack1923234234098234
rpcallow=127.0.0.1
minrelaytxfee=0.00001
mintxfee=0.00005
limitfreerelay=7

This will set your bitcoin core wallet into server and daemon mode running in perpetuity, well that is the hope. Two of those lines set minimum thresholds on transactions. I am not sure these settings are right for you. The truth is once you start down this path of running your own node you now have some server admin responsibilities. Downtime is not really an option when mining bitcoins with p2pool so make sure things are chugging along every few days at least. The simplest way to run bitcoin and specify where to keep the blockchain is with the command line or by adding an argument to a shortcut. Try not to shut the computer down improperly or you risk corrupting the blockchain and being taken out of commission for a day or so while it reindexes. In that case it’s best to sign up with a few pools. That way you can add them in the miner config as fall back pools if yours goes down for say, an automatic update. I store or look for the blockchain at a path of my choosing by running:

<pre class=”prettyprint”> C:\”Program Files”\Bitcoin\bitcoin-qt.exe -datadir=G:\Pathiwant\
</pre>

Now download P2Pool 14.0 or higher. The reason is now that BIP66 has gone into effect, mining bitcoins with p2pool’s old versions are now unable to mine on the current blockchain. This is due to the hardfork of P2Pool to keep compliance with BIP66. Since these changes I have had pretty good luck since I put everything on an SSD and fired up a few tweaked antminers.

To get P2Pool running you need to create a shortcut to the application by right clicking on the executable file. Then right click the shortcut and select properties. Then in the target field add your user and password you had selected in your bitcoin.config file. You have to get the syntax right here. Look at the photo below. When you want to look at some graphs of your performance just hit your loopback IP or localhost at port 9332. http://127.0.0.1:9332 will do.

Windows
Windows
Capture
graphs
snippingtool
trafficrate

Next you need to do the same for cgminer’s application, adding some flags to the target of the shortcut. Add the below text after the path to the program with a single space.

-o http://127.0.0.1:9332 -u user -p password -btc-address (whateveryouraddressisinyourbtcwalletbecarefulenteringit)

Run the BTC core wallet, wait for it to load. Be sure you got your wallet address right. Then when that is done run your P2Pool shortcut, let that sync. Then run cgminer from your shortcut. And point your miners to the node IP using the prefix of stratum+tcp//192.168.the.IP:9332.

Getting the miner to respond can be difficult when you first get it. To get the miner to turn on when you flip the PSU switch on you need to short two pins on the main 24 pin cable from the PSU. It’s actually necessary and common practice to insert a cut-down paperclip into the end of the cable. Some smaller ones work perfectly. Here is a guide. Please be safe. Take proper precautions with electricity mains always. Don’t have anything plugged in while doing this.

The beast lives…

Now that you have it on and the lights are blinking hypnotically and it’s whirring and making noise it’s not mining bitcoins on p2pool yet, you need to get into it via the web GUI and your browser. Check the miner for an IP marked on the case and type it in like this obviously one at a time. Turning off DHCP and getting the network settings all set up is a little confusing, just make sure you don’t duplicate IP addresses and you should be fine. Try pinging it always first. If you can’t get anything there, I’d suggest a factory reset. Possibly then making sure it is the only LAN port plugged in and making things simple. For factory resets there is a strange offset button on the S3 by the LAN port and visible on the control board of the S1; if things just won’t work. To reset it, let the S3 boot up fully, give it some time. Then hold the reset toggle for ten seconds, wait for a few minutes, rinse (sic) and repeat. The S1 is more simple . Then plug it straight into a PC’s LAN. Set the IP to something matching the same subnet as marked on the case of your miner. Then try to punch the default IP into your browser and use the default login for the GUI.

user: root
password: root

Immediately change these for security in the system tab.

I set the difficulty on my miners. To make sure I don’t sweep up all the low hanging fruit from less capable miners. It’s done by adding a few numbers to the miner name. Some suggest not setting it and letting the pool set the difficulty. The number thrown around for an S1 is miner/256+256. I am testing this currently. When configuring make sure to give each machine a new miner name so the logs see them as individuals.

 

How I had my miners configed
How I had my miners configed

That’s it. You should see some text scrolling and that is it you are now mining bitcoins on p2pool. At some point you’ll see a share. This means if there is a block found that you will have a share in the sharechain and will receive a payout. It’s shares and block timing. I just made 5 MBTC today with some really good luck and 800Gh/s. Let me know how this goes for you. You want your efficiency to be above 120% hopefully. Try not to stare at them too long.

p2pool
Cgminer

I hope this guide helps you. If you want more info or to connect to my node let me know in the comments.

Quadro FX 4800 teardown

Recently I had been having issues with heat and intermittent freezing of my Hackintosh. These crashes always happened during graphical processes like watching Netflix, or editing sound and it started getting out of hand as the temperature outside was rising. I figured I was experiencing that which I had been seeing at work with a few workstations at the studio. The older GPU’s were starting to get sluggish and glitching out. The thing is after 7 years of dutiful service, the paste that is nestled between the chip and heatsink just gets a little less thermally conductive. There is a lot of talk of how Arctic Silver is useless but it does edge out a few extra degrees of cooling efficiency and is rated for around 5 years. As with all thermal pastes, with time they migrate and leave air gaps. This brings the temperatures of the cards up slowly but surely and eventually the heatsinks and fans you have will be no good against the volume of heat generated. When this happens we do not cast these cards aside, no, we hold fast to the moorings. They can be restored to their earlier function by simply reseating the heatsinks with new thermal paste and cleaning off any of the thermal tape or pads that were in there previous. The Quadro FX 4800 teardown was relatively painless, and totally solved all my problems with heat, freezing and bluescreen’s of death.

It’s too damned hot…

There wasn’t a lot of documentation on opening this specific card but with a little sleuthing, you can figure out how to disassemble and restore your card to it’s previous glory. You will need thermal paste, I use Arctic Silver 5 because I’m a f4n 30y. It really does work and I see a few degrees difference in real world tests, so sue me. Other than that I needed some thermal pads which are a silicon pad that has a light adhesive on either side. They are used for workstation installations and reliably move heat from components to heatsinks that are buffered by a large gap. They come in various thicknesses and it is important to make sure you get ones that are thick enough. There was one spot on my card where I had to double up just to fill the gap. The pads are available on e-bay or at very specialized computer repair stores. I also can’t stress my recommendation enough for some plastic spudgers. They are used for decoupling sensitive parts you don’t want to maim or scratch. For uncoupling the molex connectors that are so fragile, it is absolutely pivotal. Having some rubbing alcohol or JY-8 to clean up is something you should have on your list along with coffee filters or some other lint-free disposable cloth.

 

And now, as promised, the Quadro FX 4800 teardown…

Please read the instructions carefully. This is a simple teardown but there are ways you can be too rough with the small fragile parts. Take care not to strip screws or break any cables.
1.

Removing the first set of screws…

There weren’t any guides online but this wasn’t my first rodeo so I decide to map the route myself. The Quadro FX 4800 teardown wasn’t that difficult, if you take care. First, there are eleven screws on the back holding the rear heatsink to the card.

Removing the first set of screws
2.
Quadro FX 4800 teardown
Quadro FX 4800 teardown

Prying this part away carefully is the easiest part of the disassembling this card. Once you get it off you get a good luck at what your thermal coupling looks like. Mine were smeared a bit and definitely a bit melty. Below you can see some of the pads stuck to the memory or the heatsink. A few were removed before I snapped this photo.

3.

So this is what we are going to replace. With a little alcohol you can easily degunk the chips and heatsink, this is important so that the old material doesn’t create air gaps. The thermal tape they used left a slimy residue.

2015-06-29 21.32.54
2015-06-29 21.33.04

Here you can see they did migrate a little and this is probably why they aren’t working so hot right now. 😉

2015-06-29 21.33.10

Don’t forget to shine up the heatsink when you wipe each component gently.

4.

Now remove these screws holding the heatsink firmly on the integrated heat-spreader.

Quadro heatspreader screws
Remove all of these screws once you have everything cleaned up.
5.

Here you can see two more screw holes that hold the front heatsink and fan assembly to the board at the rear of the card.

Two screws on the back…
6.

Before you pry the case away there are two cables connected. One of these cables is opposite to your 6 pin PCI-E power rail. Make sure not to open the case to far and be gentle unseating those guys by gently prying and rocking them out with a spudger (on each side) gently till you can grab them firmly without touching the thin cable.

Quadro FX Debris
Be gentle with these cables and don’t separate the board until you have disconnected them both!

 

7.

There is another near the S-Video port, use the same smooth motion to remove it.

Cable near the S-Video port
Cable near the S-Video port
8.

Now pull the card free, gently rock it off the face of the chip. There, pat yourself on the back, you have succesfully completed the Quadro FX 4800 teardown. The thermal paste wasn’t too tough to pull apart for me but I have heard that it can be a pretty sticky. Now you can visually tell what components had thermal coupling on them by which chips are gooey. Take a photo for reference, it’s just good to feel secure that you didn’t leave one out. Clean everything up and get rid of any dust.

Seperate the fan from the board
Seperate the fan from the board
9.

Once you have everything cleaned up reapply arctic silver thermal compound on the heat spreader and start placing the thermal pads on the components with tweezers. Make sure you pad everything that had thermal tape removed.

I call my man sun cuz he shine like one
Make it gleam
10.
I use tweezers to place them
I use tweezers to place them
Thermal pad placement
The back too.

Revers the steps and put everything back together!

After this I had no issues with crashing. This card idles at fairly high temperatures and is rated for 90˚C but I was hitting 65˙C shortly after booting and hurtling upwards during h264 playback. Let me know if that helped and as always donate BTC if you feel generous!

 

 

Please Donate To Bitcoin Address: [[address]]

Donation of [[value]] BTC Received. Thank You.
[[error]]

Using a VPN Service

VPN Servers are available now at as very reasonable rate these days with some plans coming in at sixty dollars or so a year. That’s really cheap as chips when you realize what is at stake. With all the revelations in the past few years of what internet privacy is like these days it’s easy to see why some might just get into a plan.
First of all, it offers a lot of benefits if you’re using streaming services like Netflix or want to use services not available in your area. A VPN is a stepping stone of the internet, as it were. You connect to the server with your traffic using various level’s of encryption to an end point. From this endpoint you emerge to view websites, regardless of the your origin. Using a VPN service is great for people traveling to China and staying at hotels that limit the access you have to the open internet.

There are plenty of service providers to use. You have to chose one based on your needs. HideMyAss is a great option and if you are using a VPN service for encryption or just to get past geoblocking of content. 12 VPN is great for those in China as they support their users in punching through the ‘great’ firewall. The other great thing about VPN is that your traffic will no longer be in plain site when on HTTP sites. By using one your traffic becomes indecipherable.

I like using a VPN service from my router. It just make it so that all devices can watch the same content behind the firewall. Whether I am on a laptop or desktop or phone. It is easy to configure using tomato and HMA actually has a guide for L2TP or for OpenVPN which are really easy to follow. If one of the servers isn’t working try another end point as sometimes they go down without any indication from support.

Alternatively you could run the application provided by your service provider will encrypt the traffic on that one specific machine. It’s almost instantaneous to set these things up as well. You could sign up and be encrypted within 10 minutes.

It really is that simple. The other option is to build yourself a little Linux based WiFi VPN hotspot so you have an always on encrypted network available for your wireless connected devices.

Asus RMA

Asus has a wide range of electronics from motherboards to networking to laptops. I have maintained and purchased a lot of their stuff as it is well built and affordable. I had gone out and purchased a mid range router for $120 CDN and was pretty happy with its operation.
Then one day it just crapped out. Not “fully bit the biscuit” crapped out. More like the “can’t reliably negotiate wifi connections” kind of crapped out.
I filled out a ticket on the Asus RMA website and it was a day after one year of the date of purchase.
I was in luck. I felt pretty comfortable as I had luck with Asus RMA’ing a motherboard that had failed at the very end of it’s life at work. I don’t think it was under warranty as it was a few years old but I called it in anway.
I lit a cigarette (I was still smoking at the time) and I called support to advance my ticket. As I was casually discussing the issue. Feeling pretty sure that I was a respected customer and service was Asus’ MO, I off handedly mentioned my router had been dropped. I could have kicked myself. Why did I just admit to physical damage? Could he stop the ticket there dead? Shite, I am out $150 bucks because of the grotesquely inadequate Toronto power grid.
But no. The agent simply filled the ticket so they could “take a look”. They soldered in a new chip and sent it back. I could smell the sweet odour of solders too heavily laid on the board. I wrote back the next week when performance hadn’t improved. It was still getting dismal speeds and having difficulty authenticating clients.
At this time it was revealed to me that I had an issue with the DC power supply for my modem. Swapping the inexpensive power supply fixed an issue I had been suffering from for months. Even though tech support assured me I needed a new modem.
I mentioned this to the agent and he suggested I send in all components including power supply and antennae for proper testing. Duh. Now I am patiently waiting to see what comes of my router.
It is a great router with tons of features and I’ll walk you through them just as soon as I get it back. I’m also shopping for a good UPS as well. I still have weird hiccups in my AC at my new apartment. But forget about it Jake, it’s chinatown.

20140323-133314.jpg

Backups in Mac OS X using rsync

Unix is at the core of OS X
Unix is at the core of OS X

A friend of mine posted on social media that his faithful MacBook Pro had died on him and left small bits of his projects out of reach on his hard disk. ( He had IT rustle them up)
This came at a time when I was experimenting with scripting rsync and SSH to backup a server to a secondary machine in the event things go wrong. Things do go wrong every now and again. Sometimes very wrong, like when you decided to skip putting a baking sheet under that mostly defrosted and fairly gooey Delissio pizza.
It’s easy to make backups in Mac OS X using rsync even to a company server. There are a few things you should know beforehand and your company IT guy can usually help you out with the specifics of your enterprise server. The thing about being the administrator is you are your own gatekeeper. You can easily work the angles available to you.
If you’re on your own, in a smaller company, at home or just want to take a stab at automating your backups yourself then this guide is for you.

rsync is a powerful command line utility and should be respected! Please read the whole posting before punching these commands in! As a sync tool it has the ability to delete material in the destination folder!

Rsync is a powerful unilateral sync tool that can retain all of your data with all of its attributes such as ownership, permissions, dates and so forth and it does so with compression and an algorithm that allows for incremental backups that are super fast. I have to say, it is very fast and unobtrusive to even for a full backup of a fairly large directory. The compression function boosts data throughput for the transfer and makes remote backups way less of a pain. It can also resume transfers that have failed. Along with a whole bunch of other features. Andrew Tridgel the creator of rsync said it would outlive a host of his other creations.

I use the Asus RT-N16 as my home router and it kind of runs like my Linux server as well. With a 1TB disk plugged in and mounted you can use it for incremental backups, as a media server and for always on torrenting. In this case I am going to be scheduling a local directory from my Mac’s desktop, to be backed up daily and weekly.
Rsync unlike other copy commands will remove old files that have since been deleted “syncing” the two folder or drives. This can be turned off by adding the flag –delete and your disk will grow as you go until there is no more space.
This essentially means rsync mirrors one directory to another. With a little more doing, one can have rsync keep snapshots of the disk from a few days running so that if you deleted something yesterday and the backup script ran your files still exist. This process is well explained at the previous link and requires the use of symbolic links that create a skeleton of the directory with only the files that have been changed on hand for if you need them. The “skeletal” folders only contain links to the original backup. You can script this whole process with Automator or as a cron job and then reliable backups are opened up to you with no cost and just a little elbow grease.
Heck, I love Apple’s time machine but that only works reliably when you have a network attached disk taking regular backups. Not to mention it is really a bugger trying to sort out a time machine drive. Consequently I have 2 of them sitting idly, in case I should think of some file I had forgotten about that happens to be have survived in my time machine. Not likely…

The syntax of rsync is unix based and is the same on OS X and various flavours of Linux. Actually learning rsync and cron scheduling is a good jump off point between the two operating systems. Knowing some basic Unix commands can really help you become a power user on any Mac OS.

rsync -avzn ssh /home/path/to/sourcefile/ user@IPaddress:/root/path/todestination/

Breaking the syntax down is easy:

rsync is the command and opens the syntax

-avz are the flags which delineate between all the options available for the sync. The a = archive mode which is a combination of a bunch of options meant for backups (rlptgoD). I have also included the -n flag which will only do a dry run to test the file copy.

-r, –recursive recurse into directories

-l, –links copy symlinks as symlinks

-p, –perms preserve permissions

-P, –progress and partial combined

–progress, shows the progress in the terminal

-t, –times preserve modification times

-g, –group preserve group

-o, –owner preserve owner (super-user only)

-D same as –devices –specials

–devices preserve device files (super-user only)

–specials preserve special files

It is important to note that when using the archive flag there will be differences when recopying with simpler options. The files won’t match in attributes and will be copied again!

It is also important to note to SSH into a server requires the correct key files to be in place. SSH is a widely used remote shell for administration. With it you can copy files as if you were the super user on that linux machine provided you log in with that account. If you need to do more than backing up files and want to back up a system then it will be necessary unless you are on that machine locally.

The simplest method to rsync to a company server would be:

rsync -avzPn ‘~/Desktop/Files\ for\ Work/’ /Volumes/MountedServer/Mydirectory/Backups/

The ~/ or tilde before the slash is a unix shortcut to the logged in user’s home folder!

The tricky part here is the spaces within the syntax. Spaces generally are the breaks in syntax that the shell understands as a cue to move on to the next part of the expected syntax. So that “for Work” without the slashes and single quotes would look like the destination path and effectively breaks the command when that path isn’t found. A better explanation is here.

Running that command with the syntax all in place should give you a time for transfer and a speedup time with no to minimal errors. Next time I will tell you how to schedule it using cron tables built into OS X.

 

JV