Commit Graph

443 Commits

Author SHA1 Message Date
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
rorp
41b96c4c7e
Add rescan field to walletinfo response (#3933) 2021-12-23 14:30:26 -08:00
rorp
4b07629d56
Add getmediantimepast RPC call (#3921)
* Add `getmediantimepast` RPC call

* update docs

* respond to the PR comments
2021-12-22 16:15:30 -06:00
Chris Stewart
4646ef6e19
Remove BitcoinSServerMain.startedFP (#3928) 2021-12-20 14:29:03 -06:00
Chris Stewart
3cd57d37f5
Remove backupwallet / backup oracle (#3920)
* Remove backupwallet / backup oracle

* Add zipdatadir documentation

* Fix submodule
2021-12-20 08:19:46 -06:00
rorp
f8f5a8e8dc
Update docker-application.conf (#3905) 2021-12-14 17:34:23 -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
rorp
41585a18ca
Make Bitcoin Core RPC backend to retry on Error -28: Verifying blocks (#3896) 2021-12-12 15:46:22 -06:00
Chris Stewart
a38309bed1
Add range of block heights to the error message (#3886) 2021-12-09 09:01:01 -06:00
Chris Stewart
0d37c4b54f
2021 12 08 block parsing bug caused by 65 byte taproot signatures (#3887)
* Add block  0000000000000000000593310d3b0cdc082af49f38b8a1611239072aef8433a8 test vector

* Add test cases

* wip

* Fix bug where we were classifying taproot txs as P2WPKHWitnessV0

* revert logging level

* Some cleanup

* Add logback.xml for scripts, remove scheduler in scan bitcoind

* Fix imports

* Take ben's suggestion and add check to CryptoUtil.isValidPubKey
2021-12-09 06:38:25 -06:00
Chris Stewart
d393848cc2
2021 11 30 issue 3847 (#3862)
* Start pulling over accept serializers from dlc message spec PR

* Get sign tlv json serialization working

* Implement decodeaccept,decodesign in CoreRoutes

* Move messages to DLCTestUtil, add documentation
2021-12-01 13:30:18 -06:00
Chris Stewart
8765c2f845
Disjoint union dlc (#3839)
* Implemented Disjoint Union DLC related data structures with dlcTest passing

Broke DLCClientTest up into multiple test files

Optimized DLC execution unit tests by checking all outcomes on a single setup DLC

Refactored DLCTest to allow for Disjoint Union DLC construction and validation, added tests

Responded to review

Fixed after cherry-pick

Fixed docs

* Fixed things after rebase

* Rebase

* Fix json serializer

* Finish fixing compile

* Start trying to make APIs better for multi oracle contract infos

* Clean things up in the GUI, try to make failures on disjoint union contracts as explicit as possible

* Use less numDigits as optimization for non secp CI test cases

* Fix compile

* Refactor BroadcastDLCDialog

* Fix test case optimization

* Clean up comment

Co-authored-by: nkohen <nadavk25@gmail.com>
2021-11-29 19:26:00 -06:00
rorp
41cb26a3bb
Make DLC node's external IP configurable (#3838)
* Make DLC node's external IP configurable

* docs

* some more changes
2021-11-19 14:51:23 -06:00
Chris Stewart
1d7529236f
2021 11 13 scan bitcoind witspkv1 mempool (#3825)
* Add script to count witness spk v1 txs

* more fixes and information

* Clean up
2021-11-16 13:06:51 -06:00
user411
856e455be3
Remove 'not set' rate of return % sign on wallet (#3828) 2021-11-16 13:06:36 -06:00
Chris Stewart
5189b6ad5c
revert logging directives on request/response back to DEBUG (#3819) 2021-11-12 10:39:14 -06:00
Chris Stewart
a40ef1ab21
Break existing api to get new address to remove the requirement for null label (#3818) 2021-11-12 09:58:50 -06:00
rorp
21fab4ee70
Improve app server validation error handling (#3796) 2021-11-05 10:03:16 -05:00
Chris Stewart
aa748c012f
2021 11 03 protocol version (#3793)
* ProtocolVersion WIP

* Start incorporating protocol version into DLC Offer

* Fix doc
2021-11-03 15:13:19 -05:00
rorp
e02c9bba12
Overridable Tor config (#3780) 2021-10-27 12:57:10 -05:00
rorp
403c78fd8f
Server Docker config (#3775) 2021-10-25 06:35:02 -05:00
Chris Stewart
7a3497ab9c
2021 10 15 createcontractinfo numeric (#3758)
* Implement payout function reader and tlv points reader/writer

* Add support for numeric contract infos in the createcontractinfo rpc

* Adjust logging level

* Remove unused endpoint

* Add new format to site
2021-10-15 19:56:00 -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
80d498d288
Fix bug where getbalances was always retruning sats (#3750) 2021-10-13 14:51:13 -05:00
Chris Stewart
94e219befd
Update getbalance rpcs to return a number rather than a string (#3746)
* Update getbalance rpcs to return a number rather than a string

* Make sure serialized number returned is a javascript number, not string
2021-10-12 15:43:54 -05:00
Chris Stewart
d912665067
Remove cors handler for all requests (#3736) 2021-10-07 14:55:24 -05:00
Chris Stewart
1b88d26095
Bump logging level back to INFO on http servers (#3734) 2021-10-07 13:49:04 -05:00
Chris Stewart
6cbbd8825d
2021 10 02 create contract info (#3713)
* WIP createcontractinfo

* Fix ordering issue

* Use existing contract descriptor serializer, begin fixing test case

* Get DLCRoutesSpec createcontrafctinfo passing again

* Finish implementing createcontractinfo

* Add doc

* Fix native image build by adding hard coded static private key for OracleAnnouncementV0TLV.dummy
2021-10-05 06:24:25 -05:00
Chris Stewart
ea375f9c55
Actually validate master xpub on startup (#3719)
* Fix bug where we didn't validate the master xpub on oracle server startup

* Add test for WalletAppConfig and seeds

* Remove comments

* Fix scalafmt
2021-10-04 10:37:37 -05:00
Chris Stewart
466de3e46a
Update ConsoleCli endpoints, update docs (#3705)
* Update ConsoleCli endpoints, update docs

* Rename methods in DLCOracleApi from signAnnouncement -> createAttestation

* Fix dates on deprecation

* WIP, createattestation rpc not working for some reason

* Fix misspelling

* Rename endpoint from createattestation -> signenum

* Fix docs

* Fix use of deprecated method after rebase
2021-10-02 08:01:46 -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
Chris Stewart
26d7f99173
2021 09 30 rename endpoints (#3703)
* Deprecate things with the Event suffix in DLCOracleApi

* Rename classes used in OracleRoutes

* Rename endpoints

* Update docs

* listevents -> listannouncements
2021-09-30 14:22:17 -05:00
Chris Stewart
781e77844f
Implement ability to get proper version of BitcoindRpcClient from BitcoindRpcApConfig.clientF (#3699) 2021-09-29 06:43:15 -05:00
Chris Stewart
4e56fb7901
Make it so bitcoind backend exceptions don't get swallowed (#3697)
* Make it so bitcoind backend exceptions don't get swallowed when doing IBD against bitcoind

* Move zmq polling into syncWalletWithBitcoindAndStartPolling() method
2021-09-28 17:55:47 -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
4a44f9cd58
Run appServerTest on both windows and mac (#3609)
* Run appServerTest on both windows and mac

* Add just mac test name

* Add downloadBitcoind task to windows matrix

* Make exception easier to be hit

* Remove deleting of directory as that shouldn't be needed

* Add support for not running bitcoind in test suites as a daemon on windows

* Fix bug where i forgot to re-add daemon config
2021-09-27 10:25:48 -05:00
Chris Stewart
2191eb2049
Add 'getversion' endpoint to fetch the version from the backend (#3689)
* Add 'getversion' endpoint to fetch the version from the backend

* Use EnvUtil.getversion
2021-09-27 07:42:21 -05:00
Chris Stewart
4a5265801c
Allow for enternal entropy to be passed into a docker container for the appServer and oracleServer (#3679) 2021-09-20 13:27:20 -07:00
Chris Stewart
132479d271
Implement ability to provide external entropy to bitcoin-s (#3672)
* Encapsulate initialization of DLCOracle.start() method

* Use internal WalletAppConfig.kmConf rather than passing in custom key manager parameters

* Add KeyManagerAppConfig.defaultAccountType

* Get all tests passing besides TrezorAddressTest

* Get TrezorAddressTest passing with provided entropy

* Add unit test to make sure we can always derive the seed

* Get docs compiling

* Fix dlcWalletTest test cases

* Add more test cases to keymanager

* Add the new configuration to the example configuration

* Add more test cases

* Remove coverage on 2.12 as it isn't accurate

* Rework DLCOracleAppConfig.start() to call kmConf.start() so the oracle can use entropy provided via bitcoin-s.conf
2021-09-18 09:49:11 -05:00
user411
27d4c09d37
Add sha256 announcement/event ids on oracleServer 'getevent' for use in UI (#3673) 2021-09-17 12:32:01 -05:00
Chris Stewart
cd9db4f4a9
Adjust the permissions of the statup script for the oracle server on docker so that any user can run the script (#3654) 2021-09-09 16:13:24 -05:00
Chris Stewart
0fb2cd0149
Remove implicit conversions from BitcoinSAppConfig -> {WalletAppConfig,ChainAppConfig,NodeAppConfig} etc (#3652) 2021-09-08 13:54:18 -05:00
Shruthii RG
d53f164478
BitcoindRpcClient Improvements (#3600)
* Changes in bitcoind-rpc module

* Get things compiling

* Implement BitcoindInstanceRemote & BitcoindInstanceLocal

* Fix doc compile

* bitcoind remote instance test

* rename BitcoindInstanceRemote

* Scalafmt

* Applied requested changes(except one)

* implemented fromConfigFile and fromDataDir for BitcoindInstanceRemote

* implemented fromNetworkVersion

* BitcoindInstanceRemote changes

* Get things compiling

* Add implict type parameter to InstanceFactory

* Fix recursive reference of version <-> getNetworkInfo

* bug fix

* bug fix 2

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2021-09-07 08:49:01 -05:00
benthecarman
515e85b1c5
Decode DLC messages cli commands (#3636)
* Decode DLC messages cli commands

* Move decoding to picklers, add contractInfo decoder

* Add decoding examples
2021-09-03 09:46:09 -05:00
benthecarman
40f89af597
Give help messages for DLC cli commands and document them (#3642) 2021-09-02 08:18:17 -05:00
benthecarman
ba21c24d6f
Give funding txid in DLC Signed state (#3640)
* Give funding txid in DLC Signed state

* Improve test
2021-09-02 08:17:20 -05:00
benthecarman
656e9b1b5d
Sort DLC table by last updated (#3607)
* Sort DLC table by last updated

* Add LastUpdatedDb

* Make visible

* Fix compile

* Add time, fix sorting

* Switch to local time

* fix compile

* Fix test

* Fix postgres migration

* Specify zoneId
2021-08-31 14:27:36 -05:00
user411
11dd28085a
Add debug window button to unreserve all utxos (#3633) 2021-08-30 12:31:38 -05:00
Chris Stewart
f5ed232946
Bump fee by more to make sure our fee rate is increasing the test case (#3625) 2021-08-29 18:08:07 -05:00