Установĸа Ethash Mining Pool на примере ETC. Stratum/Nicehash/Dynamic PPLNS/Выплаты
resurs2
Бывалый
Системные требования:
CPU 4, RAM 8GB, SSD 60GB, Ubuntu Server 16.04.
Для тех, кто еще не очень знаком с Linux — настоятельно рекомендую делать все пошагово через 1 открытую консоль, вставляя по одной команде и под пользователем root.
sudo apt update && sudo apt upgrade
reboot now
заходим на сервер
sudo su (вводим пароль, должны быть под root)
systemctl stop ufw.service && systemctl disable ufw.service
apt install software-properties-common unzip nginx tor pcscd pcsc-tools git curl htop mc unrar screen
mkdir /pool && cd /pool
unzip multi-geth-linux.zip
ln -s /pool/geth /usr/bin/geth
chmod ugo+x /usr/bin/geth
geth —classic account new
geth —classic account list
Будем использовать кошелек, который только что был создан командой выше:
Если geth стартовать таким образом:
screen -S server geth —classic —rpc —maxpeers 75 —syncmode «fast» —rpcapi «db,eth,net,web3,personal» —etherbase «ВАШ КОШЕЛЕК» —cache=12288 —mine —unlock «ВАШ КОШЕЛЕК» —allow-insecure-unlock
попросит ввести пароль от созданного кошелька
Можно подключаться через: geth attach http://127.0.0.1:8545
В будущем проверять баланс: web3.fromWei(eth.getBalance(eth.coinbase), «ether»)
Делать переводы: eth.sendTransaction(
Условие:
файл кошелька должен быть локально на сервере (как делали по инструкции выше)
Пример вывода после генерации файла кошелька:
Public address of the key: 0xa9c96bff41FFAFb6bE8c2990c0CF4F3b220aaEaa
Path of the secret key file: /root/.ethereum/classic/keystore/UTC—2020-03-11T22-03-07.512690005Z—a9c96bff41ffafb6be8c2990c0cf4f3b220aaeaa
Не знаю, чтобы работали выплаты с пула нужно стартовать geth таким образом или нет, но на период тестирования он был запущен с такими параметрами —unlock «ВАШ КОШЕЛЕК» —allow-insecure-unlock.
Так как в текущем окне терминала у нас запущен geth и идет синхронизация нам требуется открыть новое окно, залогиниться, ввести sudo su, должны быть под root
cd /pool
add-apt-repository ppa:chris-lea/redis-server
apt update
apt install redis-server
systemctl enable redis-server.service && systemctl stop redis-server.service && systemctl start redis-server.service
add-apt-repository ppa:longsleep/golang-backports
apt update
apt install golang-go
curl -sL https://deb.nodesource.com/setup_13.x | bash —
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add —
echo «deb https://dl.yarnpkg.com/debian/ stable main» | tee /etc/apt/sources.list.d/yarn.list
apt update
apt install nodejs yarn
git clone -b V2.0_Etc https://github.com/techievee/ethash-mining-pool.git
mv ethash-mining-pool/ open-ethereum-pool/
cd /pool/open-ethereum-pool
make
rm config_payout.json
rm config_proxy.json
1. Вĸлючить Proxy, исправить порт на 40002
«proxy»: <
«enabled»: true,
«listen»: «0.0.0.0:40002»,
2. Включить Stratum, исправить порт на 9009
«stratum»: <
«enabled»: true,
«listen»: «0.0.0.0:9009»,
3. Включить nice hash, Исправить порт на 40004
«stratum_nice_hash»: <
«enabled»: true,
«listen»: «0.0.0.0:40004»,
4. Запоминаем порт api 9091
«api»: <
«enabled»: true,
«purgeOnly»: false,
«purgeInterval»: «10m»,
«listen»: «0.0.0.0:9091»,
5. Исправляем upstream
6. Исправляем Redis
«redis»: <
«endpoint»: «127.0.0.1:6379»,
«poolSize»: 300,
«database»: 0,
«password»: «»
7. Включаем Unlocker, выставляем комиссию пула, указываем кошелек для выплат комиссии с пула
«unlocker»: <
«enabled»: true,
«poolFee»: 0.5,
«poolFeeAddress»: «ВАШ АДРЕС ДЛЯ ВЫПЛАТ КОМИССИИ»,
8. Исправляем Payouts, включаем, правим демона, прописываем адрес локального кошелька, с которого будут выплаты
«payouts»: <
«enabled»: true,
«requirePeers»: 5,
«interval»: «120m»,
«daemon»: «http://127.0.0.1:8545»,
«timeout»: «10s»,
«address»: «ВАШ_ЛОКАЛЬНЫЙ_КОШЕЛЕК»,
9. Отключаем exchange, т. к. api.coinmarketcap.com сменили API на новый. На стартовой странице актуальных курсов все-равно не увидим, будет 1970 год
«exchange»: <
«enabled»: false,
rm -rf /pool/open-ethereum-pool/www/*
cd www/
git clone -b v1.0_Etc https://github.com/techievee/statistics_api.git
mv statistics_api/* /pool/open-ethereum-pool/www/
rm -rf statistics_api/
rm config/environment_in.js
1. Заменить etc.daggerpool.com «на ВАШ INTERNET_IP»
2. Заменить http://etc-us01.daggerpool.com «на ВАШ INTERNET_IP»
3. Заменить etc-us01.daggerpool.com «на ВАШ INTERNET_IP»
4. Заменить etc-uk01.daggerpool.com «на ВАШ INTERNET_IP»
5. Заменить etc-nh.daggerpool.com «на ВАШ INTERNET_IP»
6. Поставить нужные значения PoolFee: ‘0.9%’,
7. Поставить нужные значения ShareDifficulty: ‘4000000000’,
8. Удалить секцию StratumHost1:
9. Удалить секцию StratumPort1:
10. Сохраняемся
HttpPort: 40002,
StratumPort: 9009,
NicehashPost: 40004,
Далее делать обязательно через sudo, как описано ниже, несмотря на то, что уже работаем под root и по-прежнему по одной команде.
sudo npm install -g [email protected]
sudo npm install -g bower
sudo npm install [email protected] -f —save-optional
sudo npm install intl-format-cache
sudo npm install format-number
sudo npm install ember-cli-accounting
sudo npm install [email protected]
sudo npm install @babel/[email protected]^7.0.0-beta.42
sudo npm install [email protected]
sudo npm install ember-intl
sudo npm install [email protected]
sudo npm install
sudo npm audit fix
sudo npm audit fix —force
bower install —allow-root
wget https://files.gitter.im/sammy007/open-ethereum-pool/IBJl/intl-format-cache.rar
unrar x intl-format-cache.rar node_modules/intl-format-cache/ -Y
chmod +x build.sh
./build.sh
После того, как команда отработает (сгенерируются файлы веб сервера) — консоль немного ведет себя не правильно, нажмите ctrl +c несколько раз и вернитесь на уровень выше следующей командой:
cp misc/nginx-default.conf /etc/nginx/sites-available/default
1. Исправляем upstream api порт на 9091
upstream api <
server 127.0.0.1:9091;
2. Правим путь до веб морды
systemctl enable nginx.service && systemctl stop nginx.service && systemctl start nginx.service
ЗАПУСКАЕМ POOL при условии, что цепочка полностью синхронизирована до последнего блока.
Сама команда запуска(должны быть в директории /pool/open-ethereum-pool):
screen -S pool ./build/bin/ethash-mining-pool config_api.json
Команда screen позволяет перейти ĸ процессу после подĸлючения ĸ серверу ĸомандой screen -x pool или server, если просто запустить и заĸрыть оĸно терминала — процесс прервется.
Источник
Open ethereum classic pool pplns
Open Source Ethereum Classic Mining Pool
This pool is being further developed to provide an easy to use pool for Ethereum Classic miners. Testing and bug submissions are welcome!
- Support for HTTP and Stratum mining
- Detailed block stats with luck percentage and full reward
- Failover geth instances: geth high availability built in
- Modern beautiful Ember.js frontend
- Separate stats for workers: can highlight timed-out workers so miners can perform maintenance of rigs
- JSON-API for stats
- PPLNS block reward
- Multi-tx payout at once
- Beautiful front-end highcharts embedded
- Ether-Proxy HTTP proxy with web interface
- Stratum Proxy for Ethereum
Guide to make your very own ETC mining pool
Building on Linux
I highly recommend to use Ubuntu 16.04 LTS.
Install go lang
It is recommended to bind your DB address on 127.0.0.1 or on internal ip. Also, please set up the password for advanced security.
Search on Google for nginx-setting
This will install the latest nodejs
Install Ethereum Classic node
Run Ethereum Classic node
If you use Ubuntu, it is easier to control services by using serviced.
Copy the following example
Then run ethereum classic by the following commands
If you want to debug the node command
Register pool account and open wallet for transaction. This process is always required, when the wallet node is restarted.
Install Ethereum Classic Pool
If you face open-classic-pool after ls
/open-classic-pool/build/bin/, the installation has completed.
Set up Ethereum Classic pool
Set up based on commands below.
If you are distributing your pool deployment to several servers or processes, create several configs and disable unneeded modules on each server. (Advanced users)
I recommend this deployment strategy:
- Mining instance — 1x (it depends, you can run one node for EU, one for US, one for Asia)
- Unlocker and payouts instance — 1x each (strict!)
- API instance — 1x
It is required to run pool by serviced. If it is not, the terminal could be stopped, and pool doesn’t work.
Copy the following example
Then run pool by the following commands
If you want to debug the node command
Backend operation has completed so far.
Firewall should be opened to operate this service. Whether Ubuntu firewall is basically opened or not, the firewall should be opened based on your situation. You can open firewall by opening 80,443,8080,8888,8008.
Modify configuration file
Make some modifications in these settings.
The frontend is a single-page Ember.js application that polls the pool API to render miner stats.
As you can see above, the frontend of the pool homepage is created. Then, move to the directory, www, which services the file.
Modify based on configuration file.
After setting nginx is completed, run the command below.
Type your homepage address or IP address on the web. If you face screen without any issues, pool installation has completed.
Extra) How To Secure the pool frontend with Let’s Encrypt (https)
First, install the Certbot’s Nginx package with apt-get
And then open your nginx setting file, make sure the server name is configured!
Change the _ to your pool domain, and now you can obtain your auto-renewaled ssl certificate for free!
Now you can access your pool’s frontend via https! Share your pool link!
- Unlocking and payouts are sequential, 1st tx go, 2nd waiting for 1st to confirm and so on. You can disable that in code. Carefully read docs/PAYOUTS.md .
- Also, keep in mind that unlocking and payouts will halt in case of backend or node RPC errors. In that case check everything and restart.
- You must restart module if you see errors with the word suspended.
- Don’t run payouts and unlocker modules as part of mining node. Create separate configs for both, launch independently and make sure you have a single instance of each module running.
- If poolFeeAddress is not specified all pool profit will remain on coinbase address. If it specified, make sure to periodically send some dust back required for payments.
- DO NOT OPEN YOUR RPC OR REDIS ON 0.0.0.0. It will eventually cause coin theft.
Made by sammy007. Licensed under GPLv3. Modified by Akira Takizawa & The Ellaism Project.
Источник
Open ethereum classic pool pplns
Open Source Ethereum Mining Pool
This pool is being further developed to provide an easy to use pool for Ethereum miners. This software is functional however an optimised release of the pool is expected soon. Testing and bug submissions are welcome!
- Support for HTTP and Stratum mining
- Detailed block stats with luck percentage and full reward
- Failover geth instances: geth high availability built in
- Modern beautiful Ember.js frontend
- Separate stats for workers: can highlight timed-out workers so miners can perform maintenance of rigs
- JSON-API for stats
- Ether-Proxy HTTP proxy with web interface
- Stratum Proxy for Ethereum
Building on Linux
- go >= 1.9
- geth or parity
- redis-server >= 2.8.0
- nodejs >= 4 LTS
- nginx
I highly recommend to use Ubuntu 16.04 LTS.
You can use Ubuntu upstart — check for sample config in upstart.conf .
Install nodejs. I suggest using LTS version >= 4.x from https://github.com/nodesource/distributions or from your Linux distribution or simply install nodejs on Ubuntu Xenial 16.04.
The frontend is a single-page Ember.js application that polls the pool API to render miner stats.
Change ApiUrl: ‘//example.net/’ in www/config/environment.js to match your domain name. Also don’t forget to adjust other options.
Configure nginx to serve API on /api subdirectory. Configure nginx to serve www/dist as static website.
Serving API using nginx
Create an upstream for API:
and add this setting after location / :
You can customize the layout using built-in web server with live reload:
Don’t use built-in web server in production.
Check out www/app/templates directory and edit these templates in order to customise the frontend.
Configuration is actually simple, just read it twice and think twice before changing defaults.
Don’t copy config directly from this manual. Use the example config from the package, otherwise you will get errors on start because of JSON comments.
If you are distributing your pool deployment to several servers or processes, create several configs and disable unneeded modules on each server. (Advanced users)
I recommend this deployment strategy:
- Mining instance — 1x (it depends, you can run one node for EU, one for US, one for Asia)
- Unlocker and payouts instance — 1x each (strict!)
- API instance — 1x
- Unlocking and payouts are sequential, 1st tx go, 2nd waiting for 1st to confirm and so on. You can disable that in code. Carefully read docs/PAYOUTS.md .
- Also, keep in mind that unlocking and payouts will halt in case of backend or node RPC errors. In that case check everything and restart.
- You must restart module if you see errors with the word suspended.
- Don’t run payouts and unlocker modules as part of mining node. Create separate configs for both, launch independently and make sure you have a single instance of each module running.
- If poolFeeAddress is not specified all pool profit will remain on coinbase address. If it specified, make sure to periodically send some dust back required for payments.
Alternative Ethereum Implementations
This pool is tested to work with Ethcore’s Parity. Mining and block unlocking works, but I am not sure about payouts and suggest to run official geth node for payments.
Источник