Skip to content

Dev env setup

Vitaliy Vlasov edited this page May 25, 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/CMakeLists.txt

Replace 2 occurrences of /Users/vkjr/work/projects/github/status-im3/status-go/src/github.com/status-im/status-go/build/bin in CMakeLists.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-bundler\src\defaults.js and change the line
    exports.platforms = ['ios', 'android', 'windows', 'web'];
    
    to
    exports.platforms = ['ios', 'android', 'windows', 'web', 'desktop'];
    
  8. lein deps
  9. ./re-natal use-figwheel
  10. ./re-natal enable-source-maps
  11. In separate terminal tab: npm start (note: it starts react-native packager )
  12. In separate terminal tab: node ./ubuntu_server.js
  13. In separate terminal tab: lein figwheel-repl desktop (note: wait until sources compiled)
  14. In separate terminal tab: react-native run-desktop

Note: react-native run-desktop might give this error:

CMake Error at CMakeLists.txt:18 (add_subdirectory):
  add_subdirectory given source
  "/path/status-react/desktop/../node_modules/react-native-webview-bridge/desktop"
  which is not an existing directory.

Resolve it with npm install react-native-webview-bridge.

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

Clone this wiki locally