hyperliquid-dex / hyperliquid-rust-sdk

MIT License
68 stars 49 forks source link

bin/ws_l2_book.rs - no data logged and unclean exit (panic) #59

Closed uluwatu-xyz closed 1 month ago

uluwatu-xyz commented 1 month ago

When I run the following example I get no data returned (I tried both TestNet and MainNet) - is this example still relevant? cargo run --bin ws_l2_book

I also get an unclean exit error, is this a known issue with the examples? I think it is impl Drop for WsManager causing this at process exit via a block_on call:

Cannot start a runtime from within a runtime. This happens because a function (like `block_on`) attempted to block the current thread while the thread is being used to drive asynchronous tasks.
uluwatu-xyz commented 1 month ago

Mentioned issue rollback fixed the unclean exit error.

As for lack of data, the log level needs to be specified explicitly (even INFO):

RUST_LOG=info cargo run --bin ws_l2_book