Commit graph

90 commits

Author SHA1 Message Date
Jonathan Zernik
f652915355
Use tcp peer connection (#900)
* Got basic tcp connection working

* Got passing itest for open tcp connection

* Got most of protocol working. still need to send offer correctly

* Got offer from peer over tcp connectrion

* Got single squeak download working on tcp connection

* Remove rpc peer client

* Remove old rpc clients

* Remove old squeak client modules

* Got sharesqueaks peer message working

* Remove peer rpc server

* Remove server rpc fixtures

* Remove old itests

* Remove old sync modules

* Run worker background task to keep peers synced

* Add peer connection worker

* Add test for disconnect peer

* Remove old itest util

* Delete old peer rpc client helpers.

* Handle insert duplicate received offer

* Use more specific exception handling for duplicate offer insert
2021-07-09 21:07:46 -07:00
Jonathan Zernik
d78ddfc8c1
Remove log lines for debugging delete old squeaks (#898) 2021-06-05 00:14:31 -07:00
Jonathan Zernik
b935785469
Use timestamp for like field (#896)
* Use a timestamp for like field in database

* Use query to get liked squeaks in order of like
2021-06-04 18:28:42 -07:00
Jonathan Zernik
ad36244587
Remove interested option, use download criteria (#893) 2021-06-02 00:36:07 -07:00
Jonathan Zernik
1a35af505b
Simplify download protocol (#889)
* Simplify download protocol in peer connection

* Simplify download method more in peer connections

* Simplify download squeak helper method
2021-02-26 15:14:27 -05:00
Jonathan Zernik
b7658932a9
Use query instead of iteration to get saved received offer (#881) 2021-02-22 21:40:44 -08:00
Jonathan Zernik
bfbb4ba335
Only delete squeaks that are not liked (#880) 2021-02-22 20:54:32 -08:00
Jonathan Zernik
c4477a9168
Add liked page (#879)
* Add query filter for getting only liked squeak displays

* Got liked page working

* Fix showing action bar for squeak page with null squeak
2021-02-22 20:17:45 -08:00
Jonathan Zernik
6a71bf5129
Add liked column (#878)
* Add liked column to squeak table

* Add rpc methods for like and unlike

* Fix migration to add liked column

* Got like squeak working

* Set squeak liked without reloading page

* Download squeak button reloads squeak without reloading page

* Use inconbutton for actions in squeak detail component

* Update static build
2021-02-22 18:54:20 -08:00
Jonathan Zernik
693bd782cc
Yield squeaks to delete query result (#877)
* Use yield for squeaks to delete query result

* Fix calling yield old squeaks method
2021-02-22 15:00:35 -08:00
Jonathan Zernik
26903592dd
Use config for offer deletion interval (#876) 2021-02-22 12:57:16 -08:00
Jonathan Zernik
2c42166bec
Add delete old squeak db method (#875)
* Add squeak deletion worker

* Fix method name for delete old squeaks

* Got squeak deletion worker working
2021-02-22 12:40:45 -08:00
Jonathan Zernik
cc55f8da2f
Delete verbose info level logs for delete expired offers (#870) 2021-02-21 20:38:53 -08:00
Jonathan Zernik
29ee9ab14b
Add config for payment processor subscribe invoices retry tyime (#869) 2021-02-21 20:20:12 -08:00
Jonathan Zernik
a93025a026
Save host and port of buyer client (#868)
* Save host and port of buyer client

* Show buyer port in frontend for received payments
2021-02-21 20:01:02 -08:00
Jonathan Zernik
c77bc943e8
Use host and port to identify peer in received offer and sent payment (#866) 2021-02-21 15:29:00 -08:00
Jonathan Zernik
f111aabd98
Use configurable retention for sent offer deletion (#865) 2021-02-21 13:05:22 -08:00
Jonathan Zernik
5b37fcb6f1
Only show received offers that are not paid (#864) 2021-02-21 11:34:16 -08:00
Jonathan Zernik
ce72374bfa
Add paid column offers (#862)
* Added paid column to sent offer and received offer tables

* Add paid column to offers tables

* Fix db query clause functions
2021-02-21 10:36:02 -08:00
Jonathan Zernik
4766f34cbb
Remove unique constraint on offer squeak hash client addr (#857)
* Remove unique constraint on squeak hash and client addr in sent offer

* Reinitialize db migrations
2021-02-16 15:08:39 -08:00
Jonathan Zernik
9350207201
Use helper method in payment processor for handle received payment (#856) 2021-02-16 09:53:12 -08:00
Jonathan Zernik
530ae7b86c
Simplify payment processor (#855)
* Got simplified payment processor working

* Remove log lines

* Trying to get payment processor working without passing stopped to subscripion

* Revert "Trying to get payment processor working without passing stopped to subscripion"

This reverts commit e691a37d24.

* Use settle index int as input to squeak core subscribe function

* Remove settled invoice subscription client

* Use object with cancel method in squeak core subscription response

* Got itest passing with new received payment iterator

* Remove unused arguments from squeak core get received payments method.

* Improve params for payment processor task

* Handle lnd invoice subscription cancel without raising exception

* Add logging to payment processor

* Add custom exception for unable to subscribe invoices

* Add type hint for get sent offer fn
2021-02-16 09:28:49 -08:00
Jonathan Zernik
131fa72b47
Handle db error in received payment client and keep retrying (#847)
* Handle db error in received payment client and keep retrying

* Retry populating queue of received payments after failure

* Use poison pill to shut down payment subscription client on rpc server shutdown

* Add more debugging logs

* Detect when client disconnects from payments rpc subscription and stop thread.

* Got new received payments subscription client working
2021-02-14 09:14:07 -08:00
Jonathan Zernik
4f1272cc26
Add more type hints controller (#843)
* Use more type hints in controller

* Add type hints for squeak entry detail and sent offer
2021-02-13 09:09:04 -08:00
Jonathan Zernik
00c8bd9769
Move controller to node directory (#841)
* Move squeak controller class to node directory

* Move test squeak controller to test node directory
2021-02-13 07:46:00 -08:00
Jonathan Zernik
d30150febc
Fix config name for max squeaks per address per block (#835) 2021-02-13 04:28:36 -08:00
Jonathan Zernik
5604cae842
Use block height for rate limiter (#832)
* Use block height for checking rate limiter limit

* Use block height for rate limiter limit count

* Remove print post squeak exception from itest
2021-02-13 02:35:22 -08:00
Jonathan Zernik
0936e726ff
Remove query filter for non-null block header (#827) 2021-02-12 22:22:55 -08:00
Jonathan Zernik
a4a9a57b86
Add log line for each subscribed settled invoice (#822)
* Add log line for each subscribed settled invoice

* Log latest settle index before processing received payments

* Add log line for settle index before subscribing invoices

* Use -1 for cleared settle_index

* Revert "Use -1 for cleared settle_index"

This reverts commit 701067c40b.

* No-op commit
2021-02-12 05:17:34 -08:00
Jonathan Zernik
f35182497d
Rename process received payments worker (#819) 2021-02-12 01:02:49 -08:00
Jonathan Zernik
9e15962d1a
Allow reprocess invoice without duplicate (#816)
* Allow reprocessing the same invoice without duplicate insert of received payment

* Use stopped event to stop processing invoices

* Got itest working with payment processor class

* Use payment processor class in squeak controller constructor

* Add rpc method for reprocess received payments

* Add reprocess received payments button

* Add reprocess received payments to admin web app

* Handle processing received payments subscription rpc better

* Add frontend button to reprocess received payments

* Clear settle indices in reprocess received payments

* Update static build
2021-02-12 00:14:45 -08:00
Jonathan Zernik
37fdcd9a92
Rename block interval config (#808) 2021-02-09 08:56:18 -08:00
Jonathan Zernik
85c2bcdfbc
Rename bitcoin client (#807)
* Rename bitcoin client

* Remove log line from bitcoin client
2021-02-09 08:28:00 -08:00
Jonathan Zernik
d46520dd93
Check block range and address without whitelist (#801)
* Check for followed addresses in peer connection download

* Remove whitelist from controller class

* Delete whitelist class
2021-02-09 07:48:30 -08:00
Jonathan Zernik
a36b1869b7
Add sync timeout (#797)
* Add timeout to peer client

* Fix timeout in peer client

* Make sync timeout configurable

* Remove sleep for testing from admin handler

* Remove sync timeout config override from itest
2021-02-09 04:52:57 -08:00
Jonathan Zernik
befe8db859
Fix graceful shutdown (#754)
* Refactored all components from main into squeaknode class

* Handle squeaknode initialization in constructor

* Got graceful shutdown working

* Use werkzeug for single threaded web server

* Fix import of werkzeug server

* Remove old log line
2021-01-30 03:17:15 -08:00
Jonathan Zernik
8a4c038007
Rename sync modules (#642)
* Rename modules in sync folder

* Rename modules in sync folder
2021-01-13 18:37:51 -08:00
Jonathan Zernik
24caaff56b
Simplify rate limiter constructor (#629) 2021-01-12 20:21:47 -08:00
Jonathan Zernik
eed3e744f4
Use bytes for all squeak_hash internally (#623)
* Remove logging from peer task

* Use squeak_hash as bytes for all internal objects

* Update comment about checking payment point TODO

* Simplify logging in whitelist and rate limiter

* Remove getreplyto function
2021-01-12 17:23:26 -08:00
Jonathan Zernik
1969308b20
Delete unused modules (#600) 2021-01-11 11:26:59 -08:00
Jonathan Zernik
44a15ce7be
Delete squeak maker class (#593) 2021-01-10 18:57:48 -08:00
Jonathan Zernik
508d3ab539
Remove squeak store (#592)
* Stop using save_squeak method of squeak_store

* Stop using get_squeak method of squeak_store

* Stop using delete_squeak method of squeak store

* Stop using unlock_squeak in squeak_store

* Remove squeak_store usage from peer task

* Remove some usages of squeak_db from peer_task

* Remove all squeak_db usage from peer_task

* Remove squeak_store from main module

* Delete squeak store class
2021-01-10 18:57:36 -08:00
Jonathan Zernik
080ee1eac8
Remove received payments verifier (#591)
* Got received payments working without verifier class

* Process received payments works with better exception handling

* Delete sent offers verifier
2021-01-10 14:56:23 -08:00
Jonathan Zernik
138ef7d984
Add squeak core module (#587)
* Add squeak_core module

* Remove unused import

* Delete squeakblockverifier

* Use squeak_core to make squeak

* Remove blockchain client from controller

* Move create offer method to squeak core

* Add some type hints

* Move get buy offer method to squeak_core

* Delete commented old get buy offer block

* Add pay_offer to squeak_core

* Add get received payments generator function to squak core

* Add get_offer method to squeak_core

* Remove lightning_client property from peer_task

* Remove old comments from payment verifier class

* Use bytes internally for payment_hash

* Represent secret_key as bytes internally
2021-01-10 09:31:41 -08:00
Jonathan Zernik
c984d41bcc
Use type hints for controller methods, and use bytes internally for s… (#578)
* Use type hints for controller methods, and use bytes internally for squeak hash

* Change internal representation of squeak_hash to bytes
2021-01-07 23:32:14 -08:00
Jonathan Zernik
1a64281d68
Use subclass of squeak whitelist for in memory whitelist (#576) 2021-01-07 10:37:30 -08:00
Jonathan Zernik
0b6b609864
Add unit tests for squeak controller (#557)
* Move squeak controller to core package

* Use config object in squeak controller to access configs

* Remove old comments in squeak controller

* Update unit test

* Add unit test for getting network with squeak_controller
2021-01-03 22:02:55 -08:00
Jonathan Zernik
6e42663c12
Add sync package (#543)
* Move network sync modules to new sync package

* Run sync worker thread from main module

* Got sync worker working in admin handler

* Use squeak_controller in sync_controller

* Use squeak_controller in peer task

* Remove old commented args replaced by squeak_controller

* Use squeak_controller method to get best block height

* Improve constructor for network sync task

* Improve constructor for network sync task
2021-01-02 05:46:49 -08:00
Jonathan Zernik
22f6b4fc3c
Add precommit hooks (#526) 2020-12-28 23:52:32 -08:00
Jonathan Zernik
a7564b3326
Fix all codecheck errors in source code (#512) 2020-12-26 04:16:11 -08:00