Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Create decode_bundle_messages.py #205

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open

Create decode_bundle_messages.py #205

wants to merge 1 commit into from

Conversation

harleylang
Copy link

I really struggled in writing code that grabs messages across transactions in a bundle, so here is a mwe that others may find beneficial.

@todofixthis
Copy link
Contributor

Hi @harleylang thanks for submitting this!

Have a look at Bundle.get_messages() — it might be possible to make the code even simpler by using this method.

@harleylang
Copy link
Author

Hey, thanks for your feedback! I was unaware of that function at the time of my OP and I appreciate the reference.

I have been giving this a lot of thought and have tested a few options for message gathering over the past few months. So far I have found that the most efficient message-gathering function pings a node for tangle information only as needed. `Bundle.get_messages()' pings the node for info on each recursion. Larger messages take exponentially more time to recover with this method. In my next comment to this thread, I am going to propose a function that cuts-down node/tangle pings by gathering transaction trytes at the onset. Next, the function iterates through that information for the message. From my testing, that seems to be the most efficient way to gather messages. For a 32-index message, this cuts the duration down from ~25 seconds to 5 seconds.

After I post my solution, I welcome peer review to ensure that we identify and accept the function that is the most efficient, but also safe. (The latter of which is not currently within my expertise.)

@todofixthis todofixthis changed the base branch from master to develop February 21, 2019 21:39
@harleylang
Copy link
Author

Further to my last comment, I want to clarify that the ping issue is not /specifically/ with Bundle.get_messages() but instead with Iota.get_bundles() which I understand needs to be used to generate a bundle object and therefore call bundleobj.get_messages().

I will post comparison code and function options soon.

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

Successfully merging this pull request may close these issues.

2 participants