Main > Technical Support

Compiling BitShares X on Ubuntu 14.04, and RPC errors with web wallet

(1/1)

xeroc:
1) run "npm install" without sudo
2) you need to make a links of you nodejs binary in your system to also be called node .. just like
ln -s /usr/bin/nodejs /usr/bin/node
but that is a distribution issue .. nothing from bitshares toolkit

josojo:
Hey,

I tried this well done how-to-do.
At first, I had a problem:
got following error while running
sudo npm install -g lineman  ----- this one has no problem.
sudo npm install --- got following error


--- Code: ---
> lineman-less@0.0.1 postinstall /home/ubuntu/bitsharesx/programs/web_wallet/node_modules/lineman-less
> node script/postinstall.js

sh: 1: node: not found
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian
 
npm ERR! weird error 127
npm ERR! not ok code 0

--- End code ---
But I found the solution over here:
https://bitsharestalk.org/index.php?topic=6109.msg81741#msg81741

I am posting this, just in case other people have the same issue.

valzav:

--- Quote from: arhag on July 21, 2014, 07:42:27 pm ---I don't know why lineman is giving me this problem. If I comment out the offending console.log function in web_wallet/config/server.js, I don't get that particular error anymore but the web wallet still doesn't work because the HTTP POST requests to /rpc don't get any response back. Have I not set things up correctly? In particular, I am wondering how the web wallet (the lineman process) knows what RPC username and password to use when making the requests.

--- End quote ---

arhag, if "lineman build" works for you and you are not planning making live changes to web interface, just edit your config.json in data directory and specify path to web_wallet/dist in htdocs key.

vertoe:
Wow thanks for that. Took me half an hour to find out you need to build the web wallet first. Will create an AUR package now.

Edit https://aur.archlinux.org/packages/bitshares-x/

arhag:
I initially had some trouble getting the Qt client to compile on Linux, but I finally figured it out. I wrote this detailed guide on the steps I took to get the client to compile on my system (Ubuntu 14.04 x86_64). It might be useful to other people who are having compilation problems, but it's also part of a question I have regarding errors that I am still experiencing with the web wallet (web wallet errors are at the bottom of this post).


The following is the procedure I followed to build on x86_64 Ubuntu 14.04 (3.13.0-27-generic):

Install prerequisite packages from repository (according to BUILD_UBUNTU.md):

--- Code: ---sudo apt-get update
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

--- End code ---

Download latest BitShares X code from GitHub:

--- Code: ---mkdir ~/bitshares
cd ~/bitshares
git clone https://github.com/dacsunlimited/bitsharesx.git
cd bitsharesx
git checkout 0.2.1
git submodule init
git submodule update

--- End code ---

Download and install Qt 5.3.1 for Linux 64-bit from http://qt-project.org/downloads:

--- Code: ---cd ~/bitshares
wget http://download.qt-project.org/official_releases/online_installers/qt-opensource-linux-x64-1.6.0-4-online.run
chmod +x qt-opensource-linux-x64-1.6.0-4-online.run
./qt-opensource-linux-x64-1.6.0-4-online.run

--- End code ---
I used the GUI installer to install to ~/bitshares/Qt with the default installation options.

Download and install Node.js v0.10.29 from http://nodejs.org/download:

--- Code: ---cd ~/bitshares
wget http://nodejs.org/dist/v0.10.29/node-v0.10.29-linux-x64.tar.gz
tar xzf node-v0.10.29-linux-x64.tar.gz
cd node-v0.10.29-linux-x64
export PATH=/home/$USER/bitshares/node-v0.10.29-linux-x64/bin:$PATH

--- End code ---

Install lineman and its dependencies in web_wallet folder using npm:

--- Code: ---cd ~/bitshares/bitsharesx/programs/web_wallet
npm install -g lineman
npm install

--- End code ---

Then, following directions from bitsharesx/programs/qt_wallet/README.md,
I configure using CMake:

--- Code: ---cd ~/bitshares/
mkdir bitsharesx-build
cd bitsharesx-build
export CMAKE_PREFIX_PATH=/home/$USER/bitshares/Qt/5.3/gcc_64/
cmake -DINCLUDE_QT_WALLET=ON ../bitsharesx

--- End code ---

However, CMake gave me an error with the following output:

--- Code: ----- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.8")
-- Configuring BitShares on Linux
-- Using  as BerkeleyDB root
-- Looking for: db_cxx-6.0
-- debug/usr/lib/x86_64-linux-gnu/libdb_cxx.sooptimized/usr/lib/x86_64-linux-gnu/libdb_cxx.so
-- Found BerkeleyDB: /usr/include 
-- Using custom FindBoost.cmake
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   system
--   filesystem
--   program_options
--   signals
--   serialization
--   chrono
--   unit_test_framework
--   context
--   locale
-- Using custom FindBoost.cmake
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   coroutine
-- Configuring project fc located in: /home/arhag/bitshares/bitsharesx/libraries/fc
-- Configuring fc to build on Unix/Apple
-- Using custom FindBoost.cmake
-- Boost version: 1.54.0
-- Found the following Boost libraries:
--   thread
--   date_time
--   system
--   filesystem
--   program_options
--   signals
--   serialization
--   chrono
--   unit_test_framework
--   context
--   locale
--   iostreams
--   coroutine
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libssl.a;/usr/lib/x86_64-linux-gnu/libcrypto.a (found version "1.0.1f")
** for a debug build: cmake -DCMAKE_BUILD_TYPE=Debug ..
-- Finished fc module configuration...
-- Could NOT find Curses (missing:  CURSES_LIBRARY CURSES_INCLUDE_PATH)
-- Found Readline: /usr/include 
-- Using  as BerkeleyDB root
-- Looking for: db_cxx-6.0
-- debug/usr/lib/x86_64-linux-gnu/libdb_cxx.sooptimized/usr/lib/x86_64-linux-gnu/libdb_cxx.so
-- Found BerkeleyDB: /usr/include 
-- Enabling Bitcoin Core Wallet Imports
CMake Error at /home/arhag/bitshares/Qt/5.3/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:15 (message):
  The imported target "Qt5::Gui" references the file

     "Qt5Gui_EGL_LIBRARY-NOTFOUND"

  but this file does not exist.  Possible reasons include:

  * The file was deleted, renamed, or moved to another location.

  * An install or uninstall procedure did not complete successfully.

  * The installation package was faulty and contained

     "/home/arhag/bitshares/Qt/5.3/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake"

  but not all the files it references.

Call Stack (most recent call first):
  /home/arhag/bitshares/Qt/5.3/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:31 (_qt5_Gui_check_file_exists)
  /home/arhag/bitshares/Qt/5.3/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:58 (_qt5gui_find_extra_libs)
  /home/arhag/bitshares/Qt/5.3/gcc_64/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:143 (include)
  programs/qt_wallet/CMakeLists.txt:16 (find_package)


-- Configuring incomplete, errors occurred!

--- End code ---

A little bit of searching later and I figured out I needed another dependency:

--- Code: ---sudo apt-get install libgl1-mesa-dev libegl1-mesa-dev

--- End code ---
And, now CMake successfully finishes. It seems Qt's CMake would fail because it couldn't find libGl.so and libEGL.so on my system. They were located at /usr/lib/x86_64-linux-gnu/mesa/libGL.so and /usr/lib/x86_64-linux-gnu/mesa-egl/libEGL.so, but for some reason CMake refuses to
search for them there. Adding the above packages created symlinks to the libraries at the proper locations /usr/lib/x86_64-linux-gnu/libGl.so and /usr/lib/x86_64-linux-gnu/libEGL.so. Perhaps the symlinks alone would have been enough, but installing the packages is simpler. So, it seems these two packages should be included in the list of prerequisite packages to initially install.

