Commit graph

882 commits

Author SHA1 Message Date
hinto-janaiyo
00bf92f308 helper: p2pool - fix [Advanced] argument builder 2022-12-06 15:34:11 -05:00
hinto-janaiyo
5092f085d9 helper: p2pool - fix uptime, format with commas and spaces 2022-12-06 15:17:37 -05:00
hinto-janaiyo
24d43e83b5 helper: p2pool - process output regardless of API file status 2022-12-06 13:23:16 -05:00
hinto-janaiyo
03c38bef0c helper: p2pool - connect major [Helper] APIs to GUI thread
Lots of stuff in this commit:
1. Implement [Start/Stop/Restart] and make it not possible for
the GUI to interact with that UI if [Helper] is doing stuff.
This prevents the obviously bad situation where [Helper] is in
the middle of spawning P2Pool, but the user is still allowed to
start it again, which would spawn another P2Pool. The main GUI
matches on the state and disables the appropriate UI so the
user can't do this.

2. Sync P2Pool's [Priv] and [Pub] output so that the GUI thread
is only rendering it once a second. All of Gupax also refreshes
at least once a second now as well.

3. Match the [ProcessState] with some colors in the GUI

4. GUI thread no longer directly starts/stops/restarts a process.
It will call a function in [Helper] that acts as a proxy.

5. The tokio [async_spawn_p2pool_watchdog()] function that was
a clone of the PTY version (but had async stuff) and all of the
related functions like the async STDOUT/STDERR reader is now
completely gone. It doesn't make sense to write the same code
twice, both [Simple] and [Advanced] will have a PTY, only
difference being the [Simple] UI won't have an input box.

6. P2Pool's exit code is now examined, either success or failure

7. Output was moved into it's own [Arc<Mutex>]. This allows for
more efficient writing/reading since before I had to lock all of
[Helper], which caused some noticable deadlocks in the GUI.

8. New [tab] field in [State<Gupax>], and GUI option to select
the tab that Gupax will start on.
2022-12-05 22:50:00 -05:00
hinto-janaiyo
e171f5fa3f helper: p2pool - stdout payouts/xmr parser, priv -> pub functions 2022-12-05 14:55:50 -05:00
hinto-janaiyo
7764de27f3 helper: p2pool - fix args, basic watchdog loop, add STDOUT/STDERR handle to [Process] struct 2022-12-04 11:24:38 -05:00
hinto-janaiyo
f129c66d1c helper: translate priv p2pool/xmrig API into pub [Human*] structs 2022-12-03 20:12:40 -05:00
hinto-janaiyo
aab1c4294a helper: turn [Helper] fields into [Arc]'s, add p2pool watchdog 2022-12-03 16:02:34 -05:00
hinto-janaiyo
c49b7aa982 helper: add functions for p2pool/xmrig UI -> command arguments 2022-12-03 13:41:14 -05:00
hinto-janaiyo
94293822da main: fade in/out of black when resizing frame 2022-12-02 14:00:03 -05:00
hinto-janaiyo
2de7903d99 helper: map xmrig/p2pool JSON API key/values to structs for serde 2022-12-01 23:13:53 -05:00
hinto-janaiyo
76152cf1c5 helper: async read both STDOUT/STDERR in separate tokio runtime 2022-12-01 15:51:05 -05:00
hinto-janaiyo
03dcc19e73 helper: create wireframe of the [Helper::helper()] event loop 2022-11-30 22:03:49 -05:00
hinto-janaiyo
15bbe9b8bc helper: add initial struct, add [HumanTime] for formatting uptime 2022-11-30 17:21:55 -05:00
hinto-janaiyo
3ced8637e5 helper: add stdout/stderr pipe threads to model 2022-11-30 16:08:06 -05:00
hinto-janaiyo
f93a833f00 define gupax thread model (src/README.md) 2022-11-30 16:08:02 -05:00
hinto-janaiyo
3222693c35 command: implement basic data structures, functions
This adds the basic wireframe of how processes will be handled.
The data/funcs in [command.rs] will be the API the main GUI thread
uses to talk to child processes. The process thread will loop
every 1 second to read/write the necessary data (stdout, stdin),
and handle signals from the GUI thread (kill, restart, etc).
2022-11-28 12:05:09 -05:00
hinto-janaiyo
79988a41e0 p2pool: add sized, scrollable, selectable but not mutable console
This replaces the old mutable [TextEdit] with an immutable one
with a scroll area wrapped in a [Frame]. Passing a [&str] instead
of a [String] to [TextEdit] makes it auto-select only and not
mutable by the user. The background color is changed because the
immutable [TextEdit] has a hardcoded light gray color (same as the
general ui background).
2022-11-27 21:52:29 -05:00
hinto-janaiyo
2ada583275 main/update: add [Restart] state, set name to yellow if updated 2022-11-27 15:20:28 -05:00
hinto-janaiyo
9f31ab4694 xmrig: tls+keepalive default false (for p2pool) 2022-11-26 22:41:08 -05:00
hinto-janaiyo
c348cdaba1 xmrig: reorder "rig" to be last in list 2022-11-26 22:38:18 -05:00
hinto-janaiyo
790819c5b8 cargo cleanup 2022-11-26 22:26:32 -05:00
hinto-janaiyo
646459b6f3 app: resize only once on width diff, set static button size at init
A [must_resize] and [ctx.is_pointer_over_area()] is now used to
indicate we need a resizing. This makes it so when a user is
resizing the width of Gupax, the heavy [init_text_styles()] func
will only get called once when the user hovers over the GUI.

