Commit graph

70 commits

Author SHA1 Message Date
Jonathan Zernik
742f524263
Add unit test for network connection using connection manager (#1493) 2021-10-04 00:48:46 -07:00
Jonathan Zernik
5d753ace14
Add unit test for get squeak secret key from db (#1492)
* Add unit test for get squeak secret key from db

* Add unit test for get missing squeak secret key from db
2021-10-03 21:31:17 -07:00
Jonathan Zernik
3effe81546
Add unit test for get missing squeak entry from db (#1491) 2021-10-03 21:11:28 -07:00
Jonathan Zernik
2eb1f1025d
Add unit test for get squeak entry from db (#1490) 2021-10-03 21:02:29 -07:00
Jonathan Zernik
080d6299b5
Add unit test for duplicate squeak (#1489)
* Add unit test for insert duplicate squeak in db

* Add unit test for get missing squeak from db
2021-10-03 20:52:04 -07:00
Jonathan Zernik
2e0fc25051
Got unit test working for insert and retrieve squeak in db (#1488) 2021-10-03 20:39:24 -07:00
Jonathan Zernik
70511ea291
Remove print statements from unit test (#1487) 2021-10-03 19:53:06 -07:00
Jonathan Zernik
24e64fc30b
Mock out db in unit test (#1485)
* Simplify fixtures in squeak node unit test

* Mock out get connection string which creates data dir
2021-10-03 19:49:22 -07:00
Jonathan Zernik
be8ebe7f42
Add config to enable squeak node test to cover everything (#1484)
* Add config to enable squeak node test to cover everything

* Add separate test for webadmin enabled
2021-10-03 16:14:42 -07:00
Jonathan Zernik
4fe0953f43
Got test passing for start stop squeaknode (#1483)
* Got test passing for start stop squeaknode

* Remove print statements from test
2021-10-03 15:24:24 -07:00
Jonathan Zernik
1ede8b9468
Move create saved peer function to peers module (#1473) 2021-10-02 11:25:08 -07:00
Jonathan Zernik
e2bd6ae384
Add profiles module with unit tests (#1468) 2021-10-02 02:48:09 -07:00
Jonathan Zernik
f68d8628ea
Move secret key tweak functions to secret keys module (#1464) 2021-10-02 00:07:51 -07:00
Jonathan Zernik
77fda8114f
Create squeaks module (#1460)
* Create new squeaks module in core and add make squeak function

* Move get_hash function to squeaks module

* Add unit test for squeaks module

* Add check squeak function to squeaks module

* Add get decrypted content function to squeaks module

* Add function to get payment point in squeaks module

* Use conftest for fixtures in core directory

* Add test cases for squeak matches interest function

* Remove old comment in squeak core
2021-10-01 21:24:09 -07:00
Jonathan Zernik
62f5e332a8
Refactor core interest functions (#1449)
* Convert iterable to list in interest unit tests

* Refactor interests functions into separate module

* Simplify assertions in test interests unit tests
2021-09-30 21:59:55 -07:00
Jonathan Zernik
86088f4a9a
Use differential interests after updating subscribed interests (#1424) 2021-09-26 20:25:51 -07:00
Jonathan Zernik
c9b88ffd4a
Send secret key when profile configured to free (#1197)
* Set up itest for sending free secret key

* Got itest working for download and unlock free squeak

* Simplified getting offer or free secret key from controller

* Rename get offer method of controller
2021-09-05 14:38:52 -07:00
Jonathan Zernik
76ad744936
Updrage squeaklib to 0.7.1 (#1194)
* Updrage squeaklib to 0.7.1

* Add case to handle secret key msg in peer msg handler

* Add fields for custom price and use custom price to profile table

* Got itest working with new profile fields

* Use default values for profile struct constructor

* Fix db migration to use use profile columns

* Got itest passing for set use custom price

* Show custom price or default price in profile page

* Change wording of selling with price in profile page

* Got set use custom price toggle working in configure profile dialog
2021-09-05 12:30:58 -07:00
Jonathan Zernik
26fced200d
Upgrade squeaklib to version 7 (#1188)
* Use newer version of squeaklib with decryption key outside squeak object

* Remove todo comment about clearing decryption key before insert squeak in db
2021-09-04 16:58:33 -07:00
Jonathan Zernik
512129b8ec
Implement per address rate limit (#1102)
* Add check for per address rate limit in controller

* Delete rate limiter class

* Add check for interest and rate limit to save received squeak

* Got single squeak download working using temporary interest

* Use polymorphic interest classes for temporary interest manager

* Change order of checking temporary interests before permanent interests

* Used timed dict for temporary interests

* Include check for limit in temporary interest
2021-08-29 06:36:14 -07:00
Jonathan Zernik
620cdae96c
Add license headers (#1080)
* Add pre-commit hook for license headers

* Configure pre-commit hook for license headers only for python

* Add license headers to python files
2021-08-27 18:31:53 -07:00
Jonathan Zernik
dba7c525e9
Rename core config to node config (#1045) 2021-08-24 01:13:24 -07:00
Jonathan Zernik
e9fd648cd2
Improve squeak core (#1040)
* Update squeak core methods to return results

* Re-order controller methods
2021-08-23 23:36:47 -07:00
Jonathan Zernik
b9ac4b86b4
Use peer address struct in requests (#1004)
* Update connect peer and disconnect peer rpc to use peer addrss struct

* Update get connected peer rpc to use peer addrss struct

* Use peer address struct in create saved peer rpc

* Use peer address struct in squeak peer struct

* Use peer address for requests functions in frontend

* Update frontend build
2021-08-21 00:54:48 -07:00
Jonathan Zernik
f9197f7035
Remove uploading and downloading fields and add autoconnect field in … (#993)
* Remove uploading and downloading fields and add autoconnect field in all backend code

* Remove uploading and downloading fields and add autoconnect in frontend

* Update frontend build
2021-08-20 15:46:54 -07:00
Jonathan Zernik
deb8b1b99b
Remove sharing field profile (#990)
* Remove sharing field from all backend code

* Add db migration to remove sharing field

* Remove profile sharing field from frontend

* Update frontend build
2021-08-20 14:18:04 -07:00
Jonathan Zernik
4cc617a94c
Refactor network commands into network manager (#949)
* Refactor network commands into network manager

* Start and stop peer server and peer client inside network manager

* Pass handle connection fn to peer handler instead of self object

* Remove old comments
2021-08-15 22:15:42 -07:00
Jonathan Zernik
78b7f9a7f1
Fix default port for create peer command (#905) 2021-08-10 21:29:24 -07:00
Jonathan Zernik
7d266cdf5e
Split peer server client (#901)
* Split peer server and peer client

* Got itest passing

* Catch exception when closing peer socket

* Reconfigure all itests to run
2021-08-10 02:16:46 -07:00
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
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
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
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
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
yzernik
aaf6ae975d Revert changes to use natural primary keys 2021-02-04 03:15:02 -08:00
Jonathan Zernik
64cf97dfe9
Try changing peer primary key to hash, not done (#782)
* Try changing peer primary key to hash, not done

* Got backend working with peer hash as primary key

* Got frontend working with peer hash as primary key for peer
2021-02-04 00:09:58 -08:00
yzernik
ebd61823aa Revert back the revert to use address for profile primary key 2021-02-03 20:53:00 -08:00
Jonathan Zernik
855d357ca4
Revert to using integer primary key for profile table (#783) 2021-02-03 01:42:47 -08:00
Jonathan Zernik
7c5734bd86
Use addresss for profile primary key (#779)
* Use address as primary key for profile table

* Delete old sql query comments

* Update frontend to use address for profile primary key

* Fix profiles page data table goto action

* Fix usage of get profile by address in remaining frontend
2021-02-02 20:54:11 -08:00
Jonathan Zernik
627acea07c
Add custom profile image (#745)
* Add profile image field to db

* Add set profile image rpc

* Got clear profile image working

* Add has custom profile image field in profile rpc respones
2021-01-29 01:27:59 -08:00
Jonathan Zernik
4ef08e6568
Add type hints for squeak entry db queries (#679) 2021-01-23 23:04:56 -08:00
Jonathan Zernik
5d31ca3689
Add valid column to sent payment table (#670)
* Add valid column to sent payment table

* Show valid field in sent payments frontend
2021-01-21 20:18:04 -08:00
Jonathan Zernik
00d346668a
Remove old server tests (#631) 2021-01-12 20:54:31 -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
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
62c13ddaba
Create peer with default port (#569)
* Added unit test for create peer

* Got test working for create peer with default port

* Use namedtuple for squeak peer class

* Rename test name in test create peer

* Use type hints for insert squeak peer
2021-01-06 23:47:03 -08:00
Jonathan Zernik
a57021ab0c
Use typed config (#566)
* Use typed config

* Use typed config

* Got bitcoin connection working in main config

* Use better defaults for lnd configs

* Got test working for get network using config fixture

* Use sqk_dir_path instead of sqk_dir

* Add logging of bitcoin configs

* Don't use config option when config file doesn't exist
2021-01-05 23:39:04 -08:00
Jonathan Zernik
16e8f9bc64
Add unit test for get network method of controller (#561) 2021-01-04 01:28:08 -08:00