Commit Graph

3663 Commits

Author SHA1 Message Date
Chris Beams
7a718f0ed5
Move grpc generation from :grpc to :core
Such that :grpc (soon to be renamed to :daemon), :cli and :desktop can
access these types.
2020-01-20 12:07:55 +01:00
Chris Beams
8b30c22d6e
Move bisq.core{=>.app}.CoreModule
There are two structural / organizational reasons for this move:

 1. References from one package to another should always be upward or
 lateral, never downward, as the latter causes package cycles (aka
 'tangles') which damage the suppleness and understandability of a large
 codebase. Prior to this change the high-level bisq.core.CoreModule
 class imported many classes from child packages like
 bisq.core.{btc,dao,user,util}, etc. By moving CoreModule down into the
 '.app' package, it can reference all these other packages as siblings
 instead of doing so as a parent.

 2. the bisq.core.desktop and bisq.core.app packages are the only
 locations that reference the CoreModule class. By moving the class
 into bisq.core.app, greater cohesion is acheived, again making the
 codebase that much easier to read and understand.
2020-01-20 12:07:43 +01:00
Chris Beams
65175a7f4f
Remove --desktopWith{Grpc|Http}Api options for now
The previous commit introduces the BisqGrpcServer as a proof of concept,
but it is not yet ready for production use. This commit removes the
`--desktopWithGrpcApi` option that starts the gRPC server until such
time that it is production-ready.

This change also removes the `--desktopWithHttpApi` option for starting
an HTTP API server. The option has been in place for some time, but it
was 'false advertising' in the sense that nothing actually happened if
the user specified it, because there is in fact no HTTP API
implementation to be started.

Note that when the gRPC API option is reintroduced, it will be renamed
to `--rpcserver` or similar, following the convention in Bitcoin Core.
2020-01-10 19:48:26 +01:00
chimp1984
5c02ce5766
Introduce gRPC API proof of concept
This commit introduces a new `grpc` module including the following key
types:

 - BisqGrpcServer: The API implementation itself, along with generated
   gRPC Response/Reploy types defined in grpc/src/main/proto/grpc.proto.

 - BisqGrpcServerMain: A 'headless' / daemon-like entry point for
   running a Bisq node without the JavaFX desktop UI.

 - BisqGrpcClient: A simple, repl-style client for the API that allows
   the user to exercise the various endpoints as seen in the example
   below.

In the `desktop` module, the BisqAppMain class has been modified to
start a BisqGrpcServer instance if the `--desktopWithGrpcApi` option has
been set to `true`.

In the `core` module, a new `CoreApi` class has been introduced
providing a kind of comprehensive facade for all Bisq functionality to
be exposed via the RPC API.

How to explore the proof of concept:

 1. Run the main() method in BisqAppMain providing
 `--desktopWithGrpcApi=true` as a program argument or alternatively, run
 the main() method in BisqGrpcServerMain, where no special option is
 required. In either case, you'll notice the following entry in the log
 output:

    INFO  bisq.grpc.BisqGrpcServer: Server started, listening on 8888

 2. Now run the main() method in BisqGrpcClient. Once it has started up
 you are connected to the gRPC server started in step 1 above. To
 exercise the API, type `getVersion` via stdin and hit return. You
 should see the following response:

    INFO bisq.grpc.BisqGrpcClient - 1.2.4

 Likewise, you can type `getBalance` and you'll see the following
 response:

    INFO bisq.grpc.BisqGrpcClient - 0.00 BTC

 and so forth for each of the implemented endpoints. For a list of
 implemented endpoints, see BisqGrpcServer.start().

Note once again that the code here is merely a proof of concept and
should not be considered complete or production-ready in any way. In a
subsequent commit, the `--desktopWithGrpcApi` option will be disabled in
order to avoid any potential production use.

The content of this commit is the result of squashing a number of
commits originally authored by chimp1984 in the `chimp1984` fork's `grpc`
branch.

