Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skepticoin GUI (coming in 18 months) #83

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

refacktor
Copy link
Collaborator

@refacktor refacktor commented Jun 16, 2021

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 refacktor changed the title GUI: basic architecture POC - display wallet size and chain height Skepticoin GUI Jun 16, 2021
@lk16
Copy link
Collaborator

lk16 commented Jun 16, 2021

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?

@refacktor
Copy link
Collaborator Author

  • 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
Copy link
Collaborator Author

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.

@lk16
Copy link
Collaborator

lk16 commented Jun 17, 2021

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.

@refacktor
Copy link
Collaborator Author

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!

@sashimi-houdini
Copy link
Contributor

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.

@refacktor
Copy link
Collaborator Author

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.

@PiecePaperCode
Copy link

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.

@lk16
Copy link
Collaborator

lk16 commented Jan 10, 2022

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.

@PiecePaperCode
Copy link

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

@refacktor refacktor changed the title Skepticoin GUI Skepticoin GUI (coming in 18 months) Jun 5, 2022
@refacktor
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants