Page 1 of 5

nameGUI - an RPC frontend GUI

Posted: Fri May 22, 2015 2:16 pm
by phelix
Image

v0.3.3 secure Name trading transaction creation, better value display with clickable links, data input forms for d/ and id/, client auth cookie (needs testing), bugfixes, value parsing, more bugfixes, unit testing introduced, better value display, even more bugfixes

v0.2 featuring handling of locked wallets and instant name lookup. Also I actually switched to Namecoin Core for development (but it should still work with v0.3.80, too, let me know if it does not). There now are two command line options you can use to change folders nameGUI is searching for it's own data and the namecoin conf file: 'datadir' and 'namecoindatadir'.

github/phelix/nameGUI
Windows installer (see signed sha256 below)

To run from source (Linux/OSX/Windows):
'pip install validators'
'python ./namegui.py'

The Namecoin Core client needs to be up and running with synced blockchain. Find source and binaries here.
See the NMControl readme for info on how to set up the client conf file: https://github.com/namecoin/nmcontrol

Please help and test but don't bet the farm on it yet.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

$ shasum -a 256 nameGUI_v0.3.3_setup.exe
915fafc8e5470940a31353df6856befa3c356bc3907257189983ed2ad97f9d73 nameGUI_v0.3.3_setup.exe

id/phelix


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBCAAGBQJWp6nPAAoJEMv5QLdyEy4Y0T4IAKpKjMpPXDGBpH/ERq58XavU
DuWEKhgykprTrU7xeJjRzDLQPU3tatIdlKAPqMBHcxURziBRF4GzV4hIdy7meKX9
AXw5yIGKGzKZQORjyRPsizdvYIwMPlEKr3EjfvNw8D44SvpFNBMKiHKapYP2MEuj
del/XjhRDyxnXP468gz7jCIzrlYmZTLPXzUaY1VQFUa36nGs8ko+xU1b/PYyNCu2
fEqAr2VXgP4WdmUT0H5znxWwkPtXSTeqj9JaKJ2SxFxdWiBNHa8v+m6dAmvrRq9O
8Y+twCP9pQf2CZc+YF17RSlj/Cpw+pC3AtNXH+H/0es0a1jV3OrgjoZs8WQ6Neg=
=SG+Y
-----END PGP SIGNATURE-----



[heavily edited]

Re: nameGUI - an RPC frontend GUI

Posted: Fri May 22, 2015 2:20 pm
by phelix
btw: I did only test it with Namecoin v0.3.80. It would be nice if somebody could tell me whether it works with Namecoin Core.

Re: nameGUI - an RPC frontend GUI

Posted: Fri May 22, 2015 10:44 pm
by biolizard89
Hmm, nice work. Haven't tested yet.

Would it be feasible to rebase on Py3Qt5? That way we could share the UI code with Armory (less work, yay!). FYI indolering and I are playing around with a JSON generator GUI (just letting you know so that we don't accidentally have duplicated effort).

@indolering, feedback on the usability of this UI would be awesome.

Re: nameGUI - an RPC frontend GUI

Posted: Sat May 23, 2015 1:31 am
by cassini
Definitely needs some instructions on how to run an MS-Win program on OSX and Linux. :lol:
Here we go:


edit namegui.py, line 8, remove favicon
edit namegui.py, line 104, remove default favicon
edit lib/namerpc.py, line 222, replace os.environ["HOME"] with environ["HOME"]
(because "os" and "os.environ" result in "global name is not defined" errors)

python namegui.py

... and lo and behold, it works! Just amazing. It was developed on a Windows PC (I guess), and it runs on OSX out of the box, with only minor tweaking.


Tested with Namecoin-Qt 0.3.80 for OSX.


Namecoin Core does not cooperate with namegui.py.
Line 262 in lib/namerpc.py (sendtoname "") throws an InvalidAddressOrKeyError.


Haven't tried any name operations, yet.
I found one serious bug, so far. Enter any combining character (e.g. grave, acute, tilde, circumflex) in a text box, and the program crashes with
Python[1989:5194914] -[__NSCFConstantString characterAtIndex:]: Range or index out of bounds

and one minor issue:
Every 3 seconds the line "Model RPC update" flickers with alternating text messages "waiting..." and "working...". At the same rate of once every 3 seconds, debug.log gets filled with these 385 bytes worth of text:
ThreadRPCServer method=sendtoaddress
ThreadRPCServer method=getblockcount
ThreadRPCServer method=getblockhash
ThreadRPCServer method=getblock
ThreadRPCServer method=getblockhash
ThreadRPCServer method=getblock
ThreadRPCServer method=getblockhash
ThreadRPCServer method=getblock
ThreadRPCServer method=getblockcount
ThreadRPCServer method=getblockhash
ThreadRPCServer method=getbalance

which results in 4.05 Gigabytes a year.

Aside that, excellent work!

Re: nameGUI - an RPC frontend GUI

Posted: Sun May 24, 2015 12:47 pm
by phelix
biolizard89 wrote:Hmm, nice work. Haven't tested yet.

Would it be feasible to rebase on Py3Qt5? That way we could share the UI code with Armory (less work, yay!).
Sorry, at the moment I don't feel like doing it. nameGUI is very lightweight don't want to burden it with Py3Qt5. Also I know my way around Tkinter but not Qt. I plan on making it work with Python3, though.
FYI indolering and I are playing around with a JSON generator GUI (just letting you know so that we don't accidentally have duplicated effort).
Would it be useful to stuff it into nameGUI? If you make it available to me I will be happy to take a look.

In any case I will try to separate GUI and JSON generation to some extent. More important than saving a little work would be uniform JSON output.
@indolering, feedback on the usability of this UI would be awesome.
open for suggestions.

cassini wrote:Definitely needs some instructions on how to run an MS-Win program on OSX and Linux. :lol:
Here we go:

edit namegui.py, line 8, remove favicon
edit namegui.py, line 104, remove default favicon
edit lib/namerpc.py, line 222, replace os.environ["HOME"] with environ["HOME"]
(because "os" and "os.environ" result in "global name is not defined" errors)

python namegui.py
thanks for the feedback. Should be fixed / worked around now.
... and lo and behold, it works! Just amazing. It was developed on a Windows PC (I guess), and it runs on OSX out of the box, with only minor tweaking.
Welcome to Python TTK/Tkinter :mrgreen:
Namecoin Core does not cooperate with namegui.py.
Line 262 in lib/namerpc.py (sendtoname "") throws an InvalidAddressOrKeyError.
Hopefully it works now or at least gives another error?
Haven't tried any name operations, yet.
I found one serious bug, so far. Enter any combining character (e.g. grave, acute, tilde, circumflex) in a text box, and the program crashes with
Python[1989:5194914] -[__NSCFConstantString characterAtIndex:]: Range or index out of bounds
oops. Will have to take a look at that
and one minor issue:
Every 3 seconds the line "Model RPC update" flickers with alternating text messages "waiting..." and "working...".
That is expected behaviour :)
At the same rate of once every 3 seconds, debug.log gets filled with these 385 bytes worth of text:
ThreadRPCServer method=sendtoaddress
ThreadRPCServer method=getblockcount
ThreadRPCServer method=getblockhash
ThreadRPCServer method=getblock
ThreadRPCServer method=getblockhash
ThreadRPCServer method=getblock
ThreadRPCServer method=getblockhash
ThreadRPCServer method=getblock
ThreadRPCServer method=getblockcount
ThreadRPCServer method=getblockhash
ThreadRPCServer method=getbalance

which results in 4.05 Gigabytes a year.
oh noes! Yeah, I noticed this, too. Depending on how much Namecoin Core Outputs we will have to change that.
Aside that, excellent work!
Thanks :mrgreen:

Re: nameGUI - an RPC frontend GUI

Posted: Sun May 24, 2015 3:30 pm
by domob
Regarding the InvalidAddress error: I don't remember implementing "sendtoname" in Namecoin Core. This is something that can be easily replaced by a call to name_show followed by sendtoaddress. However, if we believe it should still be there for convenience, feel free to open an issue.

Re: nameGUI - an RPC frontend GUI

Posted: Mon May 25, 2015 10:30 pm
by cassini
domob wrote:"sendtoname"
...
if we believe it should still be there for convenience, feel free to open an issue.
Opened namecore issue #5

The "sendtoname" phelix used, however, has a different purpose at the moment. This is a way of finding out if the wallet is locked. Meanwhile I've come across the official wallet-lock detection method. See nameGUI issue #1

Re: nameGUI - an RPC frontend GUI

Posted: Tue May 26, 2015 7:41 am
by phelix
You are mixing something here, "sendtoname" is never used in namerpc. Only "sendtoaddress". And this bug with Namecoin Core should already be fixed. Nevertheless it might be cleaner to switch to simply using getinfo as Cassini suggested on Github.

Note that all this is solely for the purpose of displaying to the user whether the wallet is locked - for all other cases I plan to react to an WALLET_UNLOCK_NEEDED error code.

Re: nameGUI - an RPC frontend GUI

Posted: Sun May 31, 2015 7:16 pm
by phelix
Sooo.... is this the right way to go? There is a long todo list, should I put more work into this? Can we make this official software so that we can move completely to the new client?

Re: nameGUI - an RPC frontend GUI

Posted: Mon Jun 01, 2015 8:45 am
by biolizard89
phelix wrote:Sooo.... is this the right way to go? There is a long todo list, should I put more work into this? Can we make this official software so that we can move completely to the new client?
Well, I'd really like to see it use the same GUI toolkit that a Bitcoin wallet uses, so that we could integrate it later. For Armory this would be Py3Qt5 (they're currently using Py2Qt4 but plan to switch to Py3Qt5 in the very near future); Electrum appears to be using Py2Qt4 (I hope they're planning to upgrade, but I don't know for sure). Doing this would make the code substantially more versatile. FreeSpeechMe might be willing to put up a bounty for this, depending on funding availability (which I don't have on me right now).

Other than that, I don't really have any opinion on it.