Merge branch 'master' of github.com:bisq-network/bisq into release/v1.6.3

# Conflicts:
#	scripts/install_java.sh
This commit is contained in:
Christoph Atteneder 2021-05-07 10:33:45 +02:00
commit 89729c41c9
No known key found for this signature in database
GPG Key ID: CD5DC1C529CDFD3B
31 changed files with 380 additions and 154 deletions

View File

@ -6,7 +6,7 @@ labelPRBasedOnFilePath:
- assets/**/*
firstPRWelcomeComment: >
**Thanks for opening this pull request!**<br/><br/>Please check out our [contributor checklist](https://docs.bisq.network/contributor-checklist.html) and check if *Travis* or *Codacy* found any issues with your PR. Also make sure your commits are signed, and that you applied [Bisq's code style](https://github.com/bisq-network/style/issues) and [formatting](.editorconfig).<br/><br/>A maintainer will add an `is:priority` label to your PR if it is up for compensation. Please see our [Bisq Q1 2020 Update post](https://bisq.network/blog/q1-2020-update/) for more details.
**Thanks for opening this pull request!**<br/><br/>Please check out our [contributor checklist](https://bisq.wiki/Contributor_checklist) and check if *Travis* or *Codacy* found any issues with your PR. Also make sure your commits are signed, and that you applied [Bisq's code style](https://github.com/bisq-network/style/issues) and [formatting](.editorconfig).<br/><br/>A maintainer will add an `is:priority` label to your PR if it is up for compensation. Please see our [Bisq Q1 2020 Update post](https://bisq.network/blog/q1-2020-update/) for more details.
firstPRMergeComment: >
Awesome work, congrats on your first merged pull request!

33
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Build Bisq
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
lfs: true
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Validate Gradle Wrapper JAR files
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle
run: ./gradlew build

View File

@ -11,7 +11,7 @@ Install Keybase and enter "bisq" from the teams tab. This is an "open" team, whi
Discussion about code changes happens in GitHub issues and pull requests.
Discussion about larger changes to the way Bisq works happens in issues the [bisq-network/proposals](https://github.com/bisq-network/proposals/issues) repository. See https://docs.bisq.network/proposals.html for details.
Discussion about larger changes to the way Bisq works happens in issues the [bisq-network/proposals](https://github.com/bisq-network/proposals/issues) repository. See https://bisq.wiki/Proposals for details.
## Contributor Workflow
@ -50,7 +50,7 @@ Bisq is not a company, but operates as a _decentralized autonomous organization_
Since our [Q1 2020 update](https://bisq.network/blog/q1-2020-update/) contributions are NOT eligible for compensation unless they are allocated as part of the development budget. Fixes for [critical bugs](https://bisq.wiki/Critical_Bugs) are eligible for compensation when delivered.
In any case please contact the team lead for development (@ripcurlx) upfront if you want to get compensated for your contributions.
For any work that was approved and merged into Bisq's `master` branch, you can [submit a compensation request](https://docs.bisq.network/dao/phase-zero.html#how-to-request-compensation) and earn BSQ (the Bisq DAO native token). Learn more about the Bisq DAO and BSQ [here](https://docs.bisq.network/dao/phase-zero.html).
For any work that was approved and merged into Bisq's `master` branch, you can [submit a compensation request](https://bisq.wiki/Making_a_compensation_request) and earn BSQ (the Bisq DAO native token). Learn more about the Bisq DAO and BSQ [here](https://bisq.wiki/Introduction_to_the_DAO).
## Style and Coding Conventions
@ -95,7 +95,7 @@ See the issues in the [bisq-network/style](https://github.com/bisq-network/style
## See also
- [contributor checklist](https://docs.bisq.network/contributor-checklist.html)
- [contributor checklist](https://bisq.wiki/Contributor_checklist)
- [developer docs](docs#readme) including build and dev environment setup instructions
- [project management process](https://bisq.wiki/Project_management)

View File

@ -14,8 +14,8 @@
#
# - Linux, macOS or similar *nix with standard tools like `make`
# - bitcoind and bitcoin-cli (`brew install bitcoin` on macOS)
# - JDK 10 to build and run Bisq binaries; see
# https://www.oracle.com/java/technologies/java-archive-javase10-downloads.html
# - JDK 11 to build and run Bisq binaries; see
# https://jdk.java.net/archive/
#
#
# USAGE

View File

@ -176,6 +176,10 @@ public class OptionParsersTest {
};
Throwable exception = assertThrows(RuntimeException.class, () ->
new CreatePaymentAcctOptionParser(args).parse());
if (System.getProperty("os.name").toLowerCase().indexOf("win") >= 0)
assertEquals("json payment account form '\\tmp\\milkyway\\solarsystem\\mars' could not be found",
exception.getMessage());
else
assertEquals("json payment account form '/tmp/milkyway/solarsystem/mars' could not be found",
exception.getMessage());
}

View File

@ -257,8 +257,10 @@ public class BlindVoteStateMonitoringService implements DaoSetupService, DaoStat
periodService.getCycle(blockHeight).ifPresent(cycle -> {
List<BlindVote> blindVotes = blindVoteListService.getConfirmedBlindVotes().stream()
.filter(e -> periodService.isTxInCorrectCycle(e.getTxId(), blockHeight))
.sorted(Comparator.comparing(BlindVote::getTxId)).collect(Collectors.toList());
.filter(e -> e.getTxId() != null)
.filter(e -> periodService.isTxInPhaseAndCycle(e.getTxId(), DaoPhase.Phase.BLIND_VOTE, blockHeight))
.sorted(Comparator.comparing(BlindVote::getTxId))
.collect(Collectors.toList());
// We use MyBlindVoteList to get the serialized bytes from the blindVotes list
byte[] serializedBlindVotes = new MyBlindVoteList(blindVotes).toProtoMessage().toByteArray();

View File

@ -259,8 +259,8 @@ public class ProposalStateMonitoringService implements DaoSetupService, DaoState
periodService.getCycle(blockHeight).ifPresent(cycle -> {
List<Proposal> proposals = proposalService.getValidatedProposals().stream()
.filter(e -> periodService.isTxInPhaseAndCycle(e.getTxId(), DaoPhase.Phase.PROPOSAL, blockHeight))
.filter(e -> e.getTxId() != null)
.filter(e -> periodService.isTxInPhaseAndCycle(e.getTxId(), DaoPhase.Phase.PROPOSAL, blockHeight))
.sorted(Comparator.comparing(Proposal::getTxId))
.collect(Collectors.toList());

View File

@ -33,6 +33,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -40,6 +41,8 @@ import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.jetbrains.annotations.Nullable;
// If a new BaseCurrencyNetwork type gets added we need to add the resource file for it as well!
@Slf4j
@Singleton
@ -69,11 +72,12 @@ public class DefaultSeedNodeRepository implements SeedNodeRepository {
List<NodeAddress> result = getSeedNodeAddressesFromPropertyFile(config.baseCurrencyNetwork.name().toLowerCase());
cache.addAll(result);
// filter
// let values configured by filter fail more gracefully
cache.removeAll(
config.bannedSeedNodes.stream()
.filter(n -> !n.isEmpty())
.map(NodeAddress::new)
.map(this::getNodeAddress)
.filter(Objects::nonNull)
.collect(Collectors.toSet()));
log.info("Seed nodes: {}", cache);
@ -124,4 +128,14 @@ public class DefaultSeedNodeRepository implements SeedNodeRepository {
reload();
return cache.contains(nodeAddress);
}
@Nullable
private NodeAddress getNodeAddress(String n) {
try {
return new NodeAddress(n);
} catch (Throwable t) {
log.error("exception when filtering banned seednodes", t);
}
return null;
}
}

View File

@ -157,7 +157,7 @@ public final class ArbitrationManager extends DisputeManager<ArbitrationDisputeL
@Override
protected String getDisputeInfo(Dispute dispute) {
String role = Res.get("shared.arbitrator").toLowerCase();
String link = "https://docs.bisq.network/trading-rules.html#legacy-arbitration";
String link = "https://bisq.wiki/Arbitrator#Arbitrator_versus_Legacy_Arbitrator";
return Res.get("support.initialInfo", role, role, link);
}

View File

@ -144,7 +144,7 @@ public final class MediationManager extends DisputeManager<MediationDisputeList>
@Override
protected String getDisputeInfo(Dispute dispute) {
String role = Res.get("shared.mediator").toLowerCase();
String link = "https://docs.bisq.network/trading-rules.html#mediation";
String link = "https://bisq.wiki/Dispute_resolution#Level_2:_Mediation";
return Res.get("support.initialInfo", role, role, link);
}

View File

@ -133,7 +133,7 @@ public final class RefundManager extends DisputeManager<RefundDisputeList> {
@Override
protected String getDisputeInfo(Dispute dispute) {
String role = Res.get("shared.refundAgent").toLowerCase();
String link = "https://docs.bisq.network/trading-rules.html#arbitration";
String link = "https://bisq.wiki/Dispute_resolution#Level_3:_Arbitration";
return Res.get("support.initialInfo", role, role, link);
}

View File

@ -85,7 +85,7 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
new BlockChainExplorer("mempool.emzy.de (@emzy)", "https://mempool.emzy.de/tx/", "https://mempool.emzy.de/address/"),
new BlockChainExplorer("mempool.emzy.de Tor V3", "http://mempool4t6mypeemozyterviq3i5de4kpoua65r3qkn5i3kknu5l2cad.onion/tx/", "http://mempool4t6mypeemozyterviq3i5de4kpoua65r3qkn5i3kknu5l2cad.onion/address/"),
new BlockChainExplorer("mempool.bisq.services (@devinbileck)", "https://mempool.bisq.services/tx/", "https://mempool.bisq.services/address/"),
new BlockChainExplorer("mempool.bisq.services Tor V3", "http://mempoolusb2f67qi7mz2it7n5e77a6komdzx6wftobcduxszkdfun2yd.onion/tx/", "http://mempoolusb2f67qi7mz2it7n5e77a6komdzx6wftobcduxszkdfun2yd.onion/address/"),
new BlockChainExplorer("mempool.bisq.services Tor V3", "http://mempoolcutehjtynu4k4rd746acmssvj2vz4jbz4setb72clbpx2dfqd.onion/tx/", "http://mempoolcutehjtynu4k4rd746acmssvj2vz4jbz4setb72clbpx2dfqd.onion/address/"),
new BlockChainExplorer("Blockstream.info", "https://blockstream.info/tx/", "https://blockstream.info/address/"),
new BlockChainExplorer("Blockstream.info Tor V3", "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/tx/", "http://explorerzydxu5ecjrkwceayqybizmpjjznk5izmitf2modhcusuqlid.onion/address/"),
new BlockChainExplorer("OXT", "https://oxt.me/transaction/", "https://oxt.me/address/"),
@ -142,7 +142,7 @@ public final class Preferences implements PersistedDataHost, BridgeAddressProvid
private static final ArrayList<String> TX_BROADCAST_SERVICES = new ArrayList<>(Arrays.asList(
"http://mempoolhqx4isw62xs7abwphsq7ldayuidyx2v2oethdhhj6mlo2r6ad.onion/api/tx", // @wiz
"http://mempool4t6mypeemozyterviq3i5de4kpoua65r3qkn5i3kknu5l2cad.onion/api/tx", // @emzy
"http://mempoolusb2f67qi7mz2it7n5e77a6komdzx6wftobcduxszkdfun2yd.onion/api/tx" // @devinbileck
"http://mempoolcutehjtynu4k4rd746acmssvj2vz4jbz4setb72clbpx2dfqd.onion/api/tx" // @devinbileck
));
public static final boolean USE_SYMMETRIC_SECURITY_DEPOSIT = true;

View File

@ -396,7 +396,7 @@ offerbook.warning.counterpartyTradeRestrictions=This offer cannot be taken due t
offerbook.warning.newVersionAnnouncement=With this version of the software, trading peers can verify and sign each others' payment accounts to create a network of trusted payment accounts.\n\n\
After successfully trading with a peer with a verified payment account, your payment account will be signed and trading limits will be lifted after a certain time interval (length of this interval is based on the verification method).\n\n\
For more information on account signing, please see the documentation at [HYPERLINK:https://docs.bisq.network/payment-methods#account-signing].
For more information on account signing, please see the documentation at [HYPERLINK:https://bisq.wiki/Account_limits#Account_signing].
popup.warning.tradeLimitDueAccountAgeRestriction.seller=The allowed trade amount is limited to {0} because of security restrictions based on the following criteria:\n\
- The buyer''s account has not been signed by an arbitrator or a peer\n\
@ -915,13 +915,13 @@ portfolio.pending.mediationResult.popup.info=The mediator has suggested the foll
Both traders agreeing to the mediator''s suggestion is the happy path—requesting arbitration is meant for \
exceptional circumstances, such as if a trader is sure the mediator did not make a fair payout suggestion \
(or if the other peer is unresponsive).\n\n\
More details about the new arbitration model: [HYPERLINK:https://docs.bisq.network/trading-rules.html#arbitration]
More details about the new arbitration model: [HYPERLINK:https://bisq.wiki/Dispute_resolution#Level_3:_Arbitration]
portfolio.pending.mediationResult.popup.selfAccepted.lockTimeOver=You have accepted the mediator''s suggested payout \
but it seems that your trading peer has not accepted it.\n\n\
Once the lock time is over on {0} (block {1}), you can open a second-round dispute with an arbitrator who will \
investigate the case again and do a payout based on their findings.\n\n\
You can find more details about the arbitration model at:\
[HYPERLINK:https://docs.bisq.network/trading-rules.html#arbitration]
[HYPERLINK:https://bisq.wiki/Dispute_resolution#Level_3:_Arbitration]
portfolio.pending.mediationResult.popup.openArbitration=Reject and request arbitration
portfolio.pending.mediationResult.popup.alreadyAccepted=You've already accepted
@ -1171,7 +1171,7 @@ support.initialInfo=Please enter a description of your problem in the text field
\t● Which operating system are you using?\n\
\t● If you encountered an issue with failed transactions please consider switching to a new data directory.\n\
\t Sometimes the data directory gets corrupted and leads to strange bugs. \n\
\t See: https://docs.bisq.network/backup-recovery.html#switch-to-a-new-data-directory\n\n\
\t See: https://bisq.wiki/Switching_to_a_new_data_directory\n\n\
Please make yourself familiar with the basic rules for the dispute process:\n\
\t● You need to respond to the {0}''s requests within 2 days.\n\
\t● Mediators respond in between 2 days. Arbitrators respond in between 5 business days.\n\
@ -2973,7 +2973,7 @@ popup.accountSigning.signAccounts.ECKey.error=Bad arbitrator ECKey
popup.accountSigning.success.headline=Congratulations
popup.accountSigning.success.description=All {0} payment accounts were successfully signed!
popup.accountSigning.generalInformation=You'll find the signing state of all your accounts in the account section.\n\n\
For further information, please visit [HYPERLINK:https://docs.bisq.network/payment-methods#account-signing].
For further information, please visit [HYPERLINK:https://bisq.wiki/Account_limits#Account_signing].
popup.accountSigning.signedByArbitrator=One of your payment accounts has been verified and signed by an arbitrator. Trading with this account will automatically sign your trading peer''s account after a successful trade.\n\n{0}
popup.accountSigning.signedByPeer=One of your payment accounts has been verified and signed by a trading peer. Your initial trading limit will be lifted and you''ll be able to sign other accounts in {0} days from now.\n\n{1}
popup.accountSigning.peerLimitLifted=The initial limit for one of your accounts has been lifted.\n\n{0}
@ -3442,7 +3442,7 @@ payment.f2f.info='Face to Face' trades have different rules and come with differ
of what happened at the meeting. In such cases the BTC funds might get locked indefinitely or until the trading peers come to \
an agreement.\n\n\
To be sure you fully understand the differences with 'Face to Face' trades please read the instructions and \
recommendations at: [HYPERLINK:https://docs.bisq.network/trading-rules.html#f2f-trading]
recommendations at: [HYPERLINK:https://bisq.wiki/Face-to-face_(payment_method)]
payment.f2f.info.openURL=Open web page
payment.f2f.offerbook.tooltip.countryAndCity=Country and city: {0} / {1}
payment.f2f.offerbook.tooltip.extra=Additional information: {0}

View File

@ -21,6 +21,7 @@ import bisq.network.p2p.NodeAddress;
import bisq.common.config.Config;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
@ -45,4 +46,21 @@ public class DefaultSeedNodeRepositoryTest {
Assert.assertTrue(DUT.getSeedNodeAddresses().contains(new NodeAddress(seed1)));
Assert.assertTrue(DUT.getSeedNodeAddresses().contains(new NodeAddress(seed2)));
}
@Test
public void ignoreBannedSeedNodesWithWrongFormat() {
String seed1 = "asdfbroken";
String seed2 = "localhost:2002";
String baseCurrencyNetwork = format("--%s=%s", Config.BASE_CURRENCY_NETWORK, "btc_regtest");
String bannedSeedNodesOption = format("--%s=%s,%s", Config.BANNED_SEED_NODES, seed1, seed2);
Config config = new Config(baseCurrencyNetwork, bannedSeedNodesOption);
DefaultSeedNodeRepository DUT = new DefaultSeedNodeRepository(config);
Assert.assertFalse(DUT.getSeedNodeAddresses().contains(new NodeAddress(seed2)));
}
@After
public void tearDown() {
//restore default Config
new Config();
}
}

View File

@ -244,7 +244,7 @@ public class FiatAccountsView extends PaymentAccountsView<GridPane, FiatAccounts
new Popup().information(Res.get("payment.f2f.info"))
.width(700)
.closeButtonText(Res.get("payment.f2f.info.openURL"))
.onClose(() -> GUIUtil.openWebPage("https://docs.bisq.network/trading-rules.html#f2f-trading"))
.onClose(() -> GUIUtil.openWebPage("https://bisq.wiki/Face-to-face_(payment_method)"))
.actionButtonText(Res.get("shared.iUnderstand"))
.onAction(() -> doSaveNewAccount(paymentAccount))
.show();

View File

@ -436,7 +436,7 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
String key = "securityDepositInfo";
new Popup().backgroundInfo(Res.get("popup.info.securityDepositInfo"))
.actionButtonText(Res.get("shared.faq"))
.onAction(() -> GUIUtil.openWebPage("https://bisq.network/faq#6"))
.onAction(() -> GUIUtil.openWebPage("https://bisq.wiki/Frequently_asked_questions#Why_does_Bisq_require_a_security_deposit_in_BTC.3F"))
.useIUnderstandButton()
.dontShowAgainId(key)
.show();

View File

@ -992,7 +992,10 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
}
public String getTradeAmount() {
return btcFormatter.formatCoinWithCode(dataModel.getAmount().get());
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.getAmount().get(),
true,
btcFormatter);
}
public String getSecurityDepositLabel() {
@ -1006,10 +1009,13 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
}
public String getSecurityDepositInfo() {
return btcFormatter.formatCoinWithCode(dataModel.getSecurityDeposit()) +
GUIUtil.getPercentageOfTradeAmount(dataModel.getSecurityDeposit(),
return FeeUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
dataModel.getSecurityDeposit(),
dataModel.getAmount().get(),
Restrictions.getMinBuyerSecurityDepositAsCoin());
true,
btcFormatter,
Restrictions.getMinBuyerSecurityDepositAsCoin()
);
}
public String getSecurityDepositWithCode() {
@ -1044,11 +1050,17 @@ public abstract class MutableOfferViewModel<M extends MutableOfferDataModel> ext
}
public String getTotalToPayInfo() {
final String totalToPay = this.totalToPay.get();
if (dataModel.isCurrencyForMakerFeeBtc())
return totalToPay;
else
return totalToPay + " + " + bsqFormatter.formatCoinWithCode(dataModel.getMakerFee());
if (dataModel.isCurrencyForMakerFeeBtc()) {
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.totalToPayAsCoin.get(),
true,
btcFormatter);
} else {
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.totalToPayAsCoin.get(),
true,
btcFormatter) + " + " + getTradeFee();
}
}
public String getFundsStructure() {

View File

@ -47,7 +47,7 @@ public abstract class OfferDataModel extends ActivatableDataModel {
@Getter
protected final BooleanProperty isBtcWalletFunded = new SimpleBooleanProperty();
@Getter
protected final ObjectProperty<Coin> totalToPayAsCoin = new SimpleObjectProperty<>();
public final ObjectProperty<Coin> totalToPayAsCoin = new SimpleObjectProperty<>();
@Getter
protected final ObjectProperty<Coin> balance = new SimpleObjectProperty<>();
@Getter

View File

@ -512,7 +512,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
String key = "securityDepositInfo";
new Popup().backgroundInfo(Res.get("popup.info.securityDepositInfo"))
.actionButtonText(Res.get("shared.faq"))
.onAction(() -> GUIUtil.openWebPage("https://bisq.network/faq#6"))
.onAction(() -> GUIUtil.openWebPage("https://bisq.wiki/Frequently_asked_questions#Why_does_Bisq_require_a_security_deposit_in_BTC.3F"))
.useIUnderstandButton()
.dontShowAgainId(key)
.show();
@ -520,7 +520,7 @@ public class TakeOfferView extends ActivatableViewAndModel<AnchorPane, TakeOffer
String tradeAmountText = model.isSeller() ? Res.get("takeOffer.takeOfferFundWalletInfo.tradeAmount", model.getTradeAmount()) : "";
String message = Res.get("takeOffer.takeOfferFundWalletInfo.msg",
model.totalToPay.get(),
model.getTotalToPayInfo(),
tradeAmountText,
model.getSecurityDepositInfo(),
model.getTradeFee(),

View File

@ -684,14 +684,20 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
}
String getTradeAmount() {
return btcFormatter.formatCoinWithCode(dataModel.getAmount().get());
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.getAmount().get(),
true,
btcFormatter);
}
public String getSecurityDepositInfo() {
return btcFormatter.formatCoinWithCode(dataModel.getSecurityDeposit()) +
GUIUtil.getPercentageOfTradeAmount(dataModel.getSecurityDeposit(),
return FeeUtil.getTradeFeeWithFiatEquivalentAndPercentage(offerUtil,
dataModel.getSecurityDeposit(),
dataModel.getAmount().get(),
Restrictions.getMinBuyerSecurityDepositAsCoin());
true,
btcFormatter,
Restrictions.getMinBuyerSecurityDepositAsCoin()
);
}
public String getSecurityDepositWithCode() {
@ -725,11 +731,17 @@ class TakeOfferViewModel extends ActivatableWithDataModel<TakeOfferDataModel> im
}
public String getTotalToPayInfo() {
final String totalToPay = this.totalToPay.get();
if (dataModel.isCurrencyForTakerFeeBtc())
return totalToPay;
else
return totalToPay + " + " + bsqFormatter.formatCoinWithCode(dataModel.getTakerFee());
if (dataModel.isCurrencyForTakerFeeBtc()) {
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.totalToPayAsCoin.get(),
true,
btcFormatter);
} else {
return FeeUtil.getTradeFeeWithFiatEquivalent(offerUtil,
dataModel.totalToPayAsCoin.get(),
true,
btcFormatter) + " + " + getTradeFee();
}
}
public String getTxFee() {

View File

@ -8,4 +8,4 @@
- [dao-setup.md](dao-setup.md): (deprecated) Set up a complete Bisq DAO development environment
- [testing.md](testing.md): Learn about the Bisq testing process and how you can contribute.
Looking for user-facing documentation? See https://docs.bisq.network.
Looking for user-facing documentation? See https://bisq.wiki.

View File

@ -39,6 +39,8 @@
gradlew.bat build
```
If you prefer to skip tests to speed up the building process, just append _-x test_ to the previous commands.
### Important notes
1. You do _not_ need to install Gradle to build Bisq. The `gradlew` shell script will install it for you, if necessary.

View File

@ -28,11 +28,15 @@ You can find more information about the Bitcoin regtest mode [here](https://bitc
Navigate to the [bitcoin.conf](https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File) file and set `regtest=1` and `peerbloomfilters=1`, or add `-regtest -peerbloomfilters=1` as a program arguments when starting Bitcoin Core.
At first startup you need to create 101 blocks using the command `generate 101`* from the terminal inside Bitcoin Core. 101 blocks are required because of the coin maturity (100 blocks) so you need one more to have at least 50 BTC available for spending.
At first startup you need to create 101 blocks using the command `generatetoaddress 101 address`* from the terminal inside Bitcoin Core, where `address` value could be obtained with the command `getnewaddress`. 101 blocks are required because of the coin maturity (100 blocks) so you need one more to have at least 50 BTC available for spending.
Later you can create new blocks with `generate 1`*.
Example:
*This method is deprecated in Bitcoin Core's v.0.18 and will be fully removed in v.0.19. Use instead `generatetoaddress amount address`.
generatetoaddress 101 bcrt1qhqn0t94uc269szakr4ez0zh7erdd6tlm4pv6mg
Later you can create new blocks with `generatetoaddress 1 address`*.
*If you are using Bitcoin Core v.0.18 or less, use instead `generate 1`.
## Understand Bisq P2P network options
@ -90,4 +94,4 @@ and
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. You can also open disputes with `cmd+o` and see how the arbitration system works (run the arbitrator in that case as well).
_Remember to generate a new block in the Bitcoin Core console after taking an offer using the command `generate 1` to trigger a block confirmation._
_Remember to generate a new block in the Bitcoin Core console after taking an offer using the command `generatetoaddress 1 address` to trigger a block confirmation._

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -1,18 +1,21 @@
# Importing Bisq into IntelliJ IDEA
Most Bisq contributors use IDEA for development. The following instructions have been tested on IDEA 2019.2.
Most Bisq contributors use IDEA for development. The following instructions have been tested on IDEA 2021.1.
1. Follow the instructions in [build.md](build.md) to clone and build Bisq at the command line.
1. Open IDEA
1. Go to `Preferences->Plugins` (`File->Settings, Plugins for Windows`). Search for and install the _Lombok_ plugin. When prompted, do not restart IDEA.
1. Go to `Preferences->Build, Execution, Deployment->Compiler->Annotation Processors` and check the `Enable annotation processing` option (to enable processing of Lombok annotations)
1. Restart IDEA
1. Go to `Import Project`, select the `settings.gradle` file and click `Open`
1. In the `Import Project from Gradle` screen, check the `Use auto-import` option and click `OK`
1. When prompted whether to overwrite the existing `.idea` directory, click `Yes` (This step was not required with 2019.2 but is kept here in case you are running an older version)
1. In the `Project` tool window, right click on the root-level `.idea` folder, select `Git->Revert...` and click OK in the dialog that appears (to restore source-controlled `.idea` configuration files that get overwritten during project import)
1. If you did not yet setup JDK10 in IntelliJ, Go to `File->Project Structure->Project` and under the `Project SDK` option locate your JAVA_HOME folder, then in `Project language level` beneath select `10 - ...`. (JDK10 is no longer supported but you can still download it from the [archive](https://jdk.java.net/archive/))
1. Select JDK 10 for gradle as well. Go to `Preferences->Build, Execution, Deployment->Build Tools->Gradle` and select the JDK10 location for Gradle JVM
1. Go to `Build->Build Project`. Everything should build cleanly. You should be able to run tests, run `main` methods in any component, etc.
1. Follow the instructions in [build.md](build.md) to clone and build Bisq at the command line.
1. Open IDEA
1. Go to `File -> Settings -> Build, Execution, Deployment -> Compiler -> Annotation Processors` and check the `Enable annotation processing` option to enable processing of Lombok annotations (Lombok plugin installed by default since v2020.3)
1. Go to `File -> New -> Project from Existing Sources...` and then select the main Bisq folder to load automatically the related Gradle project
1. If you did not yet setup JDK11 in IntelliJ, go to `File-> Project Structure -> Project` and under the `Project SDK` option locate your JDK11 folder
1. Select JDK 11 for Gradle as well. Go to `File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle` and select the JDK11 location for the Gradle JVM value
1. Go to `Build -> Build Project`. Everything should build cleanly
1. Go to `Run > Edit Configurations... -> Plus (+) icon on the top left -> Application` anf then fill the requested fields as shown below, while using as CLI arguments one of those listed in [dev-setup.md](dev-setup.md):
> TIP: If you encounter compilation errors in IDEA related to the `protobuf.*` classes, it is probably because you didn't build Bisq at the command line as instructed above. You need to run the `generateProto` task in the `common` project. You can do this via the Gradle tool window in IDEA, or you can do it the command line with `./gradlew :common:generateProto`. Once you've done that, run `Build->Build Project` again and you should have no errors.
![edit_configurations.png](edit_configurations.png)
9. Now you should be able to run Bisq by clicking on the _Play_ button or via `Run -> Run 'Bisq Desktop'`
10. If you want to debug the application and execute breakpoints, use `Run -> Debug 'Bisq Desktop'`
> TIP: If you encounter compilation errors in IDEA related to the `protobuf.*` classes, it is probably because you didn't build Bisq at the command line as instructed above. You need to run the `generateProto` task in the `other` project. You can do this via the Gradle tool window in IDEA, or you can do it the command line with `./gradlew :other:generateProto`. Once you've done that, run `Build -> Build Project` again and you should have no errors.
>
> If this does not solve the issue, try to execute `./gradlew clean` and then rebuild the project again.

View File

@ -13,10 +13,11 @@ In order to take part in the testing process, you will need to do the following:
## Communication Channels
If you would like to discuss and/or contribute to Bisq's testing effort, join us in the #testing channel within the [Bisq Keybase team](https://keybase.io/team/bisq).
Here you could also request access to TestPad (https://bisq.ontestpad.com).
## Compensation
Testing activities are eligible for [compensation](https://docs.bisq.network/dao/phase-zero.html#how-to-request-compensation).
Testing activities are eligible for [compensation](https://bisq.wiki/Making_a_compensation_request).
When submitting a compensation request, please include links to artifacts on TestPad (results/reports) indicating the activities that were performed (e.g. tests that were executed), as well as any bugs that were discovered and entered as a result of testing.
## Testing Process

View File

@ -91,7 +91,7 @@ abstract class MempoolFeeRateProvider extends FeeRateProvider {
private FeeRate getEstimatedFeeRate() {
Set<Map.Entry<String, Long>> feeRatePredictions = getFeeRatePredictions();
long estimatedFeeRate = feeRatePredictions.stream()
.filter(p -> p.getKey().equalsIgnoreCase("fastestFee"))
.filter(p -> p.getKey().equalsIgnoreCase("halfHourFee"))
.map(Map.Entry::getValue)
.findFirst()
.map(r -> Math.max(r, MIN_FEE_RATE))

View File

@ -1,82 +0,0 @@
#!/usr/bin/env bash
# This script will download and install the appropriate JDK for use with Bisq development.
# It will also configure it as the default system JDK.
# If you need to change to another default JDK for another purpose later, you can use the
# following commands and select the default JDK:
# Linux:
# update-alternatives --config java
# update-alternatives --config javac
# MacOS:
# echo 'export JAVA_HOME=/Library/Java/JavaVirtualMachines/<ENTER_NEW_JDK>/Contents/Home' >>~/.bash_profile
# echo 'export PATH=$JAVA_HOME/bin:$PATH' >>~/.bash_profile
# source ~/.bash_profile
set -e
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*)
JAVA_HOME=/usr/lib/jvm/openjdk-11.0.2
JDK_FILENAME=openjdk-11.0.2_linux-x64_bin.tar.gz
JDK_URL=https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
# Determine which package manager to use depending on the distribution
declare -A osInfo;
osInfo[/etc/redhat-release]=yum
osInfo[/etc/arch-release]=pacman
osInfo[/etc/gentoo-release]=emerge
osInfo[/etc/SuSE-release]=zypp
osInfo[/etc/debian_version]=apt-get
for f in "${!osInfo[@]}"
do
if [[ -f $f ]]; then
PACKAGE_MANAGER=${osInfo[$f]}
break
fi
done
if [ ! -d "$JAVA_HOME" ]; then
# Ensure curl is installed since it may not be
$PACKAGE_MANAGER -y install curl
curl -L -O $JDK_URL
mkdir -p $JAVA_HOME
tar -zxf $JDK_FILENAME -C $JAVA_HOME --strip 1
rm $JDK_FILENAME
update-alternatives --install /usr/bin/java java $JAVA_HOME/bin/java 2000
update-alternatives --install /usr/bin/javac javac $JAVA_HOME/bin/javac 2000
fi
update-alternatives --set java $JAVA_HOME/bin/java
update-alternatives --set javac $JAVA_HOME/bin/javac
;;
Darwin*)
JAVA_HOME=/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home
JDK_FILENAME=openjdk-11.0.2_osx-x64_bin.tar.gz
JDK_URL=https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_osx-x64_bin.tar.gz
if [ ! -d "$JAVA_HOME" ]; then
if [[ $(command -v brew) == "" ]]; then
echo "Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
else
echo "Updating Homebrew"
brew update
fi
brew install curl
curl -L -O $JDK_URL
sudo mkdir /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk | sudo bash
gunzip -c $JDK_FILENAME | tar xopf -
sudo mv jdk-11.0.2.jdk/* /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk
sudo rmdir jdk-11.0.2.jdk
rm $JDK_FILENAME
fi
echo export JAVA_HOME=$JAVA_HOME >>~/.bash_profile
echo export PATH=$JAVA_HOME/bin:"$PATH" >>~/.bash_profile
source "$HOME/.bash_profile"
;;
*)
esac
java -version

View File

@ -0,0 +1,143 @@
#!/bin/bash
# Install OpenJDK 11.0.2 on Linux
set -eu
# Download and install locations
JDK_URL=https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_linux-x64_bin.tar.gz
JAVA_HOME_DIR=/usr/lib/jvm/openjdk-11.0.2
alpine_openjdk_package=openjdk11
alpine_openjdk_location=/usr/lib/jvm/java-11-openjdk
OS=$(uname)
if [ "$OS" != Linux ]
then
echo This script supports Linux only >&2
exit 1
fi
PACKAGE_MANAGER=
for tool in apk yum pacman emerge zypper apt-get dnf
do
if command -v $tool >/dev/null
then
PACKAGE_MANAGER=$tool
break
fi
done
if [ -z "$PACKAGE_MANAGER" ]
then
echo "Unknown OS" >&2
fi
missing=
for cmd in curl tar gzip
do
if ! command -v $cmd >/dev/null
then
missing="${missing+$missing }$cmd"
if [ "$cmd" = curl ]
then
missing="$missing ca-certificates"
fi
fi
done
sudo_exec () {
if [ "${EID-500}" -eq 0 ] || [ "${HOME-/home}" = /root ]
then
"$@"
elif command -v sudo
then
sudo "$@"
else
echo "Can't execute with elevated priviliges: $*" >&2
exit 1
fi
}
# Install missing packages
if [ -n "$missing" ]
then
case "$PACKAGE_MANAGER" in
apk)
: no need to install missing packages, because
: we will install OpenJDK using apk
;;
pacman)
sudo_exec pacman -Syy --noconfirm "$missing"
;;
apt-get)
sudo_exec apt-get update
# shellcheck disable=SC2086
sudo_exec apt-get install -y --no-install-recommends $missing
;;
dnf|emerge|yum|zypper)
sudo_exec "$PACKAGE_MANAGER" update
# shellcheck disable=SC2086
sudo_exec "$PACKAGE_MANAGER" install -y $missing
;;
*)
echo "The following packages are missing from your system: $missing" >&2
echo "Please install these packages before proceeding" >&2
exit 1;
;;
esac
fi
if [ "$PACKAGE_MANAGER" = apk ]
then
if sudo_exec apk add --no-cache ${alpine_openjdk_package}
then
echo "Installed Java to $alpine_openjdk_location"
echo "To start using 'javac', add $alpine_openjdk_location/bin to your PATH:"
echo "export PATH=$alpine_openjdk_location/bin:\$PATH"
fi
exit
fi
JDK_FILENAME=$(basename "$JDK_URL")
tmpdir=$(mktemp -d)
trap -- 'rm -rf "$tmpdir"' EXIT
mkdir "$tmpdir/JAVA_HOME_DIR"
curl -L -o "$tmpdir/$JDK_FILENAME" "$JDK_URL"
tar -xf "$tmpdir/$JDK_FILENAME" -C "$tmpdir/JAVA_HOME_DIR" --strip-components=1
if [ -d "$tmpdir/JAVA_HOME_DIR/bin" ]
then
sudo_exec rm -rf "$JAVA_HOME_DIR"
sudo_exec mkdir -p "$(dirname "$JAVA_HOME_DIR")"
sudo_exec mv "$tmpdir/JAVA_HOME_DIR" "$JAVA_HOME_DIR"
else
echo "Error extracting archive contents" >&2
exit 1
fi
echo "Java has been installed in $JAVA_HOME_DIR"
if command -v update-alternatives >/dev/null
then
update-alternatives --install /usr/bin/java java "$JAVA_HOME_DIR/bin/java" 2000
update-alternatives --install /usr/bin/javac javac "$JAVA_HOME_DIR/bin/javac" 2000
update-alternatives --set java "$JAVA_HOME_DIR/bin/java"
update-alternatives --set javac "$JAVA_HOME_DIR/bin/javac"
echo "and configured as the default JDK using 'update-alternatives'."
echo "If you need to change to another JDK later, you can do so like so:"
echo " update-alternatives --config java"
echo " update-alternatives --config javac"
else
echo "To start using it, please set/update your 'JAVA_HOME' and 'PATH' environment variables like so:"
echo
echo "export JAVA_HOME=\"$JAVA_HOME_DIR\""
echo "export PATH=\"$JAVA_HOME_DIR/bin:\$PATH\""
echo
echo "Consider adding the above lines to one of your personal initialization files"
echo " like ~/.bashrc, ~/.bash_profile, ~/.profile, or similar."
fi

View File

@ -0,0 +1,60 @@
#!/bin/bash
# Install OpenJDK 11.0.2 on macOS
set -eu
# Download and install locations
JDK_URL=https://download.java.net/java/GA/jdk11/9/GPL/openjdk-11.0.2_osx-x64_bin.tar.gz
JAVA_HOME_DIR=/Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk
OS=$(uname)
if [[ $OS != Darwin ]]
then
echo This script supports macOS only >&2
exit 1
fi
command -v curl >/dev/null || { echo "cURL is not available" >&2; exit 1; }
command -v tar >/dev/null || { echo "tar is not available" >&2; exit 1; }
sudo_exec () {
if [[ $EUID -eq 0 ]]
then
"$@"
else
sudo "$@"
fi
}
JDK_FILENAME=$(basename "$JDK_URL")
tmpdir=$(mktemp -d)
trap -- 'rm -rf "$tmpdir"' EXIT
mkdir "$tmpdir/JAVA_HOME_DIR"
curl -L -o "$tmpdir/$JDK_FILENAME" "$JDK_URL"
tar -xf "$tmpdir/$JDK_FILENAME" -C "$tmpdir/JAVA_HOME_DIR" --strip-components=2
if [[ -d "$tmpdir/JAVA_HOME_DIR/Contents" ]]
then
sudo_exec rm -rf "$JAVA_HOME_DIR"
sudo_exec mkdir -p "$(dirname "$JAVA_HOME_DIR")"
sudo_exec mv "$tmpdir/JAVA_HOME_DIR" "$JAVA_HOME_DIR"
else
echo "Error extracting archive contents" >&2
exit 1
fi
echo "Java has been installed in $JAVA_HOME_DIR"
echo "To start using it, please set/update your 'JAVA_HOME' and 'PATH' environment variables like so:"
echo
echo " export JAVA_HOME=\"$JAVA_HOME_DIR/Contents/Home\""
echo " export PATH=\"$JAVA_HOME_DIR/Contents/Home/bin:\$PATH\""
echo
echo "Consider adding the above lines to one of your personal initialization files."
echo "(~/.bashrc, ~/.bash_profile, ~/.profile, or similar)."
export JAVA_HOME="$JAVA_HOME_DIR/Contents/Home"
export PATH="$JAVA_HOME_DIR/Contents/Home/bin":$PATH

View File

@ -123,8 +123,8 @@ echo "[*] Moving Bisq repo"
sudo -H -i -u "${ROOT_USER}" mv "${ROOT_HOME}/${BISQ_REPO_NAME}" "${BISQ_HOME}/${BISQ_REPO_NAME}"
sudo -H -i -u "${ROOT_USER}" chown -R "${BISQ_USER}:${BISQ_GROUP}" "${BISQ_HOME}/${BISQ_REPO_NAME}"
echo "[*] Installing OpenJDK 10.0.2 from Bisq repo"
sudo -H -i -u "${ROOT_USER}" "${BISQ_HOME}/${BISQ_REPO_NAME}/scripts/install_java.sh"
echo "[*] Installing OpenJDK 11.0.2 from Bisq repo"
sudo -H -i -u "${ROOT_USER}" "${BISQ_HOME}/${BISQ_REPO_NAME}/scripts/install_java_linux.sh"
echo "[*] Installing Bisq init script"
sudo -H -i -u "${ROOT_USER}" install -c -o "${ROOT_USER}" -g "${ROOT_GROUP}" -m 644 "${BISQ_HOME}/${BISQ_REPO_NAME}/seednode/bisq.service" "${SYSTEMD_SERVICE_HOME}/bisq.service"