eroxors
Legendary
Offline
Activity: 924
Merit: 1000
Think. Positive. Thoughts.
|
|
June 11, 2013, 03:14:47 PM |
|
Has anyone built the database from the code? I'd happily pay a small bounty for it.
|
|
|
|
daemondazz
|
|
June 12, 2013, 01:34:04 AM |
|
Should be pretty close, although I'm still testing and haven't tested very thoroughly yet: CREATE TABLE `devcoin_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `devcoin_payouts` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paid` varchar(48) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `devcoin_reg` ( `BTC_address` varchar(48) NOT NULL, `NMC_address` varchar(48) DEFAULT NULL, PRIMARY KEY (`BTC_address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `i0coin_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `i0coin_payouts` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paid` varchar(48) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `i0coin_reg` ( `BTC_address` varchar(48) NOT NULL, `NMC_address` varchar(48) DEFAULT NULL, PRIMARY KEY (`BTC_address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ixcoin_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ixcoin_payouts` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paid` varchar(48) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ixcoin_reg` ( `BTC_address` varchar(48) NOT NULL, `NMC_address` varchar(48) DEFAULT NULL, PRIMARY KEY (`BTC_address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `lminer_hist` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `hashrate` bigint(20) DEFAULT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `lpayouts` ( `id` int(11) DEFAULT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paddress` varchar(48) DEFAULT NULL, `paid` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `lpool_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, `blk_num` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `lpool_data` ( `id` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `hashrate` bigint(20) DEFAULT NULL, `shares` int(11) DEFAULT NULL, `stale_doa` int(11) DEFAULT NULL, `stale_orphan` int(11) DEFAULT NULL, `p2pool_hashrate` bigint(20) DEFAULT NULL, `p2pool_stale_rate` int(11) DEFAULT NULL, `block_value` decimal(16,8) DEFAULT NULL, `peers_out` int(11) DEFAULT NULL, `peers_in` int(11) DEFAULT NULL, `current_payout` decimal(16,8) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `miner_data` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `hashrate` bigint(20) DEFAULT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `miner_hist` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `hashrate` bigint(20) DEFAULT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `namecoin_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `namecoin_payouts` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paid` varchar(48) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `namecoin_reg` ( `BTC_address` varchar(48) NOT NULL, `NMC_address` varchar(48) DEFAULT NULL, PRIMARY KEY (`BTC_address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `pay_address` ( `address` varchar(48) NOT NULL, `paddress` varchar(48) DEFAULT NULL, PRIMARY KEY (`address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `payouts` ( `id` int(11) DEFAULT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paddress` varchar(48) DEFAULT NULL, `paid` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `pool_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, `blk_num` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `pool_data` ( `id` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `hashrate` bigint(20) DEFAULT NULL, `shares` int(11) DEFAULT NULL, `stale_doa` int(11) DEFAULT NULL, `stale_orphan` int(11) DEFAULT NULL, `p2pool_hashrate` bigint(20) DEFAULT NULL, `p2pool_stale_rate` int(11) DEFAULT NULL, `block_value` decimal(16,8) DEFAULT NULL, `peers_out` int(11) DEFAULT NULL, `peers_in` int(11) DEFAULT NULL, `current_payout` decimal(16,8) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `signtime` ( `address` varchar(48) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
Computers, Amateur Radio, Electronics, Aviation - 1dazzrAbMqNu6cUwh2dtYckNygG7jKs8S
|
|
|
flowice
|
|
June 12, 2013, 02:05:46 AM |
|
Should be pretty close, although I'm still testing and haven't tested very thoroughly yet: CREATE TABLE `devcoin_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `devcoin_payouts` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paid` varchar(48) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `devcoin_reg` ( `BTC_address` varchar(48) NOT NULL, `NMC_address` varchar(48) DEFAULT NULL, PRIMARY KEY (`BTC_address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `i0coin_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `i0coin_payouts` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paid` varchar(48) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `i0coin_reg` ( `BTC_address` varchar(48) NOT NULL, `NMC_address` varchar(48) DEFAULT NULL, PRIMARY KEY (`BTC_address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ixcoin_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ixcoin_payouts` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paid` varchar(48) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ixcoin_reg` ( `BTC_address` varchar(48) NOT NULL, `NMC_address` varchar(48) DEFAULT NULL, PRIMARY KEY (`BTC_address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `lminer_hist` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `hashrate` bigint(20) DEFAULT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `lpayouts` ( `id` int(11) DEFAULT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paddress` varchar(48) DEFAULT NULL, `paid` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `lpool_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, `blk_num` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `lpool_data` ( `id` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `hashrate` bigint(20) DEFAULT NULL, `shares` int(11) DEFAULT NULL, `stale_doa` int(11) DEFAULT NULL, `stale_orphan` int(11) DEFAULT NULL, `p2pool_hashrate` bigint(20) DEFAULT NULL, `p2pool_stale_rate` int(11) DEFAULT NULL, `block_value` decimal(16,8) DEFAULT NULL, `peers_out` int(11) DEFAULT NULL, `peers_in` int(11) DEFAULT NULL, `current_payout` decimal(16,8) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `miner_data` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `hashrate` bigint(20) DEFAULT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `miner_hist` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `hashrate` bigint(20) DEFAULT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `namecoin_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `namecoin_payouts` ( `id` int(11) NOT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paid` varchar(48) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `namecoin_reg` ( `BTC_address` varchar(48) NOT NULL, `NMC_address` varchar(48) DEFAULT NULL, PRIMARY KEY (`BTC_address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `pay_address` ( `address` varchar(48) NOT NULL, `paddress` varchar(48) DEFAULT NULL, PRIMARY KEY (`address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `payouts` ( `id` int(11) DEFAULT NULL, `address` varchar(48) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `txid` varchar(64) DEFAULT NULL, `paddress` varchar(48) DEFAULT NULL, `paid` varchar(64) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `pool_blocks` ( `id` int(11) NOT NULL, `txid` varchar(64) DEFAULT NULL, `time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `type` varchar(16) DEFAULT NULL, `amount` decimal(16,8) DEFAULT NULL, `confirmations` int(11) DEFAULT NULL, `blk_num` int(11) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `pool_data` ( `id` int(11) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `hashrate` bigint(20) DEFAULT NULL, `shares` int(11) DEFAULT NULL, `stale_doa` int(11) DEFAULT NULL, `stale_orphan` int(11) DEFAULT NULL, `p2pool_hashrate` bigint(20) DEFAULT NULL, `p2pool_stale_rate` int(11) DEFAULT NULL, `block_value` decimal(16,8) DEFAULT NULL, `peers_out` int(11) DEFAULT NULL, `peers_in` int(11) DEFAULT NULL, `current_payout` decimal(16,8) DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `signtime` ( `address` varchar(48) NOT NULL, `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`address`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Good job !
|
|
|
|
Jude Austin
Legendary
Offline
Activity: 1140
Merit: 1000
The Real Jude Austin
|
|
September 24, 2013, 11:03:03 PM |
|
Does anyone have the modified main.py for this to work? I am not a Python expert, at all. I have a modified work.py but when I run run_p2pool.py I get this error: 2013-09-25 02:56:48.747774 > File "/root/p2pool/p2pool/main.py", line 213, in main 2013-09-25 02:56:48.747785 > wb = work.WorkerBridge(node, my_pubkey_hash, args.donation_percentage, merged_urls, args.worker_fee) 2013-09-25 02:56:48.747799 > exceptions.TypeError: __init__() takes exactly 17 arguments (6 given) I know this is in relation to my work.py file which can be seen here: http://pastebin.com/ab5JgmMwHere is the default main.py: https://github.com/forrestv/p2pool/blob/master/p2pool/main.pyAm I supposed to replace the entire line 213 on main.py with starting at line 17 through 49 from work.py? I don't quite understand how to implement it. Any help would be greatly appreciated.
|
Buy or sell $100 of Crypto and get $10!
|
|
|
JayCoin (OP)
|
|
September 25, 2013, 01:14:23 AM |
|
to modify the p2pool code to run a litecoin pool with p2pool mining add the following after line 420 received_header_hashes.add(header_hash) in work.py try: dbf_user = request.getUser() dbuser_items = dbf_user.split('+') db_diff = bitcoin_data.target_to_difficulty(target) * 1000000000 proxy_db = MySQLdb.connect(host="localhost",user="jason",passwd="p2pool2012",db="p2pmining") pdb_c = proxy_db.cursor() pdb_c.execute("""INSERT INTO lminer_data (id,address,hashrate,timestamp,difficulty,ontime) VALUES (NULL, %s , %s , UNIX_TIMESTAMP() , %s, %s)""", (dbuser_items[0], db_diff * on_time, db_diff , on_time ) ) proxy_db.close() except: log.err(None, 'Error with database:') ###
Indent (spaces) the code to line up with line 420 Change the database info to match your database. As you can see, you will need a table called lminer_data. Also make sure you add import MySQLdb somewhere at the beginning of the work.py file with the other imports and also make sure you have python mysql support installed. No changes to the main.py required.
|
Hello There!
|
|
|
daemondazz
|
|
September 25, 2013, 01:34:07 AM |
|
Another option would be to clone from my github repo at https://github.com/daemondazz/p2pool and then write an external python module to perform the logging for you. This is the module that I use to log shares to a Django database: ## FILE: share_logger.py
import csv, time from django.core.management import call_command
FALLBACK_FILE = '/tmp/p2pool-shares.csv'
def logger(submitted_hash, submitted_diff, found_block, found_share, miner_username, miner_rate, debug=False): args = (time.time(), submitted_hash, submitted_diff, found_block, found_share, miner_username, int(miner_rate)) try: call_command('pool_logshare', *args) except: if debug: raise fh = csv.writer(open(FALLBACK_FILE, 'ab')) fh.writerow(args) print 'Share Logger: WARNING: Wrote share submission to %s' % FALLBACK_FILE
This can then be utilised by passing in the --share-logging-function argument to p2pool: /usr/bin/python /var/lib/p2pool/p2pool/run_p2pool.py [otheroptions] --share-logging-function share_logger.logger I have submitted the changes in my repo back to forrestv for inclusion upstream.
|
Computers, Amateur Radio, Electronics, Aviation - 1dazzrAbMqNu6cUwh2dtYckNygG7jKs8S
|
|
|
Jude Austin
Legendary
Offline
Activity: 1140
Merit: 1000
The Real Jude Austin
|
|
September 25, 2013, 01:38:52 AM |
|
to modify the p2pool code to run a litecoin pool with p2pool mining add the following after line 420 received_header_hashes.add(header_hash) in work.py try: dbf_user = request.getUser() dbuser_items = dbf_user.split('+') db_diff = bitcoin_data.target_to_difficulty(target) * 1000000000 proxy_db = MySQLdb.connect(host="localhost",user="jason",passwd="p2pool2012",db="p2pmining") pdb_c = proxy_db.cursor() pdb_c.execute("""INSERT INTO lminer_data (id,address,hashrate,timestamp,difficulty,ontime) VALUES (NULL, %s , %s , UNIX_TIMESTAMP() , %s, %s)""", (dbuser_items[0], db_diff * on_time, db_diff , on_time ) ) proxy_db.close() except: log.err(None, 'Error with database:') ###
Indent (spaces) the code to line up with line 420 Change the database info to match your database. As you can see, you will need a table called lminer_data. Also make sure you add import MySQLdb somewhere at the beginning of the work.py file with the other imports and also make sure you have python mysql support installed. No changes to the main.py required. And what about Bitcoin mining?
|
Buy or sell $100 of Crypto and get $10!
|
|
|
daemondazz
|
|
September 25, 2013, 01:46:56 AM |
|
And what about Bitcoin mining?
With my changes, you can have a different logging function for each instance of p2pool that you run, bitcoin, litecoin, terracoin, etc. No specific changes need to be made to the p2pool codebase for each coin.
|
Computers, Amateur Radio, Electronics, Aviation - 1dazzrAbMqNu6cUwh2dtYckNygG7jKs8S
|
|
|
Jude Austin
Legendary
Offline
Activity: 1140
Merit: 1000
The Real Jude Austin
|
|
September 25, 2013, 01:53:07 AM |
|
And what about Bitcoin mining?
With my changes, you can have a different logging function for each instance of p2pool that you run, bitcoin, litecoin, terracoin, etc. No specific changes need to be made to the p2pool codebase for each coin. I can't write my own Python, lol.
|
Buy or sell $100 of Crypto and get $10!
|
|
|
daemondazz
|
|
September 25, 2013, 02:05:22 AM |
|
I can't write my own Python, lol.
Post a bounty I'd be happy to write a simple logging function for a bit of a tip.
|
Computers, Amateur Radio, Electronics, Aviation - 1dazzrAbMqNu6cUwh2dtYckNygG7jKs8S
|
|
|
Jude Austin
Legendary
Offline
Activity: 1140
Merit: 1000
The Real Jude Austin
|
|
September 25, 2013, 04:46:48 AM |
|
to modify the p2pool code to run a litecoin pool with p2pool mining add the following after line 420 received_header_hashes.add(header_hash) in work.py try: dbf_user = request.getUser() dbuser_items = dbf_user.split('+') db_diff = bitcoin_data.target_to_difficulty(target) * 1000000000 proxy_db = MySQLdb.connect(host="localhost",user="jason",passwd="p2pool2012",db="p2pmining") pdb_c = proxy_db.cursor() pdb_c.execute("""INSERT INTO lminer_data (id,address,hashrate,timestamp,difficulty,ontime) VALUES (NULL, %s , %s , UNIX_TIMESTAMP() , %s, %s)""", (dbuser_items[0], db_diff * on_time, db_diff , on_time ) ) proxy_db.close() except: log.err(None, 'Error with database:') ###
Indent (spaces) the code to line up with line 420 Change the database info to match your database. As you can see, you will need a table called lminer_data. Also make sure you add import MySQLdb somewhere at the beginning of the work.py file with the other imports and also make sure you have python mysql support installed. No changes to the main.py required. I did this and now I get this in the P2Pool console: 2013-09-25 08:44:51.865402 > --- <exception caught here> --- 2013-09-25 08:44:51.865414 > File "/root/p2pool/p2pool/work.py", line 423, in got_response 2013-09-25 08:44:51.865426 > dbf_user = request.getUser() 2013-09-25 08:45:14.890163 > exceptions.NameError: global name 'request' is not defined
|
Buy or sell $100 of Crypto and get $10!
|
|
|
JayCoin (OP)
|
|
September 25, 2013, 01:52:25 PM |
|
I'll check on that error, must be a change to the newer version of p2pool. I'll post a fix soon.
|
Hello There!
|
|
|
Jude Austin
Legendary
Offline
Activity: 1140
Merit: 1000
The Real Jude Austin
|
|
September 25, 2013, 04:14:06 PM |
|
I'll check on that error, must be a change to the newer version of p2pool. I'll post a fix soon.
Thank you!
|
Buy or sell $100 of Crypto and get $10!
|
|
|
JayCoin (OP)
|
|
September 25, 2013, 08:52:14 PM |
|
Delete
dbf_user = request.getUser() dbuser_items = dbf_user.split('+')
Replace
pdb_c.execute("""INSERT INTO lminer_data (id,address,hashrate,timestamp,difficulty,ontime) VALUES (NULL, %s , %s , UNIX_TIMESTAMP() , %s, %s)""", (dbuser_items[0], db_diff * on_time, db_diff , on_time ) )
With
pdb_c.execute("""INSERT INTO lminer_data (id,address,hashrate,timestamp,difficulty,ontime) VALUES (NULL, %s , %s , UNIX_TIMESTAMP() , %s, %s)""", (user, db_diff * on_time, db_diff , on_time ) )
Good Luck!
|
Hello There!
|
|
|
Jude Austin
Legendary
Offline
Activity: 1140
Merit: 1000
The Real Jude Austin
|
|
September 25, 2013, 11:07:46 PM |
|
Delete
dbf_user = request.getUser() dbuser_items = dbf_user.split('+')
Replace
pdb_c.execute("""INSERT INTO lminer_data (id,address,hashrate,timestamp,difficulty,ontime) VALUES (NULL, %s , %s , UNIX_TIMESTAMP() , %s, %s)""", (dbuser_items[0], db_diff * on_time, db_diff , on_time ) )
With
pdb_c.execute("""INSERT INTO lminer_data (id,address,hashrate,timestamp,difficulty,ontime) VALUES (NULL, %s , %s , UNIX_TIMESTAMP() , %s, %s)""", (user, db_diff * on_time, db_diff , on_time ) )
Good Luck!
Did this. I had to add the columns difficulty and ontime to my table. Once I did this I now get the error saying that id can't be NULL.
|
Buy or sell $100 of Crypto and get $10!
|
|
|
JayCoin (OP)
|
|
September 26, 2013, 02:33:31 AM |
|
You need to set the id column in you database table to auto increment.
|
Hello There!
|
|
|
Jude Austin
Legendary
Offline
Activity: 1140
Merit: 1000
The Real Jude Austin
|
|
September 26, 2013, 02:41:29 AM |
|
You need to set the id column in you database table to auto increment.
Trying this now.
|
Buy or sell $100 of Crypto and get $10!
|
|
|
Jude Austin
Legendary
Offline
Activity: 1140
Merit: 1000
The Real Jude Austin
|
|
September 26, 2013, 03:00:36 AM |
|
Excellent, thank you so much! No more issues in P2Pool console. Now issues with displaying the current miners and litecoin blocks tabs. Been digging through all the code and can't seem to find the issue. I am guessing it has something to do with the database. If you want to see it in action: http://192.3.117.102/index.php?method=lpoolAgain thank you for your help.
|
Buy or sell $100 of Crypto and get $10!
|
|
|
JayCoin (OP)
|
|
September 26, 2013, 03:17:40 AM |
|
is share data showing up in lminer_data table?
|
Hello There!
|
|
|
Jude Austin
Legendary
Offline
Activity: 1140
Merit: 1000
The Real Jude Austin
|
|
September 26, 2013, 03:20:21 AM Last edit: September 26, 2013, 04:33:58 AM by Jude Austin |
|
is share data showing up in lminer_data table?
Ha, nope. For an FYI I am using the database structure a few posts above.
|
Buy or sell $100 of Crypto and get $10!
|
|
|
|