Commit graph

429 commits

Author SHA1 Message Date
Sergi Delgado Segura
59c770b25b
Merge pull request #220 from sr-gi/test-patch-sendrawtransaction
Properly patches sendrawtransaction so it does not crash
2023-07-24 11:04:55 -04:00
Sergi Delgado Segura
7093882f47
Properly patches sendrawtransaction so it does not crash
Currently, when mocking sendrawtransaction so it does nothing, the client will raise an exception
given the picked lambda does not accept any params (and sendrawtransaction has some). Patches it
so this does not happen.

This patch is pretty minimal, given the behavior wrt CLN does not change, but it feels better not to
except here.
2023-07-18 14:08:00 -04:00
Sergi Delgado Segura
1a89c5da70
Merge pull request #216 from sr-gi/outdated_tower
Adds --forceupdate to teosd
2023-05-09 11:02:37 -04:00
Sergi Delgado Segura
2bf555c07f
Adds --forceupdate to teosd
If a tower hasn't been running for a long time and the backend runs in pruned
mode it could be the case that by the time the tower comes back online, the Last
known block by the tower is not being known by the node anymore. In this situation,
the tower cannot bootstrap normally, given the cache cannot be populated.

This commits adds a new argument to teosd (`--forceupdate`) that can be used to
force a tower to update its last known block to the earliest known block by the backend
under this situation. Notice that doing so may make the tower miss some of its state
transitions (the ones triggered by missed blocks), so this must be done as a last resource.
2023-05-09 09:49:11 -04:00
Sergi Delgado Segura
7e0f0f0981
Merge pull request #211 from sr-gi/improve-contributing
Adds some notes on commits and GitHub to CONTRIBUTING
2023-05-09 09:48:29 -04:00
Sergi Delgado Segura
7fc30577ac
Adds some notes on commits and GitHub to CONTRIBUTING 2023-05-09 09:11:07 -04:00
Sergi Delgado Segura
6caf452daf
Merge pull request #213 from sr-gi/fix-cli-error
Makes teos-cli cannot connect to backend error message more friendly
2023-05-09 08:55:06 -04:00
Sergi Delgado Segura
c0f4ebc82c
Makes teos-cli cannot connect to backend error message more friendly
Let's not just spit a debug error when calling `teos-cli` pointing to an unreachable backend.
2023-05-08 21:53:56 -04:00
Sergi Delgado Segura
d1edc98a85
Merge pull request #200 from anmode/pingpong
[Feature] Implements a ping endpoint (http)
2023-05-02 15:57:06 -04:00
Anmol Agrawal
2229251702
Implements ping/pong logic for the tower and CLN plugin
Implements ping/pong logic for the tower and CLN plugin
Modification in test as suggested and some more

Some fixed

Signed-off-by: Anmol Agrawal <anmol2002.aa1@gmail.com>
2023-05-02 07:49:24 +05:30
Sergi Delgado Segura
94624fbe0b
Merge pull request #215 from anipaul2/master
Improve log messages for data directory and configuration details
2023-05-01 16:23:16 -04:00
anipaul2
ca577c558b
Improve log messages for data directory and configuration details
This commit enhances the logging output to provide clearer information
about the data directory and configuration file details. By providing
this information, it improves the user experience and make it easier for
users to find and understand the relevant paths and settings.
2023-05-02 01:36:19 +05:30
Sergi Delgado Segura
886e0fffe5
Merge pull request #206 from sr-gi/fix-clippy-responder
Removes unnecessary `into_iter` from Responder tests
2023-03-14 10:36:28 +01:00
Sergi Delgado Segura
801ef5d808
Removes unnecessary into_iter from Responder tests
The conversion was triggering https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
2023-03-13 12:54:02 +01:00
Sergi Delgado Segura
67aa345de4
Merge pull request #194 from sr-gi/replace-httpmock
Replaces httpmock with mockito
2023-03-13 12:34:21 +01:00
Sergi Delgado Segura
7dc3fcd2cc
Replaces httpmock with mockito
Also:

- Replaced time based waits for loops with the expected conditions to
get given the former is way more error prone.
- Updates tests that needed a response based on the request (main reason why
    were're switching to mockito)
2023-03-08 12:11:49 +01:00
Sergi Delgado Segura
b60299c881
Merge pull request #196 from sr-gi/http_api_constructor
Makes http::serve take a SockAddr instead of a starting
2023-03-08 10:03:41 +01:00
Sergi Delgado Segura
939d87c0f0
Makes http::serve take a SocketAddr instead of a String
`PublicTowerServicesClient::connect` needs `dest` to be `std::convert::TryInto<tonic::transport::Endpoint>`
hence why we were passing a `String`. However, we'll be better of passing something that's `Copy`, like
`SocketAddr` and converting to `String` here.
2023-02-24 22:37:55 +01:00
Sergi Delgado Segura
076c972913
Merge pull request #189 from sr-gi/badges
Adds social and build badges
2023-02-20 12:19:42 +01:00
Sergi Delgado Segura
f63fd14184
Removes WIP, adds social, build and version badges 2023-02-20 11:52:00 +01:00
Sergi Delgado Segura
df948753d3
Merge pull request #181 from sr-gi/sqlite-fixes
Replaces Result<T, E> for Option<T> in DBM load methods
2023-02-20 11:51:25 +01:00
Sergi Delgado Segura
f628b358db
Replaces Result<T, E> for Option<T> in DBM load methods
The `DBM` methods related to loading data return `Result<T, E>` where `E` is always `dbm::Error::NotFound`.

It may makes more sense make them return `Option<T>`.
2023-02-20 11:26:38 +01:00
Sergi Delgado Segura
43f9971315
Merge pull request #185 from sr-gi/clippy-inline
Formats strings to use inline params when possible
2023-02-06 23:08:06 +01:00
Sergi Delgado Segura
4bcfbf7c5d
Formats strings to use inline params when possible 2023-02-06 22:56:09 +01:00
Sergi Delgado Segura
125709be65
Merge pull request #188 from mariocynicys/correct-onion-port
fixup: record the correct port for the Tor interface
2023-02-06 22:54:48 +01:00
Omer Yacine
75db9c6519
fixup: record the correct port for the Tor interface 2023-02-06 18:18:40 +02:00
Sergi Delgado Segura
280e4785f1
Merge pull request #183 from sr-gi/update-service
Updates teosd.service
2023-02-06 16:34:51 +01:00
Sergi Delgado Segura
403044298f
Updates teosd.service, adds tor link 2023-02-06 16:15:09 +01:00
Sergi Delgado Segura
0cf3d97523
Merge pull request #184 from sr-gi/retrier-waits
Defines Retrier polling waiting time as a constant and fixes tests
2023-02-06 11:01:00 +01:00
Sergi Delgado Segura
73a9bff9fa
Defines Retrier polling waiting time as a constant and fixes tests
The pooling time for the Retrier was hardcoded to 1, let's at least use a constant for that.

Also, `retrier::tests::test_manage_retry_while_idle` was randomly failing (for Ubuntu) when checking whether the Retrier was
idle after giving up on a retry. This is due to the time of running a round not being taken into account.
2023-01-27 11:11:00 -05:00
Sergi Delgado Segura
4ce986e0be
Merge pull request #179 from sr-gi/bump-version
Bumps teos version to 0.2 in preparation for code release
2023-01-23 17:58:46 -05:00
Sergi Delgado Segura
5cf9029fe9
Bumps teos version to 0.2 in preparation for code release 2023-01-23 17:45:20 -05:00
Sergi Delgado Segura
a0e2978b8b
Merge pull request #177 from sr-gi/log-rpc-requests
Adds debug logs to RPC requests and improves the ones for the http interface
2023-01-23 17:44:46 -05:00
Sergi Delgado Segura
72b1805c1b
Adds logs to RPC requests and improves the ones for the http interface
Also updates the severity from the http logs from info to debug
2023-01-23 17:44:29 -05:00
Sergi Delgado Segura
d386e56754
Merge pull request #176 from sr-gi/teos-service
Adds teosd.service to run teos as daemon
2023-01-23 17:43:48 -05:00
Sergi Delgado Segura
eda7b263e6
Adds teosd.service to run teos as daemon
This builds on top of the work from the work by @decentralizedb and @jochemin.
It is mainly just re-arranging the code and readmes to fit the reviews.

Co-authored-by: decentralizedb <decentralized.b@protonmail.com>
Co-authored-by: jochemin <jochemin@gmail.com>
2023-01-23 17:33:40 -05:00
Sergi Delgado Segura
4e0fca3c0b
Merge pull request #178 from sr-gi/wt-client-defaults
Remove unused defaults, document new ones and updates defaults
2023-01-23 14:29:58 -05:00
Sergi Delgado Segura
f18237bb3e
Remove unused defaults, document new ones and updates defaults
- `watchtower-proxy` was still part of constants but it was not being used anymore
- `watchtower-auto-retry-delay` was not part of the README

Also redefines defaults so a retry strategy lasts at most 1h, every interval is at most 15 minutes
and automatic retries are triggered every 8 hours.
2023-01-23 13:15:05 -05:00
Sergi Delgado Segura
85b40603f7
Merge pull request #175 from sr-gi/readmes
Updates readmes
2023-01-20 20:43:07 +01:00
Sergi Delgado Segura
197ae93534
Updates readmes 2023-01-20 14:42:20 -05:00
Sergi Delgado Segura
b035a3e460
Merge pull request #173 from sr-gi/endpoints
Defines Endpoint enum to avoid using hardcoded strings as endpoints
2023-01-20 17:21:23 +01:00
Sergi Delgado Segura
44df8bb6f3
Defines Endpoint enum to avoid using hardcoded strings as endpoints
Useful for both the tower API and the clients
2023-01-20 08:55:22 -05:00
Sergi Delgado Segura
19b3ad86f0
Merge pull request #160 from sr-gi/cln-tor-flag
Improves tor flag logic in watchtower-plugin
2023-01-20 14:50:31 +01:00
Sergi Delgado Segura
d50ce639bf
Improves tor flag logic in watchtower-plugin
The `watchtower-plugin` was specifying a custom tor flag to signal whether Tor may be used by the client. This was due to `cln-plugin (v0.1.1-)` not allowing plugins to access the CoreLN configuration options and, therefore, our plugin was unable to fetch the `proxy` / `always-use-proxy` options.

This fetches the aforementioned options and revamps the logic to comply with the `always-use-proxy` requirements, that is, if the flag is set all communications must be performed using Tor. Also, it replaces some of the currently used `String`s for more meaningful types to store network data (such as `AddressType`, `NetAddress`, or `ProxyInfo`).

This drops our custom `watchtower-proxy` config option
2023-01-20 08:37:03 -05:00
Sergi Delgado Segura
2a57a388bb
Merge pull request #170 from sr-gi/cln-simplify-options
Simplifies the cln plugin option parsing
2023-01-11 11:45:53 +01:00
Sergi Delgado Segura
1a076f92ea
Fixes auto-retry-delay type
`auto-retry-delay` was set to be u16, but its default value was beyond u16::MAX.
2023-01-11 11:27:35 +01:00
Sergi Delgado Segura
6920c9bf98
Simplifies the cln plugin option parsing
Options include helper functions to convert them to their proper type after
`cln-plugin=0.1.2`. Use that to reduce the option parsing boilerplate.

Also move all names, descriptions and default values for options, rpc_methods and hooks
to a new file.
2023-01-10 15:26:42 +01:00
Sergi Delgado Segura
e918223a39
Merge pull request #172 from sr-gi/cln-plugin-v0.1.2
Bumps cln-plugin version to v0.1.2 in watchtower-plugin
2023-01-10 14:26:13 +01:00
Sergi Delgado Segura
c3b735dec7
Bumps cln-plugin version to v0.1.2 in watchtower-plugin 2023-01-10 14:05:26 +01:00
Sergi Delgado Segura
cd39c6b43e
Merge pull request #169 from sr-gi/patch-test_get_appointment-e2e
Patches watchtower-plugin test_get_appointment e2e
2023-01-10 14:04:30 +01:00