Author Topic: DVS Light Wallet for Mac Open Beta  (Read 6286 times)

0 Members and 1 Guest are viewing this topic.

Offline cn-members

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: DVS Light Wallet for Mac Open Beta
« Reply #15 on: January 31, 2015, 02:03:38 pm »
where are the sources for the light-client? I'd like to compile locally
it's in the original repository:
https://github.com/BitShares/bitshares

just cmake with
-DINCLUDE_LIGHT_WALLET=ON

also you need to build& install:
https://github.com/papyros/qml-extras
https://github.com/nathanhourt/qml-material

however, I still encountered the problem that arhag mentioned:
3453531ms th_a       thread.cpp:95                 thread               ] name:ntp tid:140008780953344
QML debugging is enabled. Only use this in a safe environment.
3453531ms ntp        ntp.cpp:77                    request_now          ] resolving... ["pool.ntp.org",123]
3453538ms ntp        ntp.cpp:81                    request_now          ] sending request to 120.119.28.1:123
3453549ms ntp        ntp.cpp:147                   read_loop            ] received ntp reply from 120.119.28.1:123
3453549ms ntp        ntp.cpp:161                   read_loop            ] ntp offset: -210141, round_trip_delay 11227
3453549ms ntp        ntp.cpp:177                   read_loop            ] ntp_delta_time updated to -210141
QQmlApplicationEngine failed to load component
qrc:/qml/main.qml:1 module "QtQuick" version 2.4 is not installed
BTS中文区发言人公共账号,帮助社区有效沟通与交流。
Chinese Community Spokesman Account,to help the effective communication between Chinese and other members of the community.We're not translators to do regular translations , but will help with vital ones as we see fit and available at that time.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12552
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: DVS Light Wallet for Mac Open Beta
« Reply #16 on: January 31, 2015, 02:34:36 pm »
ah .. thanks ..
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12552
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: DVS Light Wallet for Mac Open Beta
« Reply #17 on: January 31, 2015, 06:26:40 pm »
Code: [Select]
./LightWallet --help                                                                                                                                                                                   ─┘
1553542ms th_a       thread.cpp:95                 thread               ] name:ntp tid:2956073792
1553542ms ntp        ntp.cpp:77                    request_now          ] resolving... ["pool.ntp.org",123]
QML debugging is enabled. Only use this in a safe environment.
1553554ms ntp        ntp.cpp:81                    request_now          ] sending request to 141.82.25.201:123
1553594ms ntp        ntp.cpp:147                   read_loop            ] received ntp reply from 141.82.25.201:123
1553594ms ntp        ntp.cpp:161                   read_loop            ] ntp offset: 5618, round_trip_delay 39713
1553594ms ntp        ntp.cpp:177                   read_loop            ] ntp_delta_time updated to 5618
QQmlApplicationEngine failed to load component
file:///files/git/bitshares/programs/light_wallet/qml/main.qml:284 Type TransferLayout unavailable
file:///files/git/bitshares/programs/light_wallet/qml/TransferLayout.qml:67 Cannot assign to non-existent property "showHelperText"

on ArchLinux .. any idea how to fix this?
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline modprobe

Re: DVS Light Wallet for Mac Open Beta
« Reply #18 on: January 31, 2015, 06:41:09 pm »
Xeroc: You're using papyros's copy of qml-material, not my fork. Make sure to get qml-material from github.com/nathanhourt/qml-material and to use the develop branch. Edit: scratch that, you've got an old version of the light wallet. Are you sure you're building on the devshares branch?

Arhag: Your version of Qt is older than the lightwallet expects. You can update Qt, or you can try modifying the wallet to use an older version of Qt by turning down the version number in the qml files (change `import QtQuick 2.4` to 2.3 or lower)
« Last Edit: January 31, 2015, 06:43:09 pm by modprobe »

Offline fluxer555

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Re: DVS Light Wallet for Mac Open Beta
« Reply #19 on: January 31, 2015, 07:05:29 pm »
Some ideas, maybe you've thought of them:

- The ability to add 'trusted sources' to a list
- Delegates should be able to host public data servers / list their addresses under their accounts, and light wallets should be able to automatically add these servers to its list of 'trusted sources'
« Last Edit: January 31, 2015, 07:07:00 pm by fluxer555 »

