Commit Graph

967 Commits (21429f24b24af313a64e7a2b290727a63958a8c6)
 

Author SHA1 Message Date
rishflab 21429f24b2
Inline wait_for_locked_bitcoin() that is only called once
Reduce indirection.
3 years ago
rishflab 6a3e4802f1
Remove redundant reference 3 years ago
rishflab 458a8d594a
Rename fn param to correctly reflect underlying type 3 years ago
rishflab 752e5be8f3
Cleanup test logging 3 years ago
Thomas Eizinger 2704245ed5
Fix monero refresh interval
The comparison should be the MAXIMUM of the two values, not the
minimum, otherwise we always refresh at an interval of 1 second.
3 years ago
bors[bot] 904312d1e9
Merge #313
313: Bump tracing-subscriber to 0.2.17 r=da-kami a=thomaseizinger

This release includes a bug-fix that removes an erroneous space
from our logs when running with `--debug`.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
bors[bot] a02389f8bd
Merge #314
314: Remove CLI config file in favour of parameters r=thomaseizinger a=da-kami

Fixes #282 

The CLI has sensible default values for all parameters,
thus a config file is not really an advantage but just
keeps getting in our way, so re remove it.

Trait impls on `Data` needed for structopt, see https://docs.rs/structopt/0.3.21/structopt/#default-values

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
bors[bot] 8505d76561
Merge #311
311: Add asb to release including ARM build r=da-kami a=da-kami

https://github.com/da-kami/xmr-btc-swap/releases/tag/0.3-test

The asb ARM build does neither run tests on CI not smoke test for the binary upon release because the there is no standard runner for ARM. One can configure a self-hosted one but I think that might be an overkill: https://docs.github.com/en/actions/hosting-your-own-runners/adding-self-hosted-runners

I did download the produced ARM tar, unpack and test on the raspi, it works :)

Concerning openssl depdency see:

https://github.com/da-kami/xmr-btc-swap/runs/2093523365?check_suite_focus=true
https://www.reddit.com/r/rust/comments/axaq9b/opensslsys_error_when_crosscompiling_for/


Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
Daniel Karzel 222724b59a Update bors config
Add armv build check to bors.
Update build and test names due to matix configuration changes.
3 years ago
Daniel Karzel 0091b6cdaf Remove CLI config file in favour of parameters
The CLI has sensible default values for all parameters,
thus a config file is not really an advantage but just
keeps getting in our way, so re remove it.
3 years ago
Daniel Karzel 442c377490 Remove openssl dependency
Upgrade tokio-tungstenite to 0.14 and use feature flag rustls-tls
to get rid of the openssl dependency.
3 years ago
Daniel Karzel f8360fe853 .cargo/config.toml for specifying linker
To avoid code duplication we specify the linker for the specific
target armv7-unknown-linux-gnueabihf in the config.toml file as
specified here:
https://doc.rust-lang.org/cargo/reference/config.html#targettriplelinker
3 years ago
Daniel Karzel 6e09653d3f Remove target section from CI
matrix.include does not require the target section to be present because it
specifies the specific matrix combinations to be run.
3 years ago
Thomas Eizinger a667c0ecd8
Bump tracing-subscriber to 0.2.17
This release includes a bug-fix that removes an erroneous space
from our logs when running with `--debug`.
3 years ago
Daniel Karzel 58c33f8468 Add asb to release including ARM build 3 years ago
bors[bot] 3a5d8aee42
Merge #308
308: Fix incorrect docker tag r=thomaseizinger a=rishflab



Co-authored-by: rishflab <rishflab@hotmail.com>
3 years ago
rishflab 7cb198aea1 Remove pointless todo
The container is defined in the tests module indicating it is only
suitable for these tests
3 years ago
rishflab 9f534996ee Remove unused capability to configure bitcoind docker version tag
We only use one version of this container
3 years ago
rishflab 7b1d901ea0 Fix incorrectly formatted tag 3 years ago
bors[bot] 009597ac49
Merge #306
306: Fix logging and retrying of Monero transaction watching r=thomaseizinger a=thomaseizinger

Hopefully, this should also reduce the load because I am not asking the node every second.

Related: https://github.com/comit-network/xmr-btc-swap/issues/202

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
Daniel Karzel be52892e65
Monero wallet should not know about all execution params
Instead of passing all execution params in we only make the monero_avg_block_time known to the monero wallet.
3 years ago
Thomas Eizinger 82738b111e
Refactor `monero::Wallet::watch_for_transfer` to not use `backoff`
Instead, we use a regular loop and extract everything into a function
that can be independently tested.
`backoff` would be useful to retry the actual call to the node.
3 years ago
bors[bot] 1d1ed13b65
Merge #302
302: Fixup backticks in README r=da-kami a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
bors[bot] b956f366b9
Merge #305
305: Disable `backoff`s `max_elapsed_time` functionality r=da-kami a=thomaseizinger

