2022-10-01 16:58:22 +00:00
// Gupax - GUI Uniting P2Pool And XMRig
//
// Copyright (c) 2022 hinto-janaiyo
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
2022-11-24 04:03:56 +00:00
pub const GUPAX_VERSION : & str = concat! ( " v " , env! ( " CARGO_PKG_VERSION " ) ) ;
pub const P2POOL_VERSION : & str = " v2.4 " ;
pub const XMRIG_VERSION : & str = " v6.18.0 " ;
pub const COMMIT : & str = include_str! ( " ../.git/refs/heads/main " ) ;
2022-10-01 16:58:22 +00:00
2022-11-23 04:21:46 +00:00
// App frame resolution, [16:10] aspect ratio, height = width * 1.6
pub const APP_MIN_WIDTH : f32 = 768.0 ;
pub const APP_MIN_HEIGHT : f32 = 480.0 ;
pub const APP_MAX_WIDTH : f32 = 3456.0 ;
pub const APP_MAX_HEIGHT : f32 = 2160.0 ;
// Default, 1280x800
pub const APP_DEFAULT_WIDTH : f32 = 1280.0 ;
pub const APP_DEFAULT_HEIGHT : f32 = 800.0 ;
2022-10-31 20:08:25 +00:00
// Use macOS shaped icon for macOS
#[ cfg(target_os = " macos " ) ]
pub const BYTES_ICON : & [ u8 ] = include_bytes! ( " ../images/icons/icon@2x.png " ) ;
#[ cfg(not(target_os = " macos " )) ]
pub const BYTES_ICON : & [ u8 ] = include_bytes! ( " ../images/icons/icon.png " ) ;
pub const BYTES_BANNER : & [ u8 ] = include_bytes! ( " ../images/banner.png " ) ;
2022-11-24 04:03:56 +00:00
pub const P2POOL_BASE_ARGS : & str = " " ;
pub const XMRIG_BASE_ARGS : & str = " --http-host=127.0.0.1 --http-port=18088 --algo=rx/0 --coin=Monero " ;
pub const HORIZONTAL : & str = " -------------------------------------------- " ;
2022-10-01 16:58:22 +00:00
2022-10-27 03:15:56 +00:00
// This is the typical space added when using
// [ui.separator()] or [ui.group()]
// Used for subtracting the width/height so
// things actually line up.
pub const SPACE : f32 = 10.0 ;
2022-11-23 04:21:46 +00:00
// Some colors
pub const RED : egui ::Color32 = egui ::Color32 ::from_rgb ( 230 , 50 , 50 ) ;
pub const GREEN : egui ::Color32 = egui ::Color32 ::from_rgb ( 100 , 230 , 100 ) ;
pub const YELLOW : egui ::Color32 = egui ::Color32 ::from_rgb ( 230 , 230 , 100 ) ;
pub const LIGHT_GRAY : egui ::Color32 = egui ::Color32 ::LIGHT_GRAY ;
pub const BLACK : egui ::Color32 = egui ::Color32 ::BLACK ;
2022-11-28 17:05:09 +00:00
// [Duration] constants
pub const SECOND : std ::time ::Duration = std ::time ::Duration ::from_secs ( 1 ) ;
2022-12-01 02:58:32 +00:00
pub const TOKIO_SECOND : tokio ::time ::Duration = std ::time ::Duration ::from_secs ( 1 ) ;
2022-11-28 17:05:09 +00:00
2022-10-01 16:58:22 +00:00
// OS specific
#[ cfg(target_os = " windows " ) ]
pub const OS : & 'static str = " Windows " ;
#[ cfg(target_os = " windows " ) ]
2022-10-29 13:13:00 +00:00
pub const OS_NAME : & 'static str = " Windows " ;
2022-10-01 16:58:22 +00:00
#[ cfg(target_os = " macos " ) ]
pub const OS : & 'static str = " macOS " ;
#[ cfg(target_os = " macos " ) ]
2022-10-17 00:36:58 +00:00
pub const OS_NAME : & 'static str = " macOS " ;
2022-10-01 16:58:22 +00:00
#[ cfg(target_os = " linux " ) ]
2022-11-24 04:03:56 +00:00
pub const OS : & str = " 🐧 Linux " ;
2022-10-01 16:58:22 +00:00
#[ cfg(target_os = " linux " ) ]
2022-11-24 04:03:56 +00:00
pub const OS_NAME : & str = " Linux " ;
2022-10-01 16:58:22 +00:00
// Tooltips
// Gupax
2022-11-24 04:03:56 +00:00
pub const GUPAX_UPDATE : & str = " Check for updates on Gupax, P2Pool, and XMRig via GitHub's API and upgrade automatically " ;
pub const GUPAX_AUTO_UPDATE : & str = " Automatically check for updates at startup " ;
cargo/tor/p2pool: clean deps, warn macos arti, fix node overflow
Cargo: Cleanup unused dependencies, enable some build optimizations
Tor: Arti doesn't seem to work on macOS
Even a bare Arti+Hyper request doesn't seem to work, so it's
probably not something to do with Gupax. A lot of issues only
seem to popup in a VM (OpenGL, TLS) even though on bare metal
Gupax runs fine, so Tor might work fine on real macOS but I don't
have real macOS to test it. VM macOS can't create a circuit, so,
disable by default and add a warning that it's unstable.
P2Pool: Let selected_index start at 0, and only +1 when printing
to the user, this makes the overflow math when adding/deleting a
lot more simple because selected_index will match the actual index
of the node vector
2022-11-21 22:16:31 +00:00
#[ cfg(not(target_os = " macos " )) ]
2022-11-24 04:03:56 +00:00
pub const GUPAX_UPDATE_VIA_TOR : & str = " Update through the Tor network. Tor is embedded within Gupax; a Tor system proxy is not required " ;
cargo/tor/p2pool: clean deps, warn macos arti, fix node overflow
Cargo: Cleanup unused dependencies, enable some build optimizations
Tor: Arti doesn't seem to work on macOS
Even a bare Arti+Hyper request doesn't seem to work, so it's
probably not something to do with Gupax. A lot of issues only
seem to popup in a VM (OpenGL, TLS) even though on bare metal
Gupax runs fine, so Tor might work fine on real macOS but I don't
have real macOS to test it. VM macOS can't create a circuit, so,
disable by default and add a warning that it's unstable.
P2Pool: Let selected_index start at 0, and only +1 when printing
to the user, this makes the overflow math when adding/deleting a
lot more simple because selected_index will match the actual index
of the node vector
2022-11-21 22:16:31 +00:00
#[ cfg(target_os = " macos " ) ] // Arti library has issues on macOS
pub const GUPAX_UPDATE_VIA_TOR : & 'static str = " WARNING: This option is unstable on macOS. Update through the Tor network. Tor is embedded within Gupax; a Tor system proxy is not required " ;
2022-11-24 04:03:56 +00:00
pub const GUPAX_ASK_BEFORE_QUIT : & str = " Ask before quitting Gupax " ;
pub const GUPAX_SAVE_BEFORE_QUIT : & str = " Automatically save any changed settings before quitting " ;
pub const GUPAX_WIDTH : & str = " Set the width of the Gupax window " ;
pub const GUPAX_HEIGHT : & str = " Set the height of the Gupax window " ;
pub const GUPAX_LOCK_WIDTH : & str = " Automatically match the height against the width in a 16:10 ratio; aka HEIGHT = WIDTH / 1.6 " ;
pub const GUPAX_LOCK_HEIGHT : & str = " Automatically match the width against the height in a 16:10 ratio; aka WIDTH = HEIGHT * 1.6 " ;
pub const GUPAX_NO_LOCK : & str = " Allow individual selection of width and height " ;
pub const GUPAX_SET : & str = " Set the width/height of the Gupax window to the current values " ;
pub const GUPAX_SIMPLE : & str =
2022-11-23 04:21:46 +00:00
r #" Use simple Gupax settings:
- Update button
- Basic toggles " #;
2022-11-24 04:03:56 +00:00
pub const GUPAX_ADVANCED : & str =
2022-11-23 04:21:46 +00:00
r #" Use advanced Gupax settings:
- Update button
- Basic toggles
- P2Pool / XMRig binary path selector
- Gupax resolution sliders " #;
2022-11-24 04:03:56 +00:00
pub const GUPAX_SELECT : & str = " Open a file explorer to select a file " ;
pub const GUPAX_PATH_P2POOL : & str = " The location of the P2Pool binary: Both absolute and relative paths are accepted; A red [X] will appear if there is no file found at the given path " ;
pub const GUPAX_PATH_XMRIG : & str = " The location of the XMRig binary: Both absolute and relative paths are accepted; A red [X] will appear if there is no file found at the given path " ;
2022-11-23 04:21:46 +00:00
2022-10-01 16:58:22 +00:00
// P2Pool
2022-11-24 04:03:56 +00:00
pub const P2POOL_MAIN : & str = " Use the P2Pool main-chain. This P2Pool finds shares faster, but has a higher difficulty. Suitable for miners with more than 50kH/s " ;
pub const P2POOL_MINI : & str = " Use the P2Pool mini-chain. This P2Pool finds shares slower, but has a lower difficulty. Suitable for miners with less than 50kH/s " ;
pub const P2POOL_OUT : & str = " How many out-bound peers to connect to? (you connecting to others) " ;
pub const P2POOL_IN : & str = " How many in-bound peers to allow? (others connecting to you) " ;
pub const P2POOL_LOG : & str = " Verbosity of the console log " ;
pub const P2POOL_AUTO_NODE : & str = " Automatically ping the community Monero nodes at Gupax startup " ;
pub const P2POOL_AUTO_SELECT : & str = " Automatically select the fastest community Monero node after pinging " ;
pub const P2POOL_SELECT_FASTEST : & str = " Select the fastest community Monero node " ;
pub const P2POOL_PING : & str = " Ping the built-in community Monero nodes " ;
pub const P2POOL_ADDRESS : & str = " You must use a primary Monero address to mine on P2Pool (starts with a 4). It is highly recommended to create a new wallet for P2Pool mining; wallet addresses are public on P2Pool! " ;
2022-12-03 18:37:57 +00:00
pub const P2POOL_ARGUMENTS : & str = " Start P2Pool with these arguments and override all below settings; If the [--data-api] & [--local-api] flag is not given, Gupax will append it to the arguments automatically so that the [Status] tab can work " ;
2022-11-24 04:03:56 +00:00
pub const P2POOL_SIMPLE : & str =
2022-11-23 04:21:46 +00:00
r #" Use simple P2Pool settings:
2022-11-14 02:56:25 +00:00
- Remote community Monero node
- Default P2Pool settings + Mini " #;
2022-11-24 04:03:56 +00:00
pub const P2POOL_ADVANCED : & str =
2022-11-23 04:21:46 +00:00
r #" Use advanced P2Pool settings:
2022-11-14 02:56:25 +00:00
- Overriding command arguments
2022-11-23 04:21:46 +00:00
- Manual node list
2022-11-14 02:56:25 +00:00
- P2Pool Main / Mini selection
- Out / In peer setting
- Log level setting " #;
2022-11-24 04:03:56 +00:00
pub const P2POOL_NAME : & str = " Add a unique name to identify this node; Only [A-Za-z0-9-_] and spaces allowed; Max length = 30 characters " ;
pub const P2POOL_NODE_IP : & str = " Specify the Monero Node IP to connect to with P2Pool; It must be a valid IPv4 address or a valid domain name; Max length = 255 characters " ;
pub const P2POOL_RPC_PORT : & str = " Specify the RPC port of the Monero node; [1-65535] " ;
pub const P2POOL_ZMQ_PORT : & str = " Specify the ZMQ port of the Monero node; [1-65535] " ;
2022-11-23 04:21:46 +00:00
// Node/Pool list
2022-11-24 04:03:56 +00:00
pub const LIST_ADD : & str = " Add the current values to the list " ;
pub const LIST_SAVE : & str = " Save the current values to the already existing entry " ;
pub const LIST_DELETE : & str = " Delete the currently selected entry " ;
pub const LIST_CLEAR : & str = " Clear all current values " ;
2022-11-11 02:20:31 +00:00
2022-10-01 16:58:22 +00:00
// XMRig
2022-11-24 04:03:56 +00:00
pub const XMRIG_SIMPLE : & str =
2022-11-23 04:21:46 +00:00
r #" Use simple XMRig settings:
- Mine to local P2Pool ( localhost :3333 )
- CPU thread slider
- HTTP API @ localhost :18088 " #;
2022-11-24 04:03:56 +00:00
pub const XMRIG_ADVANCED : & str =
2022-11-23 04:21:46 +00:00
r #" Use advanced XMRig settings:
- Overriding config file
- Custom payout address
- CPU thread slider
- Manual pool list
- TLS setting
- Keepalive setting
- Custom HTTP API IP / Port " #;
2022-12-03 18:37:57 +00:00
pub const XMRIG_ARGUMENTS : & str = " Start XMRig with these arguments and override all below settings; If the [http-api] options are not set, Gupax will append it to the arguments automatically so that the [Status] tab can work " ;
2022-11-24 04:03:56 +00:00
pub const XMRIG_ADDRESS : & str = " Specify which Monero address to send payouts to; Must be a valid primary address (starts with 4) " ;
pub const XMRIG_NAME : & str = " Add a unique name to identify this pool; Only [A-Za-z0-9-_] and spaces allowed; Max length = 30 characters " ;
pub const XMRIG_IP : & str = " Specify the pool IP to connect to with XMRig; It must be a valid IPv4 address or a valid domain name; Max length = 255 characters " ;
pub const XMRIG_PORT : & str = " Specify the port of the pool; [1-65535] " ;
2022-11-27 03:35:46 +00:00
pub const XMRIG_RIG : & str = " Add an optional rig ID. This will be the name shown on the pool; Only [A-Za-z0-9-_] and spaces allowed; Max length = 30 characters " ;
2022-11-24 04:03:56 +00:00
pub const XMRIG_PAUSE : & str = " THIS SETTING IS DISABLED IF SET TO [0]. Pause mining if user is active, resume after " ;
pub const XMRIG_API_IP : & str = " Specify which IP to bind to for XMRig's HTTP API " ;
pub const XMRIG_API_PORT : & str = " Specify which port to bind to for XMRig's HTTP API " ;
pub const XMRIG_TLS : & str = " Enable SSL/TLS connections (needs pool support) " ;
pub const XMRIG_KEEPALIVE : & str = " Send keepalived packet to prevent timeout (needs pool support) " ;
pub const XMRIG_THREADS : & str = " Number of CPU threads to use for mining " ;
2022-10-16 21:29:24 +00:00
// CLI argument messages
2022-11-24 04:03:56 +00:00
pub const ARG_HELP : & str =
2022-11-20 02:20:28 +00:00
r #" USAGE: ./gupax [--flag]
2022-10-16 21:29:24 +00:00
2022-11-20 02:20:28 +00:00
- - help Print this help message
- - version Print version and build info
- - state Print Gupax state
- - nodes Print the manual node list
- - no - startup Disable all auto - startup settings for this instance
- - reset - state Reset all Gupax state ( your settings )
- - reset - nodes Reset the manual node list in the [ P2Pool ] tab
2022-11-25 02:03:42 +00:00
- - reset - pools Reset the manual pool list in the [ XMRig ] tab
2022-11-23 04:21:46 +00:00
- - reset - all Reset the state , the manual node list , and the manual pool list
2022-11-20 02:20:28 +00:00
- - ferris Print an extremely cute crab
2022-11-14 02:56:25 +00:00
To view more detailed console debug information , start Gupax with
the environment variable [ RUST_LOG ] set to a log level like so :
RUST_LOG = ( trace | debug | info | warn | error ) . / gupax " #;
2022-11-24 04:03:56 +00:00
pub const ARG_COPYRIGHT : & str =
2022-11-02 22:18:41 +00:00
r #" Gupax is licensed under GPLv3.
For more information , see link below :
< https ://github.com/hinto-janaiyo/gupax>"#;