Commit graph

54 commits

Author SHA1 Message Date
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
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
173130ab31
Use mypy precommit hook (#537)
* Add mypy precommit hook

* Add mypy precommit hook
2021-01-01 21:39:33 -08:00
Jonathan Zernik
22f6b4fc3c
Add precommit hooks (#526) 2020-12-28 23:52:32 -08:00
Jonathan Zernik
293cbc4db5
Got all flake8 checks passing (#514)
* Got all flake8 checks passing

* Remove reorder imports from codecheck tox env
2020-12-26 04:56:46 -08:00
Jonathan Zernik
62f21874f1
Autoformat python code with tox command (#510) 2020-12-26 02:01:22 -08:00
Jonathan Zernik
00fc72514f
Use squeaklib with ptlc (#502)
* Rename secret_key

* More work to convert to using PTLC

* Updated most code for PTLC

* More work to use ptlc with secret key

* Got itest passing

* Remove unused import

* Use version 0.5.0 of squeaklib

* Added simple unit test for squeak controller

* Use modular addition subtraction for secret key nonce tweak

* Move util to core folder

* Store secret key as hex in database

* Store nonce as hex in db
2020-12-25 20:17:54 -08:00
Jonathan Zernik
99ddc2df77
Rename to squeaknode (#342)
* Rename squeakserver to squeaknode and get itest passing

* Fix itest dockerfile

* Rename more squeakserver to squeaknode

* Rename database from squeakserver to squeaknode

* Update readme

* Remove frontend/build from git

* Rename squeakserver to squeaknode in tox and main
2020-10-29 14:35:17 -04:00
Jonathan Zernik
8d1bb513ac
Run codeformat with tox (#258) 2020-09-26 01:51:41 -07:00
Jonathan Zernik
4a2961de54
Add black to make codeformat in makefile (#85) 2020-07-18 19:40:28 -07:00
Jonathan Zernik
87b2a3de7d
Format imports with isort in makefile (#84) 2020-07-18 19:25:31 -07:00
Jonathan Zernik
824eabc418
Add make codeformat target (#80) 2020-07-18 04:38:10 -07:00
Jonathan Zernik
220b1eed22
Update to work with squeaklib 0.3.1 (#66) 2020-07-05 16:37:45 -07:00
Jonathan Zernik
0a47aa0568
Got unit tests passing (#30) 2020-06-04 18:30:48 -07:00
Jonathan Zernik
88108f7810
Rename squeaknode to squeakserver (#28)
* Rename server entrypoint

* Updated manifest

* Moved db init.sql file

* Rename module to squeakserver
2020-06-04 17:47:49 -07:00
Jonathan Zernik
77bec59911
Allow post squeaks (#4)
* Remove login_required and user id from blog posts.

* Remove login_required for blog endpoints.

* Rename update endpoint to show

* Remove auth.

* Tests passing.

* Remove unused auth fixture

* Remove users table from db
2020-03-17 18:07:47 -07:00
Jonathan Zernik
a2959e5bbd Fix make mypy 2020-03-01 00:29:58 -08:00