I then make the web wallet first, and then the rest of the system.

--- Code: ---cd ~/bitshares/bitsharesx-build
make buildweb
make

--- End code ---
The compilation seems to work fine with the exception of some annoying compiler warnings which seem to me to be mostly benign.

Finally, I run the Qt client and everything appears to be working.

--- Code: ---cd ~/bitsharesx-build/programs/qt_wallet
./BitSharesX

--- End code ---

At this point, everything is working fine, and there is no need for the user to go further. However, I wanted to explore the other options available, such as using the web wallet through the browser directly and not needing Qt, and that is where I got errors.

I first modified "~/BitShares X/config.json" according to bitsharesx/programs/web_wallet/README.md to contain:

--- Code: ---{
  "rpc": {
    "rpc_user": "test",
    "rpc_password": "test",
    "rpc_endpoint": "127.0.0.1:0",
    "httpd_endpoint": "127.0.0.1:0",
    "htdocs": "/home/arhag/bitshares/bitsharesx/programs/web_wallet/generated"
  },
...

--- End code ---

Then, I run the bitshares_client with the following options:

--- Code: ---cd ~/bitshares/bitsharesx-build/programs/client
./bitshares_client --data-dir ~/BitShares\ X/ --server --httpport 9989

--- End code ---
The client seems to be working fine. I can use all the commands. Only problems seem to be a regularly repeating message that says a peer disconnected me because of an invalid block:

--- Code: ---Peer <IP address>:<port> disconnected us: You offered us a block that we reject as invalid

--- End code ---
I am not sure if this is normal behavior or not. Also when stopping the client, it crashes with a segmentation fault.

Now, with the bitshares_client running, I also run the web wallet:

--- Code: ---cd ~/bitshares/bitsharesx/programs/web_wallet
lineman run

--- End code ---

I am able to use my web browser to connect to http://localhost:8000/ and see the GUI interface, however nothing actually works because it gives me an RPC error at the lower left corner with an error about prefixMatchingApiProxy not being defined. The lineman process prints the following error in the terminal:

--- Code: ---ReferenceError: prefixMatchingApiProxy is not defined
  at /home/arhag/bitshares/bitsharesx/programs/web_wallet/config/server.js:21:57
  at callbacks (/home/arhag/bitshares/bitsharesx/programs/web_wallet/node_modules/lineman/node_modules/express/lib/router/index.js:164:37)
  at multipart (/home/arhag/bitshares/bitsharesx/programs/web_wallet/node_modules/lineman/node_modules/express/node_modules/connect/lib/middleware/multipart.js:81:27)
  at /home/arhag/bitshares/bitsharesx/programs/web_wallet/node_modules/lineman/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:57:9
  at urlencoded (/home/arhag/bitshares/bitsharesx/programs/web_wallet/node_modules/lineman/node_modules/express/node_modules/connect/lib/middleware/urlencoded.js:46:27)
  at /home/arhag/bitshares/bitsharesx/programs/web_wallet/node_modules/lineman/node_modules/express/node_modules/connect/lib/middleware/bodyParser.js:55:7
  at IncomingMessage.<anonymous> (/home/arhag/bitshares/bitsharesx/programs/web_wallet/node_modules/lineman/node_modules/express/node_modules/connect/lib/middleware/json.js:72:9)
  at IncomingMessage.emit (events.js:92:17)
  at _stream_readable.js:929:16
  at process._tickCallback (node.js:419:13)

--- End code ---

I don't know why lineman is giving me this problem. If I comment out the offending console.log function in web_wallet/config/server.js, I don't get that particular error anymore but the web wallet still doesn't work because the HTTP POST requests to /rpc don't get any response back. Have I not set things up correctly? In particular, I am wondering how the web wallet (the lineman process) knows what RPC username and password to use when making the requests.

Navigation

[0] Message Index

Go to full version