BitShares Forum

Main => General Discussion => Topic started by: zhangweis on April 18, 2014, 10:22:56 am

Title: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 18, 2014, 10:22:56 am
As the GUI is delayed, I'm interested in a GUI made in pure js.
The benefit:
1. quick
The html+css+js makes it very easy and quick to write GUI. I think I can make a very simple prototype in a week if I can have some spare time as long as JSON-RPC interface is ready.
2. cross platform
Even on mobile platform like ios and android.
3. responsive page design
This makes it look and feel well on different devices.
4. easy
JS is easier than C in my opinion.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 18, 2014, 10:27:10 am
We can even setup a blockchain-like online wallet service using coinpunk code. But I don't know whether running a service like this is legal or not (considering lotto.).
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: toast on April 18, 2014, 01:06:59 pm
+1 I have been advocating for this. Define that rpc api for us dan!

Sent from my SCH-I535 using Tapatalk

Title: Re: Interested in a node-webkit implementation of GUI.
Post by: sudo on April 18, 2014, 04:51:26 pm
 +5% 

user experience optimization  is very important
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 19, 2014, 01:31:58 pm
Initial prototype (http://114.215.104.153:8081/main.html), repository:(https://github.com/zhangweis/bts-ui/):

To do:
node+webkit packaging (should not be hard, but automation could be)
make data layer and simulate JSON/RPC
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: sudo on April 19, 2014, 04:59:20 pm
Initial prototype (http://114.215.104.153:8081/main.html), repository:(https://github.com/zhangweis/bts-ui/):
  • Tested only on chrome but could possibly work on ios and android.
  • Angularjs based.
  • Responsive design (layout from coinpunk)
  • Page switch between transactions and send.
  • Really not good at page design and need some help.

To do:
node+webkit packaging (should not be hard, but automation could be)
make data layer and simulate JSON/RPC

 +5% +5%
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: clout on April 19, 2014, 05:17:22 pm
this is a great idea
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 20, 2014, 12:39:03 am
Tested on android and it works well.
You can shrink the chrome browser window to see its mobile action.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: betax on April 21, 2014, 07:56:54 am
Great idea, what is your plan? Create a desktop application using node webkit that interacts with a local / own network rpc server? Or a centralize solution ?
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 21, 2014, 08:47:37 am
Great idea, what is your plan? Create a desktop application using node webkit that interacts with a local / own network rpc server? Or a centralize solution ?

node webkit that interacts with a local / own network rpc server. For an online wallet, I think we may have legal issues with running such a service.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: betax on April 22, 2014, 10:21:55 am
That is what I thought, you could have a desktop and a server version (own home / network server), so mobile / tablets can connect.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 22, 2014, 10:03:19 pm
That is what I thought, you could have a desktop and a server version (own home / network server), so mobile / tablets can connect.
Yes, exactly. I don't know if they provide RPC on HTTP. If they don't, things will be a bit difficult as I have to use node/phonegap to setup tcp connections. I'm still trying to find some documents on their RPC interfaces.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: crazybit on April 23, 2014, 12:58:50 am
Bitshare X implements RPC interface

Title: Re: Interested in a node-webkit implementation of GUI.
Post by: alt on April 23, 2014, 01:02:33 am
As the GUI is delayed, I'm interested in a GUI made in pure js.
The benefit:
1. quick
The html+css+js makes it very easy and quick to write GUI. I think I can make a very simple prototype in a week if I can have some spare time as long as JSON-RPC interface is ready.
2. cross platform
Even on mobile platform like ios and android.
3. responsive page design
This makes it look and feel well on different devices.
4. easy
JS is easier than C in my opinion.
Great!  +5% +5% +5%
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 23, 2014, 08:17:13 pm
Pulled lastest bitshares code finally build it on my debian box.
Excited to see that the latest bts_xt_client supports --server and uses ./htdocs as http root. This makes it easier to put my code just at ./htdocs. Will play with that if I find some time.
RPC tricks:
You need to go through the below steps to send xts:
1. openwallet()
2. walletpassphrase('<<send password>>')
3. sendtoaddress('address', {"amount":<number>,"unit":0},'comment')

From RPC commands, I don't find how to retrieve latest transactions but I can try to simulate it by directly using getblock and get_transaction.
My config.json:
{"rpc":{"rpc_user":"user","rpc_password":"pwd","rpc_endpoint":"0.0.0.0:0","httpd_endpoint":"0.0.0.0:9091","htdocs":"./htdocs"},"ignore_console":false}
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 23, 2014, 09:15:15 pm
First JSON/RPC call on getbalance done.
You can see it working from http://114.215.104.153:9091/index.html#/transactions where user/password should be "user" and "pwd".

Notice the balance is "1000" at the moment which is got from calling json/rpc getbalance.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: bytemaster on April 23, 2014, 09:20:16 pm
I am working on this. 


Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 23, 2014, 10:42:52 pm
I am working on this. 


Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)

That's great. I'll stop here and please don't hesitate if anything I can help.
btw, I think an integrated window could be more user friendly. I mean let the user feel like a real desktop app than populating it in a browser. Maybe cef(https://code.google.com/p/chromiumembedded/) can help here.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: bytemaster on April 24, 2014, 01:02:13 am
I am working on this. 


Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)

That's great. I'll stop here and please don't hesitate if anything I can help.
btw, I think an integrated window could be more user friendly. I mean let the user feel like a real desktop app than populating it in a browser. Maybe cef(https://code.google.com/p/chromiumembedded/) can help here.

I agree... when I said I was working on it, it means I am working on the RPC calls and documentation... I will want some help with what you are doing here soon.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: sudo on April 24, 2014, 03:09:16 am
 +5% +5% +5%
chrome app

js html5 something like that is the future
Mobile Internet&light client   is more attractive
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 24, 2014, 04:15:58 am
Well, I misunderstood you and am very glad that if I can help.
Added receiving address list page.
There seems to be some bugs in sending transactions as it will clear the balance to 0 in some cases. But for testing ui, it's ok.
Plan to merge received transactions and send transactions to single transactions list with different colors for sent and received transactions.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: bytemaster on April 24, 2014, 05:11:22 am
See this post for the latest...

https://bitsharestalk.org/index.php?topic=3812.msg54802#msg54802
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: valzav on April 24, 2014, 03:43:35 pm
That's great. I'll stop here and please don't hesitate if anything I can help.
btw, I think an integrated window could be more user friendly. I mean let the user feel like a real desktop app than populating it in a browser. Maybe cef(https://code.google.com/p/chromiumembedded/) can help here.
Another alternative to build a desktop-like application is Qt WebKit http://qt-project.org/doc/qt-5/qtwebkitwidgets-index.html, with the Qt WebKit Bridge it's even possible to combine HTML5 based GUI with bts_xt_client in a single process.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: sudo on April 25, 2014, 04:50:34 pm
That's great. I'll stop here and please don't hesitate if anything I can help.
btw, I think an integrated window could be more user friendly. I mean let the user feel like a real desktop app than populating it in a browser. Maybe cef(https://code.google.com/p/chromiumembedded/) can help here.
Another alternative to build a desktop-like application is Qt WebKit http://qt-project.org/doc/qt-5/qtwebkitwidgets-index.html, with the Qt WebKit Bridge it's even possible to combine HTML5 based GUI with bts_xt_client in a single process.

 +5% cool
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: HackFisher on April 26, 2014, 01:06:20 pm
For mobile device, or those env not suitable to run a local light client node, solutions like blockchain.info would be nice.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: bytemaster on April 26, 2014, 01:19:54 pm

For mobile device, or those env not suitable to run a local light client node, solutions like blockchain.info would be nice.
One js API to abstract both use cases.


Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 26, 2014, 09:11:06 pm

For mobile device, or those env not suitable to run a local light client node, solutions like blockchain.info would be nice.
One js API to abstract both use cases.


Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)

I guess the new API with username in openwallet is for this purpose. As this doesn't add too much complexicity to C code, I think it's fine.
But from security point of view, the unlocking of private key still happens on server. The fact that unlocking happens in browser makes me believe that I'm safe with blockchain.info wallet. I may choose another solution If I'm going to setup some online wallet services like blockchain.info. As I understand, the online wallet like blockchain.info only need to provide 2 things:
1. Storage of encrypted private keys.
2. Publishing signed transactions. This can be public interface and doesn't have to be done from one's wallet (means no login).
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: HackFisher on April 27, 2014, 02:08:36 am

For mobile device, or those env not suitable to run a local light client node, solutions like blockchain.info would be nice.
One js API to abstract both use cases.


Sent from my iPhone using Tapatalk (http://tapatalk.com/m?id=1)

I guess the new API with username in openwallet is for this purpose. As this doesn't add too much complexicity to C code, I think it's fine.
But from security point of view, the unlocking of private key still happens on server. The fact that unlocking happens in browser makes me believe that I'm safe with blockchain.info wallet. I may choose another solution If I'm going to setup some online wallet services like blockchain.info. As I understand, the online wallet like blockchain.info only need to provide 2 things:
1. Storage of encrypted private keys.
2. Publishing signed transactions. This can be public interface and doesn't have to be done from one's wallet (means no login).

Agree, I think blockchain.info is just a lightweight client node inside browser, which only delegate wallet storage and chain broadcast part to server.

来自我的 GT-N7100 上的 Tapatalk
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: unimercio on April 29, 2014, 10:46:54 am
Pulled lastest bitshares code finally build it on my debian box.
Excited to see that the latest bts_xt_client supports --server and uses ./htdocs as http root. This makes it easier to put my code just at ./htdocs. Will play with that if I find some time.
RPC tricks:
You need to go through the below steps to send xts:
1. openwallet()
2. walletpassphrase('<<send password>>')
3. sendtoaddress('address', {"amount":<number>,"unit":0},'comment')

From RPC commands, I don't find how to retrieve latest transactions but I can try to simulate it by directly using getblock and get_transaction.
My config.json:
{"rpc":{"rpc_user":"user","rpc_password":"pwd","rpc_endpoint":"0.0.0.0:0","httpd_endpoint":"0.0.0.0:9091","htdocs":"./htdocs"},"ignore_console":false}
+5% thanks
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: bytemaster on April 29, 2014, 12:44:34 pm
We have changed the API of sendtoaddress to make it compatible with Bitcoin RPC....   We are attempting to be as compatible with Bitcoin as possible and to have extended APIs for handling our special features (like support for multiple asset types on one chain).
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: zhangweis on April 29, 2014, 07:16:08 pm
We have changed the API of sendtoaddress to make it compatible with Bitcoin RPC....   We are attempting to be as compatible with Bitcoin as possible and to have extended APIs for handling our special features (like support for multiple asset types on one chain).

I agree that the RPC API should be compatible with bitcoin's. As I understand sendtoaddress will be without asset type where asset type defaults to BTS and an extended API like sendtoaddress_asset will be added. I can also see get_transaction_history and will play with that. Good progress, thanks.

Edit: Seems like there's some uncommited changes in fc at the time of writing and I've manually fixed that by adding needed changes (in time.hpp) on my local machine.
Title: Re: Interested in a node-webkit implementation of GUI.
Post by: Snail on May 01, 2014, 05:22:09 am
 +5% +5% +5%