6.6 KiB
Developer Guide
This document is a guide for Haveno development.
Install and test Haveno
Build Haveno and join the test network or test locally.
Run the UI proof of concept
Follow instructions to run Haveno's UI proof of concept in a browser.
This proof of concept demonstrates using Haveno's gRPC server with a web frontend (react and typescript) instead of Haveno's JFX application.
Import Haveno into development environment
VSCode is recommended.
Otherwise follow instructions to import Haveno into a Eclipse or IntelliJ IDEA.
Run end-to-end API tests
Follow instructions to run end-to-end API tests in the UI project.
Add new API functions and tests
- Follow instructions to run Haveno's existing API tests successfully.
- Define the new service or message in Haveno's protobuf definition.
- Clean and build Haveno after modifying the protobuf definition:
make clean && make
- Implement the new service in Haveno's backend, following existing patterns.
For example, the gRPC function to get offers is implemented byGrpcServer
>GrpcOffersService.getOffers(...)
>CoreApi.getOffers(...)
>CoreOffersService.getOffers(...)
>OfferBookService.getOffers()
. - Build Haveno:
make
- Update the gRPC client in haveno-ts:
npm install
- Add the corresponding typescript method(s) to haveno.ts with clear and concise documentation.
- Add clean and comprehensive tests to haveno.test.ts, following existing patterns.
- Run the tests with
npm run test -- -t 'my test'
to run tests by name andnpm test
to run all tests together. Ensure all tests pass and there are no exception stacktraces in the terminals of Alice, Bob, or the arbitrator. - Open pull requests to the haveno and haveno-ts projects for the backend and frontend implementations.
Release portable Monero binaries for each platform
- Update the release-v0.18 branch on Haveno's monero repo to the latest release from upstream + any customizations (e.g. a commit to speed up testnet hardforks for local development).
git tag <tag> && git push origin <tag>
- Follow instructions to build portable binaries for each platform.
- Publish a new release at https://github.com/haveno-dex/monero/releases with the updated binaries and hashes.
- Update the paths and hashes in build.gradle and PR.
Build portable Monero binaries for each platform
Based on these instructions: https://github.com/monero-project/monero#cross-compiling
- Install Ubuntu 20.04.
sudo apt-get update && sudo apt-get upgrade
- Install monero dependencies:
sudo apt update && sudo apt install build-essential cmake pkg-config libssl-dev libzmq3-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev libboost-chrono-dev libboost-date-time-dev libboost-filesystem-dev libboost-locale-dev libboost-program-options-dev libboost-regex-dev libboost-serialization-dev libboost-system-dev libboost-thread-dev python3 ccache
sudo apt install cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev libtinfo5 autoconf libtool libtool-bin gperf git curl
git clone https://github.com/haveno-dex/monero.git
cd ./monero
(or rename to haveno-monero:mv monero/ haveno-monero && cd ./haveno-monero
)git fetch origin && git reset --hard origin/release-v0.18
git submodule update --init --force
Note: If you get the prompt "Reversed (or previously applied) patch detected! Assume -R? [n]" then confirm 'y'.
Build for Linux
make depends target=x86_64-linux-gnu -j<num cores>
cd build/x86_64-linux-gnu/release/bin/
tar -zcvf monero-bins-haveno-linux.tar.gz monerod monero-wallet-rpc
- Save monero-bins-haveno-linux.tar.gz for release.
Build for Mac
make depends target=x86_64-apple-darwin11 -j<num cores>
cd build/x86_64-apple-darwin11/release/bin/
tar -zcvf monero-bins-haveno-mac.tar.gz monerod monero-wallet-rpc
- Save monero-bins-haveno-mac.tar.gz for release.
Build for Windows
sudo apt install python3 g++-mingw-w64-x86-64 bc
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix && sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
make depends target=x86_64-w64-mingw32 -j<num cores>
cd build/x86_64-w64-mingw32/release/bin/
zip monero-bins-haveno-windows.zip monerod.exe monero-wallet-rpc.exe
- Save monero-bins-haveno-windows.zip for release.
Build executable installers for each platform
See instructions.
Rebase and squash your commits
When submitting a pull request for review, please first rebase and squash your commits.
- Checkout the latest version from master, e.g.:
git checkout master && git pull upstream master
- Checkout your feature branch, e.g.:
git checkout your_branch
- Optionally make a backup branch just in case something goes wrong, e.g.:
git checkout -b your_branch_bkp && git checkout your_branch
- Rebase on master:
git rebase master
- Squash your commits:
git reset --soft <last hash before your first commit>
- Commit your changes to a single commit:
git commit
- Push your local branch to your remote repository:
git push --force
If you have a PR open on that branch, it'll be updated automatically.
Trade Protocol
For documentation of the trade protocol, see trade protocol.