-
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 http API #476
Nomos http API #476
Conversation
…into metrics-api
* add da_blob for new http api
* add storage api for new http backend
* Add mempool add apis
@al8n , usually you need to merge from the bottom up. Not the other way around. This PR was ready to be merged yesterday already. |
.route("/cl/metrics", routing::get(cl_metrics::<ClTransaction>)) | ||
.route("/cl/status", routing::post(cl_status::<ClTransaction>)) | ||
.route("/da/blobs", routing::post(da_blobs)) | ||
.route("/cl/metrics", routing::get(cl_metrics::<T>)) | ||
.route("/cl/status", routing::post(cl_status::<T>)) | ||
.route("/carnot/info", routing::get(carnot_info::<T, S, SIZE>)) | ||
.route("/network/info", routing::get(libp2p_info)) | ||
.route("/storage/block", routing::post(block::<S, T>)) | ||
.route("/mempool/add/tx", routing::post(add_tx::<T>)) | ||
.route("/mempool/add/cert", routing::post(add_cert)) | ||
.with_state(self.settings.handle); |
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.
Why do we have all this here now? this was merged right?
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 merged other approved PR to this PR, this PR has not been merged.
use std::{fmt::Debug, hash::Hash, net::SocketAddr, sync::Arc}; | ||
use std::{fmt::Debug, hash::Hash, net::SocketAddr}; | ||
|
||
use axum::{extract::State, response::IntoResponse, routing, Json, Router, Server}; | ||
use full_replication::Blob; | ||
use hyper::StatusCode; | ||
use axum::{extract::State, response::Response, routing, Json, Router, Server}; | ||
use consensus_engine::BlockId; | ||
use full_replication::{Blob, Certificate}; | ||
use nomos_core::{da::blob, tx::Transaction}; | ||
use nomos_mempool::{openapi::Status, MempoolMetrics}; | ||
use nomos_mempool::{network::adapters::libp2p::Libp2pAdapter, openapi::Status, MempoolMetrics}; | ||
use nomos_network::backends::libp2p::Libp2p; | ||
use nomos_storage::backends::StorageSerde; | ||
use overwatch_rs::overwatch::handle::OverwatchHandle; | ||
use serde::{Deserialize, Serialize}; | ||
use serde::{de::DeserializeOwned, Deserialize, Serialize}; | ||
use utoipa::OpenApi; | ||
use utoipa_swagger_ui::SwaggerUi; | ||
|
||
use crate::{ | ||
http::{cl::*, da::*}, | ||
http::{cl, consensus, da, libp2p, mempool, storage}, | ||
Backend, | ||
}; |
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.
Nitpick. All imports are mixed. We should try to separate in blocks:
// std
// crates
// internal
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.
Sorry, I am a little bit confused here, do you mean we should treat nomos*
as internal crates? Otherwise, it seems imports are already in the std - crates - internal format.
use std::{fmt::Debug, hash::Hash, net::SocketAddr};
use axum::{extract::State, response::Response, routing, Json, Router, Server};
use consensus_engine::BlockId;
use full_replication::{Blob, Certificate};
use nomos_core::{da::blob, tx::Transaction};
use nomos_mempool::{network::adapters::libp2p::Libp2pAdapter, openapi::Status, MempoolMetrics};
use nomos_network::backends::libp2p::Libp2p;
use nomos_storage::backends::StorageSerde;
use overwatch_rs::overwatch::handle::OverwatchHandle;
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use utoipa::OpenApi;
use utoipa_swagger_ui::SwaggerUi;
use crate::{
http::{cl, consensus, da, libp2p, mempool, storage},
Backend,
};
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.
Yes, anything internally related to the project I think is better in internal:
- consensus_engine
- nomos_core
- nomos_mempool
etc
Overwatch can be kept in crates 👍
Finish information related API