Skip to content

Commit

Permalink
Solve openssl build issue for non-base nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
hansieodendaal committed Nov 26, 2024
1 parent 321e9ba commit 321df73
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 25 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion applications/minotari_node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ either = "1.6.1"
futures = { version = "^0.3.16", default-features = false, features = [
"alloc",
] }
qrcode = { version = "0.12" }
hickory-client = { version = "=0.25.0-alpha.2", features = ["dns-over-rustls", "dnssec-openssl"] }
log = { version = "0.4.8", features = ["std"] }
log-mdc = "0.1.0"
log4rs = { version = "1.3.0", default-features = false, features = [
Expand All @@ -56,6 +56,7 @@ log4rs = { version = "1.3.0", default-features = false, features = [
"fixed_window_roller",
] }
nom = "7.1"
qrcode = { version = "0.12" }
rustyline = "9.0"
rustyline-derive = "0.5"
serde = { version = "1.0", features = ["derive"] }
Expand Down
3 changes: 1 addition & 2 deletions applications/minotari_node/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ use tari_core::{
chain_metadata_service::ChainMetadataServiceInitializer,
service::BaseNodeServiceInitializer,
state_machine_service::initializer::BaseNodeStateMachineInitializer,
tari_pulse_service::TariPulseServiceInitializer,
LocalNodeCommsInterface,
StateMachineHandle,
},
Expand All @@ -69,7 +68,7 @@ use tari_p2p::{
use tari_service_framework::{ServiceHandles, StackBuilder};
use tari_shutdown::ShutdownSignal;

use crate::ApplicationConfig;
use crate::{tari_pulse_service::TariPulseServiceInitializer, ApplicationConfig};

const LOG_TARGET: &str = "c::bn::initialization";
/// The minimum buffer size for the base node pubsub_connector channel
Expand Down
9 changes: 2 additions & 7 deletions applications/minotari_node/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,7 @@ use tari_common::{
use tari_comms::{peer_manager::NodeIdentity, protocol::rpc::RpcServerHandle, CommsNode};
use tari_comms_dht::Dht;
use tari_core::{
base_node::{
state_machine_service::states::StatusInfo,
tari_pulse_service::TariPulseHandle,
LocalNodeCommsInterface,
StateMachineHandle,
},
base_node::{state_machine_service::states::StatusInfo, LocalNodeCommsInterface, StateMachineHandle},
chain_storage::{create_lmdb_database, BlockchainDatabase, ChainStorageError, LMDBDatabase, Validators},
consensus::ConsensusManager,
mempool::{service::LocalMempoolService, Mempool},
Expand All @@ -54,7 +49,7 @@ use tari_service_framework::ServiceHandles;
use tari_shutdown::ShutdownSignal;
use tokio::sync::watch;

use crate::{bootstrap::BaseNodeBootstrapper, ApplicationConfig, DatabaseType};
use crate::{bootstrap::BaseNodeBootstrapper, tari_pulse_service::TariPulseHandle, ApplicationConfig, DatabaseType};

const LOG_TARGET: &str = "c::bn::initialization";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ use tari_core::{
base_node::{
comms_interface::CommsInterfaceError,
state_machine_service::states::StateInfo,
tari_pulse_service::TariPulseHandle,
LocalNodeCommsInterface,
StateMachineHandle,
},
Expand Down Expand Up @@ -83,6 +82,7 @@ use crate::{
helpers::{mean, median},
},
grpc_method::GrpcMethod,
tari_pulse_service::TariPulseHandle,
BaseNodeConfig,
};

Expand Down
1 change: 1 addition & 0 deletions applications/minotari_node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ mod grpc_method;
#[cfg(feature = "metrics")]
mod metrics;
mod recovery;
pub mod tari_pulse_service;
mod utils;

use std::{process, sync::Arc};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,15 @@ use hickory_client::{
rr::{DNSClass, Name, RData, Record, RecordType},
tcp::TcpClientStream,
};
use log::{error, info, warn};
use log::{error, info, trace, warn};
use serde::{Deserialize, Serialize};
use tari_core::base_node::{comms_interface::CommsInterfaceError, LocalNodeCommsInterface};
use tari_p2p::Network;
use tari_service_framework::{async_trait, ServiceInitializationError, ServiceInitializer, ServiceInitializerContext};
use tari_shutdown::ShutdownSignal;
use tari_utilities::hex::Hex;
use tokio::{net::TcpStream as TokioTcpStream, sync::watch, time};

use super::LocalNodeCommsInterface;
use crate::base_node::comms_interface::CommsInterfaceError;

const LOG_TARGET: &str = "c::bn::tari_pulse";
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(deny_unknown_fields)]
Expand Down Expand Up @@ -174,7 +172,12 @@ impl TariPulseService {
.max_by(|a, b| a.0.cmp(&b.0))
.ok_or(CommsInterfaceError::InternalError("No checkpoints found".to_string()))?;
let local_checkpoints = self.get_node_block(base_node_service, max_height_block.0).await?;
Ok(local_checkpoints.1 == max_height_block.1)
let passed = local_checkpoints.1 == max_height_block.1;
trace!(
target: LOG_TARGET, "Passed checkpoints: {}, DNS: ({}, {}), Local: ({}, {})",
passed, max_height_block.0, max_height_block.1, local_checkpoints.0, local_checkpoints.1
);
Ok(passed)
}

async fn get_node_block(
Expand Down
2 changes: 0 additions & 2 deletions base_layer/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ tiny-keccak = { package = "tari-tiny-keccak", version = "2.0.2", features = [
"keccak",
] }
dirs-next = "1.0.2"
hickory-client = { version = "0.25.0-alpha.2", features = ["dns-over-rustls", "dnssec-openssl"] }
anyhow = "1.0.53"

[dev-dependencies]
criterion = { version = "0.4.0" }
Expand Down
3 changes: 0 additions & 3 deletions base_layer/core/src/base_node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,3 @@ pub mod proto;

#[cfg(any(feature = "base_node", feature = "base_node_proto"))]
pub mod rpc;

#[cfg(feature = "base_node")]
pub mod tari_pulse_service;
4 changes: 2 additions & 2 deletions base_layer/p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ tokio-stream = { version = "0.1.9", default-features = false, features = [
"time",
] }
tower = "0.4.11"
hickory-client = { version = "0.25.0-alpha.2", features = ["dns-over-rustls"] }
hickory-resolver = "0.25.0-alpha.2"
hickory-client = { version = "=0.25.0-alpha.2", default-features = false, features = ["dns-over-rustls"] }
hickory-resolver = { version = "=0.25.0-alpha.2", default-features = false, features = ["dns-over-rustls", "dnssec", "system-config"] }
webpki-roots = "0.26.6"

[dev-dependencies]
Expand Down

0 comments on commit 321df73

Please sign in to comment.