Commonware runtime in examples folder. #702
-
I'm working on augmenting the VRF example so that participants can expose the VRF signature per round via an HTTP endpoint. I initially tried using axum, which depends on tokio. However, the example package expects the runtime to come from commonware-runtime. Pulling in commonware-runtime means I’d also need to integrate it with axum, which isn't straightforward—especially since it introduces complexity around generics and compatibility. In my opinion, the examples folder should rely on tokio and other standard tools. While I understand the value of commonware-runtime for deterministic testing and simulation, I don't think the examples folder is the right place for it. Examples should prioritize approachability and ease of experimentation, especially for developers exploring the library. Moving forward, I see three possible options:
@patrick-ogrady — open to suggestions if there’s a simpler path. Adding an HTTP endpoint should ideally be a quick and clean change. Let me know what you think. Let me know if you want this rewritten more formally, or tailored for a GitHub issue comment, PR description, or internal Slack/Discord message. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Thanks for reaching out, @farazshaikh!
We ran into this issue when exposing prometheus metrics over a port exposed by monorepo/runtime/src/tokio/runtime.rs Lines 564 to 576 in e3069b3 Here is an example of using it with
We opted to avoid using For the examples currently maintained, I can appreciate your rationale/suggestion. That being said, most people building with the Commonware Library use the runtime because they want OOB deterministic simulation testing (this is the first ask to have an example avoiding it). If you want to implement some example that combines some primitives with Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Thanks for reaching out, @farazshaikh!
We ran into this issue when exposing prometheus metrics over a port exposed by
commonware-runtime
and actually already implementedaxum::serve::Listener
forruntime::tokio
:monorepo/runtime/src/tokio/runtime.rs
…