open-ethereum-pool以太坊礦池原始碼分析(1)環境安裝
# open-ethereum-pool以太坊礦池-環境安裝
## 安裝Geth
```shell
//安裝parity
cd /tmp/
wget http://d1h4xl4cr1h0mo.cloudfront.net/v1.8.11/x86_64-unknown-linux-gnu/parity_1.8.11_ubuntu_amd64.deb
dpkg -i parity_1.8.11_ubuntu_amd64.deb
//安裝screen
apt-get update
apt-get -y install screen
//啟動parity
screen parity --base-path=/root/.ethereum --chain ropsten --jsonrpc-interface local --jsonrpc-hosts all --jsonrpc-apis all --no-ws --no-dapps --author 0xc1d0932D18a4Ec35728b7fF02288dF745D1f4F40
//暫時離開 按住Ctrl,依次再按a,d
//恢復screen會話
screen -ls
screen -r 17172
//安裝Geth
apt-get -y install software-properties-common
add-apt-repository -y ppa:ethereum/ethereum
apt-get update
apt-get -y install ethereum
//啟動Geth連線parity
geth attach http://127.0.0.1:8545
//區塊同步進展
> eth.syncing
//查賬戶餘額
> eth.getBalance("0xc1d0932D18a4Ec35728b7fF02288dF745D1f4F40")
//getBlock
> eth.getBlock('pending')
//getWork
> eth.getWork()
```
## open-ethereum-pool礦池安裝
```shell
//go >= 1.9
//geth or parity
//redis-server >= 2.8.0
//nodejs >= 4 LTS
//nginx
//安裝go
wget https://dl.google.com/go/go1.9.4.linux-amd64.tar.gz
tar -zxvf go1.9.4.linux-amd64.tar.gz
mv go /usr/local/
ln -s /usr/local/go/bin/go /usr/bin/go
go version
//安裝redis-server
apt-get -y install redis-server
//安裝nodejs
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
apt-get install -y nodejs
npm config set registry https://registry.npm.taobao.org
//安裝nginx
apt-get -y install nginx
//安裝open-ethereum-pool
cd /root/
git config --global http.https://gopkg.in.followRedirects true
git clone https://github.com/sammy007/open-ethereum-pool.git
cd open-ethereum-pool
make
//執行open-ethereum-pool
cd /root/open-ethereum-pool/
screen ./build/bin/open-ethereum-pool config.json
//執行unlocker
screen ./build/bin/open-ethereum-pool unlock.json
```
## 執行www
```shell
cd /data/
//修改www/config/environment.js
vim www/config/environment.js
ApiUrl: '//106.15.89.134/',
HttpHost: 'http://106.15.89.134',
StratumHost: '106.15.89.134',
//編譯www
cd www
npm install -g ember-cli@2.9.1
npm install -g bower
sudo npm install
bower install --allow-root
./build.sh
//配置nginx
vim /etc/nginx/sites-available/default
upstream api {
server 127.0.0.1:8080;
}
root /data/www/dist;
//放在location /:之後
location /api {
proxy_pass http://api;
}
//重啟nginx
service nginx restart
//訪問地址:http://106.15.89.134/
```
## 使用ethminer測試open-ethereum-pool
```shell
//下載地址https://github.com/ethereum-mining/ethminer/releases/download/v0.14.0.dev2/ethminer-0.14.0.dev2-Windows.zip
//解壓至C:\ethminer
//啟動
cd c:\ethminer\bin
ethminer.exe -G -F http://106.15.89.134:8888/0x1DD1a1681285E09A46a69A14b010Cf846511da90
```
## 參考文件
* [Installing Go Ethereum](https://ethereum.github.io/go-ethereum/install/#install-on-ubuntu-via-ppas)
* [以太坊客戶端Geth命令用法-引數詳解](http://blog.csdn.net/xilibi2003/article/details/78662000)
* [JavaScript Runtime Environment](https://ethereum.gitbooks.io/frontier-guide/content/jsre.html)
* [Ropsten Testnet Ethereum BlockChain Explorer and Search](https://ropsten.etherscan.io/)
* [Installation Instructions for Ubuntu](https://github.com/ethereum/go-ethereum/wiki/Installation-Instructions-for-Ubuntu)
* [Open Source Ethereum Mining Pool](https://github.com/sammy007/open-ethereum-pool)
* [ethminer](https://github.com/ethereum-mining/ethminer)
網址:http://www.qukuailianxueyuan.io/
欲領取造幣技術與全套虛擬機器資料
區塊鏈技術交流QQ群:756146052 備註:CSDN
尹成學院微信:備註:CSDN
相關文章
- open-ethereum-pool以太坊礦池原始碼分析(1)-main入口分析原始碼AI
- open-ethereum-pool以太坊礦池原始碼分析(2)API分析原始碼API
- open-ethereum-pool以太坊礦池原始碼分析(3)payouts模組原始碼
- open-ethereum-pool以太坊礦池原始碼分析(4)-policy模組原始碼
- open-ethereum-pool以太坊礦池原始碼分析(5)proxy模組原始碼
- open-ethereum-pool以太坊礦池原始碼分析(6)-redis模組原始碼Redis
- open-ethereum-pool以太坊礦池原始碼分析(7)unlocker模組原始碼
- btcpool礦池原始碼分析(1)環境搭建TCP原始碼
- 以太坊交易池原始碼分析原始碼
- 以太坊原始碼分析(16)挖礦分析原始碼
- 以太坊原始碼分析(42)miner挖礦部分原始碼分析CPU挖礦原始碼
- btcpool礦池原始碼分析(8)-slparserTCP原始碼
- 以太坊原始碼分析(26)core-txpool交易池原始碼分析原始碼
- 死磕以太坊原始碼分析之挖礦流程分析原始碼
- lnmp環境安裝-原始碼編譯LNMP原始碼編譯
- EOS原始碼分析(1)安裝原始碼
- btcpool礦池原始碼分析(3)-BlockMaker模組解析TCP原始碼BloC
- btcpool礦池原始碼分析(5)-JobMaker模組解析TCP原始碼
- btcpool礦池原始碼分析(6)-nmcauxmaker模組解析TCP原始碼UX
- btcpool礦池原始碼分析(9)-statshttpd模組解析TCP原始碼httpd
- btcpool礦池原始碼分析(10)-StratumServer模組解析TCP原始碼Server
- PyOpenGl 1 -- 環境安裝
- 以太坊交易池原始碼解析原始碼
- Linux環境PostGIS原始碼編譯安裝Linux原始碼編譯
- btcpool礦池原始碼分析(4)-GbtMaker模組解析TCP原始碼
- btcpool礦池原始碼分析(6)-PoolWatcher模組解析TCP原始碼
- Linux環境下原始碼編譯方式安裝MySQL5.1(1)Linux原始碼編譯MySql
- [1]SpinalHDL安裝環境
- [環境搭建] 透過原始碼編譯安裝 Redis原始碼編譯Redis
- 以太坊原始碼分析(36)ethdb原始碼分析原始碼
- 以太坊原始碼分析(38)event原始碼分析原始碼
- 以太坊原始碼分析(41)hashimoto原始碼分析原始碼
- 以太坊原始碼分析(43)node原始碼分析原始碼
- 以太坊原始碼分析(52)trie原始碼分析原始碼
- 1、Spring原始碼環境搭建Spring原始碼
- 【MyBatis原始碼分析】環境準備MyBatis原始碼
- webpack(1)安裝環境與解決環境問題Web
- 以太坊原始碼分析(51)rpc原始碼分析原始碼RPC