diff --git a/applications/minotari_merge_mining_proxy/src/block_template_protocol.rs b/applications/minotari_merge_mining_proxy/src/block_template_protocol.rs index 07621fae0a..44b54f48a8 100644 --- a/applications/minotari_merge_mining_proxy/src/block_template_protocol.rs +++ b/applications/minotari_merge_mining_proxy/src/block_template_protocol.rs @@ -24,7 +24,7 @@ use std::{cmp, convert::TryFrom, sync::Arc}; use log::*; -use minotari_app_grpc::tari_rpc::{GetNewBlockRequest, MinerData, NewBlockTemplate}; +use minotari_app_grpc::tari_rpc::{pow_algo::PowAlgos, GetNewBlockRequest, MinerData, NewBlockTemplate, PowAlgo}; use minotari_app_utilities::parse_miner_input::{BaseNodeGrpcClient, ShaP2PoolGrpcClient}; use minotari_node_grpc_client::grpc; use tari_common_types::{tari_address::TariAddress, types::FixedHash}; @@ -130,7 +130,13 @@ impl BlockTemplateProtocol<'_> { } else { let block = match self.p2pool_client.as_mut() { Some(client) => { - let block_result = client.get_new_block(GetNewBlockRequest::default()).await?.into_inner(); + let pow_algo = PowAlgo { + pow_algo: PowAlgos::Randomx.into(), + }; + let block_result = client + .get_new_block(GetNewBlockRequest { pow: Some(pow_algo) }) + .await? + .into_inner(); block_result .block .ok_or_else(|| MmProxyError::FailedToGetBlockTemplate("block result".to_string()))? diff --git a/applications/minotari_merge_mining_proxy/src/config.rs b/applications/minotari_merge_mining_proxy/src/config.rs index 30badfa0d3..44058daa8f 100644 --- a/applications/minotari_merge_mining_proxy/src/config.rs +++ b/applications/minotari_merge_mining_proxy/src/config.rs @@ -58,6 +58,8 @@ pub struct MergeMiningProxyConfig { pub monerod_use_auth: bool, /// The Minotari base node's GRPC address pub base_node_grpc_address: Option, + /// P2Pool node's gRPC address + pub p2pool_node_grpc_address: Option, /// GRPC authentication for base node pub base_node_grpc_authentication: GrpcAuthentication, /// GRPC domain name for node TLS validation @@ -107,6 +109,7 @@ impl Default for MergeMiningProxyConfig { monerod_password: String::new(), monerod_use_auth: false, base_node_grpc_address: None, + p2pool_node_grpc_address: None, base_node_grpc_authentication: GrpcAuthentication::default(), base_node_grpc_tls_domain_name: None, base_node_grpc_ca_cert_filename: "node_ca.pem".to_string(), diff --git a/applications/minotari_merge_mining_proxy/src/run_merge_miner.rs b/applications/minotari_merge_mining_proxy/src/run_merge_miner.rs index 5f226bbe0e..a23a4ca592 100644 --- a/applications/minotari_merge_mining_proxy/src/run_merge_miner.rs +++ b/applications/minotari_merge_mining_proxy/src/run_merge_miner.rs @@ -192,7 +192,7 @@ async fn connect_base_node(config: &MergeMiningProxyConfig) -> Result Result { // TODO: Merge this code in the sha miner - let socketaddr = base_node_socket_address(config.base_node_grpc_address.clone(), config.network)?; + let socketaddr = base_node_socket_address(config.p2pool_node_grpc_address.clone(), config.network)?; let base_node_addr = format!( "{}{}", protocol_string(config.base_node_grpc_tls_domain_name.is_some()),