raspberry pi 樹莓派作為比特比礦機


http://www.instructables.com/id/Bitcoin-Mining-using-Raspberry-Pi/

Step 5: Installing Required Libraries

The miner to be installed comes as source files, which means that the program must be compiled into a binary before it can be run. To make a program, in this case BFGMiner, many dependencies are required.

Dependencies are additional software, or libraries the program needs in order to compile properly, as it has been developed using them to make the software more efficient. Hopefully you will be seeing the Raspbian desktop, so double click on LXTerminaland type in the following:

1) sudo apt-get update

2) sudo apt-get install autoconf autogen libtool uthash-dev libjansson-dev libcurl4-openssl-dev libusb-dev libncurses-dev git-core –y

This process will take a few minutes to complete.

Step 6: Installing BFGMiner

Now you’re ready to start mining. To do this, providing you're using Slush’s pool, you’ll use the following command:

./bfgminer -o stratum.bitcoin.cz:3333 -O username.worker:password -S all

The username section is composed of two parts, the username that you use to login to the pool, and worker which is the worker name you gave when you registered the worker. Finally, the password that was set when you created the worker.

That’s a lot of numbers, so I’ll make some of them a bit clearer.
Current mining speed, typically calculated in megahashes or gigahashes. The number of hashes a second that can be calculated the better. A hash is an algorithm of converting numbers and letters into an undecryptable set of characters. So a miner is used to process millions of numbers in an effort to match the hash to guess the original number. The more hashes that can be processed the faster it is able to solve the problem.

Number of accepted shares. A share on a pool is to show the miner has successfully worked out a given problem, so the more shares you can process the better your reward from the pool.

Detailed information on accepted shares and pool updates. This is a running log of what is currently happening with the miners and basic pool information, such as messages of updates and when new blocks are found.

More information can be found at the BFGminer github site.

Step 8: Conclusion

Following these steps will leave you with a very energy efficient bitcoin miner, as a Raspberry Pi only uses four watts of power, and a miner is typically 2.5W. Mining used to be done with computers consuming over 700W for the same process so to make a jump in savings helps repay the cost of the hardware we are using.

All there is to do now is to sit back and watch the money slowly build up. Though it is important that you understand that Bitcoin value fluctuates wildly, it is extremely volatile, so invest at your own risk.

You can also put up LCDs. Connect more Pis for getting better speed :D

For more information there are a number of websites and forums available, such ashttps://bitcointalk.org/,to help get you started.

 

 

 

 

 

 

https://computers.tutsplus.com/tutorials/how-to-create-a-raspberry-pi-bitcoin-miner--cms-20353

Requirements

In order to mine Bitcoin, you will need:

  • A pool account
  • Bitcoin Wallet
  • Raspberry Pi
  • Raspbian image SD card
  • USB Bitcoin miner

Creating an Account

There are four things you need to do:

  1. Download a bitcoin wallet
  2. Create a pool account
  3. Set up payment
  4. Set up workers

A wallet is a program that sits on your computer and gives you a wallet address, this is a unique string of numbers and letters that you will use to receive bitcoins. Download the client for your computer from https://bitcoin.org/en/download

After installation, you will have to save a file called wallet.dat, keep this file safe, as this contains your unique wallet address within it, including all bitcoins that you will gain. If you lose this file, you cannot recover any bitcoins it contained.

Once you have a wallet address, create a pool account. A pool is a huge collection of other people working towards gaining bitcoins. Due to the complexity of mining a bitcoin, it has become unrealistic to solo mine–the act of processing millions of numbers to solve the block problem. Working as a group, or pool, lets everyone have a chance of earning some Bitcoin. There are many pools around, in this tutorial I’ll be using one called Slush’s pool: http://mining.bitcoin.cz/

Once you have created a pool account, you'll need to enter your unique wallet address into the Bitcoin payout address.

Next step is to create a worker login account. Within your pool account you have the ability to create something called a worker for each of your bitcoin miners, so you're able to monitor them all separately just in case one should fail. 

Each worker has its own login name and password. Whilst you are on My Account click Register New Worker and give it a name, for example; worker, and a password.

Now you're ready to set your Raspberry Pi mining for Bitcoin.

Setting Up the Raspberry Pi

Start with a fresh Raspbian install, if you don’t know who to do this, read the tutorial How to Install NOOBS on a Raspberry Pi With a Mac

If you plan on running more than one Bitcoin miner at the same time, it is best to use a powered USB hub. Take into account the power rating as mining will need a lot of power, as much as one mp per miner.

With your USB miner attached to your Raspberry Pi, let’s get everything installed.

Installing Required libraries

The miner to be installed comes as source files, which means that the program must be compiled into a binary before it can be run. To make a program, in this case BFGMiner, many dependencies are required. 

Dependencies are additional software, or libraries the program needs in order to compile properly, as it has been developed using them to make the software more efficient.

Hopefully you will be seeing the Raspbian desktop, so double click on LXTerminal and type in the following:

This process will take a few minutes to complete.

Installing BFGMiner

Once all the dependencies have been installed, now it is time to download and install BFGMiner, so type the following into LXTerminal. It’s normal for these to take a few minutes to complete so some patience is needed.

You will be greeted with a screen that looks similar to the following:

Start Mining Bitcoin

Now you’re ready to start mining. To do this, providing you're using Slush’s pool, you’ll use the following command:

The username section is composed of two parts, the username that you use to login to the pool, and worker which is the worker name you gave when you registered the worker. Finally, the password that was set when you created the worker.

If everything works, you will see the main screen that will look similar to this:

That’s a lot of numbers, so I’ll make some of them a bit clearer.

  1. Current mining speed, typically calculated in megahashes or gigahashes. The number of hashes a second that can be calculated the better. A hash is an algorithm of converting numbers and letters into an undecryptable set of characters. So a miner is used to process millions of numbers in an effort to match the hash to guess the original number. The more hashes that can be processed the faster it is able to solve the problem.
  2. Number of accepted shares. A share on a pool is to show the miner has successfully worked out a given problem, so the more shares you can process the better your reward from the pool.
  3. Detailed information on accepted shares and pool updates. This is a running log of what is currently happening with the miners and basic pool information, such as messages of updates and when new blocks are found.

 

 

 

 

 

https://learn.adafruit.com/piminer-raspberry-pi-bitcoin-miner/initial-setup-and-assembly

What you'll need:

Before you start this tutorial you'll need a fully working Pi with network setup and also an assembled Adafruit LCD Pi Plate.

For help with initial setup, check out the following tutorials:
When you've got all that working, come back here!

A note about USB mining devices

At the time of this writing, dedicated bitcoin mining hardware can be somewhat hard to find, but they are becoming more common as next generation ASIC-based devices are released. A number of open source projects and related info can be found in the BitcoinTalk forums.

For this tutorial I'll be using ASICMiner Block Erupter USB devices. Though this tutorial uses details specific to the Block Erupter USB, a few small modifications should make it work with any hardware compatible with cgminer v3.1.1
 
 
 
 
 
 
http://www.daveconroy.com/beginners-guide-to-turn-your-raspberry-pi-into-an-affordable-bitcoin-mining-rig/

Beginners Guide To Turn Your Raspberry Pi into an Affordable Bitcoin Mining Rig

raspberry pi bitcoin rig
First off, I know this post is a little late in the game as it is becoming less profitable for amateurs to mine Bitcoins, and that there are more efficient ways to go about this. But I am writing this anyways for posterity’s sake as I know for a fact there are people out there who have idle Raspberry Pis and are looking for a project. I’m sure there are also others like myself who are just looking to learn more about cryptocurrencies. To get started, here is our shopping list (if you are reading this, you probably already own some of these items):

Shopping List

