Commit Graph

820 Commits

Author SHA1 Message Date
Sergi Delgado Segura
3405490a10 cli - Updates README 2020-05-08 19:55:31 +02:00
Sergi Delgado Segura
d5dc833bf5 datadir and apibind were not properly working 2020-05-08 19:43:56 +02:00
Sergi Delgado Segura
e91f65048d cli - fixes cli without params
Cli was crashing if no param was provided
2020-05-08 19:43:56 +02:00
Sergi Delgado Segura
f2162b6add plugin - Improves README and defaults misbehaving_proof to empty dict 2020-05-08 19:43:08 +02:00
Sergi Delgado Segura
445d4c0aca plugin - Adds README 2020-05-07 15:10:36 +02:00
Sergi Delgado Segura
1f1fa161cf Merge pull request #142 from talaia-labs/pypi_common
Adds common module to PyPi
2020-05-07 12:01:40 +02:00
Sergi Delgado Segura
a2c010b685 Adds teos-common requirements to the plugin 2020-05-07 11:43:57 +02:00
Sergi Delgado Segura
63cd55c1c6 plugin - removes unused commented line 2020-05-07 11:41:41 +02:00
Sergi Delgado Segura
07e00c2e5e common - Adds requirements for common (added to PyPi) 2020-05-07 10:13:33 +02:00
Sergi Delgado Segura
304af4f8b9 Updates gitignore 2020-05-06 22:49:04 +02:00
Sergi Delgado Segura
0c5ad56a84 Adds common to pypi under teos-common 2020-05-06 22:48:59 +02:00
Sergi Delgado Segura
4af32a11c4 Merge pull request #141 from talaia-labs/update-readme
Updates readme with watchtower-plugin info
2020-05-06 19:53:31 +02:00
Sergi Delgado Segura
0044a65396 Updates readme with watchtower-plugin info 2020-05-06 19:04:53 +02:00
Sergi Delgado Segura
3d10589ea7 Merge pull request #139 from talaia-labs/watchtower-plugin
Watchtower plugin
2020-05-06 18:56:51 +02:00
Sergi Delgado Segura
c18abefe4b plugin - adds getappointment tests and tests with multiple towers 2020-05-06 12:58:00 +02:00
Sergi Delgado Segura
cda13c5a04 plugin - Fixes behaviour for misbehaving towers
Returning made the hook to stop if a single tower was misbehaving. Fixing that.
2020-05-06 12:48:16 +02:00
Sergi Delgado Segura
69b0109ca8 plugin - Fixes log entry 2020-05-05 20:11:20 +02:00
Sergi Delgado Segura
94e36ebeda plugin - Adds docstrings 2020-05-05 20:11:04 +02:00
Sergi Delgado Segura
bef8df8d36 plugin - fixes key generation
Key generation was performed using pyca/crpytography but keys were expected to be objects from coincurve. This comes from teos_cli where keys are generated beforehand and stored, and later on loaded from disk. The plugin generates keys and uses them straightaway (at least the first time), so it would fail in that case.
2020-05-05 18:46:37 +02:00
Sergi Delgado Segura
df43d30ca5 Fixes tests 2020-05-05 17:07:22 +02:00
Sergi Delgado Segura
1fae487071 plugin - Fixes log entry 2020-05-05 17:07:02 +02:00
Sergi Delgado Segura
f5c634ed14 plugin - repurpose invalid_appointments and adds misbehaving_proof
invalid_appointments in TowerInfo was used to stored invalid appointment responses from the tower when it was misbehaving (i.e. wrong or missing signature). However, a single item was stored since the tower is abandoned after misbehaving. data reported as invalid by the tower was not backed up.

invalid_appointments now stores the appointment rejected by the tower and reported as invalid.
misbehaving_proof stores the proof of misbehaviour by the tower (single item)
2020-05-05 17:03:31 +02:00
Sergi Delgado Segura
b650ba3c26 plugin - small changes 2020-05-05 15:22:48 +02:00
Sergi Delgado Segura
8704dcf2b9 plugin - defines TowerSummary as object to improve readability of the code 2020-05-05 15:22:44 +02:00
Sergi Delgado Segura
cb4920b566 plugin - Modifies conf when running tests to reduce running time 2020-05-05 15:19:36 +02:00
Sergi Delgado Segura
ae4cea8aa2 plugin - Adds additional tower tests 2020-05-05 15:19:36 +02:00
Sergi Delgado Segura
03eb67f71f plugin - Some fixes and renaming 2020-05-05 15:19:31 +02:00
Sergi Delgado Segura
01a18b3fd7 Finishes basic test 2020-05-04 19:40:54 +02:00
Sergi Delgado Segura
d3cbfc7ac4 string format -> f-function 2020-05-04 19:40:00 +02:00
Sergi Delgado Segura
93029301bf Refactors plugin to have a single point of db data loading
The previous approach was a bit messy with the db access and could have potential race conditions and data inconsistency

Also replaces format for f-functions for readability
2020-05-04 19:37:13 +02:00
Sergi Delgado Segura
cf5455043c plugin - adds some plugin tests, still WIP 2020-04-30 21:53:51 +02:00
Sergi Delgado Segura
43217874b5 Splits add_appointment so it can also be used by the Retrier
- The appointment constructions is left in Watchtower (via on_commit_revocation method)
- The tower interaction is moved to net/http so it can be reused
- Adds missing logic for invalid resposes by the tower (e.g invalid signatures)
2020-04-29 14:14:01 +02:00
Sergi Delgado Segura
7bbfd925f4 Adds invalid appointment to tower_info
Invalid appointments are those which tower signature is invalid
2020-04-29 13:11:44 +02:00
Sergi Delgado Segura
8575bc6209 plugin - redesigns retrier using backoff 2020-04-29 13:10:51 +02:00
Sergi Delgado Segura
390dc3e090 teos - adds log line with tower id 2020-04-29 13:04:02 +02:00
Sergi Delgado Segura
88c19d5a0d teos - moves errors to common so it can be used by clients 2020-04-29 13:03:39 +02:00
Sergi Delgado Segura
9f2c90d12e plugin - adds Retrier and improves get_tower_info and listtowers
- Logs data identified by tower_id instead of endpoint
- Adds Retrier to deal with retries (for connection errors and rejects) and moves sending logic to net/http
- Adds pending appointments to TowerInfo and serves that information via `get_tower_info` and `list_towers`
- Deals with connection errors (but not with rejections yet)
2020-04-27 19:56:35 +02:00
Sergi Delgado Segura
fa0e103d71 pluggin - adds basic retrier (WIP) 2020-04-27 19:56:31 +02:00
Sergi Delgado Segura
780cb5c202 pluggin - adds pending appointments to towers 2020-04-27 19:51:39 +02:00
Sergi Delgado Segura
75ca281cc4 api - updates errors and separates error from message in api errors responses 2020-04-27 19:51:38 +02:00
Sergi Delgado Segura
8918f15b62 gatekeeper - stores user_info in db after adding appointment (it was missing) 2020-04-27 19:51:38 +02:00
Sergi Delgado Segura
c7ec4e6b7c pluggin - Moves send_appointment to net so it can be reused for retries
Also changes logs so towers are identified by id
2020-04-27 19:51:34 +02:00
Sergi Delgado Segura
bc5f09000a plugin - adds tower state to TowerInfo
The state flags whether the tower is reachable or not so the user can be aware of it
2020-04-27 18:23:58 +02:00
Sergi Delgado Segura
7b3bc6e6a8 plugin - adds gettowersinfo command to get all local data about a tower (from db) 2020-04-23 12:54:16 +02:00
Sergi Delgado Segura
fd4241bfe3 plugin - improves listtowers output to resemble listpeers 2020-04-23 12:54:08 +02:00
Sergi Delgado Segura
df3531dd3e plugin - several improvements in the main class
- Moves from *args to required params after 5f33d63cb6
- tower.endpoint -> tower.netaddr
- Adds basic exception handling logic in add_appointemnt
- Stores appointment data in the database (locator: signature) and keeps summary on memory
2020-04-23 12:49:26 +02:00
Sergi Delgado Segura
d86112d86e plugin - endpoint -> netaddr in TowerInfo and adds get_summary 2020-04-23 12:44:25 +02:00
Sergi Delgado Segura
5f33d63cb6 plugin - simplifies argparser after https://github.com/ElementsProject/lightning/pull/3640 2020-04-23 12:43:16 +02:00
Sergi Delgado Segura
7b6d4a0c9c plugin - specifies cryptography library version 2020-04-23 12:40:24 +02:00
Sergi Delgado Segura
a8b9697a38 teosd - handles AppointmentDBM exceptions
AppointmentDBM creation was outside the main try/except, so exception were not properly handled
2020-04-23 12:38:07 +02:00