mirror of
https://github.com/boldsuck/haveno.git
synced 2024-12-22 20:19:21 +00:00
4.2 KiB
4.2 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
Follow instructions to import Haveno into a development environment.
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.
Manually sign accounts as the arbitrator
- Open legacy UI as the arbitrator.
- Go to the 'Account' tab.
- Open Signing tab:
ctrl+i
a. Sign payment account:ctrl+s
, select payment accounts to sign (sourced from disputes). b. Sign account age witness:ctrl+p
then enter , (from past trade details) and click the "Import unsigned account age witness" button. c. Sign unsigned witness pub keys:ctrl+o
Package executable binaries
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.