QTY Required Items Price(USD)*
1 Raspberry PI $35.00
1 Micro USB cable $5.49
1 ASICMiner Erupter USB 336MH/s Sapphire Bitcoin Miner $10.99
1 Powered USB Hub** $25.00
1 SD Card (class 4 and 2gb minimum) $7.49
Total: $83.97
Optional Items
1 Power Supply $9.95
1 HDMI Cable $2.28
1 Case $12.75
1 USB Fan (The mining devices run hot) $8.43

*Prices are subject to change
**The Pi alone can not power one of these miners, a Powered USB HUB is mandatory to mine bitcoin.

Bitcoin Wallets

Before we setup the Mining software on the Pi we need to setup a bitcoin wallet where we will store the credit from the mining. There are countless options(Software, Web, Mobile) when it comes to setting up a bitcoin wallet. I’ve listed a few below but there are many more and each method has its own risks, luckily bitcoin.org has a great writeup on how to choose a wallet.

Windows/MAC/Linux
Multi-Bit – Quick and Lightweight Bitcoin Wallet
Bitcoin-QT – Takes a day or two to download ~6gigs of Bitcoin Transactional Data
Armory – Desktop Add-on Application

Web/Hosted
Coinbase
Blockchain.info

Android
Bitcoin Wallet

iOS
Currently the app store does not allow any bitcoin wallet applications.

Mining Pools

Bitcoin Pooled Mining is the best way to get started mining. Pooled Mining allows multiple users to work together to “crack” a single bitcoin and then share the benefits fairly. Due to the competitive nature of mining, if you tried to mine on your own it could be a long time before you successfully mined anything. Pooled Mining is a nice way to receive smaller and more regular payouts instead. For people with slower rigs, pooled mining might be the only way you ever earn bitcoins.

Two Mining pools I recommend and have verified are:
Slush’s Pool
BTC Guild

The setup for both pools is straight forward. You create a username, password, and then worker credentials(for each mining device). You also add the bitcoin wallet address you created above to your pool so you receive bitcoin payments when you hit the pool’s payout thresholds (usually around .01 BTC). It’s also recommended you sign up for multiple pools in case one experiences technical difficulties, the software we are about to install will switch if one goes down.

Installing Mine Peon the rPi

Now that we have a bitcoin wallet and have joined a mining pool, Neil Fincham and his project Mine Peon makes getting the software running on the rPi quite easy. Mine Peon is an ARM Mining Platform that is built specifically for Raspberry Pi. It is built on Arch Linux and uses the popular cgminer and bfgminer for the heavy lifting. To get started, you simply download the latest image here and burn it to your SD card.
If you are using Windows to flash your SD Card, I recommend using Win32DiskImager. This tool can also be used after our initial setup to create an image of our finalized implementation(very useful as a backup).

mine-peon

For other operating systems, you can find a handy guide on flashing SD cards from eLinux.org here.

After the image is flashed, you can boot your device. The first boot takes about a minute as it needs to generate the SSH keys, but future boots take only about 10 seconds. Use your router or keyboard/video/mouse to find out the IP address of the rPi. The default username and password for SSH and for the WebUI are:

Username: minepeon
Password: peon

After the rPi has booted, you can navigate to Mine Peon’s handy WebUI by opening your browser and entering the Raspberry Pi’s IP address. There you can insert the mining pool and worker information.
mine peon pools

The best part about Mine Peon is that it automatically supports the USB mining devices, so you can be up and running in a few minutes without having to worry about drivers/compatability issues. There are even handy graphs to check your stats!
mine peon stats

For Further information on Mine Peon check out their installation guide here.

Closing Remarks

Are you going to get rich quick using the Raspberry Pi for bitcoin mining? Of course not. This tutorial was never meant to give that impression. But, could you potential recoup your investment costs and perhaps end up a couple bucks ahead after 6-12 months? Definitely possible!

PS – If you have any questions about earning potential, profitability, or just basic setup, just add a comment below and I’d be happy to help! And if you get your rPi working and mining Bitcoin – Feel free to send a tip to my blog’s BTC address:

