curl.lib.js
curl.lib.js copied to clipboard
overrideAttachToTangle(api) - howto attach?
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!
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
I'm having this issue too..
@andrewmunro
@pRizz answer did help me - or checkout https://www.npmjs.com/package/iota-engine/ where I implemented my solution
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 +1
@andrewmunro +1
@pRizz Would you mind creating a pull request with the proposed fix for this repository?
@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?
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 yes I saw it, thanks. Either way I think people will benefit if the latest fixes of this repo will get released :)