Skip to content

Commit

Permalink
add status check grpc (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
0g-peterzhb authored Jul 4, 2024
1 parent f39a765 commit 8be1b87
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
9 changes: 8 additions & 1 deletion grpc/proto/signer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ service Signer {
rpc BatchSign(BatchSignRequest) returns (BatchSignReply) {}
// This retrieves the requested encoded rows from the DA node database.
rpc BatchRetrieve(BatchRetrieveRequest) returns (BatchRetrieveReply) {}
rpc GetStatus(Empty) returns (StatusReply) {}
}

message SignRequest {
Expand Down Expand Up @@ -53,4 +54,10 @@ message Slices {
message BatchRetrieveReply {
// required encoded slices
repeated Slices encoded_slice = 1;
}
}

message StatusReply {
uint64 status_code = 1;
}

message Empty {}
12 changes: 11 additions & 1 deletion grpc/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use ethers::types::{Res, U256};
use ethers::utils::keccak256;
use prost::Message;
use rayon::iter::{IndexedParallelIterator, IntoParallelRefIterator, ParallelIterator};
use signer::{BatchRetrieveReply, BatchRetrieveRequest, Slices};
use signer::{BatchRetrieveReply, BatchRetrieveRequest, Empty, Slices};
use std::sync::Arc;
use std::time::{Duration, Instant};
use storage::blob_status_db::{BlobStatus, BlobStatusDB};
Expand Down Expand Up @@ -246,6 +246,16 @@ impl Signer for SignerService {
) -> Result<Response<BatchRetrieveReply>, Status> {
self.batch_retrieve_inner(request).await
}

async fn get_status(
&self,
request: Request<Empty>,
) -> Result<Response<signer::StatusReply>, Status> {
let status = signer::StatusReply {
status_code: 200
};
Ok(Response::new(status))
}
}

pub enum VerificationError {
Expand Down

0 comments on commit 8be1b87

Please sign in to comment.