Code Monkey home page Code Monkey logo

ethereum-mining-pool-php's Introduction

Ethereum Mining pool written in PHP

This is full source of Ethereum Mining Pool - http://ethereumpool.co It has been written mostly in php, code is not bad, but needs some work, it runs fine on one decent dedicated server if it's not serving more than ~500 workers, for more it needs to be rewritten and split between more servers. It should be considered alpha code. Code is messy, my intention at time was to swiftly create pool to save community from only one existing pool with more than 3/4 network hashrate.

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

Requirements

Recommended HHVM, not mandatory, can be replaced with php-fpm
MariaDB server
Memcached
BigInteger for php (included in project)
Nginx
Pyethereum
Geth

Setup on Linux

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

misc>database_scheme.sql
Setup valid mysql connection details in config.php.
Setup nginx server blocks:

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

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 Address

Now start background scripts:
Get work from geth json and cache it with memcached

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;

Don't use it on production, it's quite heavy.

Make sure to setup valid permissions, allow php-fpm to run python script and make sure that directory permissions are correct to save logs. Some paths may require changes.

Setting up pool revenue address and fee

block_processing/index.php
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

php,python and some js,css,html code is under The MIT License (MIT) including charting library Plotly.js
Front end template is paid (sorry, at first it wasn't meant to be open sourced thus i just picked paid template)

ethereum-mining-pool-php's People

Contributors

jeffanthony avatar koszycl avatar ming08108 avatar tidro avatar

Watchers

 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.