Crypto-Expert / stratum-mining

AIO Stratum mining server for various coins
Other
365 stars 348 forks source link

Bug fixes. Added scryptn basecoin implementation. #341

Closed a432511 closed 10 years ago

a432511 commented 10 years ago

It appears that hash_bin and block_hash_bin did different things in the original code. I added a distinct method for block_hash_bin to accommodate this. In the base, it simply returns hash_bin. I believe the return value of build_block was incorrect as the returned value would have gotten re-"join"ed in calc_algo. Also, the return value was never assigned to a variable for use in halfnode.py.

a432511 commented 10 years ago

My spacing gets all hosed up using Notepad++... Sorry about that. Any recommendations on a python editor?

ahmedbodi commented 10 years ago

thats looking good. ive heard geany is good.

a432511 commented 10 years ago

Lot's of good cleanup here. When are you able to review and pull?

a432511 commented 10 years ago

NUMEROUS inconsistent spacing issues fixed. This version is currently running on my pool, and is no longer throwing compiler or runtime errors, however, the mining client is saying JSON authentication error.

ahmedbodi commented 10 years ago

Thanks for that ill look through the code and see whats broken

a432511 commented 10 years ago

Ok. There were many other issues. This version is running on my pool now. No errors in the log, however, the client still won't connect. The client doesn't throw an error either. Strange.

a432511 commented 10 years ago

Here is the output when I run non-daemon, verbose:

