shadowproject / shadow

ShadowCore integration/staging tree
MIT License
95 stars 62 forks source link

mblk instead of block #89

Closed mmitech closed 5 years ago

mmitech commented 7 years ago

I am trying to parse the block data, I've already figured out that the P2P message for a new block is 'mblk' instead of 'block' (like in Bitcoin and most alts), what I can't figure out is how to parse that message!

In other words, I am trying to make a fork of bitcore that would work with shadow to use it bitpay repos (Insight, Copay...). and the issue relies here on:

https://github.com/bitpay/bitcore/blob/v0.1.34/lib/Connection.js#L470-L485 https://github.com/bitpay/bitcore/blob/v0.1.34/lib/Block.js#L19-L76

rynomster commented 7 years ago

Mblk is multiblock, it sends multiple blocks at a time for clients that are a few blocks behind. I think it's easiest just to take the code out of main.cpp, and recompile the daemon.

On 4 Mar 2017 10:25, "Mourad Ilyes Mlik" notifications@github.com wrote:

I am trying to parse the block data, I've already figured out that the P2P message for a new block is 'mblk' instead of 'block' (like in Bitcoin and most alts), what I can't figure out is how to parse that message!

In other words, I am trying to make a fork of bitcore that would work with shadow to use it bitpay repos (Insight, Copay...). and the issue relies here on:

https://github.com/bitpay/bitcore/blob/v0.1.34/lib/Connection.js#L470-L485 https://github.com/bitpay/bitcore/blob/v0.1.34/lib/Block.js#L19-L76

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/shadowproject/shadow/issues/89, or mute the thread https://github.com/notifications/unsubscribe-auth/AGl7FQcWvU3TtYf0KW196zQV0VN4GZDVks5riR_ggaJpZM4MTBWq .

mmitech commented 7 years ago

yes removing the multiblock code seems to fix the issue, but I am having problems with the tx message as well! the message I get for tx has completely different hash than the one is confirmed or the one in the mempool ! is data parsed differently here as well?

rynomster commented 7 years ago

Shadow used to use scrypt, have a look at our bitcore / insight forks to add the scrypt support

On 5 Mar 2017 9:10 p.m., "Mourad Ilyes Mlik" notifications@github.com wrote:

yes removing the multiblock code seems to fix the issue, but I am having problems with the tx message as well! the message I get for tx has completely different hash than the one is confirmed or the one in the mempool ! is data parsed differently here as well?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/shadowproject/shadow/issues/89#issuecomment-284252319, or mute the thread https://github.com/notifications/unsubscribe-auth/AGl7FeKbGFdI__WtrF3Vmuv2Gn-CXOPuks5riwi1gaJpZM4MTBWq .

mmitech commented 7 years ago

OK I see where I went wrong, you said "used to use scrypt", I am on master now and I still see that you use scrypt for blocks and transactions.

BTW, am I safe to use the repos you have published already?

rynomster commented 7 years ago

They're very outdated, but you should be able to get a block explorer up and a few of the older insight apis still work

On 5 Mar 2017 9:22 p.m., "Mourad Ilyes Mlik" notifications@github.com wrote:

OK I see where I went wrong, you said "used to use scrypt", I am on master now and I still see that you use scrypt for blocks and transactions.

BTW, am I safe to use the repos you have published already?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/shadowproject/shadow/issues/89#issuecomment-284253139, or mute the thread https://github.com/notifications/unsubscribe-auth/AGl7FW-Iq-sdaxZ393H9FKqrrjYjWLpwks5riwuKgaJpZM4MTBWq .