1Q9ASkZFAHXLvpPAzAVipcKUH5Vy2xmsA6

 

 

 

 

https://bitcointalk.org/index.php?topic=1736096.0

 

Requirements

In order to mine Bitcoin, you will need:

  • A pool account
  • Bitcoin Wallet
  • Raspberry Pi
  • Raspbian image SD card
  • USB Bitcoin miner

Creating an Account

There are four things you need to do:

  1. Download a bitcoin wallet
  2. Create a pool account
  3. Set up payment
  4. Set up workers

A wallet is a program that sits on your computer and gives you a wallet address, this is a unique string of numbers and letters that you will use to receive bitcoins. Download the client for your computer from https://bitcoin.org/en/download

After installation, you will have to save a file called wallet.dat, keep this file safe, as this contains your unique wallet address within it, including all bitcoins that you will gain. If you lose this file, you cannot recover any bitcoins it contained.

Once you have a wallet address, create a pool account. A pool is a huge collection of other people working towards gaining bitcoins. Due to the complexity of mining a bitcoin, it has become unrealistic to solo mine–the act of processing millions of numbers to solve the block problem. Working as a group, or pool, lets everyone have a chance of earning some Bitcoin. There are many pools around, in this tutorial I’ll be using one called Slush’s pool: http://mining.bitcoin.cz/

Once you have created a pool account, you'll need to enter your unique wallet address into the Bitcoin payout address.

Next step is to create a worker login account. Within your pool account you have the ability to create something called a worker for each of your bitcoin miners, so you're able to monitor them all separately just in case one should fail. 

Each worker has its own login name and password. Whilst you are on My Account click Register New Worker and give it a name, for example; worker, and a password.

Now you're ready to set your Raspberry Pi mining for Bitcoin.

Setting Up the Raspberry Pi

Start with a fresh Raspbian install, if you don’t know who to do this, read the tutorial How to Install NOOBS on a Raspberry Pi With a Mac

If you plan on running more than one Bitcoin miner at the same time, it is best to use a powered USB hub. Take into account the power rating as mining will need a lot of power, as much as one mp per miner.

With your USB miner attached to your Raspberry Pi, let’s get everything installed.

Installing Required libraries

The miner to be installed comes as source files, which means that the program must be compiled into a binary before it can be run. To make a program, in this case BFGMiner, many dependencies are required. 

Dependencies are additional software, or libraries the program needs in order to compile properly, as it has been developed using them to make the software more efficient.

Hopefully you will be seeing the Raspbian desktop, so double click on LXTerminal and type in the following:

This process will take a few minutes to complete.

Installing BFGMiner

Once all the dependencies have been installed, now it is time to download and install BFGMiner, so type the following into LXTerminal. It’s normal for these to take a few minutes to complete so some patience is needed.

You will be greeted with a screen that looks similar to the following:

 

 

 

 

 

 

 

 

 

 

 

 

 

今天收到了小派,UK產的綠板子,還配了個透明盒子,裝在里面閃亮亮的很好看,而且只有卡片大小,尋思着用它做什么好呢?想來想去,看到人家拿小派作家庭媒體中心,還有人拿它當下載機,於是就萌生了一個家庭媒體中心+下載機二合一的東東,白天看電影,晚上添加任務讓它自己下載到SD卡里,第二天就能看了,接上無線網卡,通過手機控制它,遙控器都省了。下面我們就開始吧。

你需要的東西:

也可能需要的東西:

高大上的奢侈品

需要安裝的軟件如下:

PC端:

  • putty(一個SSH工具,用於遠程連到你的樹莓派上,這樣你就不用把你的小派挪來挪去了)
  • FileZilla(一個開源的ftp客戶端,這樣你可以把你電腦上的文件直接拖到你的小派里了)
  • win32DiskImager-binary(把網上下載的鏡像刷到SD卡里)

