Developer loop from clion using [ubuntu 16.04 x64 omega clion] as a base image - Zacorich/omegacoin GitHub Wiki

Link to long video stream that created this tutorial

  1. Download image with pre-installed dependencies and pre-compiled source code and run/start ubuntu_16.04_x64-omega-clion.vbox : link ; This will save your time significantly. Otherwise you would have to complete Steps 1-13 of this wiki page by yourself! Guest minimal requirements to run: RAM 3090 MB(to debug wallet) and 4000 MB(to run make build in parallel), 2 CPU Cores(3-4 Cores for Clang-tidy), Optional additional 4100 MB Disk space on host to suspend vm

    RAM usage maximum by processes(VirtualBox *.vbox file is set to 4100 MB RAM by default):

    • System(QDirStat, htop, 3 Gnome terminals, PCManFM, OpenBox, tint2, lnav) - 207 MB
    • CLion with 10 *.cpp files opened - +2313 MB(Total: 2520 MB )
    • omegacoin-qt in debug mode running - +399 MB(Total: 2919 MB)
    • wireshark-qt with capturing running- +171 MB(Total: 3090 MB)
    • Make build running in parallel- +910 MB(Total: 4000 MB)

    *If swap used for example, what would take no swap config to build in 2 minutes will take 7m30s to build with swap

  2. Start vm and login as ubuntu user. Further I call the running VirtualBox image simply - "vm". Sudo username: ubuntu Sudo password: ubuntu Root password: ubuntu

  3. On github go to https://github.com/omegacoinnetwork/omegacoin and press "Fork" in the top-right corner so your own fork will appear here: https://github.com/omegacoinnetwork/omegacoin/network/members. Your objective is to create/close as many useful pull request as possible here: https://github.com/omegacoinnetwork/omegacoin/pulls;

  4. Open your forked repo on github.com in any of your browsers and click "Clone or Download" button to get https link. Save the link into clipboard.

  5. Inside vm start clion by clicking shortcut on toolbar. Select "Evaluate for free" bullet and press "Evaluate" button to start your 30 day clion trial. clion will by default open omegacoin pre-configured project for you.

  6. Checkout local master branch: VCS / Git / Branches... / master / checkout . You can get to the same menu in the bottom-right corner of clion that states "Git:..." . Initially source is detached from head to latest Tag of the repo so you must make sure you are on your local main branch before doing any work and committing.

  7. Press "ctrl+t" or blue arrow icon in top-right corner of clion. Update type: Merge , Clean working tree before update: Using Stash. Balloon stating "All files up-to-date" must appear.

  8. Compile project for the first time. Open View / Tool Windows / Terminal and type "time make". If project to be compiled completely from scratch with minimum system requirements it will take about 45 minutes to do so. As this vm already pre-compiled project once, it should take you about 2 minute just to build executable binaries for the project. You can delete executable binaries with the following bash command and build project again with "time make" or simply "make".

    rm -f ./src/omegacoind ./src/omegacoin-tx ./src/omegacoin-cli ./src/qt/omegacoin-qt ./src/test/test_omegacoin ./src/bench/bench_omegacoin
    
  9. Press Shift+F9 to start omegacoin-qt debug version. The program will stop on the brake point set at the app entry point. Press F9 to resume app. Omega wallet qt app will start to update blockhain from mainnet into /home/ubuntu/omegacoin/.omegacoincore. Wait for it to sync with mainnet and if some errors just close debug and continue with step 10. You can start multiple wallet at the same time as well.

  10. Configure remote url of your forked branch(also called upstream). Open File / Settings / Version Control / GitHub / Add account and type in you github.com username and password(it won't be cached as used only to get token). Press "Apply" and type and remember your key-ring password in dialog "Choose password for new keyring"(example: 123456). Press "Ok". Open VCS / Git / Remotes... press "+" button and add your fork name( example name: "fork") and earlier in step 4 saved https link(example: https://github.com/Zacorich/omegacoin.git). Open terminal in clion and run following bash commands.

git fetch
-- git branch -u <name of the remote you created: "fork">/<branch to select from your fork: "master">
-- this will make sure you pull/push commits from/to your fork(that you configured write permission to with github.com) and not official omega repo
git branch -u fork/master
  1. Introduce some code change that solve one of the issues or cards described here: https://trello.com/b/ZoeSmaeh/omega-governance , https://github.com/omegacoinnetwork/omegacoin/issues, https://github.com/omegacoinnetwork/omegacoin/pulls

  2. Commit and push your local commits to your forked branch on github. Press ctrl+k to do commit to your local branch. Press ctrl+shift+k and the "Push" button to push your commits to your forked repo hosted on github.com. Wait for balloon saying "Successful push".

  3. Create/Update pull request. Open official omega repo pull requests page in any browser : https://github.com/omegacoinnetwork/omegacoin/pulls. Press "New pull request" button. Press on "compare across forks". Select base fork: "omegacoinnetwork/omegacoin" with base: "master". Select head fork: "find your fork name in dropdown(example: Zacorich/omegacoin)" compare: "find your fork branch in dropdown(example: master)". And finally press: "Create pull request" green button. Write the pull request comment message explicitly describing what was done in all the commits you want to be included with this pull request. Bookmark your pull request link for later reference(example: https://github.com/omegacoinnetwork/omegacoin/pull/11).

  4. Check you pull request link for code review to pass.

  5. If code review didn't pass you should repeat steps 11, 12 and 13(update you pull request with newer commits all done from your pull request link github webpage)

  6. Once code review passed your commits will be merged into main omega wallet codebase and you can continue development from step 11.