Offline modprobe

Re: DVS Light Wallet for Mac Open Beta
« Reply #20 on: January 31, 2015, 07:12:41 pm »
Hi, fluxer. Thanks for the thoughts. I would like to move to a multiple server model, but this does have some difficulties. One is performance (I've got to wait for N servers to respond instead of 1), and another is fragility (if I use 2 servers and they give different results... now what?) as well as ambiguity (If I query three servers and two never respond... now what?), as well as economics (each light server charges a fee for propagating transactions; if I have N lightservers, I have to pay N fees?). I haven't taken the time to come up with good answers to these questions, so the current version only supports one server. If we can come up with a good design, though, I'll be happy to implement a multiple server architecture.

As to the issue of delegates hosting servers, it's a great idea, but the light wallet has no way of knowing who the delegates are nor what they've published in their accounts. The light wallet would then need to trust a lightserver to give it accurate information about the delegates, which defeats the purpose.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12552
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Re: DVS Light Wallet for Mac Open Beta
« Reply #21 on: January 31, 2015, 09:40:27 pm »
Xeroc: You're using papyros's copy of qml-material, not my fork. Make sure to get qml-material from github.com/nathanhourt/qml-material and to use the develop branch. Edit: scratch that, you've got an old version of the light wallet. Are you sure you're building on the devshares branch?
Oh .. I was compiling the tag dvs/0.6.2 .. the devshares branch compile fine and the client start up all fine .. however, no connection can be made. What  steps are required to make the client connect to your host? I found this in the code (main.qml):
Code: [Select]
54    function connectToServer() {
 55       if( !wallet.connected )
 56          wallet.connectToServer("localhost", 5657, "DVS8GV6nP15gBZQbuEGamH95gYR5EioxkUbEYjpDHMjPEeRWsvR63")                                                                                                     
 57    }
Give BitShares a try! Use the http://testnet.bitshares.eu provided by http://bitshares.eu powered by ChainSquad GmbH

Offline modprobe

Re: DVS Light Wallet for Mac Open Beta
« Reply #22 on: January 31, 2015, 11:54:20 pm »
Yeah, for some reason it's still pointing at localhost. I thought I fixed that. Anyways, just change "localhost" to "nathanhourt.com" and you'll be set.

Offline modprobe

Re: DVS Light Wallet for Mac Open Beta
« Reply #23 on: February 01, 2015, 01:46:43 am »
For those on Qt 5.3, which I believe ships QtQuick 2.3, I've updated the imports in the QML files to reference QtQuick 2.3 instead of 2.4. I've also updated the light wallet to connect to my server on the devshares branch. Hopefully that will simplify building for you all.

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
Re: DVS Light Wallet for Mac Open Beta
« Reply #24 on: February 01, 2015, 02:39:49 am »
For those on Qt 5.3, which I believe ships QtQuick 2.3, I've updated the imports in the QML files to reference QtQuick 2.3 instead of 2.4. I've also updated the light wallet to connect to my server on the devshares branch. Hopefully that will simplify building for you all.

Tried compiling the latest updates to the devshares branch that includes your 4eeaada384f018eb8a5dff5383002f36d2cfb283 commit, I made sure cmake is recognizing my Qt 5.3 installation, and verified with ldd that LightWallet is linked against the shared object files in my custom Qt 5.3 installation, and yet:
Code: [Select]
$ ./LightWallet
1502092ms th_a       thread.cpp:95                 thread               ] name:ntp tid:139931628037888
1502118ms ntp        ntp.cpp:77                    request_now          ] resolving... ["pool.ntp.org",123]
QML debugging is enabled. Only use this in a safe environment.
1502613ms ntp        ntp.cpp:81                    request_now          ] sending request to 132.163.4.102:123
QQmlApplicationEngine failed to load component
qrc:/qml/main.qml:116 Type WelcomeLayout unavailable
qrc:/qml/WelcomeLayout.qml:2 module "QtQuick.Controls" version 1.3 is not installed

