[bisq-network/bisq] Update the wiki page describing how to use regtest (#1833)

Devin Bileck notifications at github.com
Mon Oct 29 06:43:03 UTC 2018


Since I found the wiki documentation to be confusing and outdated, I have provided updated content below for the wiki page describing how to use regtest
https://github.com/bisq-network/bisq/wiki/4.2.1.-How-to-use-Bisq-with-regtest-(advanced)

## Introduction
You can test Bisq locally without requiring a connection to the Tor-based P2P network and without requiring another trading partner by using regtest mode.

**Note that this method is intended for developers and technical users only for the purpose of testing Bisq. You will need to edit lines in the source code of Bisq, requiring you to compile the code from source.**

The regtest environment differs from the testnet and mainnet networks because it runs a local Bitcoin network on your computer and allows you to run multiple instances of Bisq to simulate each side of a trade. This environment is ideally suited for testing because you are able to create blocks on demand (no need to wait for confirmations) and you don't need to download the entire blockchain, therefore startup and trading is much faster.

You can find more information about the Bitcoin regtest mode [here](https://bitcoin.org/en/developer-examples#regtest-mode).

Before testing Bisq in regtest mode, read the [Bisq wiki](https://github.com/bisq-network/bisq/wiki/4.1.-How-to-prepare-your-Bisq-source-code-for-regtest-mode) to learn about the basic setup process.

## Run Bitcoin Core in Regtest Mode
Running Bitcoin Core in regtest mode does not require you to download the blockchain making the startup process quick.

To begin, navigate to the [bitcoin.config file](https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File) and set regtest=1, or add -regtest as a program argument when starting the Bitcoin Core binary.

On your first use, you need to create 101 blocks using `generate 101` via the console inside Bitcoin Core.

_Note that while testing the trade process, when you need a blockchain confirmation the command for creating a single block is: `generate 1`._

Read the [bitcoinj wiki](https://bitcoinj.github.io/testing#regression-test-mode) for more information about regtest mode.

## Run the Seed Node
The seed node is required for the bootstrap process in the P2P network. It must be running before you start the Bisq application.

Run SeedNode.jar (after building from source, will be located in the seednode/build/libs folder) with the command: `java -jar SeedNode.jar --baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --nodePort=2002 --myAddress=localhost:2002 --appName=bisq-BTC_REGTEST_Seed_2002 --useDevPrivilegeKeys=true`.

## Setup the Arbitrator Instance
Before starting instances of the Bisq application as "traders", you will need to start and configure an instance of Bisq as an "arbitrator".

Pass the following list of program arguments to the application instance to create the arbitrator:  
`--baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --nodePort=9222 --appName=bisq-BTC_REGTEST_Arb --useDevPrivilegeKeys=true`

Once the arbitrator instance is running, click the "Account" button and press Alt+R to reveal the hidden "Arbitrator Registration" tab and select it. The developer registration key will be pre-filled. Select your preferred language to complete the arbitrator registration.

At this point you can close the arbitrator instance, since it is not necessary to be running, and proceed to create the trader instances (see below), which will auto-select your registered arbitrator (provided a matching language is defined).

## Launch the Trader Instances
Here we will launch two instances of the Bisq application as "traders" and refer to them as Alice (as a Bitcoin buyer) and Bob (as a Bitcoin seller).

Pass the following list of program arguments to the application instance to create Alice:
`--baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --nodePort=3632 --appName=bisq-BTC_REGTEST_Ali --useDevPrivilegeKeys=true`  

Pass the following list of program arguments to the application instance to create Bob:
`--baseCurrencyNetwork=BTC_REGTEST --useLocalhostForP2P=true --nodePort=3333 --appName=bisq-BTC_REGTEST_Bob --useDevPrivilegeKeys=true`

## Testing the Trading Process
At this point you can now perform trades between Alice and Bob using your local regtest environment and test from both the buyer's and seller's perspective.

_Note, remember to generate a new block in the Bitcoin Core console after taking an offer using the command `generate 1`._

## Testing Disputes/Arbitration
If you want to test disputes and the role of the arbitrator, you will need to navigate to the Portfolio/Open Trades tab as either Alice or Bob and press `Ctrl+o` or `Cmd+o` to manually open a dispute. You will then need to launch the arbitrator instance as described above.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/issues/1833
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20181028/61705dc3/attachment.html>


More information about the bisq-github mailing list