The button size is also now set in that function so it doesn't
have to be called in every separate tab.
2022-11-25 12:01:52 -05:00
hinto-janaiyo
3b8b00b33c main: implement [--reset-pools] 2022-11-24 21:06:29 -05:00
hinto-janaiyo
16f77d5a59 update: sanity check p2pool/xmrig path from user before starting
Define a strict list [&str; 4] of valid path endings for p2pool/xmrig.
This prevents users (for some reason) inputting a path to some
other (maybe very important) file which Gupax would have completely
overridden with the update binary. Windows paths end with [.exe].
2022-11-24 20:51:18 -05:00
hinto-janaiyo
174139efc5 Cargo update + clippy lint fixes 2022-11-23 23:03:56 -05:00
hinto-janaiyo
ad64bd87fa add utils/skel 2022-11-23 22:32:17 -05:00
hinto-janaiyo
9462459c85 [Simple/Advanced] for [Gupax/XMRig] tabs 2022-11-23 16:50:15 -05:00
hinto-janaiyo
56c4a2c236 node: add plowsof to community node list 2022-11-22 23:10:06 -05:00
hinto-janaiyo
a62d9c12a6 prepare v0.7.0 2022-11-22 23:02:05 -05:00
hinto-janaiyo
ac43d93cc9 utils: add package.sh 2022-11-22 13:58:39 -05:00
hinto-janaiyo
539764e0ed v0.5.0 2022-11-22 10:12:16 -05:00
hinto-janaiyo
6ae89b7e80 update: consolidate upgrade/rename loop
Since p2pool/xmrig could be running as well, this also applies the
windows old binary rename code to p2pool/xmrig.
2022-11-21 20:54:19 -05:00
hinto-janaiyo
b636013384 p2pool: refine ping auto_select 2022-11-21 20:11:31 -05:00
hinto-janaiyo
90ce2c913c gupax: consolidate FileWindow thread into separate function 2022-11-21 19:57:36 -05:00
hinto-janaiyo
12c1f67baa 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 17:25:38 -05:00
hinto-janaiyo
77d5daa93e log: date -> sec.milli since init 2022-11-20 20:26:50 -05:00
hinto-janaiyo
cd14297b50 node: handle [write!] error 2022-11-20 14:46:43 -05:00
hinto-janaiyo
d37d830952 update/ping: consolidate code in *::spawn_thread() 2022-11-20 14:20:25 -05:00
hinto-janaiyo
26eecd4b25 main/disk: get OS data path only once, pass ref for [state/node] 2022-11-20 13:31:00 -05:00
hinto-janaiyo
088aa56325 disk: add [ErrorState] handling for disk errors 2022-11-19 22:49:15 -05:00
hinto-janaiyo
20a73cbc67 main: prevent overflowing p2pool manual node index 2022-11-19 13:35:28 -05:00
hinto-janaiyo
4b7a4ad53b p2pool: use indexing for nodes instead of for loop comparisons 2022-11-19 13:03:33 -05:00
hinto-janaiyo
1ecd37b99d update: recreate tor client on failure in metadata loop 2022-11-19 09:43:38 -05:00
hinto-janaiyo
b3fbcf432d Update CHANGELOG.md 2022-11-18 21:47:14 -05:00
hinto-janaiyo
fcdd25b186 p2pool: implement async node ping in GUI 2022-11-18 14:30:55 -05:00
hinto-janaiyo
c352a4510b node: implement async ping 2022-11-17 22:45:57 -05:00
hinto-janaiyo
3e3c44e492 gupax: disable FileSelector ui if thread exists 2022-11-17 16:53:55 -05:00
hinto-janaiyo
27fa10c7ad gupax: add [FileWindow] selector for p2pool/xmrig path 2022-11-17 13:03:45 -05:00
hinto-janaiyo
bf3a14bfa2 update: use compiled + updated version in gupax version comparison
If the built-in compiled version of Gupax is the only version
getting compared when updating, an old Gupax instance will always
think there's a new version even if the user already updated and
the actual binaries are swapped. To prevent forcing users to
restart, the built-in compiled version gets compared as well as
the version stored in [Arc<Mutex<Version>>], which should get
updated in a successful Gupax update.
2022-11-16 21:14:21 -05:00