"QML_IMPORT_TRACE=1 ./LightWallet" shows that it is looking in the right place "/opt/Qt5.3.0/5.3/gcc_64/qml" for the the various modules.

I will try installing Qt 5.4 and building LightWallet against that next. Is that the version of Qt you have installed on your machine Nathan?

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
Re: DVS Light Wallet for Mac Open Beta
« Reply #25 on: February 01, 2015, 03:50:15 am »
I will try installing Qt 5.4 and building LightWallet against that next.

Woohoo! That worked. I will post detailed build instructions for Ubuntu 14.04 later.

Offline fluxer555

  • Hero Member
  • *****
  • Posts: 748
    • View Profile
Re: DVS Light Wallet for Mac Open Beta
« Reply #26 on: February 01, 2015, 03:57:21 am »
Hi, fluxer. Thanks for the thoughts. I would like to move to a multiple server model, but this does have some difficulties. One is performance (I've got to wait for N servers to respond instead of 1), and another is fragility (if I use 2 servers and they give different results... now what?) as well as ambiguity (If I query three servers and two never respond... now what?), as well as economics (each light server charges a fee for propagating transactions; if I have N lightservers, I have to pay N fees?). I haven't taken the time to come up with good answers to these questions, so the current version only supports one server. If we can come up with a good design, though, I'll be happy to implement a multiple server architecture.

As to the issue of delegates hosting servers, it's a great idea, but the light wallet has no way of knowing who the delegates are nor what they've published in their accounts. The light wallet would then need to trust a lightserver to give it accurate information about the delegates, which defeats the purpose.

My idea is to have a few initial 'seed' servers when you first download the client. There ideally should be more than 2, to avoid that problem you stated, as well as to be sufficiently distributed so to mitigate risk of server hacks / attacks. Once there is consensus of the initial seed servers as to who the delegates are and what their servers are, the delegates' servers are then added to the trusted servers list. From there, the data of the delegates' servers are compared against each other for authenticity, and any discrepancies can either be ignored if a very low percent (probably usually due to software malfunction rather than malicious intent), or if under a certain threshold can issue a warning to the user, much like the current system in the full client with the delegate participation rate. Since each delegate is paid (at the bare minimum) to run a server anyway, it should remain economical to have them set this up at no additional charge.

To address your points specifically,

One is performance (I've got to wait for N servers to respond instead of 1),

You might not need to wait for all servers to respond, as long as the number that do are above a threshold, and as long as you rotate through the servers you have (to not trust one source more than others). This is much much better than trusting a central entity that can be hacked or DDoS'd easily.

and another is fragility (if I use 2 servers and they give different results... now what?)

If you only have two results and they are different, you need more results, or you stop transactions. This would indicate that something is wrong, and the user should be glad their client checked more than once source before trusting the faulty one (whichever one that may be).

as well as ambiguity (If I query three servers and two never respond... now what?),

Related to answer above. You set a threshold, and if this threshold is not met, you either warn the user or stop transactions.

as well as economics (each light server charges a fee for propagating transactions; if I have N lightservers, I have to pay N fees?).

If delegates are hosting lightservers, then this problem is solved. You would just need a handful of 'seed' lightservers, which I suspect certain trusted patrons would run for free.

As to the issue of delegates hosting servers, it's a great idea, but the light wallet has no way of knowing who the delegates are nor what they've published in their accounts. The light wallet would then need to trust a lightserver to give it accurate information about the delegates, which defeats the purpose.

Answered in various ways throughout this post.


EDIT: Added "at no additional charge" to the end of my first paragraph to clarify.
« Last Edit: February 01, 2015, 02:39:12 pm by fluxer555 »

Offline cn-members

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: DVS Light Wallet for Mac Open Beta
« Reply #27 on: February 01, 2015, 05:31:27 pm »
Finally I get it worked on ubuntu 14.04:


this is how I did it:
1. Install qt5.4 from PPA
Code: [Select]
add-apt-repository ppa:beineri/opt-qt54-trusty
apt-get update
apt-get install qt54-meta-full

2. set variables
Code: [Select]
export QTDIR=/opt/qt54/
export PATH=$QTDIR/bin:$PATH   
export MANPATH=$QTDIR/man:$MANPATH   
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH 

you can use:
Code: [Select]
qmake -vto check if the version is correct

3. build qml-extra & qml-material
Code: [Select]
git clone https://github.com/papyros/qml-extras
cd qml-extras
qmake
make
make check
sudo make install
cd ..

Code: [Select]
git clone https://github.com/nathanhourt/qml-material
cd qml-material
qmake
make
make check
sudo make install
cd ..

4. final thing: compile dvs-light wallet
Code: [Select]
git clone https://github.com/BitShares/bitshares
cd bitshares
git checkout devshares
git submodule init
git submodule update
cmake -DINCLUDE_LIGHT_WALLET=ON CMakeLists.txt
make

and the process is in
bitshares/programs/light_wallet/LightWallet
BTS中文区发言人公共账号,帮助社区有效沟通与交流。
Chinese Community Spokesman Account,to help the effective communication between Chinese and other members of the community.We're not translators to do regular translations , but will help with vital ones as we see fit and available at that time.

Offline arhag

  • Hero Member
  • *****
  • Posts: 1214
    • View Profile
    • My posts on Steem
  • BitShares: arhag
  • GitHub: arhag
Re: DVS Light Wallet for Mac Open Beta
« Reply #28 on: February 01, 2015, 10:27:34 pm »
Nice job on those build instructions cn-members. I'll post my (slightly different) guide on how to build the light wallet (as well as the CLI client, web wallet, and Qt client) on Ubuntu 14.04 x64. This guide can be used if you want to install Qt directly from its creators rather than relying on a PPA. Please note that I haven't actually tried these exact instructions on a fresh install, but they were reconstructed from memory based on various things I tried. So, let me know if it actually works for you.

Initial setup stage:
0) Set up a working directory in which everything will be done and install all pre-requisites from repositories:
Code: [Select]
~$ mkdir BitShares && cd BitShares
~/BitShares$ sudo apt-get install cmake git libreadline-dev uuid-dev g++ libdb++-dev libdb-dev zip libssl-dev openssl build-essential python-dev autotools-dev libicu-dev libbz2-dev libboost-dev libboost-all-dev npm nodejs-legacy
~/BitShares$ sudo npm install -g lineman

1) Install Qt 5.4:
Code: [Select]
~/BitShares$ wget http://download.qt-project.org/official_releases/qt/5.4/5.4.0/qt-opensource-linux-x64-5.4.0.run
~/BitShares$ sha256sum qt-opensource-linux-x64-5.4.0.run
Verify that the SHA-256 hash of the executable is correct by comparing to the hash listed here. Although, the website's current SSL security practices are pretty disappointing.   
Then run the installer to install Qt 5.4 in a system-wide location:
Code: [Select]
~/BitShares$ chmod +x qt-opensource-linux-x64-5.4.0.run
~/BitShares$ sudo ./qt-opensource-linux-x64-5.4.0.run
Then follow the GUI and install in "/opt/Qt5.4.0".

