Giter Site home page Giter Site logo

gaoyang853 / ethereum-mining-pool-php Goto Github PK

View Code? Open in Web Editor NEW

This project forked from grizscom/ethereumpool.co---ethereum-mining-pool-full-source

0.0 2.0 0.0 12.8 MB

Ethereum Mining Pool written in php

License: MIT License

PHP 13.28% CSS 27.73% JavaScript 52.43% HTML 6.49% Python 0.08%

ethereum-mining-pool-php's Introduction

Ethereum Mining pool written in PHP

This is full source of Ethereum Mining Pool - http://ethereumpool.co Pool has been written in php and one script in python to perform proof of work validation. Pool software is efficient, it was using only 4% cpu while handling ~250 workers. It may be quite messy but i didn't spend much time on creating this, my intention was to fastly create pool to save community from only one existing pool with 50-70% network hashrate, but later other pools pop up. So now it's even more decentralized, everybody can easily set up own pool :)

Disclaimer
This is latest avaiable source code from original ethereumpool.co mining pool.
Domain has been sold to eth.pp.ua

Requirements

Recommended HHVM over php5-fpm, but php5-fpm is fine.
MariaDB server
Memcached
BigInteger for php (included in project)
Nginx (Apache may be also fine, but i didn't tested)
Pyethereum
Geth
Highcharts (included in project)

Setup on Linux

Install all software mentioned above.
Setup your mysql server and import database scheme

misc>database_scheme.sql
Now please review all source files and set desired names etc. and setup valid mysql connection details in config.php. Copy all files to server
Setup nginx server blocks:

'mainpage' directory as public and if you need block /logs directory
'block_processing' locally

Also remember to setup phpmyadmin with ssl, etc..
Now move files

nonce_fast.py and nonce.py
from 'misc' directory to
/root/pyethereum/ethereum/ (main directory of Pyethereum)

To maximize performance tweak configurations of memcached,mariadb,nginx,hhvm and kernel but it's not necessary to start pool.

Start Pool

screen -dmS geth geth --rpcaddr 127.0.0.1 --rpcport 8983 --rpc --unlock COINBASE_ADDRESS

Now start background scripts:
Get Work from GETH Json RPC and cache it with memcached (reduces queries to geth rpc)

screen -dmS process_work php /var/www4/block_processing/process_work/index.php


Block Processing - this script handle block splitting and Proof of Work verification

screen -dmS block_processing php /var/www4/block_processing/index.php


This script updates data to calculate predicted mining rewards

screen -dmS update_calculator php /var/www4/block_processing/update_calculator/index.php


Used to process internal statistics and save to database

screen -dmS stats php /var/www4/block_processing/stats/index.php

You can execute withdraws manually or add it as cron job
sudo php /var/www4/block_processing/withdraw/index.php

crontab -e

* */12 * * * sudo php /var/www4/block_processing/withdraw/index.php

This both scripts can be used to check if withdraws has been processed correctly or check if splited balance == real balance, it was mainly used while development process but it might be helpful.

sudo php /home/www4/block_processing/withdraw_check/index.php
curl http://127.0.0.1:9846/check/

Notes

withdraw_check and withdraw scripts saves logs in block_processing directory.
If you would like to debug mining proxy (mainpage/index.php)

$logstate = true;

But don't use it on production, it's quite heavy with many workers.

Make sure to setup valid permissions to allow php run python script and make sure that directory permissions are fine to save logs. Also please review python path in php files, but '/usr/bin/python' should be fine, other paths may be also necessary to review depending on where you put files!

Setting up pool revenue address and fee

block_processing/index.php
and make sure address exists as 'miner' in miners table.



You can easily access all background scripts by

screen -x stats/update_calculator/block_processing/process_work/geth

Contributing

If you want to contribute, fork and pull request or open issue.

License

Entire PHP and Python code is under The MIT License (MIT)
Front-end(site theme) is used from http://themes.3rdwavemedia.com/website-templates/responsive-bootstrap-theme-web-development-agencies-devstudio/
Personally i own license, so better buy license or use your own front-end.

ethereum-mining-pool-php's People

Contributors

koszycl avatar jeffanthony avatar tidro avatar ming08108 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.