-
Notifications
You must be signed in to change notification settings - Fork 12
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
[nomos-cli] Add command to disseminate data #400
Conversation
Codecov ReportPatch has no changes to coverable lines. 📢 Thoughts on this report? Let us know!. |
loop { | ||
if let Some(cert) = da.certify_dispersal() { | ||
terminal_cmd_done(); | ||
return Ok(cert); | ||
} | ||
da.recv_attestation(attestations.next().await.unwrap()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably clearer to call recv_attestation
prior to certify_dispersal
? It's not very important, though.
tracing::subscriber::set_global_default(tracing_subscriber::FmtSubscriber::new()) | ||
.expect("setting tracing default failed"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be on the main function of the binary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure everybody is interested in logs. For example, the complete interactive version of this command probably wants to use a different UI without printing node logs. Also, I'm using logs here to catch whatever the node is printing, a command that does not have a running node maybe does not even use tracing logs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, makes sense, thanks!
for blob in blobs { | ||
adapter.send_blob(blob).await.unwrap(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can send then all at once (they may be a lot of chunks eventually), something like:
let tasks: FuturesUnordered<_> = blobs.map(|blob| tokio::spawnadapter.send_blob(blob))).collect()
future::try_join_all(tasks).await;
// To interact with the network service it's easier to just spawn | ||
// an overwatch app |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if it would have been enough to spawn a NetworkBackend
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the Libp2pAdapter
likes a NetworkService
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes indeed, likes it very much!
Add nomos-cli to hold various utilities for the node. To start, this commit adds a command to disseminate some data through the network and build a certificate of correct dispersal for inclusion in a block
0b8eaa8
to
13baf27
Compare
Add nomos-cli to hold various utilities for the node.
To start, this commit adds a command to disseminate some
data through the network and build a certificate of correct
dispersal for inclusion in a block.
The idea is to grow this command into an interactive one covering the whole DA and transaction submit process emulating an EZ
Still haven't tested it but not sure we have the corresponding server component in place