Commit graph

226 commits

Author SHA1 Message Date
Jonathan Zernik
93da9c0c97
Fix handling of p2p server port config (#2232) 2022-06-17 19:04:31 -07:00
Jonathan Zernik
afd3af091a
Use default peer port config when port not specified (#2218) 2022-05-24 21:41:56 -07:00
Jonathan Zernik
ed360ff3d1
Add clightning backend support (#2205)
* Add c-lightning support

* Got subscribe paid invoices working with c-lightning

* Remove log lines

* Use a single config section for all lightning configs

* Fix itest config

* Update configuration doc with new confis
2022-05-08 12:41:44 -07:00
Jonathan Zernik
80155f1fb7
Fix exception handling in squeak_core payment subscription (#2204) 2022-05-06 18:31:11 -07:00
Jonathan Zernik
7658a4d95c
Upgrade squeaklib to v013 (#2165)
* Upgrade to squeaklib v0.13

* Allow different squeak types in server reponse

* Add core method for create resqueak.

* Add make resqueak method for squeak store

* Update db migration to include resqueak hash

* Add db method to insert and get resqueak

* Return resqueak as squeak entry in db query method

* Add RPC method for make resqueak

* Got make resqueak modal working in frontend

* Show different content for resqueak in frontend

* Show resqueaed squeak in display

* Show resqueak correctly

* Got resqueak display working on squeak card component

* Fix display for missing resqueaked squeak.

* Fix display for missing resqueaked squeak in squeak card.

* Got resqueak from squeak card working

* Fix prevent default action on resqueak unlock click

* Fix prevent default on make reply squeak in squeak card

* Got number of replies to resqueaked squeak working

* Fix click on squeak card

* Fix too many characters warning message

* Fix click on squeak card image and name and pubkey

* Rename set reply modal state function

* Fix toggle modals for resqueaked squeak

* Fix form submit action for squeak modals

* Include num resqueaks and num resqueaked resqueaks in get squeak entry db query

* Show number of resqueaks in frontend

* Fix distinct count in query for num replies and num resqueaks

* Update resqueaked squeak in slice state

* Update frontend build
2022-04-24 17:54:07 -07:00
Jonathan Zernik
80a484ef3b
Simplify get payment summary in controller (#2159) 2022-04-14 15:17:26 -07:00
Jonathan Zernik
d626147c71
Show num replies (#2144)
* Got show num replies working on squeak page

* Fix group by squeak hash

* Fix db queries for get num replies

* Update frontend build
2022-04-13 15:47:28 -07:00
Jonathan Zernik
f7fec3b8a3
Show sent payments for profile (#2100)
* Add db methods to get sent and received payments for pubkey

* Add flask endpoints for payments per pubkey

* Got amount earned summary working in profile page.

* Update frontend build
2022-03-30 19:58:49 -07:00
Jonathan Zernik
b251263394
Show payments for squeak (#2078)
* Add get received payment summary for squeak and get sent payment summary for squeak.

* Add get sent payments for squeak.

* Add get received payments for squeak.

* Add RPC and flask endpoint for get payment summary for squeak.

* Got payment summary fields working in squeak page.

* Refetch payment summary from backend after buy completes successfully

* Update frontend build
2022-03-29 23:20:38 -07:00
Jonathan Zernik
50af9bb905
Fix conflicting sent offers by address (#2075)
* Don't check for existing sent offer when getting requested sent offer.

* Check if received offer is already saved before requesting from peer.
2022-03-29 20:27:08 -07:00
Jonathan Zernik
964477ceb0
Delete interests module (#2073) 2022-03-29 18:55:49 -07:00
Jonathan Zernik
bff7bbbc4b
Use squeak store to encapsulate all core fns (#2030)
* Revert "Remove usage of squeak_core from squeak_store (#2029)"

This reverts commit bd15c653aa.

* Add make squeak method to squeak store class

* Add pay offer method to squeak store

* Remove squeak_core from controller constructor

* Remove default port param from controller constructor

* Fix broken itests

* Got download single squeak working synchronously
2022-03-26 20:42:42 -07:00
Jonathan Zernik
bd15c653aa
Remove usage of squeak_core from squeak_store (#2029)
* Remove usage of squeak_core from squeak_store

* Remove default peer port arg from controller constructor
2022-03-26 18:42:00 -07:00
Jonathan Zernik
8a89dbfa10
Make peer client connect with tor (#2018) 2022-03-25 23:12:43 -07:00
Jonathan Zernik
fbc66c9813
Fix change profile name default (#2013)
* Fix default value for change profile name

* Partially fix set sell price dialog

* Fix itest in progress

* Fix get sell price
2022-03-17 23:24:50 -07:00
Jonathan Zernik
68e69e55c8
Use http for peer connection (#2002)
* Got basic web server running for peer

* Got squeak route and lookup route working

* Got secret key route working

* Got offer endpoint working

* Remove old comment

* Move peer server code to server subdir

* Create client subdir for peer client

* Return empty list for lookup when pubkeys is empty

* Add peer client and network controller class

* Remove old network code

* Remove old block subscription worker

* Remove network handler class

* Remove more old classes

* Add back twitter forwarder worker

* Remove download methods from controller

* Add websocket endpoint

* Add websocket subscribe method

* Add websocket client library

* Fetch squeaks from peer (slowly) on UI timeline load

* Fetch squeaks from peer (slowly) on UI pubkey squeaks load

* Got download squeaks working with HTTP requests

* Fixed external address method in controller

* Remove download pubkey squeak button and action

* Remove unused connection displays from peer ana peers page

* Fix 404 not found for offer endpoint

* Better handling of null cases in peer client downloader

* Simplify peer downloader

* Create subclass for range download

* Got single squeak download working

* Fix itest for get external address
2022-03-17 14:38:46 -07:00
Jonathan Zernik
4d349005d4
Simplify add peer UI (#1999)
* Remove non-null constraint on peer name

* Remove validation requiring non-empty name for peer

* Update database to use autoconnect true by default

* Remove connect peer button and modal from peers page

* Show saved peers tab by default in peers page

* Update frontend build
2022-03-15 17:38:18 -07:00
Jonathan Zernik
ac3279c532
Improve node init (#1940)
* Eliminate squeak params from controller and network manager

* Separate instantiation from initialization of objects in node class
2022-02-13 03:23:11 -08:00
Jonathan Zernik
d347534b55
Display private squeaks (#1914)
* Update squeak display entry in proto for private squeaks

* Add select private message recipient in make squeak dialog

* Show recipient of private squeak in squeak thread item

* Use squeak content str is null to determine background color of squeak component

* Update frontend build

* Refactor private squeak indicator to separate component

* Remove old comments

* Got private message recipient indicator working in thread item and detail item

* Add decrypt squeak dialog

* Got button showing for unlocked but encrypted squeak

* Show lock icon for squeak thread item when unlocked but still encypted

* Comment out get secret key method of controller

* Add rpc method for decrypt squeak content

* Got decrypt content working with recipient private key

* Update frontend build
2021-12-28 18:40:09 -08:00
Jonathan Zernik
20d651df8e
Implement unlock private squeak (#1910)
* Add method stub for unlock private squeak in controller class

* Add methods to unlock private squeak in controller

* Remove todo comments

* Add test for create and decrypt private squeak in core module

* Update handler method for make squeak to support recipient profile id

* Add itest for make private squeak and unlock content as author
2021-12-28 01:07:59 -08:00
Jonathan Zernik
75d0b0634d
Split save secret key and unlock content methods (#1909)
* Split save secret key and unlock content methods of squeak store

* Unlock squeak content automatically after saving private key when squeak is not private
2021-12-27 21:13:56 -08:00
Jonathan Zernik
aef9afda61
Split set secret key and set decrypted content into separate methods of squeak db class (#1908) 2021-12-27 19:53:35 -08:00
Jonathan Zernik
e827db2ef7
Refactor unlock squeak method of squeak store (#1907) 2021-12-27 19:28:14 -08:00
Jonathan Zernik
9a2d37edb6
Add more tests for squeak store (#1905)
* Use mock db for tests in squeak store

* Add assertion about event listener call in save squeak test

* Add test for save squeak when max squeaks is exceeded

* Add test for save squeak when max squeaks per pubkey per block is exceeded
2021-12-27 17:56:05 -08:00
Jonathan Zernik
d2e61a02f4
Validate squeak against blockchain inside squeak store class (#1902) 2021-12-27 17:00:03 -08:00
Jonathan Zernik
e6e59bb3fb
Include block header in make squeak method (#1900)
* Update make squeak method to include block header in return value

* Remove type hint from make squeak in twitter forwarder
2021-12-27 14:17:12 -08:00
Jonathan Zernik
cf64664a44
Update squeaklib to support private messages (#1898)
* Update squeaklib and update import from keys module

* Rename signing key variable to private key in test util

* Fix calling make squeak function

* Update db data file to v3

* Add recipient public key column to squeak table

* Got squeak entry db query working with alias for profiles table

* Add test for make squeak with recipient

* Add test case for get profile from squeak entry query

* Got outer join with recipient profile working

* Use outer join to get recipient profile for all squeak entry db queries

* Got itest passing with refactored squeak_store

* Remove unused config from squeak store class
2021-12-27 01:15:05 -08:00
Jonathan Zernik
51f412d75f
Update squeaklib to support private messages (#1897)
* Update squeaklib and update import from keys module

* Rename signing key variable to private key in test util

* Fix calling make squeak function

* Update db data file to v3

* Add recipient public key column to squeak table

* Got squeak entry db query working with alias for profiles table

* Add test for make squeak with recipient

* Add test case for get profile from squeak entry query

* Got outer join with recipient profile working

* Use outer join to get recipient profile for all squeak entry db queries
2021-12-27 00:56:31 -08:00
Jonathan Zernik
1a159a5f10
Fix max squeaks per public key per block height config (#1896) 2021-12-26 10:08:00 -08:00
Jonathan Zernik
0ecb73fac3
Update squeaklib and use new msg type (#1894)
* Use updated squeaklib with offer msg removed

* Bump squeaklib version and use methods to check if message has offer
2021-12-25 19:47:07 -08:00
Jonathan Zernik
b5801097b8
Implement squeak store v3 (#1886)
* Add test for insert squeak in squeak store

* Add test for delete squeak in squeak store

* Add test for save and get sent offer

* Add test for get received offer in squeak store

* Add subscription methods for squeak store

* Use squeak store in squeak controller

* Use squeak store for save squeak method in controller

* Use squeak store for unlock squeak method in controller

* Add comment to make squeak method

* Use squeak_store for more methods in controller

* Use squeak_store for price policy in controller

* Use squeak_store for create signing profile in controller

* Use squeak_store for more profile methods in controller

* Use squeak_store for more profile methods in controller

* Use squeak_store for create peer method in controller

* Use squeak_store for more peer methods in controller

* Use squeak_store for pay offer method in controller

* Use squeak_store for get sent payments and received payments method in controller

* Use squeak_store for get received offers method in controller

* Use squeak store for delete expired offers method

* Use squeak store for get squeak entries methods

* Use squeak store for save received offer method of controller

* Use squeak store for get followed public keys method of controller

* Use squeak store for reprocess received payments method of controller

* Use squeak store for delete old squeaks method of controller

* Use squeak store for like and unlike squeak method of controller

* Use squeak store for get connected peers method of controller

* Use squeak store for add and remove twitter account methods of controller

* Remove squeak_db param from controller constructor

* Use squeak core in squeak store for save squeak andunlock squeak

* Use squeak core in squeak store for make and get sent offer

* Remove old comments

* Remove more old comments

* Use squeak core in squeak store for save received offer

* Use squeak core in squeak store for pay received offer

* Use squeak core in squeak store for get interested struct

* Update twitter forwarder to use squeak store instead of squeak controller

* Update squeak deletion worker to use squeak store instead of squeak controller

* Delete old comments with lines about squeak controller

* Update squeak forwarder worker to use squeak store instead of squeak controller

* Update squeak secret key forwarder worker to use squeak store instead of squeak controller

* Update delete expired offers worker to use squeak store instead of squeak controller

* Update peer subscription workers to use squeak store instead of squeak controller

* Update peer autoconnect worker to use squeak store instead of squeak controller

* Remove usage of squeak controller in download manager start method.

* Add network handler class

* Remove unused constructor params from network handler

* Remove old comments
2021-12-25 09:47:55 -08:00
Jonathan Zernik
c2aeb344bc
Implement node settings (#1884)
* Implement node settings class

* Fix price policy for zero price

* Remove old comment

* Remove old comments

* Remove old comments
2021-12-23 08:33:40 -08:00
Jonathan Zernik
9f0d5e4097
Include bearer token in twitter account (#1881)
* Got twitter forwarder working with bearer token in twitter accounts table

* Update frontend to use bearer token in twitter account

* Update frontend build
2021-12-22 16:10:03 -08:00
Jonathan Zernik
5198467889
Use new squeak protocol with schnorr and pubkey as identifier (#1870)
* Got all tests in core dir passing

* Got all tests in db dir passing

* Got tests for admin dir passing

* Got all unit tests passing

* Added migration for squeak table and profile table using new pubkey

* Re-start db migrations with new data-v2.db file

* Fix column type for profile public key

* Got all itests passing

* Log the public key in hex in create contact profile handle fn

* Rename rpc methods to use pubkey instead of address

* Got frontend mostly working with new profile pubkey

* Update frontend to use pubkey instead of address

* Change size of squeak profile detail item

* Update create contact profile dialog to use pubkey

* Update twitter account item to use pubkey

* Include label for pubkey in profile detail item

* Decrease size of profile detail item

* Update frontend build

* Improve logging of requests in handler
2021-12-20 09:28:38 -08:00
Jonathan Zernik
6233890e5b
Remove squeak detail include in squeak entry (#1837)
* Got squeak details dialog working without details rpc request

* Remove get squeak detail from rpc proto

* Update frontend build

* Remove old get squeak detail itest

* Remove unused fixture for squeak detail item
2021-11-30 22:25:43 -08:00
Jonathan Zernik
ed9cf92ccc
Use custom class for get secret key reply to peer (#1831)
* Use custom class for get secret key reply to peer

* Update connection class to use secret key reply

* Rename get secret key reply method
2021-11-29 01:56:57 -08:00
Jonathan Zernik
0a5d0d1d10
Remove profile custom price (#1807)
* Remove custom price from profile

* Remove profile custom price from frontend

* Update frontend build
2021-11-19 00:04:07 -08:00
Jonathan Zernik
488ed5dfc4
Add global sell price setting (#1791)
* Add sell price setting to db

* Add rpc method for set and get sell price setting

* Fix servicer methods for get and set sell price

* Add settings page in frontend

* Include default sell price in get sell price rpc

* Show sell price in settings page

* Got set sell price working in frontend

* Remove frontend validation of sell price dialog

* Use sell price from settings when determining price

* Add rpc to clear sell price setting

* Add clear sell price to frontend

* Remove unused imports in frontend

* Update frontend build
2021-11-10 01:53:55 -08:00
Jonathan Zernik
de2f84e6f8
Use polymorphic class for downloaded object (#1787) 2021-11-07 18:50:27 -08:00
Jonathan Zernik
c96f7c7f7f
Add price policy class to determine sell price (#1785) 2021-11-07 04:40:17 -08:00
Jonathan Zernik
c0141effcb
Implement share for free with saved peer (#1782)
* Add share_for_free column to peer table in db and to core struct

* Got set share for free toggle working in frontend

* Got share for free working with price zero in controller
2021-11-07 02:21:13 -08:00
Jonathan Zernik
6c40891ad8
Add twitter forwarder (#1755)
* Add twitter stream class

* Got twitter forwarder subscription working

* Add config table in db with twitter bearer token

* Only run forward tweets task when twitter bearer token and twitter handles are not null

* Add twitter page to frontend and add button to set bearer token

* Reload bearer token in ui after setting value

* Add twitter accounts table to db

* Got get twitter accounts request working

* Display twitter account list items in twitter page

* Show twitter accounts in twitter page

* Got create squeak from tweet working

* Update twitter stream upon twitter accounts changes

* Got terminate twitter stream connection working

* Update frontend build

* Remove print statements from itest

* Remove main function from twitter stream module

* Make tweet forwarder worker run as daemon thread

* Use custom config for subscribe tweets retry interval
2021-11-04 19:10:00 -07:00
Jonathan Zernik
a8745d0dbd
Add test for download result to message (#1739) 2021-10-26 21:46:35 -07:00
Jonathan Zernik
8daeee2717
Return immediately from download when zero connected peers (#1733) 2021-10-26 15:27:06 -07:00
Jonathan Zernik
00eb68cf72
Add test for is interested for download interest (#1728) 2021-10-25 16:49:25 -07:00
Jonathan Zernik
635dff92ac
Fix shutdown threadpool in download manager (#1727)
* Fix shutdown threadpool in download manager

* Call event.wait with timeout value so it stops eventually

* Cancel all running downloads when download manager shuts down
2021-10-25 16:24:19 -07:00
Jonathan Zernik
dbc6c31381
Make download async (#1725)
* Use active download class for explicit downloads

* Delete old temporary interest manager and expiringdict dependency

* Delete old comments related to temporary interest manager

* Add log line after successful download single squeak

* Add unit test for mark download complete

* Add unit test for wait for stop method of download

* Add test for download hash not interested

* Add test for get download result

* Add test for initiate download for hash download

* Add test for initiate download for interest download

* Rename interest download

* Remove commented old method

* Remove another comment from active download

* Use limit 1 for hash download

* Rename wait for complete method of download
2021-10-25 14:48:12 -07:00
Jonathan Zernik
0b1f0a9257
Use custom db error when db init fails (#1720) 2021-10-24 16:53:39 -07:00
Jonathan Zernik
583d076394
Use payment hash as parameter for set received offer paid (#1718) 2021-10-24 16:19:23 -07:00
Jonathan Zernik
b2d5326d34
Delete received offers when out of configured retention from download time (#1708) 2021-10-23 09:34:21 -07:00