-
Notifications
You must be signed in to change notification settings - Fork 124
Add support for performing attachToTangle
PoW locally (without relying on IRI node)
#139
Comments
For reference here's how the js promoter creates a |
I don't really have experience with c extensions in python, but it seems like it would be more robust and faster if the c version could be wrapped and called via a c extension rather than porting to pure python. |
Aye, I agree. Based on my experiences porting Curl-P to Python, I am not optimistic about how a pure-Python PearlDiver will perform. We already have a C extension for Curl-P, and with a little bit of work, we could probably turn it into a wrapper for the ccurl library (which itself includes a PearlDiver implementation). I think that would be a pretty sweet approach (: |
I wouldn't port it to python but rather use the existing one. Could even use it directly by going the cython route.. For the overall feature itself I would like it to be very easy to use, like you said. I would recommend the RoutingWrapper though. Just add the possibility to 'route' that call locally to a different function. Doing that, basically every existing function that calls (directly or indirectly) attachToTangle (like promote, replay, ..) can stay the same. |
The C extension would be nice to have, but a pure python implementation may be good for embedded devices running micro python it will be more portable as well this way. Some libraries let you switch out between the pure python and the optimized version so that would be nice to have. |
I have a Python version of pearldiver (PoW) here: https://github.com/mlouielu/iota-pearldiver but CPython got poor performance, even with pypy still get bad performance... |
@mlouielu excellent! Do have the time to implement your Python solution into a |
What would you think of this: one place to specify where PoW is computed is globally in the
Possibly the keyword argument could just take a string instead of a I know that this approach would require a tedious modification of all the functions. Else you would either end up with things like
, since there might be a valid reason to use a |
@todofixthis Any update about the local execution of the PoW ? |
I tried to use this package, but I found that the running time changing trend is so strange when I increase mwm step by step... |
Local PoW is supported from PyOTA 2.1.0 .
Or only the pow extension:
Essentially, this lets you to perform pow calculation on your device by redirecting all calls (direct or indirect) to To enable/disable
Note, that omitting the
|
The PoW process can be done 100% offline, so the library should provide a mechanism for doing this locally, without having to send an
attachToTangle
request to a node.Requirements not 100% nailed down yet, but here are some thoughts:
local_pow
argument toIota.__init__()
(maybeStrictIota.__init__()
?).Also, don't forget to update documentation and example scripts (:
The text was updated successfully, but these errors were encountered: