Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't work with stratum #1

Closed
filipe3x opened this issue Mar 26, 2014 · 22 comments
Closed

Doesn't work with stratum #1

filipe3x opened this issue Mar 26, 2014 · 22 comments

Comments

@filipe3x
Copy link

Doesn't work with stratum. Anything wrong in the code?

@filipe3x
Copy link
Author

LOG: ERROR template_registry # [Failure instance: Traceback: <type 'exceptions.ValueError'>: invalid address

@sanasol
Copy link
Owner

sanasol commented Mar 26, 2014

invalid address - wallet address maybe?
for same reason i cant setup block explorer, wallet addresses and txids generating by different way not like all other coins.
Anyway code work - generation block hash is right

I think problem is in this code(Hash4 function) https://bitcointalk.org/index.php?topic=519138.msg5881617#msg5881617

@filipe3x
Copy link
Author

Coin address seems to be correct
Complete log:

2014-03-26 23:54:35,946 DEBUG block_template # Got To  Block_template.py
2014-03-26 23:54:35,946 DEBUG block_template # Got To Block_template.py
2014-03-26 23:54:35,946 DEBUG coinbasetx # Got to CoinBaseTX
2014-03-26 23:54:35,947 ERROR template_registry # [Failure instance: Traceback: <type 'exceptions.ValueError'>: invalid address
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:1126:gotResult
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:1113:_inlineCallbacks
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:380:callback
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:488:_startRunCallbacks
--- <exception caught here> ---
/usr/lib/python2.7/dist-packages/twisted/internet/defer.py:575:_runCallbacks
/stratum-mining-fuguecoin/lib/template_registry.py:144:_update_block
/stratum-mining-fuguecoin/lib/block_template.py:62:fill_from_rpc
/stratum-mining-fuguecoin/lib/coinbasetx.py:40:__init__
/stratum-mining-fuguecoin/lib/coinbaser.py:76:get_script_pubkey
/stratum-mining-fuguecoin/lib/util.py:218:script_to_address
]
2014-03-26 23:54:35,950 INFO coinbaser # Coinbase address 'FLepEQLqSH7948pUpiybUBNVCbMdoebkZ7' is valid
2014-03-26 23:54:35,950 DEBUG coinbaser # Address = FLepEQLqSH7948pUpiybUBNVCbMdoebkZ7

@sanasol
Copy link
Owner

sanasol commented Mar 27, 2014

try change in util.py

cksumB = doublesha(addr[:-4])[:4]
to
import fugue_hash
cksumB = fugue_hash.getPoWHash(addr[:-4])[:4]

@filipe3x
Copy link
Author

Same error.

@filipe3x
Copy link
Author

And everytime I try to connect my miner I get this error:

2014-03-27 00:23:41+0000 [stratum.socket_transport.SocketTransportFactory] 2014-03-27 00:23:41,183 INFO stats # 1 peers connected, state changed 1 times
2014-03-27 00:23:41+0000 [stratum.socket_transport.SocketTransportFactory] 2014-03-27 00:23:41,183 DEBUG protocol # Connected 
2014-03-27 00:23:41,185 DEBUG template_registry # Getting Unique Extronance
2014-03-27 00:23:41,185 DEBUG template_registry # Getting Laat Template
2014-03-27 00:23:41,186 ERROR subscription # Template not ready yet

"ERROR subscription # Template not ready yet"

@sanasol
Copy link
Owner

sanasol commented Mar 27, 2014

i have no idea how fix it, same problem with ABE block explorer....

They changed many coin src lines to fugue hashing(even lines that not need for changing 👎 ), cant get work address validation and hashing txs on ABE, spent few days for it...

@sanasol
Copy link
Owner

sanasol commented Mar 27, 2014

write here if you will find solution

@filipe3x
Copy link
Author

I will.

@filipe3x
Copy link
Author

The problem is in this function https://github.com/Crypto-Expert/stratum-mining/blob/7a6fd9ac30f92e556dd13b8995d36a0ec7845fb1/lib/util.py#L171

def address_to_pubkeyhash(addr) is returning 'None' everytime it runs when it should return return (ver, addr[1:-4])

@filipe3x
Copy link
Author

I found a work around. Now the miner is connecting and it's getting work.
The only problem now is all shares are getting rejected with a Share is above target error.

I think the problem is the diff1 value. Do you know what's the diff1 value for fugue?

https://github.com/Crypto-Expert/stratum-mining/blob/7a6fd9ac30f92e556dd13b8995d36a0ec7845fb1/lib/template_registry.py#L152

@sanasol
Copy link
Owner

sanasol commented Mar 28, 2014

Share is above target
i get same error, just commented this checking in stratum, but not sure work pool or not without this.

@filipe3x
Copy link
Author

It's working now. I'm getting accepted shares 👍

Still, I'm afraid of using this on a live pool.
https://github.com/Crypto-Expert/stratum-mining/blob/7a6fd9ac30f92e556dd13b8995d36a0ec7845fb1/lib/template_registry.py#L156

Changed diff1 to 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000

@sanasol
Copy link
Owner

sanasol commented Mar 28, 2014

accepting, but is real to find block or still working wrong at all? :D

@filipe3x
Copy link
Author

No clue. The only way to find out is to deploy this on a live pool.

@sanasol
Copy link
Owner

sanasol commented Mar 28, 2014

why not? testnet!
use testnet to check

@filipe3x
Copy link
Author

testnet doesn't work with most of these new coins.
See filipe3x@ubuntu:~$ fuguecoind: main.cpp:2816: bool InitBlockIndex(): Assertion hash == hashGenesisBlock' failed.`

@sanasol
Copy link
Owner

sanasol commented Mar 28, 2014

okay :(

@sanasol
Copy link
Owner

sanasol commented Mar 28, 2014

let test it, give me worker and address :)

@filipe3x
Copy link
Author

It's a local stratum. I don't have a public address : /

@filipe3x
Copy link
Author

Alright, I opened a test pool just for this http://crown.bitember.com/

It's for crowncoin, it's the same algo as fugue so shouldn't be a problem

@sanasol sanasol closed this as completed Mar 29, 2014
@filipe3x
Copy link
Author

Diff1 value is 0x00000ffff0000000000000000000000000000000000000000000000000000000

I think this one is more correct and it's working flawlessly 👍

PS: wait no, it's not :(
[2014-03-29 05:38:22] accepted: 0/4 (0.00%), 411.68 khash/s (booooo)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants