Skip to content

Commit ba7c7bf

Browse files
fix http url/socket
1 parent 3d4ab68 commit ba7c7bf

File tree

3 files changed

+11
-23
lines changed

3 files changed

+11
-23
lines changed

crates/block-producer/src/server.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use miden_node_proto::generated::{
77
use miden_node_utils::{
88
errors::ApiError,
99
formatting::{format_input_notes, format_output_notes},
10-
tracing::grpc::{OtelInterceptor, block_producer_trace_fn},
10+
tracing::grpc::{block_producer_trace_fn, OtelInterceptor},
1111
};
1212
use miden_objects::{
1313
block::BlockNumber, transaction::ProvenTransaction, utils::serde::Deserializable,
@@ -20,13 +20,13 @@ use tracing::{debug, info, instrument};
2020
use url::Url;
2121

2222
use crate::{
23-
COMPONENT, SERVER_MEMPOOL_EXPIRATION_SLACK, SERVER_MEMPOOL_STATE_RETENTION,
2423
batch_builder::BatchBuilder,
2524
block_builder::BlockBuilder,
2625
domain::transaction::AuthenticatedTransaction,
2726
errors::{AddTransactionError, BlockProducerError, VerifyTxError},
2827
mempool::{BatchBudget, BlockBudget, Mempool, SharedMempool},
2928
store::StoreClient,
29+
COMPONENT, SERVER_MEMPOOL_EXPIRATION_SLACK, SERVER_MEMPOOL_STATE_RETENTION,
3030
};
3131

3232
/// Represents an initialized block-producer component where the RPC connection is open,
@@ -59,7 +59,8 @@ impl BlockProducer {
5959
) -> Result<Self, ApiError> {
6060
info!(target: COMPONENT, endpoint=?listener, store=%store_address, "Initializing server");
6161

62-
let channel = tonic::transport::Endpoint::try_from(store_address.to_string())
62+
let store_url = format!("http://{store_address}");
63+
let channel = tonic::transport::Endpoint::try_from(store_url)
6364
.map_err(|err| ApiError::InvalidStoreUrl(err.to_string()))?
6465
.connect()
6566
.await

crates/rpc/src/server/api.rs

+7-9
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ use miden_node_proto::{
2222
};
2323
use miden_node_utils::tracing::grpc::OtelInterceptor;
2424
use miden_objects::{
25-
Digest, MAX_NUM_FOREIGN_ACCOUNTS, MIN_PROOF_SECURITY_LEVEL, account::AccountId,
26-
crypto::hash::rpo::RpoDigest, transaction::ProvenTransaction, utils::serde::Deserializable,
25+
account::AccountId, crypto::hash::rpo::RpoDigest, transaction::ProvenTransaction,
26+
utils::serde::Deserializable, Digest, MAX_NUM_FOREIGN_ACCOUNTS, MIN_PROOF_SECURITY_LEVEL,
2727
};
2828
use miden_tx::TransactionVerifier;
2929
use tonic::{
30-
Request, Response, Status,
3130
service::interceptor::InterceptedService,
3231
transport::{Channel, Error},
32+
Request, Response, Status,
3333
};
3434
use tracing::{debug, info, instrument};
3535

@@ -52,15 +52,13 @@ impl RpcService {
5252
store_address: SocketAddr,
5353
block_producer_address: SocketAddr,
5454
) -> Result<Self, Error> {
55-
let channel = tonic::transport::Endpoint::try_from(store_address.to_string())?
56-
.connect()
57-
.await?;
55+
let store_url = format!("http://{store_address}");
56+
let channel = tonic::transport::Endpoint::try_from(store_url)?.connect().await?;
5857
let store = store_client::ApiClient::with_interceptor(channel, OtelInterceptor);
5958
info!(target: COMPONENT, store_endpoint = %store_address, "Store client initialized");
6059

61-
let channel = tonic::transport::Endpoint::try_from(block_producer_address.to_string())?
62-
.connect()
63-
.await?;
60+
let block_producer_url = format!("http://{block_producer_address}");
61+
let channel = tonic::transport::Endpoint::try_from(block_producer_url)?.connect().await?;
6462
let block_producer =
6563
block_producer_client::ApiClient::with_interceptor(channel, OtelInterceptor);
6664

genesis.toml

-11
This file was deleted.

0 commit comments

Comments
 (0)