Log PoW zero bits progress #8
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nostr/nostr-types!8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "PoW-improvements"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is helpful for if you have gossip started from CLI, at least. I'm not sure of a good way to stream updates, but that can be added later. For testing, see this branch:
https://github.com/cryptoquick/gossip/tree/PoW-improvements
I then installed it locally with this:
RUSTFLAGS="-Ctarget-cpu=native --cfg tokio_unstable" cargo install --path .Screenshot:
It might be cool to have timestamps on this too somehow... But that might need to be added in the client itself.
Interesting.
println!() isn't appropriate for a library. We could make new_with_pow() an async function and also pass back a mpsc channel were these messages are written as structs by the threads into the channel.
Great point! Though, wouldn't you pass in an mpsc, not return one? Something like tracer can consume messages produced by this method, and others.
Yeah prob have to pass it in, since async has to return a future.
I just added an MPSC sender, does that look good to you? Just know, this would require blocking IO, I'm not sure if you wanted to use tokio's async channel types instead (a whole copy of the entire tokio runtime is not necessary to just have the type).
std::sync::mpsc::Sender is fine since it will never block.
It should be optional.
Okay, I've made the argument optional and renamed it to
msg_sender, which might be more self-documenting.