btccom / btcpool-ABANDONED

backend of pool.btc.com
https://pool.btc.com
MIT License
638 stars 408 forks source link

DGB Pool Support #353

Open feepool opened 5 years ago

feepool commented 5 years ago

Thank you very muvh for sharing this great software i have several questions

if i want to make a front-end for this pool can you please point me to the right direction ?

and how can we implement different payout methods like PPS, PPLNS for our workers

Is it possible to add DGB-SHA to suppoerted coins ?

YihaoPeng commented 5 years ago

BTCPool's slparser is a PPS based reward statistics program. bpool_local_stats_db.stats_users_day have users' daily PPS rewards (field earn, the unit is Satoshi of BTC, Wei of Ethereum, ...), you can multiply them by a ratio (such as 96%, keep 4% as your profit) and then send to your users.

Note that when slparser calculates PPS rewards, it does not consider the transaction fee income of the block, which assumes that the block only receives the basic mining reward. You can then share the fee income with your users by changing the distribution ratio.

Currently slparser does not support PPLNS. You will need to write a new reward analyzer to do similar work, and your program may read bpool_local_db.found_blocks to find the time point of your blocks.

YihaoPeng commented 5 years ago

And we have no plan to add DGB-SHA as a suppoerted coin. But because DigiCoin's code is forked from DASH, maybe you can refer to another developer's DASH implementation:

https://github.com/btccom/btcpool/files/3077084/btc-pool-dash-service.tar.gz

It is based on an older version of BTCPool and is currently not merged into our main branch.

YihaoPeng commented 5 years ago

I made a mistake and it seems that the Digibyte is forked from Bitcoin instead of Dash. This way you can try to link it directly to BTCPool (assuming its source code is BTC's) and then fix the build error.

BobZombiE69 commented 5 years ago

sorry for this noob question:

for DGB-SHA (it's sha256d ) i used :

cmake -DJOBS=4 -DCHAIN_TYPE=BTC -DCHAIN_SRC_ROOT=/work/bitcoin-0.16.0 ..

everything is working except: JobMakerBitcoin.cc:77] invalid pool payout address

should i edit JobMakerBitcoin.cc to fix this problem ? (and i don't know how to fix it) the code is: // check pool payout address if (!BitcoinUtils::IsValidDestinationString(def()->payoutAddr_)) { LOG(ERROR) << "invalid pool payout address"; return false; } poolPayoutAddr_ = BitcoinUtils::DecodeDestination(def()->payoutAddr_);

or should i use digibyte source for cmake ? like this: cmake -DJOBS=4 -DCHAIN_TYPE=BTC -DCHAIN_SRC_ROOT=/work/digibyte-7.17.2 ..

(i tried this also and it gives error during compile)

also the pool found 2 blocks but the reward did not come into my address :-(

BobZombiE69 commented 5 years ago

i removed the code to check the validity of the payout address :)) cmake with digibyte source has lots of errors, (the errors are related to file name , because for example instead of libbitcoin_common.a the file names are like libdigibyte_common.a .... ) i changed them in CMakeLists.txt , but then more errors related to IsValidDestinationString ...

so i used cmake with bitcoin source: cmake -DJOBS=4 -DCHAIN_TYPE=BTC -DCHAIN_SRC_ROOT=/work/bitcoin-0.16.0 ..

and compiled again , and the jobmaker did not show any error anymore everything is working , the block found successfully , but the reward did not come into my wallet address (still the same problem) here is the block explorer result of the block my pool found: https://explorer-1.us.digibyteservers.io/block/0000000000000003eb1cd29f12bb7b7412667f45970cf30adfc00fee42416c10

the receiver address is empty Unparsed address [1] : 0 DGB

and also the coinbase_info (signature of my pool , mined by: .... ) in jobmaker.cfg coinbase_info = "my_text/example_signature/";

has not written into the found block !

de1acr0ix commented 5 years ago

DGB is using a different p2pkh address scheme and you have to use DGB source code. We are going to look into this and try to add some minimal DGB support changes.