Co-authored-by: Chris Beams <chris@beams.io>
2020-01-10 19:48:26 +01:00
wiz
4e30402d78
Dark mode isn't beta anymore šŸŽ‰ 2020-01-09 20:56:21 +09:00
Christoph Atteneder
ce1e954236
Remove dead code 2020-01-08 21:23:02 +01:00
Christoph Atteneder
744173ce61
Merge pull request #3875 from wiz/disable-z33nukt7ngik3cpe-btcnode
Temporarily disable z33nukt7ngik3cpe btcnode due to failing service cā€¦
2020-01-08 09:08:55 +01:00
Christoph Atteneder
9523c04788
Merge pull request #3874 from wiz/tweak-wiz-btcnode-clearnet
Update clearnet hostnames / IPs for 2 btcnodes operated by @wiz
2020-01-08 09:08:35 +01:00
Christoph Atteneder
c960e6d3fc
Merge pull request #3873 from wiz/add-m52go-btcnode
Add new 4nnuyxm5k5tlyjq3.onion:8333 btcnode operated by @m52go
2020-01-08 09:08:13 +01:00
wiz
b67f901f18
Temporarily disable z33nukt7ngik3cpe btcnode due to failing service checks 2020-01-08 07:57:41 +09:00
wiz
be59df4ff7
Migrated onions for my 2 btcnodes to new servers, only clearnet changed 2020-01-08 07:31:34 +09:00
wiz
e75bc14037
Add new 4nnuyxm5k5tlyjq3.onion:8333 btcnode operated by @m52go 2020-01-08 07:12:18 +09:00
wiz
5c6c5f77e8
Add bsq.bisq.cc BSQ explorer operated by @m52go 2020-01-08 06:47:33 +09:00
Christoph Atteneder
e7c16a6fe7
Use general "(required minimum)" label with BTC value if min value is used 2020-01-07 18:20:33 +01:00
Christoph Atteneder
d904d1ee6a
Show minimum security deposit in create offer dialog when used
In the past we allowed the user to enter a percentage of the trade amount
although it wasn't used if the minimum security deposit was higher.
2020-01-07 17:30:00 +01:00
Christoph Atteneder
e6f491c8ac
Add information if minimum trading fee or minimum security deposit is used 2020-01-07 16:32:24 +01:00
Christoph Atteneder
02ac14e234
Use trading fee in BSQ fee comparison 2020-01-07 16:28:56 +01:00
wiz
a4a5415a57
Add bsq.emzy.de BSQ explorer operated by @emzy 2020-01-06 22:27:50 +09:00
wiz
0c160d08ff
Add bsq.vante.me BSQ explorer operated by @mrosseel 2020-01-06 20:34:56 +09:00
wiz
44152fdb57
Add bsq.sqrrm.net BSQ explorer operated by @sqrrm 2020-01-06 19:44:25 +09:00
Devin Bileck
a55c3b5bc2
Add bsq.bisq.services BSQ explorer 2020-01-06 00:22:53 -08:00
wiz
f4b16d2308
Add bsq.ninja BSQ explorer operated by @wiz 2020-01-06 06:33:47 +09:00
wiz
c0783205bb
Check existence of selected block explorer using name string comparison
After further testing, I realized I introduced a bug in commit
4f4b0f6ce9 because apparently the
ArrayList.contains() method does not properly work for
BlockChainExplorer object - to fix this I implemented a new
contains() method that uses string comparison instead
2020-01-04 03:52:11 +09:00
Christoph Atteneder
8e2bad462a
Show the correct sign state icon for accounts that are able to sign (30+ days)
This behavior was different during development time and wasn't updated properly in the UI.
2020-01-03 12:00:35 +01:00
sqrrm
ae2e06de23
Merge pull request #3827 from chimp1984/use-min-refund-at-mediated-payout
Use min. refund at mediated payout
2020-01-03 11:17:49 +01:00
Christoph Atteneder
2792a20afb
Upgrade mempool.space to full block explorer (#3843)
* Upgrade mempool.space to full block explorer functionality

* Add mempool.space Tor V2 block explorer

* If no valid Bitcoin block explorer is set, use the 1st block explorer
2020-01-03 11:12:43 +01:00
Christoph Atteneder
4e905e872e
Merge pull request #3812 from stejbac/fix-some-doc-comment-tags
Fix doc comment warnings in TradeWalletService & OfferUtil
2020-01-03 10:25:14 +01:00
wiz
4f4b0f6ce9
If no valid Bitcoin block explorer is set, use the 1st block explorer 2020-01-03 18:17:41 +09:00
chimp1984
37ef8c0d85
Add comment 2020-01-03 02:13:40 +01:00
Pac
df49d5cdbd
Fix bank account number label for Swedish language
According to issue #3641, the label "Bankgiro number", as it was
hardcoded in BankUtil.java, should not be used in Sweden.
The label "Kontonummer" is the correct one to be used in Sweden and
Norway.

Account number validation is implemented to Norwegian accounts in
AccountNrValidator.java.
There is no validation implemented to Swedish accounts, so nothing
to change there.
If account validation for Sweden is needed, a different method would
be needed.

Fixes #3641
2020-01-02 17:29:58 -03:00
Christoph Atteneder
9a558472f6
Merge pull request #3830 from chimp1984/only-move-to-failed-trades-for-critical-reject-msg
Only move to failed trades if the reject msg is critical
2020-01-02 19:01:28 +01:00
sqrrm
3a74e74e15
Merge pull request #3828 from stejbac/speed-up-trade-charts-view-load
Speed up trades charts view load
2020-01-02 18:46:25 +01:00
sqrrm
eeea465a0c
Merge pull request #3826 from chimp1984/increase-security-deposits
Increase security deposits
2020-01-02 12:18:05 +01:00
sqrrm
567684172d
Merge pull request #3821 from chimp1984/handle-spv-resync-edge-cases
Improve handling of spv resync edge case
2020-01-02 12:04:31 +01:00
wiz
678b8b20bd
Add mempool.space Tor V2 block explorer 2019-12-31 22:16:05 +09:00
wiz
47d0f4f8cd
Upgrade mempool.space to full block explorer functionality 2019-12-31 21:25:49 +09:00
Christoph Atteneder
7980d1ee5d
Add 2 new columns to vote result (#3822)
* Add 2 new columns to vote result

Add threshold and quorum column.
Combine name and link column.
Add sorting function for accepted column.
Adjust column width.

* Fix sorting functions

* Improve column sorting
2019-12-27 19:05:36 +01:00
Christoph Atteneder
42cabe0077
Merge pull request #3813 from wiz/re-enable-kanocztomas-btcnode
Re-enable mbm6ffx6j5ygi2ck.onion btcnode operated by @KanoczTomas
2019-12-27 12:12:13 +01:00
chimp1984
7e44c60b10
Only move to failed trades if the reject msg is critical
We got a report where a "tx already known" message caused a failed
trade but the deposit tx was valid.
To avoid such false positives we only handle reject messages which
we consider clearly critical.
2019-12-24 23:08:45 -05:00
Steven Barclay
0bcf238d71
Optimise CurrencyUtil.get[Fiat|Crypto|Trade]Currency
Use a LinkedHashMap in place of a List, for the caching CurrencyUtil
fields 'allSortedFiatCurrencies' & 'allSortedCryptoCurrencies', using
the same iteration order as before. In this way, we can avoid a linear
search in the lookup methods getFiatCurrency & getCryptoCurrency.

In particular, this speeds up the activation of TradesChartsView (and to
a lesser extent OfferBookChartView), which make a lot of calls to
CurrencyUtil.getTradeCurrency in the fillTradeCurrencies/updateChartData
methods respectively.
2019-12-23 22:29:32 +00:00
chimp1984
47647a98f8
Improve text 2019-12-23 13:19:48 -05:00
chimp1984
fadd384443
Use min. refund at mediated payout
At mediation we require a min. payout to the losing party to keep
incentive for the trader to accept the mediated payout. For Refund
agent cases we do not have that restriction.
2019-12-23 12:55:55 -05:00
chimp1984
95a79a3536
Refactoring: Remove unused parameter 2019-12-23 12:00:58 -05:00
chimp1984
223441bb7d
Adjust security deposits
According to https://github.com/bisq-network/proposals/issues/155

For buyer:
Default: 15%
Min. 15% for Altcoin, 15% for Fiat
Max. 50% for Altcoin, 50% for Fiat
Absolute min. deposit in BTC: 0.006 BTC (currently 40 USD)

For Seller:
Fixed: 15%
Absolute min. deposit in BTC: 0.006 BTC (currently 40 USD)
2019-12-23 11:49:11 -05:00
Steven Barclay
24889c87d7
Remove unused fields passed as constructor params from various classes
These are mostly injected objects that are now redundant, such as some
CoinFormatter and Preferences fields.

Also do some additional minor tidying of TradesChartsViewModel.
2019-12-22 23:48:57 +00:00
chimp1984
31b618d862
Add 2 new columns to vote result
Add threshold and quorum column.
Combine name and link column.
Add sorting function for accepted column.
Adjust column width.
2019-12-21 19:27:28 -05:00
chimp1984
29a8b10cdc
Improve popup text 2019-12-21 17:51:18 -05:00
chimp1984
292ac30f85
Handle unconfirmed BSQ change at spv resync
In case we had an unconfirmed change output we reset the
unconfirmedBsqChangeOutputList so that after a SPV resync we do not
have any dangling BSQ utxos in that list which would cause an incorrect
BSQ balance state after the SPV resync.
2019-12-21 16:59:20 -05:00
chimp1984
de144143e5
Add button for shutdown
If a trader has a pending trade with an unconfirmed tx and is doing a
spv resync, the deposit tx is not found. They get displayed a popup
asking to restart and if problem continues to move trade to failed
trades. In regtest testing the missing deposit tx was always received
from the network at a restart. So this commit adds another button as
default button to shut down Bisq so that the user do first that activity
instead of moving the trade to failed trades.
It is not guaranteed that the trader will receive the missing deposit tx
at restart, but at least it is better as the state before. We should
find a way how to distinguish a valid unconfirmed tx from an invalid one
but it is not clear yet how we can do that and if it is feasible with
doing that with BitcoinJ only. It might require a external service to
look up the tx if it is in the mem pool, but even that will never gie a
100% certainty.
2019-12-21 16:17:12 -05:00
wiz
97b0651669
Re-enable mbm6ffx6j5ygi2ck.onion btcnode operated by @KanoczTomas
Fixes #3810
2019-12-20 02:10:10 +09:00