mirror of
https://github.com/creating2morrow/neveko.git
synced 2025-01-18 08:44:46 +00:00
add remote node flag to gui
This commit is contained in:
parent
7b50e6d666
commit
ed91849a27
3 changed files with 16 additions and 0 deletions
|
@ -120,6 +120,13 @@ pub struct Args {
|
||||||
default_value = "false"
|
default_value = "false"
|
||||||
)]
|
)]
|
||||||
pub remote_node: bool,
|
pub remote_node: bool,
|
||||||
|
/// Dummy flag for normal mode when not using remote node
|
||||||
|
#[arg(
|
||||||
|
long,
|
||||||
|
help = "dummy flag for normal node operations. (Future use)",
|
||||||
|
default_value = "false"
|
||||||
|
)]
|
||||||
|
pub full_node: bool,
|
||||||
/// Connect to micro servers
|
/// Connect to micro servers
|
||||||
#[arg(
|
#[arg(
|
||||||
long,
|
long,
|
||||||
|
|
|
@ -85,6 +85,7 @@ pub struct Connections {
|
||||||
pub blockchain_dir: String,
|
pub blockchain_dir: String,
|
||||||
pub daemon_host: String,
|
pub daemon_host: String,
|
||||||
pub i2p_zero_dir: String,
|
pub i2p_zero_dir: String,
|
||||||
|
pub is_remote_node: bool,
|
||||||
pub mainnet: bool,
|
pub mainnet: bool,
|
||||||
pub monero_location: String,
|
pub monero_location: String,
|
||||||
pub rpc_credential: String,
|
pub rpc_credential: String,
|
||||||
|
@ -98,6 +99,7 @@ impl Default for Connections {
|
||||||
blockchain_dir: String::from("/home/user/.bitmonero"),
|
blockchain_dir: String::from("/home/user/.bitmonero"),
|
||||||
daemon_host: String::from("http://localhost:38081"),
|
daemon_host: String::from("http://localhost:38081"),
|
||||||
i2p_zero_dir: String::from("/home/user/i2p-zero-linux.v1.21"),
|
i2p_zero_dir: String::from("/home/user/i2p-zero-linux.v1.21"),
|
||||||
|
is_remote_node: false,
|
||||||
mainnet: false,
|
mainnet: false,
|
||||||
monero_location: String::from("/home/user/monero-x86_64-linux-gnu-v0.18.2.2"),
|
monero_location: String::from("/home/user/monero-x86_64-linux-gnu-v0.18.2.2"),
|
||||||
rpc_credential: String::from("pass"),
|
rpc_credential: String::from("pass"),
|
||||||
|
@ -140,6 +142,7 @@ impl ReleaseEnvironment {
|
||||||
/// start core module from gui
|
/// start core module from gui
|
||||||
pub fn start_core(conn: &Connections) {
|
pub fn start_core(conn: &Connections) {
|
||||||
let env = if !conn.mainnet { "dev" } else { "prod" };
|
let env = if !conn.mainnet { "dev" } else { "prod" };
|
||||||
|
let remote_node = if !conn.is_remote_node { "--full-node" } else { "--remote-node" };
|
||||||
let args = [
|
let args = [
|
||||||
"--monero-location",
|
"--monero-location",
|
||||||
&conn.monero_location,
|
&conn.monero_location,
|
||||||
|
@ -157,6 +160,7 @@ pub fn start_core(conn: &Connections) {
|
||||||
&conn.i2p_zero_dir,
|
&conn.i2p_zero_dir,
|
||||||
"-r",
|
"-r",
|
||||||
env,
|
env,
|
||||||
|
remote_node
|
||||||
];
|
];
|
||||||
let output = std::process::Command::new("./neveko")
|
let output = std::process::Command::new("./neveko")
|
||||||
.args(args)
|
.args(args)
|
||||||
|
|
|
@ -261,6 +261,11 @@ impl eframe::App for HomeApp {
|
||||||
ui.text_edit_singleline(&mut self.connections.i2p_zero_dir)
|
ui.text_edit_singleline(&mut self.connections.i2p_zero_dir)
|
||||||
.labelled_by(cm_i2p_dir_label.id);
|
.labelled_by(cm_i2p_dir_label.id);
|
||||||
});
|
});
|
||||||
|
let mut is_remote_node = self.connections.is_remote_node;
|
||||||
|
if ui.checkbox(&mut is_remote_node, "remote node").changed() {
|
||||||
|
self.connections.is_remote_node = !self.connections.is_remote_node;
|
||||||
|
log::debug!("is remote node: {}", self.connections.is_remote_node);
|
||||||
|
}
|
||||||
// let mut is_mainnet = self.connections.mainnet;
|
// let mut is_mainnet = self.connections.mainnet;
|
||||||
// if ui.checkbox(&mut is_mainnet, "mainnet").changed() {
|
// if ui.checkbox(&mut is_mainnet, "mainnet").changed() {
|
||||||
// self.connections.mainnet = !self.connections.mainnet;
|
// self.connections.mainnet = !self.connections.mainnet;
|
||||||
|
|
Loading…
Reference in a new issue