Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update build instructions for mainnet #1231

Merged
merged 1 commit into from
Aug 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 37 additions & 23 deletions docs/installing.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Set up environment
# Build and run Haveno

These are the steps needed to build Haveno and test it on our test network or locally.
These are the steps needed to build and run Haveno. You can test it locally or on our test network using the official Haveno repository.

## Install dependencies

On Linux and macOS, install Java JDK 21:
> [!note]
> Trying to use Haveno on mainnet?
>
> The official Haveno repository does not operate or endorse any mainnet network.
>
> Find a third party network and use their installer or build their repository. Alternatively [create your own mainnet network](create-mainnet.md).

```
curl -s "https://get.sdkman.io" | bash
sdk install java 21.0.2.fx-librca
```
## Install dependencies

On Windows, install MSYS2 and Java JDK 21:
On Ubuntu: `sudo apt install make wget git`

On Windows, first install MSYS2:
1. Install [MSYS2](https://www.msys2.org/).
2. Start MSYS2 MINGW64 or MSYS MINGW32 depending on your system. Use MSYS2 for all commands throughout this document.
4. Update pacman: `pacman -Syy`
Expand All @@ -21,12 +22,17 @@ On Windows, install MSYS2 and Java JDK 21:
64-bit: `pacman -S mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake git`

32-bit: `pacman -S mingw-w64-i686-toolchain make mingw-w64-i686-cmake git`
6. `curl -s "https://get.sdkman.io" | bash`
7. `sdk install java 21.0.2.fx-librca`

On all platforms, install Java JDK 21:

```
curl -s "https://get.sdkman.io" | bash
sdk install java 21.0.2.fx-librca
```

## Build Haveno

If it's the first time you are building Haveno, run the following commands to download the repository, the needed dependencies, and build the latest release:
If it's the first time you are building Haveno, run the following commands to download the repository, the needed dependencies, and build the latest release. If using a third party network, replace the repository URL with theirs:

```
git clone https://github.com/haveno-dex/haveno.git
Expand All @@ -45,15 +51,23 @@ git pull
make clean && make
```

Make sure to delete the folder with the local settings, as there are breaking changes between releases:
## Run Haveno

> [!note]
> When you run Haveno, your application folder will be installed to:
> * Linux: `~/.local/share/Haveno/`
> * macOS: `~/Library/Application\ Support/Haveno/`
> * Windows: `~\AppData\Roaming\Haveno\`

On **Linux**: remove everything inside `~/.local/share/haveno-*/xmr_stagenet/`, except the `wallet` folder.
### Mainnet

On **Mac**: remove everything inside `~/Library/Application\ Support/haveno-*/xmr_stagenet/`, except the `wallet` folder.
If you are building a third party repository which supports mainnet, you can start Haveno with:

On **Windows**: remove everything inside `~\AppData\Roaming\haveno-*/xmr_stagenet/`, except the `wallet` folder.
```
make haveno-desktop-mainnet
```

## Join the public test network
### Join the public test network

If you want to try Haveno in a live setup, launch a Haveno instance that will connect to other peers on our public test environment, which runs on Monero's stagenet (you won't need to download the blockchain locally). You'll be able to make test trades with other users and have a preview of Haveno's trade protocol in action. Note that development is very much ongoing. Things are slow and might break.

Expand All @@ -67,19 +81,19 @@ Steps:
6. Now if you are taking a trade you'll be asked to confirm you have sent the payment outside Haveno. Confirm in the app and wait for the confirmation of received payment from the other trader.
7. Once the other trader confirms, deposits are sent back to the owners and the trade is complete.

# Run a local test network
### Run a local test network

If you are a developer who wants to test Haveno in a more controlled way, follow the next steps to build a local test environment.

## Run a local XMR testnet
#### Run a local XMR testnet

1. In a new terminal window run `make monerod1-local`
1. In a new terminal window run `make monerod2-local`
3. Now mine the first 150 blocks to a random address before using, so wallets only use the latest output type. Run in one of the terminal windows opened above:

`start_mining 9tsUiG9bwcU7oTbAdBwBk2PzxFtysge5qcEsHEpetmEKgerHQa1fDqH7a4FiquZmms7yM22jdifVAD7jAb2e63GSJMuhY75 1`

## Deploy
#### Deploy

If you are a *screen* user, simply run `make deploy`. This command will open all needed Haveno instances (seednode, user1, user2, arbitrator) using *screen*.

Expand All @@ -93,14 +107,14 @@ If you don't use *screen*, open 4 terminal windows and run in each one of them:

If this is the first time launching the arbitrator desktop application, register the arbitrator after the interface opens. Go to the *Account* tab and press `cmd+r`. Confirm the registration of the arbitrator.

## Fund your wallets
#### Fund your wallets

When running user1 and user2, you'll see a Monero address prompted in the terminal. Send test XMR to the addresses of both user1 and user2 to be able to initiate a trade.

You can fund the two wallets by mining some test XMR coins to those addresses. To do so, open a terminal where you ran monerod and run: `start_mining ADDRESS 1`.

monerod will start mining local testnet coins on your device using one thread. Replace `ADDRESS` with the address of user1 first, and then user2's. Run `stop_mining` to stop mining.

## Start testing
#### Start testing

You are all set. Now that everything is running and your wallets are funded, you can create test trades between user1 and user2. Remember to mine a few blocks after opening and accepting the test trade so the transaction will be confirmed.
Loading