Commit Graph

556 Commits

Author SHA1 Message Date
GreyMcCarthy
b7c7cb8fc2
Moving duplicate dataStructures in cli and app-server into app-commons (#4541)
* duplicate data structures in (ConsoleCli.scala) and (ServerJsonModels.scala) moved to (Command.scala)

* removed unused imports

* rebase for merge conflitcts

* change output type for Accept DLC

* more error fixes

* error fixes

* fixed destintaion error

* scala reformatting

* send from outpoints test runs and passes

* removed unnecessary braces, removed incorrect extensions on objects

* scala reformatting

* removed commented out code
2022-08-02 11:55:43 -05:00
Chris Stewart
191df09196
Move pollBitcoind out of startBitcoindBlockPolling (#4559)
* Move pollBitcoind out of startBitcoindBlockPolling

* Rework startBitcoindBlockPolling to not return Future[Cancellable]

* Stop NodeCallbacksStreamManager inside of NodeAppConfig.stop()

* Make BitcoindSyncState which encapsulates syncing with bitcoind and polling of mempool

* Fix bug where processingBitcoindBlocks cannot be top level val as that method may be used by different parts of the codebase

* Rename isPolling -> processingBitcoindBlocks

* Cleanup more resources in appServerTest/test

* Complete polling stream regardless if we synced blocks are not to complete the Future returned by pollBitcoind

* Empty commit to run CI
2022-08-02 06:40:17 -05:00
Chris Stewart
f487c1270e
Implement cleanup of dlcWallet/wallet DbAppConfig threadpools (#4557)
* Implement cleanup of dlcWallet/wallet DbAppConfig threadpools

* Cleanup

* Remove uncessary walletHolder.start()
2022-08-01 06:55:02 -05:00
Chris Stewart
936a65edd4
2022 07 21 Modify helper methods in BitcoindRpcBackendUtil to not materialize streams eagerly. (#4526)
* Refactor syncWalletToBitcoind impl to be completely stream based

* Add getParallelism, refactor usages in BitcoindRpcBackendUtil to use it

* Fix compile

* Replace usages of 'WalletApi with NeutrinoWalletApi' with NeutrinoHDWalletApi

* Revert wallet sync height logic

* Refactor to make things cleaner
2022-07-31 12:16:26 -05:00
Chris Stewart
4b83286922
2022 07 25 wallet api refactor (#4545)
* Move MockChainQueryApi/NodeApi out of BaseWalletTest

* refactor BitcoinSServerMain.start() to return WalletHolder

* Add walletConfig to WalletWithBitcoind

* Move findOutputsBeingSpent into WalletApi

* Add WalletApi.clearAllAddresses(), HDWalletApi.{findAccount, getnewaddress(account)}

* Add HDWalletApi.fundRawTransaction() with an account as parameter

* Add WalletApi.findByScriptPubKey()

* Fix lots of tests in WalletIntegrationTest

* Create WalletApi.processOurTransaction()

* Get things compiling

* Fix tag integration test

* Refactor AnyDLCHDWalletApi -> DLCNeutrinoHDWalletApi

* Fix docs

* Get postgres tests passing locally

* Move initBalance map before calling callback in CallBackUtilTest

* Get compile working, rename to destroyOnlyWalletWithBitcoindCached

* Fix docs

* Fix missing destroyWalletAppConfig

* Fix scalafmt

* Fix bug in dlcWalletTest where wallet db thread pools weren't being shutdown after unit test completes

* Empty commit
2022-07-31 08:04:39 -05:00
Chris Stewart
2cd8c80f67
Refactor so we don't create multiple WalletAppConfig in testkit (#4548)
* Refactor so we don't create multiple WalletAppConfig in testkit

Fix buildBip39PasswordConfig

* Remove bip39Password argument from dlcWalletTest fixtures

* Fix allowExternalDLCAddresses config in tests

* Remove unnecessary overrides of BitcoinSWalletTest.getFreshConfig, fix docs

* Add DLCExecutionBackendTest.afterAll()

* Fix nodeTest bip39Password usage

* Fix bug where we weren't using correct config inside of getFreshConfig

* Fix DLCExecutionBitcoindBackendtest.afterAll()

* Fix RescanDLCTest
2022-07-30 17:20:18 -05:00
Chris Stewart
6c76639ba3
Move processBlock into WalletApi (#4543) 2022-07-27 09:32:22 -05:00
Chris Stewart
a2e7c428cf
Bump sleeps on CallbackUtilTest (#4534)
* Bump sleeps on CallbackUtilTest

* Bump timeout even more

* Reduce timeout again

* Re-bump to 5 minutes

* Make sure we shutdown actor system in test fixture BitcoinSServerMainBitcoindFixture
2022-07-25 06:36:48 -05:00
Chris Stewart
d508d65142
Implement ability to cancel bitcoind polling jobs (#4538)
* Implement ability to cancel bitcoind polling jobs

* Fix bug so we don't block application on fully syncing wallet against bitcoind
2022-07-24 19:56:53 -05:00
Chris Stewart
4ef27dd163
Fix bug where dlcNode was not apart of tor dependent configs (#4537) 2022-07-24 16:48:25 -05:00
Chris Stewart
67dd16d8ad
Add missing calls to BitcoinSAppConfig.stop() (#4535) 2022-07-24 15:59:03 -05:00
Chris Stewart
b905afa65e
2022 07 20 wallet rescan stream (#4530)
* Implement rescan with akka streams

Get basic stream working with rescan

Fix bug where we weren't using rescan specific threadpool

Implement killswitch for rescan

* WIP: Expose promise to allow external completion of rescan stream

* Rework RescanStarted.RescanStarted to contain a promise to complete the stream early, and a future that represents the completed streams materialized value

* Comment cleanup

* Fix compile errors, remove killswitch

* Fix 2.12.x compile

* Introduce ActorSystem into wallet, refactor rescans to use that ActorSystem

* Fix import

* Fix bug where we were prepending instead appending to batched Vector

* Propogate RescanState upwards into WalletRoutes

* Refactor fetching of filters to be a Flow
2022-07-24 12:26:21 -05:00
Chris Stewart
d4210fad65
Pull over changes from loadwallet branch (#4527) 2022-07-21 12:12:32 -05:00
Chris Stewart
0a127368f0
2022 07 18 node callback stream manager (#4520)
* Implement akka stream proxy for nodecallbacks

Add killswitch to createBitcoindNodeCallbacksForWallet

Add unit test for killswitch in createBitcoindNodeCallbacksForWallet

Add delays to make sure callbacks are executed

Fix rebase

Move killswitch out of methods into class level val

* Bump timeout

* Attempt to implement NodeCallbacks proxy with akka streams

* Refactor CallbackUtil to use NodeCallbackStreamManager

* Rebase & remove killswitch

* Implement NodeCallbackStreamManager.+ method
2022-07-20 06:28:55 -05:00
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
Shreyansh
2e309086d5
Fix block fetch issue #4513 (#4522)
* fix block fetch issue #4513

* start syncing before rescane
2022-07-19 16:40:36 -05:00
Chris Stewart
0cb93ddbf4
2022 07 17 node callback akka streams (#4516)
* Implement akka stream proxy for nodecallbacks

Add killswitch to createBitcoindNodeCallbacksForWallet

Add unit test for killswitch in createBitcoindNodeCallbacksForWallet

Add delays to make sure callbacks are executed

Fix rebase

Move killswitch out of methods into class level val

* Bump timeout
2022-07-19 13:45:41 -05:00
Chris Stewart
e3a7c0971f
Refactor to hide the Message paramter that gets fed to the websocket queue, move it to a internal implementation detail (#4514) 2022-07-18 07:32:18 -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
6f42f83146
Move OSX check inside of jre path check, fix bug where quarantine wasn't working in case where we are in the same directory as script (#4508) 2022-07-14 06:57:52 -05:00
Chris Stewart
d1375a589e
2022 07 12 server startup cleanup (#4501)
* Remove handleMissingSpendingInfoDb

* Remove chainwork recalc

* Fix compile error and move torcallbacks in to buildNeutrinoCallbacks()

* Fix compile pt2
2022-07-13 14:22:19 -05:00
Chris Stewart
cdef8c01dd
Set syncing flag to true on startup (#4506) 2022-07-13 13:09:06 -05:00
Chris Stewart
6dfa7683e4
Implement a timeout on fee rate requests (#4503)
* Switch to bitgo fee provider by default

* Implement 1 second timeout on retrieving fee rate
2022-07-12 19:49:31 -05:00
rorp
e90e372e54
Add sync JSON field to the getinfo endpoint output (#4452)
* Add `sync` JSON field to the `getinfo` endpoint output

* improve test coverage

* update docs

* rename sync flag

* WebSocket notifications

* fix unit tests

* fix unit tests

* increase test timout
2022-07-12 14:41:43 -05:00
Chris Stewart
5b44c074f1
Fix chmod: jre/bin/java: No such file or directory errors (#4493)
* Fix 'chmod: jre/bin/java: No such file or directory' errors

* Remove echos

* Remove duplicate quaratine in oracle-server-extra-startup-script.sh
2022-07-11 15:04:04 -05:00
Chris Stewart
1b169d8fa0
Implement torstarted websocket callback (#4476)
* Implement tor started websocket callback

* Implement tor callbacks when tor is provided
2022-07-11 10:26:30 -05:00
Chris Stewart
1ae4d40dac
Implement rescancomplete callback (#4475)
* Implement rescancomplete callback

* Add walletName to payload

* Add to documentation
2022-07-09 16:23:15 -05:00
rorp
414557effb
Add imported flag to the seed JSON (#4459)
* Add `imported` flag to the seed JSON

* scalafmt

* update `walletinfo`

* fix docs

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-07-08 18:55:47 -05:00
Chris Stewart
83cff9a44c
2022 07 07 issue 4455 (#4457)
* Get simple serialization symmetry working for taproot keypath

* Implement generators for TaprootScriptPath, check serialization symmetry

* Make sure bytes are symmetrical too

* Add check in TaprootScriptPath.hasAnnex() to make sure therer is more than one stack element

* Cleanup

* Address ben's review

* Fix pattern match
2022-07-07 12:04:16 -05:00
Chris Stewart
2b60bbb1c3
Remove .map() and use .foreach() with buffer in CryptoBytesUtil.toByteVector() (#4454) 2022-07-06 18:23:14 -05:00
Chris Stewart
20bf1e6a08
Remove map on tor to allow access to getdlchostaddress endpoint before tor is fully stated (#4435) 2022-06-28 13:53:44 -05:00
Shreyansh
42564bc810
Find and switch peers (#4408)
* add support to find and switch peers

* fix compile on 2.12

* allow empty config peers in regtest

* fix test

* minor fixes

changes timeouts, fix issue with ipv6 dns seeds, initDisconnect when disconnected bug, dbPeers order fix

* fix: not removing peers on initialization timeout

* fix: query again when previous failed

* fix: wrong condition for deferred peers

* restore log levels

* clean up

* add PeerStack to allow trying peers based on priority values

* fix migrations

* changes from comments

* use StartStopAsync

* changes from comments

* fix switch if peer down test

* changes from comments
2022-06-28 10:19:13 -05:00
Chris Stewart
aed92c35af
Implement DISABLE_JLINK env variable to disable jlink jre's usage at runtime (#4426) 2022-06-26 13:20:22 -05:00
rorp
a7aad46934
Seed backup API (#4357)
* Seed backup API

* respond to the PR comments

* exportseed/importseed symmetry

* update docs
2022-06-22 08:14:11 -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
Chris Stewart
3154362f1a
Add platform specific name to bitcoin-s artifacts (#4401)
* Add platform specific name to bitcion-s artificats so they don't overwrite each other on releases

* Fix so artifact name is changed, but startup script name is not changed
2022-06-16 17:08:06 -05:00
rorp
1ad540703c
Improve bitcoind connection retry logic (#4386) 2022-06-14 08:40:04 -05:00
rorp
fdf281b469
DLC <-> contact mapping (#4346)
* DLC <-> contact mapping

* updated docs

* populate dlc/contact mapping automatically

* typo

* respond to the PR comments

* rename `contact` to `peer`

* fix unit tests

* create a contact when an incoming offers gets created

* drop dlc_contact_mapping table

* fix build

* update the docs

* Revert "update the docs"

This reverts commit 2386adadcd.

* revert dlc-contact-* endpoints
t Please enter the commit message for your changes. Lines starting
2022-06-14 08:14:28 -05:00
Chris Stewart
171001273c
Implement a workaround for 4369 on docker images and m1 macs IF the user has another java installed on their machine (#4377) 2022-06-09 15:10:28 -05:00
Shreyansh
d8fc8e588f
Remove Spv code (#4356)
* change node tests to neutrino

* get node test working

* merge DataMessageHandlerTest and DataMessageHandlerNeutrinoNodeTest

* delete unused files

* remove commented out spv parts

* formatting

* delete spv node

* remove merkle callback for neutrino node

* remove spv node wallet callbacks

* formatting

* remove SpvWalletApi

* replace SpvTestConfig with NeutrinoTestConfig

* more replace SpvTestConfig with NeutrinoTestConfig

* minor fix

* fix tests
2022-05-30 07:57:31 -05:00
user411
8a01432db4
Try to debug why shutdown isn't working on windows (#4349)
* Try to debug why shutdown isn't working on windows

* Add 2022-05-18-shutdown-bug branch so it triggers release.yml

* Cleanup OracleServerMain shutdown

* Make cleaner shutdown messages

* Remove feature branch

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-05-24 14:41:12 -05:00
rorp
f680ab8691
Persist whether wallet is rescanning in the database (#4326)
* Persist whether wallet is rescanning in the database

* fix cli

* fix build

* fix unit tests

* fix postgres tests

* remove wallet_state table

* fix rescan bug

* cleanup

* revert Cancellable's

* Cleanup

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-05-23 19:03:02 -05:00
Chris Stewart
107f95cd5a
Upgrade sttp to 3.6.1 (#4341) 2022-05-18 08:35:49 -05:00
Chris Stewart
272f31aeaa
Fix race condition on DLC node startup wrt to tor (#4335) 2022-05-13 09:56:53 -05:00
Chris Stewart
5036b37729
2022 05 11 tor race condition (#4333)
* WIP tor race condition debug

* Fix race condition between starting node and starting tor

* Remove extra log
2022-05-11 16:38:24 -05:00
Chris Stewart
e4d38ba53a
2022 05 05 OS specific jlink builds (#4322)
* Add OS specific zips

* Try to fix windows build

* Try to fix windows build shell

* Try to see if double zip works w/o mac verified developer error

* Add bash script to handle making file executable and make it non quarantine on mac

* Do chmod regardless of os

* Remove chmod as that cannot work by definition, revert to only packaging stage/ directory

* Make java exectuable on every OS

* refactor CommonSettings.jlinkIgnore

* Try to build appServer

* Make cli use jlink

* Make bash scripts more generic on mac

* Remove feature branch on release.yml

* Fix startup scripts
2022-05-07 18:42:02 -05:00
Chris Stewart
d46b4a6c91
Make logging to file async, remove neverBlock configuration so that we are guaranteed to capture logs (#4305) 2022-05-01 06:45:33 -05:00
rorp
0c6c9180ed
Handle duplicate UTXOs (#4296)
* Handle duplicate UTXOs

* Add logging

* Add log for exception in handleDuplicateSpendingInfoDb

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-04-29 08:21:41 -05:00
Chris Stewart
f4d864fab8
2022 04 26 Startup time of appServer (#4294)
* Make Server's route be async

* WIP

* Add StartedBitcoinSAppConfig to indicate when tor starts up

* Add torStarted flag to getinfo response
2022-04-28 13:50:28 -05:00
Nadav Kohen
525fb2ac0d
Default createDLCOffer to current block height (#4285)
* Added createDLCOffer endpoint which doesn't take a locktime and uses current block height instead

* Made cetLocktime an option instead of an argument to the CLI, updated docs

* fix compile

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-04-25 14:30:32 -05:00