Commit Graph

951 Commits (f8360fe853841c69c74310f85ba011d52983a889)
 

Author SHA1 Message Date
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
Daniel Karzel 58c33f8468 Add asb to release including ARM build 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
Thomas Eizinger 265f4ee2e5
Remove stale mergify configuration 3 years ago
Thomas Eizinger d6789508da
Remove outdated docs 3 years ago
Thomas Eizinger 0b17b1177a
Replace protocol definition in README with setup instructions
Fixes #262.
3 years ago
bors[bot] ba9e92c4b9
Merge #275
275: `main` fn and error message improvements r=thomaseizinger a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Thomas Eizinger c826a28911
Add context if we fail to compute extended private key 3 years ago
Thomas Eizinger 1aa6d177bf
Improve error messages when determining BTC amount to be swapped 3 years ago
Thomas Eizinger 4138039ea0
Make sure all error messages start with an uppercase letter
These might potentially be shown to a user, let's make them all
consistent.
3 years ago
Thomas Eizinger 816e8b9b96
Add more context to fallible functions inside bitcoin::Wallet 3 years ago
Thomas Eizinger 5c24a46298
Improve error message if stuff fails directly in main 3 years ago
Thomas Eizinger 37f97ac471
Shorten function name
The variable will always be at least called `wallet`, hence we can
omit the `_wallet` postfix from the function name.
3 years ago
Thomas Eizinger 4f66269887
Move error message on sync _into_ the function
The bitcoin::Wallet::sync_wallet function doesn't do anything else
other than delegating. As such, we have just as much information
about what went wrong inside this function as we have outside.

By moving the .context call into the function, we can avoid repeating
us on every call-site.
3 years ago
Thomas Eizinger 5953037b81
Don't repeat the module name within the type 3 years ago
Thomas Eizinger 87f928f56c
Move const to function where it is used 3 years ago
Thomas Eizinger 4642e6c0e3
Simplify arguments to `init_XYZ_wallet` functions
This makes the function calls fit onto one line.
3 years ago
Thomas Eizinger d0db6cba10
Favour individual logs over one in main 3 years ago
bors[bot] 2041f367c6
Merge #288
288: Switch to public stagenet node that works r=rishflab a=rishflab

The xmr.to node has been unreliable lately. The exan.tech node seems to
working.

@da-kami is following up with making this configurable. Lets get this in so we can get a release on Friday.

Co-authored-by: rishflab <rishflab@hotmail.com>
3 years ago