skepticoin icon indicating copy to clipboard operation
skepticoin copied to clipboard

Skepticoin GUI (coming in 18 months)

Open refacktor opened this issue 3 years ago • 11 comments

This Draft PR is an initial proof of concept to demonstrate one possible architecture for a Skepticoin GUI.

Architecture:

The basic idea is to run an embedded HTTP Server in the Skepticoin Python code, and fire up a browser based app. The embedded HTTP Server has access to all the Skepticoin data structures such as wallet, blockchain, and peer connections. The browser based app uses a combination of GET api calls and EventSource to get information from the Python runtime.

Testing:

Run from this branch with:

python -c 'from skepticoin.scripts.gui import main; main()'

refacktor avatar Jun 16 '21 03:06 refacktor

Very nice. I was thinking of implementing this almost the same.

Some ideas:

  • Use flask instead of the stdlib http.server? IMO it's worth adding a dependency to gain some readability/maintainability.
  • This now runs as a standalone script, should this be enabled with a --gui flag for mine and other commands?

lk16 avatar Jun 16 '21 06:06 lk16

  • Use flask instead of the stdlib http.server? IMO it's worth adding a dependency to gain some readability/maintainability.

Good idea. I'll look into this for the next iteration. Also, I like it that documentation exists on how to integrate Flask with other front-end frameworks such as React etc.

  • This now runs as a standalone script, should this be enabled with a --gui flag for mine and other commands?

It's a GUI, my first thought is that there would be buttons and other GUI controls in the GUI, not additional commands in the CLI.

refacktor avatar Jun 16 '21 08:06 refacktor

Flask was pretty easy to add. Over the weekend I'll look into integrating ReactJS. My initial goal (MVP) is to be able to visualize the blockchain in the browser.

refacktor avatar Jun 17 '21 01:06 refacktor

I checked the code so far, looks nice.

Do we have a risk of race-conditions when a miner and your gui would run on the same wallet and chain at the same time?

I will be on holidays, so from Friday you won't see me here for a week.

lk16 avatar Jun 17 '21 15:06 lk16

There will be no race conditions because only one process can bind to the peer port, 2412. You'll be able to start mining threads from within the GUI, without conflict.

Enjoy your holidays!

refacktor avatar Jun 17 '21 20:06 refacktor

My 2 cents on the architecture: the main value a GUI would bring to the project in my eyes would be to make skepticoin accessible to those that are skeptical to cryptocurrencies, but not tech savvy enough to work on a command line. This includes the process of starting up the GUI with a single click. I did not look at the code yet, but an architecture with a separate server which is to be accessed via the browser sounds a bit more complicated than that.

sashimi-houdini avatar Oct 18 '21 06:10 sashimi-houdini

starting up the GUI with a single click

There are ways to package it up so that it launches in one click. I don't know how they did it but pgAdmin (https://www.pgadmin.org/development/) accomplishes this. It uses this same architecture and launches with one click after it's been installed.

refacktor avatar Oct 19 '21 02:10 refacktor

i would suggest to not package a GUI inside the skepticoin core code. why not use git submodule instead? what if our overlord @sashimi-houdini would create an gui lib where people could pull request into it ?

Trivia This is somthing i always hated about bitcoin that everything is put together in one just huge repo. i love how simlpy and neat this repo presents itself that a coder can understand its inner workings in a couple of hours.

PiecePaperCode avatar Jan 10 '22 17:01 PiecePaperCode

Considering the activity of development in the last few months I wouldn't be too concerned about seeing a GUI inside this repo any time soon, if ever.

lk16 avatar Jan 10 '22 18:01 lk16

i cloned the pr and run it. its not compatible with the current version. when trying to merge. it requires some work to make it run

PiecePaperCode avatar Jan 11 '22 12:01 PiecePaperCode

This PR was intended as a proof of concept just to check how hard or easy it would be. Other contributors are welcome to continue where I left off. I have updated the issue title to say it is "coming in 18 months" which is a common way to acknowledge missing features in crypto projects.

refacktor avatar Jun 05 '22 21:06 refacktor