diff --git a/Cargo.lock b/Cargo.lock index 7a37e412a6..12eb149d09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3162,6 +3162,7 @@ dependencies = [ "hyper", "jsonrpc", "log", + "minotari_app_grpc", "minotari_app_utilities", "minotari_node_grpc_client", "minotari_wallet_grpc_client", diff --git a/applications/minotari_merge_mining_proxy/Cargo.toml b/applications/minotari_merge_mining_proxy/Cargo.toml index 67097ef679..5aebf91c49 100644 --- a/applications/minotari_merge_mining_proxy/Cargo.toml +++ b/applications/minotari_merge_mining_proxy/Cargo.toml @@ -16,8 +16,9 @@ tari_comms = { path = "../../comms/core" } tari_core = { path = "../../base_layer/core", default-features = false, features = ["transactions"] } minotari_app_utilities = { path = "../minotari_app_utilities" } tari_utilities = { version = "0.6" } -minotari_node_grpc_client = {path="../../clients/rust/base_node_grpc_client" } -minotari_wallet_grpc_client = {path="../../clients/rust/wallet_grpc_client" } +minotari_node_grpc_client = { path = "../../clients/rust/base_node_grpc_client" } +minotari_wallet_grpc_client = { path = "../../clients/rust/wallet_grpc_client" } +minotari_app_grpc = { path = "../minotari_app_grpc" } anyhow = "1.0.53" crossterm = { version = "0.25.0" } 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 38fbe6640c..1cb70122f7 100644 --- a/applications/minotari_merge_mining_proxy/src/block_template_protocol.rs +++ b/applications/minotari_merge_mining_proxy/src/block_template_protocol.rs @@ -25,9 +25,13 @@ use std::{cmp, sync::Arc}; use log::*; -use minotari_node_grpc_client::{grpc, BaseNodeGrpcClient}; -use minotari_wallet_grpc_client::WalletGrpcClient; +use minotari_app_grpc::{ + authentication::ClientAuthenticationInterceptor, + tari_rpc::{base_node_client::BaseNodeClient, wallet_client::WalletClient}, +}; +use minotari_node_grpc_client::grpc; use tari_core::proof_of_work::{monero_rx, monero_rx::FixedByteArray, Difficulty}; +use tonic::{codegen::InterceptedService, transport::Channel}; use crate::{ block_template_data::{BlockTemplateData, BlockTemplateDataBuilder}, @@ -41,14 +45,14 @@ const LOG_TARGET: &str = "minotari_mm_proxy::proxy::block_template_protocol"; /// Structure holding grpc connections. pub struct BlockTemplateProtocol<'a> { config: Arc, - base_node_client: &'a mut BaseNodeGrpcClient, - wallet_client: &'a mut WalletGrpcClient, + base_node_client: &'a mut BaseNodeClient>, + wallet_client: &'a mut WalletClient>, } impl<'a> BlockTemplateProtocol<'a> { pub fn new( - base_node_client: &'a mut BaseNodeGrpcClient, - wallet_client: &'a mut WalletGrpcClient, + base_node_client: &'a mut BaseNodeClient>, + wallet_client: &'a mut WalletClient>, config: Arc, ) -> Self { Self { diff --git a/applications/minotari_merge_mining_proxy/src/config.rs b/applications/minotari_merge_mining_proxy/src/config.rs index 2eddef5de1..0684db75de 100644 --- a/applications/minotari_merge_mining_proxy/src/config.rs +++ b/applications/minotari_merge_mining_proxy/src/config.rs @@ -43,6 +43,8 @@ pub struct MergeMiningProxyConfig { pub monerod_use_auth: bool, /// The Minotari base node's GRPC address pub base_node_grpc_address: Option, + /// GRPC authentication for base node + pub base_node_grpc_authentication: GrpcAuthentication, /// The Minotari wallet's GRPC address pub console_wallet_grpc_address: Option, /// GRPC authentication for console wallet @@ -80,6 +82,7 @@ impl Default for MergeMiningProxyConfig { monerod_password: String::new(), monerod_use_auth: false, base_node_grpc_address: None, + base_node_grpc_authentication: GrpcAuthentication::default(), console_wallet_grpc_address: None, console_wallet_grpc_authentication: GrpcAuthentication::default(), listener_address: "/ip4/127.0.0.1/tcp/18081".parse().unwrap(), diff --git a/applications/minotari_merge_mining_proxy/src/proxy.rs b/applications/minotari_merge_mining_proxy/src/proxy.rs index 66e58b6aac..17b4319c9a 100644 --- a/applications/minotari_merge_mining_proxy/src/proxy.rs +++ b/applications/minotari_merge_mining_proxy/src/proxy.rs @@ -39,8 +39,8 @@ use bytes::Bytes; use hyper::{header::HeaderValue, service::Service, Body, Method, Request, Response, StatusCode, Uri}; use json::json; use jsonrpc::error::StandardError; -use minotari_node_grpc_client::{grpc, BaseNodeGrpcClient}; -use minotari_wallet_grpc_client::WalletGrpcClient; +use minotari_node_grpc_client::{grpc, grpc::base_node_client::BaseNodeClient}; +use minotari_wallet_grpc_client::{grpc::wallet_client::WalletClient, ClientAuthenticationInterceptor}; use reqwest::{ResponseBuilderExt, Url}; use serde_json as json; use tari_core::proof_of_work::{ @@ -50,6 +50,7 @@ use tari_core::proof_of_work::{ randomx_factory::RandomXFactory, }; use tari_utilities::hex::Hex; +use tonic::{codegen::InterceptedService, transport::Channel}; use tracing::{debug, error, info, instrument, trace, warn}; use crate::{ @@ -75,8 +76,8 @@ impl MergeMiningProxyService { pub fn new( config: MergeMiningProxyConfig, http_client: reqwest::Client, - base_node_client: BaseNodeGrpcClient, - wallet_client: WalletGrpcClient, + base_node_client: BaseNodeClient>, + wallet_client: WalletClient>, block_templates: BlockTemplateRepository, randomx_factory: RandomXFactory, ) -> Self { @@ -157,8 +158,8 @@ struct InnerService { config: Arc, block_templates: BlockTemplateRepository, http_client: reqwest::Client, - base_node_client: BaseNodeGrpcClient, - wallet_client: WalletGrpcClient, + base_node_client: BaseNodeClient>, + wallet_client: WalletClient>, initial_sync_achieved: Arc, current_monerod_server: Arc>>, last_assigned_monerod_server: Arc>>, 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 d5d433fede..420f9b78d8 100644 --- a/applications/minotari_merge_mining_proxy/src/run_merge_miner.rs +++ b/applications/minotari_merge_mining_proxy/src/run_merge_miner.rs @@ -20,13 +20,13 @@ // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE // USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -use std::convert::Infallible; +use std::{convert::Infallible, str::FromStr}; use futures::future; use hyper::{service::make_service_fn, Server}; use log::*; -use minotari_node_grpc_client::BaseNodeGrpcClient; -use minotari_wallet_grpc_client::WalletGrpcClient; +use minotari_node_grpc_client::grpc::base_node_client::BaseNodeClient; +use minotari_wallet_grpc_client::{grpc::wallet_client::WalletClient, ClientAuthenticationInterceptor}; use tari_common::{ configuration::bootstrap::{grpc_default_port, ApplicationType}, load_configuration, @@ -35,6 +35,10 @@ use tari_common::{ use tari_comms::utils::multiaddr::multiaddr_to_socketaddr; use tari_core::proof_of_work::randomx_factory::RandomXFactory; use tokio::time::Duration; +use tonic::{ + codegen::InterceptedService, + transport::{Channel, Endpoint}, +}; use crate::{ block_template_data::BlockTemplateRepository, @@ -59,25 +63,9 @@ pub async fn start_merge_miner(cli: Cli) -> Result<(), anyhow::Error> { .build() .map_err(MmProxyError::ReqwestError)?; - let base_node = multiaddr_to_socketaddr( - config - .base_node_grpc_address - .as_ref() - .expect("No base node address provided"), - )?; - info!(target: LOG_TARGET, "Connecting to base node at {}", base_node); - println!("Connecting to base node at {}", base_node); - let base_node_client = BaseNodeGrpcClient::connect(format!("http://{}", base_node)).await?; - let wallet_addr = multiaddr_to_socketaddr( - config - .console_wallet_grpc_address - .as_ref() - .expect("No waller address provided"), - )?; - info!(target: LOG_TARGET, "Connecting to wallet at {}", wallet_addr); - let wallet_addr = format!("http://{}", wallet_addr); - let wallet_client = - WalletGrpcClient::connect_with_auth(&wallet_addr, &config.console_wallet_grpc_authentication).await?; + let base_node_client = connect_base_node(&config).await?; + let wallet_client = connect_wallet(&config).await?; + let listen_addr = multiaddr_to_socketaddr(&config.listener_address)?; let randomx_factory = RandomXFactory::new(config.max_randomx_vms); let randomx_service = MergeMiningProxyService::new( @@ -110,6 +98,50 @@ pub async fn start_merge_miner(cli: Cli) -> Result<(), anyhow::Error> { } } +async fn connect_wallet( + config: &MergeMiningProxyConfig, +) -> Result>, MmProxyError> { + let wallet_addr = format!( + "http://{}", + multiaddr_to_socketaddr( + &config + .console_wallet_grpc_address + .clone() + .expect("Wallet grpc address not found") + )? + ); + info!(target: LOG_TARGET, "👛 Connecting to wallet at {}", wallet_addr); + let channel = Endpoint::from_str(&wallet_addr)?.connect().await?; + let wallet_conn = WalletClient::with_interceptor( + channel, + ClientAuthenticationInterceptor::create(&config.console_wallet_grpc_authentication)?, + ); + + Ok(wallet_conn) +} + +async fn connect_base_node( + config: &MergeMiningProxyConfig, +) -> Result>, MmProxyError> { + let base_node_addr = format!( + "http://{}", + multiaddr_to_socketaddr( + &config + .base_node_grpc_address + .clone() + .expect("Base node grpc address not found") + )? + ); + info!(target: LOG_TARGET, "👛 Connecting to base node at {}", base_node_addr); + let channel = Endpoint::from_str(&base_node_addr)?.connect().await?; + let node_conn = BaseNodeClient::with_interceptor( + channel, + ClientAuthenticationInterceptor::create(&config.base_node_grpc_authentication)?, + ); + + Ok(node_conn) +} + fn setup_grpc_config(config: &mut MergeMiningProxyConfig) { if config.base_node_grpc_address.is_none() { config.base_node_grpc_address = Some( diff --git a/applications/minotari_miner/src/config.rs b/applications/minotari_miner/src/config.rs index ca9101ddde..aaef7be8b4 100644 --- a/applications/minotari_miner/src/config.rs +++ b/applications/minotari_miner/src/config.rs @@ -49,6 +49,8 @@ use tari_comms::multiaddr::Multiaddr; pub struct MinerConfig { /// GRPC address of base node pub base_node_grpc_address: Option, + /// GRPC authentication for base node + pub base_node_grpc_authentication: GrpcAuthentication, /// GRPC address of console wallet pub wallet_grpc_address: Option, /// GRPC authentication for console wallet @@ -97,6 +99,7 @@ impl Default for MinerConfig { fn default() -> Self { Self { base_node_grpc_address: None, + base_node_grpc_authentication: GrpcAuthentication::default(), wallet_grpc_address: None, wallet_grpc_authentication: GrpcAuthentication::default(), num_mining_threads: num_cpus::get(), diff --git a/applications/minotari_miner/src/run_miner.rs b/applications/minotari_miner/src/run_miner.rs index 815ccfe757..4c51695c56 100644 --- a/applications/minotari_miner/src/run_miner.rs +++ b/applications/minotari_miner/src/run_miner.rs @@ -57,6 +57,7 @@ pub const LOG_TARGET: &str = "minotari::miner::main"; pub const LOG_TARGET_FILE: &str = "minotari::logging::miner::main"; type WalletGrpcClient = WalletClient>; +type BaseNodeGrpcClient = BaseNodeClient>; #[allow(clippy::too_many_lines)] pub async fn start_miner(cli: Cli) -> Result<(), ExitError> { @@ -167,18 +168,18 @@ pub async fn start_miner(cli: Cli) -> Result<(), ExitError> { } } -async fn connect(config: &MinerConfig) -> Result<(BaseNodeClient, WalletGrpcClient), MinerError> { - let base_node_addr = format!( - "http://{}", - multiaddr_to_socketaddr( - &config - .base_node_grpc_address - .clone() - .expect("no base node grpc address found"), - )? - ); - info!(target: LOG_TARGET, "🔗 Connecting to base node at {}", base_node_addr); - let node_conn = BaseNodeClient::connect(base_node_addr).await?; +async fn connect(config: &MinerConfig) -> Result<(BaseNodeGrpcClient, WalletGrpcClient), MinerError> { + let node_conn = match connect_base_node(config).await { + Ok(client) => client, + Err(e) => { + error!(target: LOG_TARGET, "Could not connect to base node"); + error!( + target: LOG_TARGET, + "Is its grpc running? try running it with `--enable-grpc` or enable it in config" + ); + return Err(e); + }, + }; let wallet_conn = match connect_wallet(config).await { Ok(client) => client, @@ -215,8 +216,28 @@ async fn connect_wallet(config: &MinerConfig) -> Result Result { + let base_node_addr = format!( + "http://{}", + multiaddr_to_socketaddr( + &config + .base_node_grpc_address + .clone() + .expect("Base node grpc address not found") + )? + ); + info!(target: LOG_TARGET, "👛 Connecting to base node at {}", base_node_addr); + let channel = Endpoint::from_str(&base_node_addr)?.connect().await?; + let node_conn = BaseNodeClient::with_interceptor( + channel, + ClientAuthenticationInterceptor::create(&config.base_node_grpc_authentication)?, + ); + + Ok(node_conn) +} + async fn mining_cycle( - node_conn: &mut BaseNodeClient, + node_conn: &mut BaseNodeGrpcClient, wallet_conn: &mut WalletGrpcClient, config: &MinerConfig, cli: &Cli, @@ -336,7 +357,7 @@ pub async fn display_report(report: &MiningReport, num_mining_threads: usize) { /// If config async fn validate_tip( - node_conn: &mut BaseNodeClient, + node_conn: &mut BaseNodeGrpcClient, height: u64, mine_until_height: Option, ) -> Result<(), MinerError> { diff --git a/applications/minotari_node/src/cli.rs b/applications/minotari_node/src/cli.rs index 041f7bc0d5..924974c2aa 100644 --- a/applications/minotari_node/src/cli.rs +++ b/applications/minotari_node/src/cli.rs @@ -45,6 +45,8 @@ pub struct Cli { pub watch: Option, #[clap(long, alias = "profile")] pub profile_with_tokio_console: bool, + #[clap(long, env = "MINOTARI_NODE_ENABLE_GRPC", alias = "enable-grpc")] + pub grpc_enabled: bool, } impl ConfigOverrideProvider for Cli { diff --git a/applications/minotari_node/src/commands/command/hash_grpc_password.rs b/applications/minotari_node/src/commands/command/hash_grpc_password.rs new file mode 100644 index 0000000000..5571f7c0d0 --- /dev/null +++ b/applications/minotari_node/src/commands/command/hash_grpc_password.rs @@ -0,0 +1,69 @@ +// Copyright 2023, The Tari Project +// +// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the +// following conditions are met: +// +// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following +// disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the +// following disclaimer in the documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote +// products derived from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE +// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +use anyhow::{anyhow, Error}; +use async_trait::async_trait; +use clap::Parser; +use minotari_app_grpc::authentication::salted_password::create_salted_hashed_password; + +use super::{CommandContext, HandleCommand}; + +/// Hashes the GRPC authentication password from the config and returns an argon2 hash +#[derive(Debug, Parser)] +pub struct Args {} + +#[async_trait] +impl HandleCommand for CommandContext { + async fn handle_command(&mut self, _: Args) -> Result<(), Error> { + self.hash_grpc_password().await + } +} + +impl CommandContext { + pub async fn hash_grpc_password(&mut self) -> Result<(), Error> { + match self + .config + .base_node + .grpc_authentication + .username_password() + .ok_or_else(|| anyhow!("GRPC basic auth is not configured")) + { + Ok((username, password)) => { + match create_salted_hashed_password(password.reveal()).map_err(|e| anyhow!(e.to_string())) { + Ok(hashed_password) => { + println!("Your hashed password is:"); + println!("{}", *hashed_password); + println!(); + println!( + "Use HTTP basic auth with username '{}' and the hashed password to make GRPC requests", + username + ); + }, + Err(e) => eprintln!("HashGrpcPassword error! {}", e), + } + }, + Err(e) => eprintln!("HashGrpcPassword error! {}", e), + } + + Ok(()) + } +} diff --git a/applications/minotari_node/src/commands/command/mod.rs b/applications/minotari_node/src/commands/command/mod.rs index 4a02c670d0..e4efb921aa 100644 --- a/applications/minotari_node/src/commands/command/mod.rs +++ b/applications/minotari_node/src/commands/command/mod.rs @@ -35,6 +35,7 @@ mod get_mempool_stats; mod get_network_stats; mod get_peer; mod get_state_info; +mod hash_grpc_password; mod header_stats; mod list_banned_peers; mod list_connections; @@ -136,6 +137,7 @@ pub enum Command { Quit(quit::Args), Exit(quit::Args), Watch(watch_command::Args), + HashGrpcPassword(hash_grpc_password::Args), } impl Command { @@ -228,6 +230,7 @@ impl CommandContext { Command::Status(_) | Command::Watch(_) | Command::ListValidatorNodes(_) | + Command::HashGrpcPassword(_) | Command::Quit(_) | Command::Exit(_) => 30, // These commands involve intense blockchain db operations and needs a lot of time to complete @@ -293,6 +296,7 @@ impl HandleCommand for CommandContext { Command::Quit(args) | Command::Exit(args) => self.handle_command(args).await, Command::Watch(args) => self.handle_command(args).await, Command::ListValidatorNodes(args) => self.handle_command(args).await, + Command::HashGrpcPassword(args) => self.handle_command(args).await, } } } diff --git a/applications/minotari_node/src/config.rs b/applications/minotari_node/src/config.rs index 29f508e35c..bd642ae7e9 100644 --- a/applications/minotari_node/src/config.rs +++ b/applications/minotari_node/src/config.rs @@ -34,6 +34,7 @@ use tari_common::{ DefaultConfigLoader, SubConfigPath, }; +use tari_common_types::grpc_authentication::GrpcAuthentication; use tari_comms::multiaddr::Multiaddr; use tari_core::{ base_node::BaseNodeStateMachineConfig, @@ -89,6 +90,8 @@ pub struct BaseNodeConfig { pub grpc_address: Option, /// GRPC server config - which methods are active and which not pub grpc_server_deny_methods: Vec, + /// GRPC authentication mode + pub grpc_authentication: GrpcAuthentication, /// A path to the file that stores the base node identity and secret key pub identity_file: PathBuf, /// Spin up and use a built-in Tor instance. This only works on macos/linux - requires that the wallet was built @@ -155,6 +158,7 @@ impl Default for BaseNodeConfig { GrpcMethod::Identify, GrpcMethod::GetNetworkStatus, ], + grpc_authentication: GrpcAuthentication::default(), identity_file: PathBuf::from("config/base_node_id.json"), use_libtor: false, tor_identity_file: PathBuf::from("config/base_node_tor_id.json"), diff --git a/applications/minotari_node/src/lib.rs b/applications/minotari_node/src/lib.rs index f6f3c2d0aa..bc4ebf542f 100644 --- a/applications/minotari_node/src/lib.rs +++ b/applications/minotari_node/src/lib.rs @@ -42,11 +42,13 @@ use std::{process, sync::Arc}; use commands::{cli_loop::CliLoop, command::CommandContext}; use futures::FutureExt; use log::*; +use minotari_app_grpc::authentication::ServerAuthenticationInterceptor; use minotari_app_utilities::{common_cli_args::CommonCliArgs, network_check::is_network_choice_valid}; use tari_common::{ configuration::bootstrap::{grpc_default_port, ApplicationType}, exit_codes::{ExitCode, ExitError}, }; +use tari_common_types::grpc_authentication::GrpcAuthentication; use tari_comms::{multiaddr::Multiaddr, utils::multiaddr::multiaddr_to_socketaddr, NodeIdentity}; use tari_shutdown::{Shutdown, ShutdownSignal}; use tokio::task; @@ -85,6 +87,7 @@ pub async fn run_base_node( non_interactive_mode: true, watch: None, profile_with_tokio_console: false, + grpc_enabled: false, }; run_base_node_with_cli(node_identity, config, cli, shutdown).await @@ -137,7 +140,8 @@ pub async fn run_base_node_with_cli( &ctx, config.base_node.grpc_server_deny_methods.clone(), ); - task::spawn(run_grpc(grpc, grpc_address, shutdown.to_signal())); + let auth = config.base_node.grpc_authentication.clone(); + task::spawn(run_grpc(grpc, grpc_address, auth, shutdown.to_signal())); } // Run, node, run! @@ -171,13 +175,17 @@ pub async fn run_base_node_with_cli( async fn run_grpc( grpc: grpc::base_node_grpc_server::BaseNodeGrpcServer, grpc_address: Multiaddr, + auth_config: GrpcAuthentication, interrupt_signal: ShutdownSignal, ) -> Result<(), anyhow::Error> { info!(target: LOG_TARGET, "Starting GRPC on {}", grpc_address); let grpc_address = multiaddr_to_socketaddr(&grpc_address)?; + let auth = ServerAuthenticationInterceptor::new(auth_config); + let service = minotari_app_grpc::tari_rpc::base_node_server::BaseNodeServer::with_interceptor(grpc, auth); + Server::builder() - .add_service(minotari_app_grpc::tari_rpc::base_node_server::BaseNodeServer::new(grpc)) + .add_service(service) .serve_with_shutdown(grpc_address, interrupt_signal.map(|_| ())) .await .map_err(|err| { diff --git a/common/config/presets/c_base_node.toml b/common/config/presets/c_base_node.toml index d6d8db46c9..9c8a307076 100644 --- a/common/config/presets/c_base_node.toml +++ b/common/config/presets/c_base_node.toml @@ -33,6 +33,9 @@ identity_file = "config/base_node_id_nextnet.json" # Set to false to disable the base node GRPC server (default = true) #grpc_enabled = true +# gRPC authentication method (default = "none") +#grpc_authentication = { username = "admin", password = "xxxx" } + # Uncomment all gRPC server methods that should be denied default (only active when `grpc_enabled = true`) grpc_server_deny_methods = [ "get_version", diff --git a/common/config/presets/f_merge_mining_proxy.toml b/common/config/presets/f_merge_mining_proxy.toml index ce0c8bf709..8744f28b90 100644 --- a/common/config/presets/f_merge_mining_proxy.toml +++ b/common/config/presets/f_merge_mining_proxy.toml @@ -39,11 +39,14 @@ monerod_url = [# stagenet # The Minotari base node's GRPC address. (default = "/ip4/127.0.0.1/tcp/18142") #base_node_grpc_address = "/ip4/127.0.0.1/tcp/18142" +# GRPC authentication for the base node (default = "none") +#base_node_grpc_authentication = { username = "miner", password = "$argon..." } + # The Minotari wallet's GRPC address. (default = "/ip4/127.0.0.1/tcp/18143") #console_wallet_grpc_address = "/ip4/127.0.0.1/tcp/18143" # GRPC authentication for the Minotari wallet (default = "none") -#wallet_grpc_authentication = { username: "miner", password: "$argon..." } +#wallet_grpc_authentication = { username = "miner", password = "$argon..." } # Address of the minotari_merge_mining_proxy application. (default = "/ip4/127.0.0.1/tcp/18081") #listener_address = "/ip4/127.0.0.1/tcp/18081" diff --git a/common/config/presets/g_miner.toml b/common/config/presets/g_miner.toml index 717a9da1d7..b821e95521 100644 --- a/common/config/presets/g_miner.toml +++ b/common/config/presets/g_miner.toml @@ -9,11 +9,13 @@ # GRPC address of base node (default = "/ip4/127.0.0.1/tcp/18142") #base_node_grpc_address = "/ip4/127.0.0.1/tcp/18142" +# GRPC authentication for the base node (default = "none") +#base_node_grpc_authentication = { username = "miner", password = "$argon..." } # GRPC address of console wallet (default = "/ip4/127.0.0.1/tcp/18143") #wallet_grpc_address = "/ip4/127.0.0.1/tcp/18143" # GRPC authentication for the console wallet (default = "none") -#wallet_grpc_authentication = { username: "miner", password: "$argon..." } +#wallet_grpc_authentication = { username = "miner", password = "$argon..." } # Number of mining threads (default: number of logical CPU cores) #num_mining_threads = 8