2014-05-16 09:44:45-0400 [Protocol,8,xx.xx.xx.xx] 2014-05-16 09:44:45,298 INFO stats # 0 peers connected, state changed 1 times 2014-05-16 09:44:49,812 INFO block_updater # Checking for new block. 2014-05-16 09:44:49,817 DEBUG coin_rpc_manager # Check Height -- Current Pool 0 : 87748 2014-05-16 09:44:49,817 DEBUG block_updater # Next prevhash update in 4.994 sec 2014-05-16 09:44:49,817 DEBUG block_updater # Merkle update in next 9.994 sec 2014-05-16 09:44:54,814 INFO block_updater # Checking for new block. 2014-05-16 09:44:54,818 DEBUG coin_rpc_manager # Check Height -- Current Pool 0 : 87748 2014-05-16 09:44:54,818 DEBUG block_updater # Next prevhash update in 4.993 sec 2014-05-16 09:44:54,819 DEBUG block_updater # Merkle update in next 4.993 sec 2014-05-16 09:44:59,813 DEBUG DBInterface # DBInterface.run_import_schedule called 2014-05-16 09:44:59,813 INFO block_updater # Checking for new block. 2014-05-16 09:44:59,817 INFO block_updater # Merkle update! Prevhash: 991cb5c45584c12414caaf1207bdf90e7d723fe31a99510aaa59964ec5c24412 2014-05-16 09:44:59,818 DEBUG block_updater # Next prevhash update in 5.000 sec 2014-05-16 09:44:59,818 DEBUG block_updater # Merkle update in next 59.999 sec 2014-05-16 09:44:59,819 DEBUG coin_rpc_manager # Check Height -- Current Pool 0 : 87748 2014-05-16 09:44:59,835 DEBUG block_template # Got To Block_template.py 2014-05-16 09:44:59,836 DEBUG block_template # Got To Block_template.py 2014-05-16 09:44:59,836 DEBUG coinbasetx # Got to CoinBaseTX 2014-05-16 09:44:59,839 INFO template_registry # None 2014-05-16 09:44:59,840 INFO template_registry # New template for 991cb5c45584c12414caaf1207bdf90e7d723fe31a99510aaa59964ec5c24412 2014-05-16 09:44:59,840 DEBUG template_registry # Getting Last Template 2014-05-16 09:44:59,840 INFO subscription # BROADCASTED to 0 connections in 0.000 sec 2014-05-16 09:44:59,840 INFO template_registry # Update finished, 0.005 sec, 20 txes 2014-05-16 09:44:59,844 INFO coinbaser # Coinbase address 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' is valid 2014-05-16 09:44:59,844 DEBUG coinbaser # Address = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2014-05-16 09:44:59,844 DEBUG coinbaser # PubKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 2014-05-16 09:44:59,844 DEBUG coinbaser # Is Compressed = True 2014-05-16 09:44:59,845 DEBUG coinbaser # Account = 2014-05-16 09:44:59,960 INFO work_log_pruner # Pruned 0 jobs 2014-05-16 09:45:00-0400 [stratum.socket_transport.SocketTransportFactory] 2014-05-16 09:45:00,768 INFO stats # 1 peers connected, state changed 1 times 2014-05-16 09:45:00-0400 [stratum.socket_transport.SocketTransportFactory] 2014-05-16 09:45:00,769 DEBUG protocol # Connected xx.xx.xx.xx 2014-05-16 09:45:00,770 DEBUG template_registry # Getting Unique Extranonce 2014-05-16 09:45:00,770 DEBUG template_registry # Getting Last Template 2014-05-16 09:45:00-0400 [Protocol,9,xx.xx.xx.xx] 2014-05-16 09:45:00,814 INFO stats # 0 peers connected, state changed 1 times 2014-05-16 09:45:00-0400 [stratum.socket_transport.SocketTransportFactory] 2014-05-16 09:45:00,860 INFO stats # 1 peers connected, state changed 1 times 2014-05-16 09:45:00-0400 [stratum.socket_transport.SocketTransportFactory] 2014-05-16 09:45:00,861 DEBUG protocol # Connected xx.xx.xx.xx 2014-05-16 09:45:00,861 DEBUG template_registry # Getting Unique Extranonce 2014-05-16 09:45:00,862 DEBUG template_registry # Getting Last Template 2014-05-16 09:45:00-0400 [Protocol,10,xx.xx.xx.xx] 2014-05-16 09:45:00,900 INFO stats # 0 peers connected, state changed 1 times 2014-05-16 09:45:04,818 INFO block_updater # Checking for new block. 2014-05-16 09:45:04,822 DEBUG coin_rpc_manager # Check Height -- Current Pool 0 : 87748 2014-05-16 09:45:04,823 DEBUG block_updater # Next prevhash update in 4.995 sec 2014-05-16 09:45:04,823 DEBUG block_updater # Merkle update in next 54.994 sec 2014-05-16 09:45:09,818 INFO block_updater # Checking for new block. 2014-05-16 09:45:09,824 DEBUG coin_rpc_manager # Check Height -- Current Pool 0 : 87748 2014-05-16 09:45:09,824 DEBUG block_updater # Next prevhash update in 4.993 sec 2014-05-16 09:45:09,825 DEBUG block_updater # Merkle update in next 49.993 sec 2014-05-16 09:45:14,814 DEBUG DBInterface # DBInterface.run_import_schedule called 2014-05-16 09:45:14,818 INFO block_updater # Checking for new block. 2014-05-16 09:45:14,826 DEBUG coin_rpc_manager # Check Height -- Current Pool 0 : 87748 2014-05-16 09:45:14,827 DEBUG block_updater # Next prevhash update in 4.991 sec 2014-05-16 09:45:14,827 DEBUG block_updater # Merkle update in next 44.990 sec 2014-05-16 09:45:19,818 INFO block_updater # Checking for new block. 2014-05-16 09:45:19,825 DEBUG coin_rpc_manager # Check Height -- Current Pool 0 : 87748 2014-05-16 09:45:19,836 DEBUG block_updater # Next prevhash update in 4.981 sec 2014-05-16 09:45:19,837 DEBUG block_updater # Merkle update in next 39.981 sec

a432511 commented 10 years ago

It appears to be running well... something with pushing the job to the client must be wrong.

a432511 commented 10 years ago

Tried several different things. No dice. Any ideas?

ahmedbodi commented 10 years ago

no idea im afraid

a432511 commented 10 years ago

This version works and can be seen on https://vtc.sovereignshare.com (stratum+tcp://vtc.sovereignshare.com:3333)

I did end up setting these config values and ferreting out more issues.

USERS_AUTOADD = True USERS_CHECK_PASSWORD = False

ahmedbodi commented 10 years ago

sweet!

a432511 commented 10 years ago

Ok. What's next?

ahmedbodi commented 10 years ago

cleanup/removal of anything thats un-needed, adding merged mining, multicoin and p2p node support

a432511 commented 10 years ago

Merged mining is a bit daunting, but I'll try.

ahmedbodi commented 10 years ago

time to merge :+1:

a432511 commented 10 years ago

Cool. I also noticed the c# project, CoiniumServ. C# is my primary language and what I do for a living, so I will likely start contributing there moving forward. Cheers!

ahmedbodi commented 10 years ago

nice! @a432511 join us on freenode IRC #coinium-dev