前兩款軟件的安裝都非常簡單,直接一路下一步,第三款直接解壓縮,這里就不介紹了

樹莓派端:

  • Raspbmc(Xbmc的樹莓派版,Xbmc是一個流行的媒體中心系統,基於linux,可以方便的播放你各種設備上的音頻視頻圖片拽過來在你的Xbmc上播放,也能播放廣播和在線視頻,這里要贊一下Raspbmc的作者,Sam Nazarko,他還是一個19歲的學生,相當厲害)
  • aria2c(Linux下的命令行下載利器,nani?命令行???你是在逗我么,莫怕,接着往下看)
  • yaaw(基於web的aria2c的UI,可以添加任務,查看任務進度)
  • nginx(http服務器,用於承載yaaw)

我們需要從Raspbmc網站下載鏡像,這里你有兩個選擇,

  1. 安裝的時候比較痛苦:參照這篇教程,點擊頁面上的link鏈接或這里下載windows installer,按照頁面上的指導向SD中刷入boot鏡像(這個鏡像只包含最基本的boot,在啟動后會聯網下載最新的鏡像),完成后插入SD到你的樹莓派中,開機,並為你的樹莓派插上網線(此時無線網卡不可用),用前面提到的線纜連接上顯示器(或電視機),看着藍色的屏幕開始品嘗你的程序員飲料吧,痛苦開始了,視你的網速,我是在等了2個小時之后突然發現它只走了20%然后果斷放棄了
  2. 更新的時候比較痛苦:訪問Raspbmc下載頁面,點擊頁面上的Standalone Image下載完整鏡像,解壓縮得到一個sd.img,然后使用win32DiskImager-binary.exe工具刷入SD卡中(選擇解壓出的sd.img,然后“設備”里選擇你的SD卡,注意一定要是你的SD卡,別選錯了,然后點“寫”),等刷成功之后,把SD插入樹莓派中,啟動,你就可以使用了,這個時候你也可以使用你的無線網卡了,需要配置一下,一會說。win32DiskImager

到此,媒體中心安裝完成,恭喜你獲得了“事倍功半”成就(Why?看了這么久藍屏,就完成了一半,不是事倍功半么),好的,繼續往下看!

我們開始配置下載機。

在PC上打開putty,進你的路由器看你的樹莓派地址是多少,填進puttyHost Name(or IP address)欄里,點Open,
putty

在彈出的窗口中輸入用戶名pi,回車,然后是密碼raspberry(屏幕上不會有任何顯示),回車,你就打開了一個樹莓派的shell,可以遠程操作啦!(nani?又是命令行,這回幫不了你了,只能用命令行了,不過順帶學習一下linux的精髓也是不錯的嘛,對吧)。我們開始安裝軟件。

第一次連接ssh可能還要進行一些配置,根據提示點ok就行了。

進入后先update一下軟件源,使用命令

首先安裝aria2c

在shell窗口使用下面的命令進行安裝

接下來我們做一些配置

在aria2.conf里面輸入如下內容,可以直接復制后在窗口里按鼠標右鍵粘貼

按ctrl+o 保存,回車一下,然后按ctrl+x退出編輯,完了后運行:

測試有沒有錯誤,如果沒有錯誤的話按一下Ctrl + C終止當前程序,繼續往下。

接下來我們讓aria2c成為系統服務並且開機自啟動

粘貼如下內容到窗口,注意格式一定要保持一致

之后按ctrl+o保存,回車一下,再按ctrl+x退出編輯

使用命令進行權限更改

測試服務是否可以啟動:

如果只顯示Starting aria2c,沒有其他錯誤提示的話就成功了
添加aria2c服務自動運行:

到此aria2c就可以開機自啟動了。

下來是安裝nginx web服務器

在shell窗口使用命令進行安裝

由於Raspbmc以及自帶的遠程管理占用了80端口,因此我們需要更改nginx的端口號使他們不相互沖突,通過修改nginx.conf文件實現

