How difficult would it be to develop a simple Graphical User Interface (GUI) for the test nets?
This looked promising, worth pinging @DeusNexus to know where this is at, and whether he’s planning to bring this up to date for the next testnets (most of key/wallet command have either changed or being deprecated with the introduction of DBC)
More bother than is worth unless we are a good few months from release with @JimCollinson s UI
@DeusNexus would have a LOT of work to do for short term gain.
Learn the CLI, its not that difficult
Yeah, I did propose it, and we did discussed it, but it would end up effectively pushing the development out for weeks/months and mean that we couldn’t iterate on the testnets so quickly.
Should we get to a point were we need a far wider pool of testers then it may be worth it, and of course when we want to start testing the GUIs themselves it will be necessary. But we are probably talking Maxwell era there.
Are there any specific difficulties folk are finding with the CLI that the need some help with? Perhaps we need better docs, or a video explainer?
It could be done fairly easily with a python script (simply invoking cli and grabbing stdout) along side a QT or something like Kivra interface, but what would be the goal that the current scripts don’t support?
I was waiting for the CLI to get updated as they were going to remove authd (or just not use it). It’s not too much effort to update the back-end of the gui with the new CLI commands, majority stays the same.
I’m mostly interested to get this working with electronjs for cross-platform compatibility.
Yeah, your stuff is pretty much the gold standard in this area. What I want to eventually contribute along with @riddim is a proper python toolkit to make SAFE api-available to other systems, but the pace of change/development atm makes it pointless until things stabilize and the ffi layer is available and current again.
I do think we should probably make it easier for users to get something running that’s not just a local network. For example, we could have some kind of packages available that setup a node as a service and get it running.
What form it would take though, I’m not exactly sure. I’m a command line guy myself, so I personally don’t really care too much about having a GUI. You could make something like the sn_testnet_tool
a lot more generic and user facing, that would give people the ability to get a setup running on a cloud provider, but that would be for more technically inclined people.
Thank you for this question!..
It prompted that I search for “rust GUI” and then find an fltk Mo_Al_ - YouTube which becomes just a copy paste exercise for creating a simple window with tabs and adding in bits, makes the difference. So, within an hour I had something more than I expected.
So, to answer the question - very easy… a bit of spare time over a couple of weeks and I have this below. If all you have is an idea, it seems that rust makes that possible… not rocket science; more like waking up and being able to speak a new language…
The difficulty comes trying to push the limit of what is possible and polish clinks in what is available as copy-paste … so, fltk is a work in progress and without a GPU seems not to render perfectly; still it is extraordinary - more of fltk at fltk - Rust
So, an example of what is possible then…
This works only on LInux 64bit atm and only works in the sense of tempting that with a network it would be useful… but if you have and old safe instance installed it should just try to work and fail on no responses from the network… saves files and logs to ./Downloads/
If you want to give it a go, download binary: https://github.com/davidpbrown/hammer/raw/main/hammer
Make it executable and run with
chmod +x ./hammer
./hammer
Screenshots
and it works in 56 languages - picks up the user preferred language or you can force it with two letter iso8601 code like
hammer el
hammer zh
I spent lot more time trying to get cross compiling working than learning rust!.. and still not there… I can do gnu Windows binary but not MSVC; and zig doesn’t work OSx for fltk but I guess native machines might compile… though it’s setup for Linux with safe > log and I don’t know if Windows and Mac bash action exactly the same… and what option there is if Windows does not have bash. Still, useful for me learning the basics of rust.
We’ll see what difference the new testnet is but any of the basic commands being the same, this above should just work, as it’s just making request to the CLI. The advantage of that over trying to integrate it, is that you can close the GUI and terminal and the download and logs will still capture what the network responds with. There are more complex questions about how to allow the user control to stop existing requests but it works as a useful graphic coversheet on the CLI, which in part answers a question!
edit: added Windows binary which is set to use START \B
instead of bash https://github.com/davidpbrown/hammer/blob/main/hammer.exe
Fantastic work hopefully we will have a new test net to try it out on soon
Great work @davidpbrown, very nice to see and adding new options.
There’s a good thread on the Rust forum you may have found in your searches, which gives good coverage of Rust GUI options.
The one I tried most and found very attractive is Tauri:
Yes… I’ve seen a number of lists of the unfamiliar for GUIs but I’ve not had good experience with JS and not wanting to read a book first, jumped on what works intuitively. Also, complexity adds risk and I’d rather have the risk within one app, than compounded by whatever browser and multiple languages… depends the app but perhaps options can be built if there is a secure safe browser that is trustable not just for browsing.
Also, the idea above was just a GUI that prompts the CLI to action - rather than owning the result and needing to wait on that. So, the result follows outside the app, which for testing perhaps is useful to see the same results as direct CLI use.
I think the key takeaway from trying, is that it is now the idea that matters - understanding clearly what is wanted, there are then many options that most anybody could craft.
If the network is doing the heavy lifting, then alsorts of simple tools can arise.
Excellent work thank you - looking forward to trying it out
But…
I thought the idea was for the clients to do the heavy work…
Very cool Mr. Brown!
When I cat it says [result → ./Downloads/2021-09-04_13:02+48333 UTC/file] but I am not seeing it there?
Using cli33.3 node9.1
Edit: Hold on. it showed up once I closed the info pop-up.
Thanks… I might check the order that is happening.
The request typically writes a log to ./Downloads/timestamp but might have the message first.
Also if not clear, the results from network or errors from no network, might appear later when GUI is closed as safe process continues in the background from the CLI actioning that.
Also to note this makes no use of node just the cli.
Fltk is easy and simple, but may not be a good long term solution. I would recommend something else like gtk and qt with wayland support before you spend too much time on it. Or just make it browser based, which would be cross platform by default.
this is the winning strategy.
Yes… it is only because it was easy and simple… it is rough around the edges… but monkey hits keyboard gets result, is worth showing for visibility that not everything is necessarily hard.
Polished options will need to draw on what is understood as secure and cross platform… but cross platform might be possible just compiling on a cloud instance of each OS??
Still this might help as something in the absence of nothing to help test … and more done for me learning rust…
As above, I’m wary of trusting browsers; qt I only associate with bitcoind which was clunky but perhaps that’s unfair.
I liked the idea of a rust front end being possible… that tempts option to call safe-cli libraries at compile time but I can’t quite get my head around the problem of having to wait for responses from the network… relative to the application being shutdown.
This option made sense as it is simply a front that makes bash calls and drops them with & to run in the background… so the response is always received to the downloaded files and even errors from the network get collected into the log files.
So, first the ideas of what is useful and possible - then pick your tool.
btw the name as hammer is simple that anyone should be able to pick it up and use it… just like fltk… it’s not art but functional.
Thank you! This is perfect.