Commit graph

161 commits

Author SHA1 Message Date
Jonathan Zernik
41278868bd
Create base class network sync (#639)
* itest passing with refactored peer sync

* Fix query for downloading peers

* Delete old network sync

* Revert "Delete old network sync"

This reverts commit 91d5620129.

* Delete old network sync
2021-01-13 17:41:50 -08:00
Jonathan Zernik
5572ee07d0
Use bytes for server proto (#626)
* Use bytes for squeak_hash in getsqueak method

* Use bytes for squeak hash in get offer rpc

* Use bytes for hash field in squeak message in proto

* Use bytes for hashes in lookup response

* Remove old commented code

* Use bytes for squeak hash in peer client post

* Remove old comments
2021-01-12 19:13:40 -08:00
Jonathan Zernik
1414c2163f
Delete sent offer and received offer after payment (#601)
* Delete sent offer and received offer after payment

* Fix itest for deleted offers after payment
2021-01-11 11:34:49 -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
cede35ed55
Fix serialization of payment hash db (#579)
* Use postgres for db in itest

* Fix serialization of payment hash in db tables
2021-01-08 00:48:16 -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
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
59c73c85b3
Add get network rpc method (#563) 2021-01-05 14:37:20 -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
b2766f5ab0
Add admin rpc enabled config (#535)
* Add config to enable admin rpc server

* Allow squeaknode to run on mainnet

* Clean up main module more

* Clean up configs in main module more
2020-12-31 19:49:26 -08:00
Jonathan Zernik
98d9b5a87d
Make dockerfile run with cmd (#529)
* Add cmd to dockerfile

* Remove waiting for cert file in start script

* Output docker container dirs before starting script

* Remove failing ls line

* Add lnd tls cert path and macaroon path env vars

* Add env vars for webadmin congis
2020-12-31 00:05:20 -08:00
Jonathan Zernik
9b14c8016b
Package for umbrel (#528)
* Switch dockerfile base image to buster

* Try to make build work for umbrel

* Remove libs from Dockerfile

* Add build-essential to dockerfile

* Make sqk_dir configurable with environment variable

* Use new env var names
2020-12-30 16:46:48 -08:00
Jonathan Zernik
22f6b4fc3c
Add precommit hooks (#526) 2020-12-28 23:52:32 -08:00
Jonathan Zernik
34ec5deee8
Use python slim docker base image (#516)
* Use python slim image for both squeaknode and test

* Clean up dockerfiles

* Reorder dockerfile for squeaknode

* Load alembic config file from packaged module

* Alembic directory is now loaded from packaged module

* Got multi-stage docker build working

* Removed old app directory from docker config

* Remove commented package data arg from setup.py

* Remove unused alembic graft from manifest

* Fix extra space in alembic revision
2020-12-27 04:59:59 -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
c62d4229cf
Remove btcd cert shared volume (#486)
* Remove shared volume for btcd cert file

* Got ssl cert working as a config

* Remove old comment about adding ssl certificate in dockerfile
2020-11-24 01:18:53 -05:00
Jonathan Zernik
a43576a10e
Use bitcoincore for bitcoin node (#481)
* Got docker-compose working with bitcoin-core

* Got itest working

* Add bitcoin use_ssl config

* Rename service to bitcoin-core in docker-compose
2020-11-23 14:43:17 -05:00
Jonathan Zernik
d25a56ccb1
Subscribe received payments (#471)
* Got subscribe received payments working

* Add test for subscribe received payments
2020-11-21 03:30:45 -05:00
Jonathan Zernik
c5e5889135
Rename get timeline squeak displays (#469)
* Rename get timeline squeak displays and don't filter for following

* Update static build
2020-11-20 23:26:14 -05:00
Jonathan Zernik
0c072ae470
Include client_addr in sent_offer and received_payment tables (#458) 2020-11-13 04:29:20 -05:00
Jonathan Zernik
4e17c4611d
Make fields nullable false in models (#456) 2020-11-13 00:42:28 -05:00
Jonathan Zernik
2c8d6e0df5
Fix timestamp in get received payments (#453)
* Fix timestamp in get received payment rpc

* Update static build

* Fix proto numbering of received payment

* Include log line with returned received payments

* Lg the received payments reply

* Lg received payments reply list

* Lg received payments reply list

* Fix received payment component

* Remove log lines from frontend

* Remove log lines for received payment
2020-11-12 14:04:28 -05:00
Jonathan Zernik
1d68e0b569
Add sent offer table (#451)
* Rename received payments to sent offers

* Add received payments table

* Add get received payments rpc method

* Rename old received payment to sent offer in frontend

* Add received payment frontend component

* Improve logging of error in admin web request
2020-11-12 04:02:28 -05:00
Jonathan Zernik
2f8d718518
Add received payments worker (#450)
* Got subscribe invoices worker working

* Improve error message in lnd invoice worker

* Only mark received payments if paid if the invoice is settled

* Check if invoice is settled before marking received payment as paid

* Pass settle index as param to mark paid db method

* Add migration to include settle_index in sent payments table

* Got latest settle index query working, I think

* Only return received payments that are already paid in db query

* Remove unused column from get latest settle index query

* Update static build
2020-11-11 22:02:26 -05:00
Jonathan Zernik
0dde62bf46
Add received payments table and get it in rpc method (#443) 2020-11-11 03:04:09 -05:00
Jonathan Zernik
b1d8d133e6
Show time in sent payment (#431)
* Get time field in sent payment rpc

* Show sent payment time in frontend
2020-11-10 15:55:26 -05:00
Jonathan Zernik
6641e64995
Use msat as price unit (#427)
* Use price_msat for config and internally

* Use price_msat in admin protocol for offer message

* Use price_msat in sent payments table and protocol

* Update frontend to use new protocol with price_msat for offer

* Update static build
2020-11-10 02:35:24 -05:00
Jonathan Zernik
0a50a377e0
Add get profile by name rpc method (#415) 2020-11-08 12:09:46 -05:00
Jonathan Zernik
ba5ab85163
Add unique constraints for profile name and address (#414) 2020-11-08 11:32:07 -05:00
Jonathan Zernik
12a8ddc88f
Add squeak detail page (#412)
* Created squeak detail page

* Add get squeak details rpc method

* Got squeak serialized data to show

* Put style back

* Show raw squeak data in text field

* Show hash in squeak details page

* Include link to zoom in to squeak detail page from squeak page

* Update static build and frontend makefile
2020-11-07 22:19:24 -05:00
Jonathan Zernik
b29a8ca8ea
Remove whitelisted attribute, use following to build whitelist (#386)
* Remove whitelisted attribute, use following to build whitelist

* Fix update whitelist on set profile following method

* Remove whitelist feature toggle from fronted

* Update frontend build
2020-11-05 14:12:23 -05:00
Jonathan Zernik
ab3284dafc
Use hex string for squeak hash everywhere (#384)
* Use hex string for squeak hash everywhere

* Fix squeak hash in post squeak method
2020-11-05 12:54:59 -05:00
Jonathan Zernik
8c4db6f85a
Rename squeaknode docker container (#377) 2020-11-04 23:35:32 -05:00
Jonathan Zernik
724f72f1e5
Use more config defaults (#376)
* Use default configs for webadmin

* Remove sqlite config from config file

* Use default config for sqk dir

* Use derived default lnd tls cert path in config

* Use default config for macaroon path

* Remove macaroon path config from docker config.ini

* Got mainnet working in docker

* Update readme

* Remove unused network param in docker config.ini file

* Update readme
2020-11-04 23:18:04 -05:00
Jonathan Zernik
225cd7fdf1
Use better config defaults (#375)
* Use default ports for bitcoin rpc

* Use default configs for lnd ports

* Use default configs for server host/port and admin host/port
2020-11-04 21:24:04 -05:00
Jonathan Zernik
611e13c07f
New config class (#374)
* Create new config class

* Load lnd configs from new config class

* Use new config class for server and webadmin

* Use new config for webadmin

* Fix boolean configs for webadmin

* Use new config class for squeaknode configs

* Use new config for postgresql configs

* Use configparser get method for all configs

* Remove old configparser from main module
2020-11-04 19:06:49 -05:00
Jonathan Zernik
d73b40c4c3
Rename getoffer rpc method (#373) 2020-11-04 07:19:39 -05:00
Jonathan Zernik
4e9bc47440
Simplify get squeak with cleared decryption key (#366)
* Simplify get squeak method of squeak store working

* Shorten sleep time for mining blocks
2020-11-04 02:23:22 -05:00
Jonathan Zernik
9e1defb037
Yield results from network sync (#360)
* Use queue to signal peer sync completion/failure

* Got network sync result from multiple peers

* Add peer connection class

* Got network sync working with network sync class

* Simplify peer timeline sync

* Remove old comments

* Make timeline sync and single squeak sync work for both upload and download

* Simplify timeline sync worker

* Got itest working for sync squeaks and download squeak

* Got sync squeak and sync squeaks rpc methods working with reply on completion of sync.

* Delete unused node controller class
2020-11-03 02:46:07 -05:00
Jonathan Zernik
fc81868e45
Add download single squeak method (#349)
* Add download single squeak method

* Add test for download squeak rpc method

* Imprive peerdownload class to only use block height only for sync method
2020-10-30 23:31:16 -04: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
ee27bcb6ee
Add config to enable admin web server (#315) 2020-10-23 21:31:06 -04:00
Jonathan Zernik
7051a07361
Add rpc method for get sent payment by id (#300) 2020-10-18 16:23:59 -04:00
Jonathan Zernik
e834547cf6
Get sent payments working in test (#299) 2020-10-18 14:26:58 -04:00
Jonathan Zernik
8ebdc754ca
Add pay offer dialog and backend method (#296)
* Add insert sent payment method

* Delete db container from itest

* Add other container in itest

* Connect to other squeak node in itest

* Use client lightning container for itest to get offers from main node

* Get offers itest working

* Open channel to buy offer in itest

* Successfully pay offer

* Remove old print statements from itest

* Successfully unlock squeak in pay offer method

* Assert that decrypted content is correct in pay offer itest
2020-10-18 00:27:49 -04:00
Jonathan Zernik
92a77ce7bb
Add subscribe channel events rpc (#283)
* Add subscribe channel events rpc

* Upgrade lnd to 0.11.1 (#284)

* Got test working for open and close channel with subscriptions
2020-10-11 07:01:35 -07:00
Jonathan Zernik
45b089ce93
Add open channel close channel (#282)
* Add open channel and close channel rpc

* Use different context managers for open channel and connect peer

* Add test for opening channel rpc
2020-10-11 04:21:07 -07:00
Jonathan Zernik
8b9f87990d
Show peer connection in lightning node (#280)
* Show peer connection status for lightning node

* Add connect peer button to lightning node page

* Add test for connect peer

* Add working test for list peers and connect peer

* Add test for disconnect peer

* Fix sqk dir config

* Fix sqk_dir config

* Successfully connect to sqkserver_other in docker-compose

* Remove unused dialog from lightning node page
2020-10-09 05:55:32 -07:00