Commit Graph

160 Commits

Author SHA1 Message Date
rorp
5d309fbae0
Fee rate WS notification (#4518)
* Fee rate WS notification

* make the test more CI friendly

* fix the default config

* always return errors

* fix build

* scalafmt

* send notifications every time
2022-07-19 16:41:06 -05:00
Chris Stewart
948d2b424e
Make KeyManagerAppConfig.walletName return String rather than Option[String] (#4507) 2022-07-16 09:33:10 -05:00
Chris Stewart
84ce76e16c
Fix race condition related to sqlite3 database not being created before we access it (#4479) 2022-07-09 21:38:21 -05:00
Chris Stewart
7f43ef98ad
Default to suredbits node if peers field is left empty (#4404)
* Default to suredbits node if peers field is left empty

* Remove log
2022-06-18 18:40:53 -05:00
benthecarman
24a9e6a5e6
Add PaymentSecret, ShortChannelId, and MilliSatoshis Db Mappers (#4396) 2022-06-15 07:32:53 -05:00
benthecarman
441937238f
Make flyway protected so other apps can access it (#4372) 2022-06-06 16:10:26 -05:00
Chris Stewart
2f4bbf7014
Upgrade flyway to 8.5.9 (#4311)
* Upgrade flyway to 8.5.9

* Remove comment
2022-05-04 11:24:51 -05:00
rorp
f5940c93d4
Contact list (#4234)
* Contact list

* fix unit tests

* Add contact rpc tests

* Add documentation

* Refactor ConsoleCli into app-commons

* Add commands to bitcoin-s-cli

* Fix timeout for rescan

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-04-21 13:02:35 -05:00
Chris Stewart
5475a994cf
Bump default address gap limit to 100, add log indicating we didn't find funds in the last addressBatchSize addresses (#4201) 2022-03-19 19:02:32 -05:00
Chris Stewart
8e3b8c1f4f
Improve key manager error message (#4161) 2022-03-04 09:57:02 -06:00
rorp
ffd7d921a8
Database support for incoming offers (#4105)
* Database support for incoming offers

* fix tests
2022-02-18 14:03:05 -06:00
rorp
5777ec1c31
Add an ability to set custom payout and change addresses (#4101)
* Add an ability to set custom payout and change addresses

* config changes

* formatting

* respond to the comments
2022-02-18 09:29:00 -06:00
benthecarman
3d674c37f3
Create upsertAllAction (#4073) 2022-02-11 13:06:50 -06:00
benthecarman
2166faf61d
Make findByPrimaryKeysAction public (#4079) 2022-02-11 12:06:56 -06:00
benthecarman
3991789129
Don't call findByPrimaryKeys if ids is empty (#4074) 2022-02-11 06:51:32 -06:00
rorp
48189d5c1d
Make CRUD.run and CRUD.runVec transactional (#4059)
* Make `CRUD.run` and `CRUD.runVec` transactional

* remove explicit `transactionally` calls
2022-02-07 17:42:48 -06:00
Chris Stewart
08941206fc
Bump timeout to 60 seconds (#4021) 2022-01-27 11:52:19 -06:00
Chris Stewart
bd5bcfef3a
2022 01 18 issue 3969 Add serialization_version to global_dlc_data (#3992)
* Get refactor working where we decouple CETSignatures and the partial refund signature

* WIP

* Implement migration to specify serialization_version on global_dlc_data table

* Fix migrations test

* WIP

* implement contractid computation

* Get migration working for wallet on testnet

* Add check to make sure we only try to migrate old wallets

* Refactor DLCDataManagement.getOfferAndAcceptWithoutSigs to not use DLCTxBuilder

* WIP

* Bubble up Option[] into DLCWallet, trivially assert on it and then use .get. We will have to do the refactor of DLCWallet sometime in the future

* Change global_dlc_data serializationVersion at database level to not have an Option

* Add DLCDbState, propogate it through the codebase

* Remove log

* Remove invariant for making sure all DLCs are defined on migraiton, add log for the case of issue 4001

* Add filter on ALPHA serialization DLCs. We dont need to migrate DLCs that are using the beta serialization

* Rebase onto 4004

* Refactor to use the refund signature in the accept/sign message

* Add output index to the return of DLCTxBuilder.buildFundingTransaction()

* Fix compile

* Remove log
2022-01-26 14:57:45 -06:00
user411
3162c1b2d0
Ignore .DS_Store files when making backups (#4000) 2022-01-21 12:57:38 -06:00
rorp
f438ce2897
Refactor zipDatadir (#3999)
* Refactor zipDatadir

* cleanup
2022-01-21 10:03:53 -06:00
benthecarman
0079489a15
Create DbMapper for DoubleSha256Digest (#3995) 2022-01-19 15:00:08 -06:00
Chris Stewart
ee0d62c5b8
2022 01 14 DLCDataManagement refactor (#3982)
* WIP

* Finish refactor, get unit tests working

* Remove log
2022-01-18 08:12:27 -06:00
rorp
ee3ee53191
RPC password authentication (#3961)
* RPC password authentication

* fix compiler error

* add more unit tests

* change default behavior

* Cleanup and add unit test for sad path for rpc authentication

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-01-13 05:55:33 -06:00
benthecarman
524c5212e0
Add MasterXPubTable to list of DLCOracle tables (#3955)
* Add MasterXPubTable to list of DLCOracle tables

* Allow clean to be called by outside libraries
2021-12-31 06:30:44 -06:00
Chris Stewart
f8f8f50aae
Implement ping every 5 seconds to keep websocket connection alive (#3947) 2021-12-29 17:43:56 -06:00
Chris Stewart
50bec2abc6
2021 12 14 websockets (#3906)
* WIP

* Get basic websocket working (sort of)

* Push websocket fixes

* WIP: Implementing SpendingInfoDb json serializer

* Implement onreserved callbacks, add json serializers for SpendingInfoDb

* Get first unit test working for websockets when a address is generated

* Rework WalletNotification to have case classes, get unit test working for receiving addresses over the websocket

* WIP

* Add websocket callback for when a wallet processes a block

* Cleanup

* basic updates to unit test

* Fix compile

* Fix submodule

* Fix compile

* Get both unit tests passing when run by themselves

* Fix so both test cases can be run

* Implement unit tests for blockpressed and reservedutxos websockets

* Fix RoutesSpec get a block header test

* Implement configuration for wsbind and wsport via bitcoin-s.conf

* Add some nonblocking sleeps on all WebsocketTests

* Add documentation

* Properly close the server with .terminate() rather than .unbind()

* Add BitcoinSServerMainBitcoindFixture.afterAll()

* Add println

* Add more println

* Try to downgrade bitcoind version

* Fix datadir bug

* Cleanup callbacks so they don't have nested futures

* Fix SpendingInfoDb.apply() pattern match

* Add spendingInfoDb json serializer test, does not pass

* Fix SpendingInfoDb json serializer

* Make small refactors

* Fix compile

* Add maxBufferSize, change overflow strategy to OverflowStrategy.dropHead

* Address Nadav's code review

* Address ben's code review
2021-12-25 11:11:04 -06:00
benthecarman
6c2bb0d111
Rename database username and password variables (#3930) 2021-12-23 06:46:01 -06:00
rorp
7e214da601
Improve BitcoinSAppConfig.zipDatadir (#3903) 2021-12-14 17:23:18 -06:00
Chris Stewart
6c67e83d3f
2021 12 10 issue 3891 (#3894)
* Add some logs to indicate how long startup time is

* Parallelize submodule configuration startup between modules dependent on tor and modules not dependent on tor

* Start tor dependent modules in parallel too

* Make Wallet.initialize() use DBIOAction

* Scalafmt

* Make Wallet.initialize() use .transasctionally
2021-12-13 14:20:51 -06:00
benthecarman
afb51228b4
Add NodeId to DbCommonsColumnMappers (#3880) 2021-12-07 17:17:30 -06:00
Chris Stewart
085b8b1910
Implement CRUDAction.deleteAction() (#3877) 2021-12-06 07:19:31 -06:00
Chris Stewart
6e7af37ca0
2021 12 03 installer rename (#3876)
* Rename installers to try and make it more obvious waht they are

* Try super short names

* Fix missing update to error message on CRUDAction.update()

* Remove special branch

* Update submodule
2021-12-04 06:10:08 -06:00
Chris Stewart
2d5732375f
Add CRUDAction.{updateAllAction, updateAction} (#3872)
* Add CRUDAction.{updateAllAction, updateAction}

* Move updateDLCOracleSigs into DLCActionBuilder and make it an action

* Update DLCTransactionProcessing.calculateAndSetOutcome() to use actions
2021-12-04 05:29:51 -06:00
Chris Stewart
f71d3567ed
2021 11 23 crud action (#3851)
* WIP

* Finish implementing {CRUD,CRUDAction}.createAllAction()

* Try to make database inserts more atomic

* Consolidate more database calls in DLCWallet.initDLCForAccept()

* WIP2

* More refactor and using actions

* Add DLCIdDaoUtilNoPK for querying when dlcId is not a primary key

* Add DLCDataManagement.deleteDLC()

* make DLCWalletApi.createDLCOffer() use actions

* Rework DLCWallet.createNewDLCAccept() to use DBIOAction

* Use actions in DLCWallet.registerDLCAccept() a bit

* Create DLCActionBuilder, move actions to there

* Move more actions into ActionBuilder

* Implement transactionally on database writes for actions
2021-11-30 12:38:55 -06:00
benthecarman
92ab9faa45
Decide which coin selection solution to use based on waste metric (#3646)
* Decide which coin selection solution to use based on waste metric

* Fix test

* Fix NeutrinoNodeWithWalletTest
2021-10-19 09:47:28 -05:00
rorp
5a5f1e00c7
Store oracle name in the database (#3748)
* Store oracle name in the database

* fix pg tests

* respond to the PR comments
2021-10-14 09:35:11 -05:00
Chris Stewart
3d725adc92
2021 09 29 delete announcement (#3701)
* Implement delete attestations

* Add DLCOracleApi.deleteAnnouncements()

* Make sure we don't have attestations before deleting announcements

* Add endpoint in OracleRoutes for delete announcement

* Add ConsoleCli implementation

* deleteattestations -> deleteattestation

* Document endpoints and add warnings

* Wire up ConsoleCli with deleteannouncement/deleteattestation

* Fix use of deprecated methods
2021-10-01 14:42:59 -05:00
rorp
6df0354a73
Enable WAL mode for SQLite (#3704)
* Enable WAL mode for Sqlite

* load the jdbc driver
2021-10-01 07:08:02 -05:00
rorp
698fe9e800
Add backupwallet and backuporacle endpoints (#3694)
* Add backupwallet and backuporacle endpoints

* respond to the PR comments
2021-09-28 07:46:33 -05:00
Chris Stewart
48213d9b81
Implement MasterXPubDAO (#3451)
* Implement MasterXPubDAO

* Fix nits

* Add postgres migrations

* Make sure tables are getting cleaned on postgres

* Get dlcOracleTest test cases passing with validation of the master xpub in the database on startup

* Fix test case

* Fix more tests

* Move things around so keymanager does not need to depend on dbCommons

* Get all walletTest passing

* Add unit test for wallet startup

* Fix rebase

* Get all sqlite tests passing

* Get postgres test cases passing locally

* Remove early call to walletAppConfig.start() in node project

* Make KeyManagerAppConfig.externalEntropy private

* Fix MasterXpubDAO.existsOneXpub()

* Fix bug in migrating database for oralce project
2021-09-21 08:05:23 -05:00
rorp
704b02ae6c
Use random ports for pre-packaged Tor daemon (#3604)
* Use random ports for pre-packaged Tor daemon

* fix unit tests

* configurable random ports

* shutdown hook
2021-08-26 13:02:49 -05:00
Chris Stewart
4f7b6422ea
2021 08 06 app config refacotr (#3498)
* Move AppConfig into app-commons, reduce classpath deps on keyManager,tor

* Move test ServerArgParserTest

* Fix compile error
2021-08-07 14:36:11 -05:00
benthecarman
1051e6365a
DLC P2P Client (#3402)
* DLC P2P WIP

* P2PClient refactor (#10)

* Add to CI

* Remove unused

* Attempt to create DLCNode and Tests

* Full Tor support

* Get DLCNegotiationTest passing

* Config options, connect & send func

* Test for DLCNode

* Add createDLCNode to config

* Fix formatting

* Update DLC state after all other data is set

* Remove unneeded line

* Respond to some review

* 2021 07 26 dlc node code review (#13)

* WIP

* WIP2

* Rewrite tests not use Await.result()

* Skip Tor test on CI

* Cleanup threadpool leaks in tests

* Handle actor pattern matching better

* Respond to review

* Implement DLCNode.stop

* sock5 -> socks5

* Use Tcp.Unbind

* Respond to review

* Implement postStop

* Switch to unbind

Co-authored-by: rorp <rorp@users.noreply.github.com>
Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2021-08-02 18:15:56 -05:00
Chris Stewart
b2b2ca45db
Add ability to configure postgres database backends for test cases via reference.conf (#3421) 2021-07-19 09:55:36 -05:00
rorp
8b663d91b6
Tor support for P2P (#3311)
* Tor support for P2P

* fix stuck connections

* unit tests

* docs

* update docs

* respond to the PR comments

* fix docs
2021-07-13 14:27:24 -05:00
Chris Stewart
bc79a24f53
Get both bundle and app server logging working (#3362)
* Get both bundle and app server logging working, oracleServer does not compile

* Get everythig compiling

* Fix bug where bundle wouldn't use command line param rpc port for ConsoleCli

* Add unit tests to make sure we are translating to config properly

* Fix bug where app config wasn't re-created after parsing bundle args

* Fix datadir resolution in BundleGUI

* Implement force-recalc-chainwork

* fix bug

* Try not using tilde on windows

* Try to print datadir on CI

* Try using stackoverflow answer

* Try escaping windows path

* Take ben's suggestion of using AppConfig.safePathToString

* Just check the paths are equal

* Fix nullpointerexceptions on startup

* Fix bug where bitcoin-s-bundle.conf was not being read

* Remove usage of --conf flag in bundle when starting backend server

* Fix compile

* Rename usedDir -> networkDir

* Fix passing in datadir
2021-07-07 10:59:11 -05:00
benthecarman
d669bd58ae
Resolve bundle config and read/write in tmp file (#3327)
* Have it save config for next time

* Fix compile
2021-06-28 07:46:32 -05:00
benthecarman
c72c5f84e3
Add extranious json readers, writers, and column mappers (#3325) 2021-06-24 07:37:55 -05:00
benthecarman
88187abf1a
Add LnInvoice db mapper (#3286) 2021-06-17 06:49:33 -05:00
Chris Stewart
dee044eb4e
2021 05 26 uint64 mapper (#3155)
* Add unit for u64 mapper

* Add more unit tests for u64 mapper
2021-05-27 06:43:49 -05:00