This config setting makes backoff stop retrying if we didn't get an
error within this timeframe.
For us, this results in backoff not actually doing anything.

The connection to kraken is very long-running. It might be active
for hours without failing. However, the default value for
`max_elapsed_time` is set to 15 minutes. As such, once the connection
fails any time after that, backoff doesn't actually retry the operation
but just gives up.

Fixes #303.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Thomas Eizinger f0a2134f76
Remove unused field 3 years ago
Thomas Eizinger 7e0c44ad1d
Add avg monero block time to execution params 3 years ago
Thomas Eizinger d560e69203
Make durations more readable by using extension methods from `time` 3 years ago
Thomas Eizinger ecff1d1cbe
Remove indirection of constants
We never use these constants anywhere else, inline them.
3 years ago
Thomas Eizinger bac0f11898
Disable `backoff`s `max_elapsed_time` functionality
This config setting makes backoff stop retrying if we didn't get an
error within this timeframe.
For us, this results in backoff not actually doing anything.

The connection to kraken is very long-running. It might be active
for hours without failing. However, the default value for
`max_elapsed_time` is set to 15 minutes. As such, once the connection
fails any time after that, backoff doesn't actually retry the operation
but just gives up.

Fixes #303.
3 years ago
Thomas Eizinger 8d8b3100ea
Fixup backticks in README 3 years ago
bors[bot] 9279877c8f
Merge #301
301: Refactor the kraken module to automatically re-connect on errors r=thomaseizinger a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Thomas Eizinger 9ad2160c69
Refactor the kraken module to automatically re-connect on errors
In order to be able to re-connect on certain errors, we model
connection errors separately from parsing errors. We also change
the API of the whole module to no longer forward all errors to
the subscribers but instead, only update the subscribers with
either a latest rate or a permanent failure in case we exhausted
all our options to re-connect the websocket.

To model all of this properly, we introduce to sub-modules so that
each submodule can have their own `Error` type.

Resolves #297.
3 years ago
Thomas Eizinger c560b3b21a
Introduce `RateUpdate` type alias to reduce duplication 3 years ago
Thomas Eizinger fd5b38739a
Remove constant in favor of inlining string
This removes an import and simplifies the `connect_async` call.
3 years ago
Thomas Eizinger 142e5e2d3a
Use tracing macros by fully-qualifying them 3 years ago
bors[bot] cc131ecf60
Merge #293
293: Some friday evening goodies r=thomaseizinger a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Thomas Eizinger 08923a14f3
Simplify GET request for block tip height 3 years ago
Thomas Eizinger e9d7d9299c
Simplify the GET request to the tx status URL 3 years ago
Thomas Eizinger 418ad7089d
Make tests more readable by following arrange-act-assert 3 years ago
Thomas Eizinger c2329b19a2
Tell the user more about the monero lock transaction
First, we tell the user that we are now waiting for Alice to lock
the monero. Additionally, we tell them once we received the
transfer proof which will lead directly into the
"waiting for confirmations" function.
3 years ago
Thomas Eizinger 13c4d29d40
Tell the user immediately how many confirmations we expect
Without this, the user doesn't see a message before the first
confirmation.
3 years ago
Thomas Eizinger 4883e23dd8
Tell the user for how many confirmations we are waiting
Without this, the user has no idea for how long the program is
waiting.
3 years ago
Thomas Eizinger 5d4cf40831
Fix comparison of Monero confirmations 3 years ago
bors[bot] 52483a5a43
Merge #291
291: Improve CLI help comments and "type" hints r=rishflab a=rishflab

The type hints are generated from the field names. This has the
unfortunate consequence of the config field becoming file_path which
does not really make sense people working on the codebase.

Co-authored-by: rishflab <rishflab@hotmail.com>
3 years ago
rishflab f92a8ac300 Improve CLI help comments and "type" hints
The type hints are generated from the field names. This has the
unfortunate consequence of the config field becoming file_path which
does not really make sense people working on the codebase.
3 years ago
bors[bot] 4b99d68790
Merge #290
290: Monero daemon host configurable r=rishflab a=da-kami

Note: `monero-daemon-host` in accordance with the wallet RPC params, from wallet RPC help:

```
Usage:
  monero-wallet-rpc [--wallet-file=<file>|--generate-from-json=<file>|--wallet-dir=<directory>] [--rpc-bind-port=<port>]

General options:
  --help                                Produce help message
  --version                             Output version information

Wallet options:
  --daemon-address arg                  Use daemon instance at <host>:<port>
  --daemon-host arg                     Use daemon instance at host <arg>
                                        instead of localhost
```

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
bors[bot] 21a2a005e8
Merge #289
289: Tidy up README and docs r=rishflab a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Daniel Karzel 196557b377 Rename binary to swap 3 years ago
Daniel Karzel f8b61e2e0e Make monero daemon host configurable 3 years ago
Daniel Karzel f091402c7a Remove parameter duplication by introducing structs 3 years ago