Skip to content

Dev env setup

Vitaliy Vlasov edited this page May 23, 2018 · 21 revisions

Prerequisites:

lein, node.js v.8 , cmake, Qt 5.9.1, Qt's qmake available in PATH

Note: add qmake to PATH via export PATH=<QT_PATH>/clang_64/bin:$PATH

Caveats:

  • if npm hangs at some step, check the version. If it's 5.6.0, try downgrading to 5.5.1 via npm install -g [email protected] (or upgrade to 6.0.1)
  • if status-react/re-natal is not available, try manually installing via npm install re-natal in status-react dir and symlink re-natal to status-react/node_modules/re-natal/index.js
  • also it might happen that metro-bundler is missing, so you'll have to force install it via npm install metro-bundler

To install react-native-cli with desktop commands support:

  1. git clone https://github.com/status-im/react-native-desktop.git
  2. cd react-native-desktop/react-native-cli
  3. npm update
  4. npm install -g

Build status-go module

  1. mkdir status-go-root
  2. Install GoLang, make sure that go is available in PATH. On macOS, following steps have to be done:
  • export GOPATH=<path_to_status-go-root>
  • export GOROOT=/usr/local/opt/go/libexec
  • export PATH=$PATH:$GOPATH/bin
  • export PATH=$PATH:$GOROOT/bin
  1. cd status-go-root
  2. mkdir -p src/github.com/status-im && cd src/github.com/status-im
  3. git clone [email protected]:status-im/status-go.git
  4. cd status-go
  5. git checkout develop-desktop
  6. cd ./lib && go get ./ && cd ..
  7. make statusgo-library
  8. If build is success you should be able to find built status-go binaries in ./build directory. Please edit CMakeList.txt file to point correct local paths to the status-go lib in your status-react git clone: /modules/react-native-status/desktop/CMakeList.txt

Replace 2 occurrences of /Users/vkjr/work/projects/github/status-im3/status-go/src/github.com/status-im/status-go/build/bin in CMakeList.txt with your local path to status-go build

To setup re-natal dev builds of status-react for Desktop:

  1. git clone https://github.com/status-im/status-react.git
  2. cd status-react
  3. git checkout desktop
  4. npm install
  5. react-native desktop (this command should create "desktop" directory in root of your project and default index.desktop.js file as well. note: for some reasons, npm internally might remove whole react-native package from node_modules; if this happens, you need to install it back with npm install react-native)
  6. remove manually index.desktop.js auto generated file
  7. Edit node_modules\metro\src\defaults.js and change the line
    exports.platforms = ['ios', 'android', 'windows', 'web'];
    
    to
    exports.platforms = ['ios', 'android', 'windows', 'web', 'desktop'];
    
  8. Create the following folder inside status-react repo (needed to fix application hanging during blockchain account creation):
mkdir -p desktop/bin/ethereum/mainnet_rpc
  1. Edit modules/react-native-status/desktop/rctstatus.cpp:
  • add #include <QCoreApplication>
  • change line #112 to QString networkDir = QCoreApplication::applicationDirPath() + "/" + dataDir;
  1. lein deps
  2. ./re-natal use-figwheel
  3. ./re-natal enable-source-maps
  4. In separate terminal tab: npm start (note: it starts react-native packager )
  5. In separate terminal tab: node ./ubuntu_server.js
  6. In separate terminal tab: lein figwheel-repl desktop (note: wait until sources compiled)
  7. In separate terminal tab: react-native run-desktop

The app window will say that it is waiting for Figwheel reload. Press Cmd+R to force reload.

Clone this wiki locally