Commit Graph

403 Commits

Author SHA1 Message Date
Chris Stewart
41fab3dfd2
2024 08 07 createnewaccount rpc (#5638)
* Implement creatnewaccount rpc

* Get WalletRoutesSpec createnewaccount unit test passing

* Rename HDPurposes -> HDPurpose

* Fix docs

* Implement ConsoleCli arg, change HDPurpose json serialization to be a json string instead of a num
2024-08-13 10:32:03 -05:00
Chris Stewart
38850d22e3
2024 07 31 bitcoind callbacks (#5631)
* Add NodeApiCallbacks

* Add BitcoindCallbacks

* Add BitcoindRpcAppConfig

* fix docs

* Add helper method for construction

* Add helper constructor method to avoid explicitly passing BitcoindRpcAppConfig parameter to BitcoindRpcClient when we have a BitcoindInstanceLocal

* Fix docs
2024-08-02 07:43:24 -07:00
Chris Stewart
4b17645c1b
Add -Xsource:3 to docs/ (#5581) 2024-05-10 12:37:02 -05:00
Chris Stewart
d23d7851b8
rework bitcoind-rpc to take a walletName parameter that is a String (#5545)
* rework bitcoind-rpc to take a wallet name parameter that is a String rather than Option[String]

* Fix docs
2024-04-26 08:09:28 -05:00
Chris Stewart
a6d93622f8
2024 04 16 descriptor fidelity (#5529)
* Implement unit tests for key expression fidelity to user input for hardened paths

* Create HardenedType, rework BIP32Node to take Option[HardenedType] as a parameter

* Fix docs
2024-04-17 18:35:33 -05:00
Chris Stewart
302110cb56
Bump max connected peers default to 2 (#5515) 2024-04-08 09:14:28 -05:00
Chris Stewart
9fef2c505c
Add bitcoin-s.node.connection-attempt-cool-down-period (#5489)
* Add bitcoin-s.node.connection-attempt-cool-down-period

Add bitcoin-s.node.connection-attempt-cool-down-period

* Re-add shuffling
2024-03-22 13:16:45 -05:00
Chris Stewart
af342dd6c1
2024 03 18 rm unused configs (#5480)
* Remove bitcoin-s.node.connection-timout setting as it wasn't used

* Remove bitcoin-s.node.peer-discovery-timeout
2024-03-18 15:26:31 -05:00
Chris Stewart
55e4dab86e
Rework NodeApi.downloadBlocks() to use DoubleSha256DigestBE (#5456)
* Rework NodeApi.downloadBlocks() to use DoubleSha256DigestBE rather than DoubleSha256Digest

* Fix test cases

* Fix docs

* Fix compile
2024-03-05 15:19:32 -06:00
Chris Stewart
8a0c00637c
Remove duplicate PeerConnection.disconnect() call (#5426)
* Remove duplicate disconnect() call

* Remove log for case where we haven't set PeerConnection.connectionGraphOpt but call PeerConnection.stop()

* Remove bitcoin-s.node.initialization-timeout
2024-02-27 08:03:37 -06:00
Chris Stewart
783ed1903d
Rename bitcoin-s.node.inactivity-timeout -> bitcoin-s.node.health-check-interval (#5418) 2024-02-23 08:31:22 -06:00
Chris Stewart
1dff918848
2023 02 21 pekko (#5413)
* Get dependencies resolving, get tor module compiling

* Get everything compiling with pekko

* Rework configs/logging to use pekko namespace

* Rename AkkaUtil -> PekkoUtil, BitcoinSAkkaAsyncTest -> BitcoinSPekkoAsyncTest
2024-02-22 10:26:21 -06:00
Chris Stewart
3177ee405f
Move away from suredbits provided peers by default (#5390)
* Move away from suredbits provided peers by default

* Remove setting bitcoin-s.node.use-default-peers

* Don't allow peer to stay connected if it doesn't support compact filters

* Move disconnection logic into managePeerAfterInitialization()

* Remove reconnect() when we have no other peers, send getaddr message after we know we are keeping the peer connection

* Remove hasCf flag check, revert log

* Reduce inactivity-timeout to 5 minutes by default, shuffle peers in PeerFinder beforing pushing onto stack

* Add logic to disconnect AttemptToConnect peers after addr mesage is received

* Create PeerFinder.queryForPeerConnections(), call it directly from PeerManager on health checks rather than restarting PeerFinder

* scalafmt

* Move more logic into managePeerAfterInitalization()

* Don't set isPersistent for db peers by default

* Add call to queryForPeerConnections() inside of PeerManager.onDisconnect() to try to attempt to more peers when we have no more connections, fix MisBehavingPeer logic to not start sync, starting sync should happen in onDisconnect()

* Revert logback-test.xml

* Sort peers we are attempting to connect to by lastSeen parameter

* Refactor DoneSyncing.toHeaderSync() to return Option[HeaderSync] to represent the case where we don't have a peer to sync with

* scalafmt

* Remove duplicate PeerFinder.buildPeerData()
2024-02-20 12:12:57 -06:00
Chris Stewart
76e468c5c4
2024 01 28 Refactor PeerFinder.start() to avoid initializing connections (#5376)
* Conslidate PeerFinder.start() logic into peerConnectionScheduler, add bitcoins-s.node.try-peers-start-delay config settig to indicate how long until we start attempting to connect to peers in PeerFinder

* Cleanup

* Revert logback-test.xml

* Add documentation

* Empty commit to run CI

* Rework NodeAppConfig.peers to return Vector[Peer] rather than Vector[String]

* Add higher priority to paramPeers
2024-01-29 09:46:31 -06:00
benthecarman
f01987160d
Lnd v0.17.3 (#5375) 2024-01-27 11:28:25 -06:00
Chris Stewart
c0e8d376eb
Remove oracle explorer client (#5308)
* Remove oracle explorer client

* Remove doc, remove ci flow
2023-11-22 10:27:29 -06:00
Chris Stewart
b252c2d6a2
2023 10 16 Implement WalletCallbackStreamManager, DLCWalletCallbackStreamManager (#5263)
* WIP: Implement WalletCallbackStreamManager

* Implement stopping of WalletCallbackStreamManager in WalletAppConfig

* WIP: DLCWalletCallbackStreamManager

* Refactor DLCWalletCallbacks to be a trait

* Integrate DLCWalletCallbackStreamManager into WebsocketUtil

* Use  java.util.concurrent.atomic.AtomicBoolean rather than monix

* Remove logger param from dlc callbacks

* fix docs

* Call super.stop() in DLCappConfig

* Empty commit to run CI

* Try to debug

* Empty commit to run CI

* Revert things
2023-10-19 11:52:07 -05:00
Chris Stewart
008dd42a08
Upgrade lnd to 0.16.4 (#5194)
* Upgrade lnd to 0.16.4

* fix the rest of the hashes

* Fix version

* Fix queryroutes cltv delta param from 40 -> 80

* update doc versions
2023-08-14 14:38:23 -05:00
Chris Stewart
e66c078863
First attempt at implementing inactivityChecks() (#5144)
* First attempt at implementing inactivityChecks()

* Move lastParsedMessage logic into PeerMessageSender

* Add bitcoin-s.node.inactivity-timeout config option

* implement unit test

* Fix CommonSettings

* scalafmt

* scalafmt

* Rename lastSuccessfulParsedMsg -> lastSuccessfulParsedMsgOpt

* make sure we disconnect in the case the stream terminates with an error

* Reduce log level
2023-07-16 16:03:16 -05:00
Chris Stewart
bed670fb6f
Remove chainApi parameter from NeutrinoNode (#5101)
* Remove chainApi parameter from NeutrinoNode

* Fix doc
2023-06-13 12:07:04 -05:00
Chris Stewart
447c6d03de
Implement getconnectioncount rpc (#5048)
* Implement getconnectioncount rpc

* Reduce waits in test, add documentation

* Fix docs

* Empty commit to re-run CI
2023-04-19 16:47:54 -05:00
Chris Stewart
af349d2179
Remove support for v19 of bitcoind (#4991)
* Remove support for v19 of bitcoind

* Remove downloading v19 bitcoind inside of bitcoind-rpc.sbt

* Clean up docs

* Move unit tests in BitcoindV19RpcClientTest into other test files so we don't remove them, these rpcs are supported in future versions of bitcoind
2023-02-16 10:27:56 -06:00
Chris Stewart
ec596ec51b
Enable peer discovery by default (#4862) 2022-10-26 07:36:54 -05:00
Chris Stewart
f483e356cb
Adjust period of time we query for peers on the p2p network from 12 seconds -> 1 hour (#4847) 2022-10-17 14:42:14 -05:00
Chris Stewart
1a220a3937
2022 10 14 v19 testkit refactor (#4843)
* Break versioning on V19 of bitcoind rpc client in chain handler, use BitcoindRpcClient with V19BlockFilterRpc

* Make NodeTestWithCachedBitcoindNoP2pBlockFilters for test case with unsupported peers

* Fix docs

* Empty commit

* Empty commit

* Turn logging off again
2022-10-15 13:50:44 -05:00
Chris Stewart
9c506b639f
Add OrderedSchnorrSignatures, use it in OracleAttestment (#4803)
* Add OrderedSchnorrSignatures, use it in OracleAttestment, propagate it threw the codebase

* Small cleanups

* Add SortedVecFactory

* Fix test case with out of order nonces
2022-09-26 19:35:04 -05:00
Chris Stewart
fae1a53579
Bump bitcoin-s.node.query-wait-time=120 seconds (#4759)
* Bump query-wait-time to 120 seconds

* bump disconnection log level

* Bump log to INFO where peer disconnects us
2022-09-10 09:47:50 -05:00
Chris Stewart
26595ab3ac
Fix bug where no exception was thrown if the acceptor did not have enough money (#4728)
* Fix bug where no exception was thrown if the acceptor did not have enough money

* Revert ContractInfo.max definition, fix bug in acceptDLCOffer

* Fix incorrect usages of ContractInfo.max

* Refactor ContractInfo.max -> ContractInfo.maxOfferorPayout

* Fix dlc.md
2022-09-07 19:08:27 -05:00
rorp
7322186b56
Fix Tor hidden service config (#4689)
* Fix Tor hidden service config

* default the target list to an empty list

* Scala 2.12 compatibility

* update docs

* Fix typo

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-09-01 16:54:39 -05:00
Chris Stewart
15b6e429b2
Update README to use grey's new build-wallet-electron.sh script (#4686)
* Update README to use grey's new build-wallet-electron.sh script

* Cleanup website
2022-08-30 17:12:14 -05:00
Shreyansh
2c2e03b279
Header sync validation (#4456)
* add header sync validation

* fix docs, minor fixes

* Refactor to us InvalidBlockHeader ChainException, also refactor recovery to private helper method

* changes from comments

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-08-22 17:05:41 -05:00
Chris Stewart
86463231d6
2022 08 18 Add configuration to only emit websocket events when IBD is done (#4627)
* Implement isinitialblockdownload flag in databaes

* Change to IsInitialBlockDownload to be less confusing

* Fix missing refactors, add ChainApi.isIBD()

* Implement logic for ChainApi.isIBD(), add configuration flag to toggle whether to emit websocket events while IBD is ongoing or not, add isinitialblockdownload field to getinfo endpoint

* Remove confusing ChainApi.isIBD() that didn't accurately account for the case where IBD wasn't set in the database

* Fix bug around emitting the websocket events

* Add some documentation
2022-08-22 10:09:00 -05:00
Chris Stewart
1b19872ac4
Implement exportstakingaddresswif (#4617)
* Implement exportstakingaddresswif

* Add documentation

* Add unit test
2022-08-16 12:37:58 -05:00
rorp
7b754138b8
Drop support for the experimental bitcoind version (#4586)
* Drop support for the experimental bitcoind version

* update docs
2022-08-08 14:48:33 -05:00
rorp
9f89ba9b7a
loadwallet endpoint (#4417)
* `loadwallet` endpoint

* Scala 2.12 compatibility

* remove `getwalletname`

* fix unit tests

* fix DbManagementTest

* fix wallet tests

* fix DbManagementTest

* fix RejectedExecutionException

* fix postgres tests

* fix password override

* update `loadwallet`

* Move WalletHolder into wallet module

* Kill use of null in WalletHolder

* Kill use of null in WalletHolder

* Refactor to use WalletAppConfig.DEFAULT_WALLET_NAME

* update cli and unit tests

* cleanup

* Refactors to get compatible with master

* Fix compile

* Distinguish between loadWalletNeutrino & loadWalletBitcoind

* Fix initialized bug with WalletHolder in loadWallet methods

* Refactor loadWalletBitcoindBackend/loadNeutrinoWallet to have a common helper method

* Introduce DLCWalletLoaderApi, refactor codebase to use it

* Fix dumb initialization bug

* Fix test:compile

* Cleanup

* Get loadwallet mostly working with neutrino wallet

* Fix compile

* scalafmt

* Move loadwallet into app-commons

* Remove {DLCWallet,Wallet}.stop()

* Implement LoadWallet json parsing unit test

* Implement stopping of NodeStreamManager callbacks

* Fix rebase, integrate setRescanState into WalletRoutes

* Fix import

* Fix unit tests

* Implement listwallets in ConsoleCli

* Fix imports

* Cleanup

* scalafmt

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2022-08-05 17:34:14 -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
b69e487d04
Move MockChainQueryApi/MockNodeApi out of BaseWalletTest (#4542)
* Move MockChainQueryApi/NodeApi out of BaseWalletTest

* fix docs

* Move wallet configurations out of BaseWalletTest

* Move helper methods out of BitcoinSFixture trait into companion object to simplify the hierarchy

* Refactor usage of WalletWithBitcoind to allow parameterization of the BitcoindRpcClient type
2022-07-27 10:18:22 -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
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
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
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
Nadav Kohen
ae0962d7ed
Musig2 Implementation (#4418)
* An initial (not yet working) implementation with test

* Added custom (non-bip-340) verification for now

* Made KeySet a case class

* Got MuSig2 working with BIP340 verification passing

* Responds to Ben's review

* Fixed hash tags and added parital signature verification

* Added point multiplication that allows infinity and did some refactoring

* Refactored type defs into case classes

* Added tests for more signers and fixed single-party bug

* Added key aggregation test vectors from BIP

* Added nonce generation test vectors from BIP

* Added nonce aggregation test vectors from BIP

* Made nonce aggregation test vectors pass by having MultiNoncePub wrap SecpPoints

* Added remaining static test vectors from BIP

* Implements tweaking support and adds tests, including all of the remaining BIP tests

* Added factory objects for nonce types

* Refactored things into multiple files with renaming and restructuring

* Some minor renaming

* Introduced ParityMultiplier ADT to remove unneccesary computations

* Added scaladocs

* Added messages to invariants

* Fixed a typo

* Nonce generation now takes a SchnorrPublicKey instead of raw bytes

* Made point multiplication more robust

* Responded to Ben nits

* Added musig.md
2022-07-06 12:59:13 -05:00
fiatjaf
a5080ad7cd
fix a space typo. (#4447) 2022-07-04 15:47:57 -05:00
GreyMcCarthy
135b9f8a35
Update documentation for UI to use build script Advanced Setup (#4430)
* Updated the instructions for installing the Suredbits wallet app

* Changed npm make to npm run make in instructions

* removed npm run make from the instructions as it is already run in the bash file
2022-06-29 16:28:33 -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
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
Shreyansh
4dc1bc7050
add bitcoind v23 rpc (#4368) 2022-06-21 13:20:47 -05:00
Chris Stewart
0f3c28e23e
Fix UI build instructions (#4405)
* Fix UI build instructions

* Fix 1.9.2 version of docs too
2022-06-19 07:58:40 -05:00