curl.lib.js icon indicating copy to clipboard operation
curl.lib.js copied to clipboard

overrideAttachToTangle(api) - howto attach?

Open ouya99 opened this issue 7 years ago • 10 comments

I would like to do "attachToTangle" after pow:

The readme states that there is a function:

overrideAttachToTangle(api) overrides attachToTangle for iota.lib.js api object

How would I use the attachToTangle method here? is it necessary to call the iota.lib.js attachToTangle method and do sort of method override here?

iota.lib.js: self.attachToTangle(toApprove.trunkTransaction, toApprove.branchTransaction, minWeightMagnitude, trytes,

takes 4 parameters. How would i fill those with the results from this pow ?

Thank you!

ouya99 avatar Oct 04 '17 00:10 ouya99

This library's overrideAttachToTangle/PoW seems to be broken; I have a workaround here: https://github.com/pRizz/iota.transactionSpammer.js/blob/9ad59895a846849adf344de9d0d52b0ff83b8e2c/src/transactionSpammer.js#L224

pRizz avatar Oct 04 '17 01:10 pRizz

I'm having this issue too..

andrewmunro avatar Oct 20 '17 12:10 andrewmunro

@andrewmunro

@pRizz answer did help me - or checkout https://www.npmjs.com/package/iota-engine/ where I implemented my solution

ouya99 avatar Oct 20 '17 13:10 ouya99

I eventually got it working from @pRizz 's code. Would be nice for someone who knows what they're doing to update this library :)

andrewmunro avatar Oct 20 '17 18:10 andrewmunro

@andrewmunro +1

mrbianchi avatar Mar 03 '18 20:03 mrbianchi

@andrewmunro +1

sbeugen avatar Mar 14 '18 12:03 sbeugen

@pRizz Would you mind creating a pull request with the proposed fix for this repository?

laubsauger avatar Mar 28 '18 15:03 laubsauger

@paulhandy after testing with the latest master version, it seems that this was fixed in https://github.com/iotaledger/curl.lib.js/commit/c225a64b1ab6645efe98392b45216b4bfee74263

However, I spent a lot of hours experiencing the same issue. I think this is because the above commit has not been put in a new release version yet. So when installing the curl.lib.js through npm, I think it still provides a version with the broken attachToTangle.

Can you ship a new version?

desjob avatar May 08 '19 13:05 desjob

I have made some wrapper npm packages that utilizes either ccurl or the webgl2 curl implementation, depending on your needs.

https://www.npmjs.com/package/curl-transaction-core https://www.npmjs.com/package/curl-transaction-webgl2-impl https://www.npmjs.com/package/curl-transaction-ccurl-impl

pRizz avatar May 08 '19 18:05 pRizz

@pRizz yes I saw it, thanks. Either way I think people will benefit if the latest fixes of this repo will get released :)

desjob avatar May 08 '19 21:05 desjob