2) Install qml-extras and qml-material into the Qt5.4.0 folder:
Code: [Select]
~/BitShares$ git clone https://github.com/papyros/qml-extras.git
~/BitShares$ mkdir qml-extras-build && cd qml-extras-build
~/BitShares/qml-extras-build$ /opt/Qt5.4.0/5.4/gcc_64/bin/qmake ../qml-extras
~/BitShares/qml-extras-build$ make && make check
Make sure all the tests pass.
Code: [Select]
~/BitShares/qml-extras-build$ sudo make install
~/BitShares/qml-extras-build$ cd ..
~/BitShares$ git clone https://github.com/nathanhourt/qml-material.git
~/BitShares$ mkdir qml-material-build %% cd qml-material-build
~/BitShares/qml-material-build$ /opt/Qt5.4.0/5.4/gcc_64/bin/qmake ../qml-material
~/BitShares/qml-material-build$ make && make check
Make sure all the tests pass.
Code: [Select]
~/BitShares/qml-material-build$ sudo make install
~/BitShares/qml-material-build$ cd ..

3) Initial setup of DevShares:
Code: [Select]
~/BitShares$ rm -rf bitshares # Remove any prior bitshares folder
~/BitShares$ git clone https://github.com/BitShares/bitshares.git
~/BitShares$ cd bitshares
~/BitShares/bitshares$ git submodule init && git submodule update
~/BitShares/bitshares$ cd programs/web_wallet
~/BitSharesbitshares/programs/web_wallet$ npm install
~/BitSharesbitshares/programs/web_wallet$ cd ../../../