使用下面的命令進入修改

進入vi后,輸入

按回車 查找listen,找到

按方向鍵移動光標(nani?不能用鼠標?對不起,不能)到第一個listen的”#”,按del刪除,再移動光標到80,按一下字母i,進入編輯模式,此時就可以自由編輯了,把80改為8080,改完后應該是這個樣子:

按一下esc鍵,回到瀏覽模式,然后按一下冒號鍵(shift + ;鍵),輸入wq,保存退出
edit-nginx-conf

使用如下命令啟動nginx

進入http://樹莓派的ip:8080/你能看到Welcome to nginx!說明安裝成功(OY!)
nginx

再來是yaaw,

這里下載yaaw,可以使用git直接下載到樹莓派上或者在PC端點擊頁面的右下角那個“Download Zip”下載最新版本,解壓縮,再通過FileZilla上傳到你的樹莓派上的,我推薦第二種方式,這樣你就不用命令行了:)

在PC端解壓縮yaaw的壓縮包,解壓出的文件夾叫yaaw-master,我們把它重命名名為yaaw

我們還需要更改一下nginx的www目錄訪問權限,才能使用ftp把yaaw扔進去

之后打開FileZilla,在”主機”處輸入你的樹莓派的ip,用戶名輸入pi,密碼輸入raspberry,點擊“快速連接”,然后在下面“本地站點里”選擇yaaw所在的本地路徑,在“遠程站點”里定位到/usr/share/nginx/www,把剛才的yaaw拖進去就行了。
FileZilla
然后在你的shell上使用命令

讓yaaw文件夾可以被瀏覽器訪問。

然后在pc的地址欄里輸入http://樹莓派IP:8080/yaaw,就能看到任務管理界面了,它看起來像這個樣子
yaaw
到此大功告成,OY!!

別着急,我們還需要一些額外的工作使你以后的使用更方便。有點耐心,就要完了。

一些額外的工作:

  • 首先要把系統語言改成中文,在System-Settings-Appearance-International里把Language改成Chinese(Simple),光標移開就自動換了,然后把字符集改成Chinese Simplified (GBK)
    language setting
  • 無線網的配置,這個需要在樹莓派的UI界面進行,進入程序-Raspbmc Settings-Network Configuratioin
    netword setting
  • 請為你的小派在路由器里分配一個固定的IP地址,這樣可以省去很多麻煩。

遠程控制:

你現在有兩種方式來遠程控制你的樹莓派了,

  • 通過瀏覽器訪問http://你的樹莓派IP 來訪問,他看起來像這樣
    browser remote
  • 通過智能手機,參考這里 Android, IOS

知識加油站:

什么是樹莓派?
樹莓派是一款基於ARM的微型電腦主板,以SD卡為內存硬盤,卡片主板周圍有兩個USB接口和一個網口,可連接鍵盤、鼠標和網線,同時擁有視頻模擬信號的電視輸出接口和HDMI高清視頻輸出接口,以上部件全部整合在一張僅比信用卡稍大的主板上,具備所有PC的基本功能只需接通電視機和鍵盤,就能執行如電子表格、文字處理、玩游戲、播放高清視頻等諸多功能。 Raspberry Pi B款只提供電腦板,無內存、電源、鍵盤、機箱或連線。

 

 

 

 

 

 

挖礦的起點其實很低,用CPU、GPU挖是成本最低的選擇,不過CPU效率實在太低,用顯卡的話必須要較高端A卡,假如你是使用筆記本的話,大概挖一輩子都買不了饅頭。如果您還是想湊熱鬧不妨買個Bitcoin ASICMiner Block Erupter USB,成本大概是300元左右,成本低,功耗低,但挖礦效率比普通電腦強得多,甚至還可以買N個並行挖礦,而在這時候,你就需要多個個USB口擴展。ORICO P10-U2ORICO P10-U3ORICO A3H10等10口USB HUB就是一極佳的擴展助手。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM