Commit Graph

18 Commits

Author SHA1 Message Date
Sergi Delgado Segura
94e36ebeda plugin - Adds docstrings 2020-05-05 20:11:04 +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
8704dcf2b9 plugin - defines TowerSummary as object to improve readability of the code 2020-05-05 15:22:44 +02:00
Sergi Delgado Segura
03eb67f71f plugin - Some fixes and renaming 2020-05-05 15:19:31 +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
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
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
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
4e1c3e83cf Removes start/end_time from plugin 2020-04-20 17:58:40 +02:00
Sergi Delgado Segura
1ec69e8703 Stops plugin if towers db cannot be accessed 2020-04-20 17:30:17 +02:00
Sergi Delgado Segura
96d98a3546 compressed_pk -> user_id and logs id on bootstrap 2020-04-20 17:30:17 +02:00
Sergi Delgado Segura
2242e780dd Fixes log level and register command 2020-04-20 17:30:16 +02:00
Sergi Delgado Segura
6b025a2d9c Improves add_appointment method. Has some pending fixmes
- Start and end time have to be dealt with (changes required on the tower side)
- Sends appointments to every register tower. We may want to manage this better
2020-04-20 17:30:16 +02:00
Sergi Delgado Segura
b3841c1da6 Updates defaults names 2020-04-20 17:30:15 +02:00
Sergi Delgado Segura
ed8ff228d8 First commands with basic structure.
- Moves DBManager to common.
2020-04-20 17:30:15 +02:00