Building DevShares from scratch:
If this is the first time building DevShares, or you want to build an update of it from scratch, you must first do the following additional setup before compiling. If you think you can get away with a quick recompilation after some minor changes, skip to "Recompiling Devhares after minor changes".

4) Build from scratch:
Code: [Select]
~/BitShares$ cd bitshares
~/BitShares/bitshares$ git pull
~/BitShares/bitshares$ git checkout devshares
~/BitShares/bitshares$ git submodule update
~/BitShares/bitshares$ cd ..
~/BitShares$ rm -rf devshares-build  # Remove any prior devshares-build folder
~/BitShares$ mkdir devshares-build && cd devshares-build
~/BitShares/devshares-build$ cmake -DINCLUDE_QT_WALLET=ON -DINCLUDE_LIGHT_WALLET=ON -DCMAKE_PREFIX_PATH=/opt/Qt5.4.0/5.4/gcc_64/ ../bitshares/
~/BitShares/devshares-build$ make forcebuildweb
~/BitShares/devshares-build$ make
~/BitShares/devshares-build$ cd ..

The Qt client will be located in "~/BitShares/devshares-build/programs/qt_wallet/bin/DevShares". The light wallet will be located in "~/BitShares/devshares-build/programs/light_wallet/LightWallet". The CLI client will be located in "~/BitShares/devshares-build/programs/client/devshares_client". The CLI client can be run with the "--server" flag to run the backend of the web wallet (make sure to first set up the RPC parameters in the config.json file appropriately). The web wallet can be run from the "~/BitShares/bitshares/programs/web_wallet" folder using "npm start" and then accessed from the browser using http://localhost:8000/.


Recompiling DevShares after minor changes (assuming updating HEAD of same branch):
5) Get latest sources and recompile:
Code: [Select]
~/BitShares$ cd bitshares
~/BitShares/bitshares$ git pull && git checkout devshares && git submodule update && cd ../devshares-build
~/BitShares/devshares-build$ make forcebuildweb # Only needed if web_wallet code changed
~/BitShares/devshares-build$ make

If there are any problems from this quick recompilation procedure, then go back and do it properly with step 4, and if that has problems then go back to step 3.
« Last Edit: February 01, 2015, 10:38:29 pm by arhag »

Offline modprobe

Re: DVS Light Wallet for Mac Open Beta
« Reply #29 on: February 01, 2015, 10:28:32 pm »
@fluxer: I agree with you, and I'd like to see such solutions deployed. The issues aren't insurmountable, but they need consideration, and I welcome new ideas on how to solve them (why waste time implementing one bad solution if someone else can think of a better one?). Right now I'm the only one running a light server because it's under heavy development (you think delegates have to upgrade a lot? Ha!) and I need to be able to debug and redeploy rapidly. Once I've got a relatively stable solution (which is, of course, the point of this beta -- to figure out what needs to be changed to sustain a reliable solution) then I'll be looking into multi-server models. Eventually, I'll make it configurable.

Still, the model of paying a centralized party to provide immediate, accurate information is a reasonable one, particularly when I deploy mobile apps where all matters of internet traffic are much more expensive (in time and money).

@cn-members: Thank you very much for taking the time to detail out those instructions. I'll add those to a README on GitHub soon.

@arhag: I'm glad you got it working! Yes, I do develop against 5.4. I think 5.3 would work, but you'll have to turn back the version numbers in the import statements until it works, and doing that might break something which depends on the later version. I haven't researched exactly when all the features I need were added, so I just use the latest version available at the time of writing.


Is anyone else still having trouble building? For the rest of you, do you have any comments or problems you've experienced?

For the windows users, I'm hoping to get my hands on a windows dev box tomorrow, so hopefully I'll get something together for you. Thanks for being patient!