Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background or universal debug stream? #165

Open
muzam1l opened this issue Apr 11, 2022 · 8 comments
Open

Background or universal debug stream? #165

muzam1l opened this issue Apr 11, 2022 · 8 comments

Comments

@muzam1l
Copy link
Collaborator

muzam1l commented Apr 11, 2022

Like it captures all account logs be it deploy or transactions. More discussions needed.

@vbar
Copy link
Collaborator

vbar commented Apr 11, 2022

I don't think it makes sense to have multiple debug streams: Hooks Builder works on a single blockchain, which has a single debug stream (filtered for specified accounts). Even now, it is possible to send SetHook in the deploy tab and see the deployment log in the test tab (when switching fast enough). Implementing a "transactions" stream different from "deploy" stream would just add complications - why shouldn't the IDE have a single debug stream?

@muzam1l
Copy link
Collaborator Author

muzam1l commented Apr 11, 2022

I didn't mean new debug stream at all!. Just having background capabilities for current one as discussed in #162 and maybe someway of summoning that from other pages!

@vbar
Copy link
Collaborator

vbar commented Apr 12, 2022

Thinking about it, I still can't decide whether the debug stream should update in the background - it would have its advantages, e.g. when switching to Develop too soon and not seeing the end of a test, but also problems, like using too much memory... The important thing IMHO is to show when the debug stream is or isn't updating, as described in #125.

@WietseWind
Copy link
Collaborator

If e.g. the last X messages of history are stored & then older messages are pruned/spliced/.. I think the memory consumption wouldn't be terrible. Alternatively we could persist the debug stream on our side and offer a websocket command to retrieve history?

@muzam1l
Copy link
Collaborator Author

muzam1l commented Apr 12, 2022

Alternatively we could persist the debug stream on our side and offer a websocket command to retrieve history?

Actually that would make it smooth for frontend, having an api endpoint to retrieve some history of logs via websocket or better a http call would be neat!

@WietseWind
Copy link
Collaborator

WietseWind commented Apr 12, 2022

@muzam1l Added :)

https://hooks-testnet-v2-debugstream.xrpl-labs.com/recent/rDADDYfnLvVY9FBnS8zFXhwYFHPuU5q2Sk

It'll return the last 30 minutes (key: timestamp) of debug messages.

And just in case it makes sense at some point to auto-suggest recently active accounts when typing r...:
https://hooks-testnet-v2-debugstream.xrpl-labs.com/recent/accounts (the index of accounts debug messages are stored for in the last 30 minutes)

@muzam1l
Copy link
Collaborator Author

muzam1l commented Apr 12, 2022

That's awesome 🔥.

Will start playing with it soon!

@muzam1l
Copy link
Collaborator Author

muzam1l commented Apr 21, 2022

So recents api is now implemented in main branch, therefore after opening debug stream for an account, logs are fetched and persisted even while navigating to other pages! However there seems to be slight issue with results, some of the logs are missing when retrieved from http api vs when retrieved from web-socket connection. For example:

Before (websocket only):
before

After (Recent api only):
after

From what I figured, this seems to be issue with same timestamps (no decimals), so only one log is kept while others with same timestamp are omitted. Any ideas @WietseWind

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

No branches or pull requests

3 participants