Commit Graph

70 Commits

Author SHA1 Message Date
Ben Carman
a022fbaed1 Batch add filters to database (#1725)
* Process filter headers in batch

* Use correct batch

* Cache filter heights

* Convert to option
2020-08-04 07:30:42 -05:00
Ben Carman
db7af37ac5 Start syncing filters on node startup (#1729) 2020-08-03 17:17:47 -05:00
Ben Carman
51d35e24e9 Fix Node Startup Issue (#1683)
* Fix Node Startup Issue

* Small fixes

* Add option to force chain work recalc
2020-07-29 09:37:20 -05:00
Nadav Kohen
faf2e0148a Fix All Loggers! (#1695)
* Fixed logging so that appenders are always started when logging is happening

* Started rolling policy so that file appenders could start in getLoggerImpl
2020-07-28 07:13:38 -05:00
Ben Carman
5c9cbbdfc1 Skip downloadBlocks if given an empty Vector (#1690) 2020-07-21 13:59:07 -05:00
Ben Carman
f7037c00a2 Drop AutoInc col for Broadcastable Transaction Table (#1630) 2020-07-07 09:56:34 -05:00
Ben Carman
365d98da10 Add extra logs, fix best filter bug (#1624)
* Add extra logs, fix best filter bug

* Fix to work for when filter count != header count

* Put blockheader items baack in place
2020-07-06 11:38:53 -05:00
Ben Carman
cd594ab069 AppConfig Start Interface (#1598)
* AppConfig Start Interface

* Use StartStop interface
2020-06-21 09:33:43 -05:00
Ben Carman
157c84a4e0 Have BroadcastTransactionTest rebroadcast on failure (#1561) 2020-06-19 14:41:53 -05:00
Scala Steward
97a4886c6e Update scalafmt-core to 2.6.0 (#1579)
* Update scalafmt-core to 2.6.0

* Upgrade scalafmt, fix all formatting errors

* Scalafmt on 2.12

* fix test

* More fixes

Co-authored-by: Ben Carman <benthecarman@live.com>
2020-06-19 10:38:12 -05:00
Nadav Kohen
e5bd6e53a3 Added compile scope scalafmtCheck to travis runs (#1563) 2020-06-16 15:16:43 -05:00
Chris Stewart
dec503f561 2020 06 12 mv to appconfig (#1553)
* Move hasWallet() to WalletAppConfig

* Move helper methods to create data dstructures in a project to their respective AppConfig file
2020-06-16 12:49:32 -05:00
Ben Carman
1731bd3163 Callback rework (#1542) 2020-06-15 17:30:08 -05:00
Chris Stewart
32c06cbe81 2020 06 05 mv chainwork calc (#1519)
* Fix Chaindb chainwork Migration

* Move chain work calculation out of node, use the ChainApi returnd by runChainWorkCalc()

Co-authored-by: Ben Carman <benthecarman@live.com>
2020-06-05 11:04:09 -05:00
Chris Stewart
aaa750b23a Add more descriptive log message in P2PClient when we get disconnectd (#1514) 2020-06-04 16:25:04 -05:00
Ben Carman
61d9f0efba Implement best block hash correctly (#1452)
* Implement best block hash correctly

* Handle no common history

* Fix getBlockProof to be BigInt instead of UInt32

* Fix warnings

* Make get best filter use chainwork

* Remove unused function, test isMissingChainWork

* Fix comparisons for chain work in sql

* Fix migrations from rebase

* Fix CI error

* Fix postgresql
2020-06-04 12:05:10 -05:00
rorp
823a392e98 PostgreSQL support (#1315) 2020-06-02 16:37:48 -05:00
Chris Stewart
d8170f319a Implement AppConfigFactory (#1462)
* Implement AppConfigFactory

* Fix docs
2020-05-25 14:43:37 -05:00
Ben Carman
99db9062ac Add option to correctly use logback config (#1398)
* Logger now uses correct parent logger for all, names appenders correctly

* Set logback to true for tests, rename file

* Fix docs
2020-05-20 15:46:24 -05:00
Nadav Kohen
a503441619 Crypto Project Refactor (#1380)
* Added crypto project and decoupled BitcoinSLogger from NetworkElement

Decoupled BitcoinSLogger from Factory

Moved NetworkElement into crypto project

Moved Factory and BitcoinSUtil (renamed to BytesUtil) to crypto project

Moved MaskedToString to crypto project

Added BytesUtil to imports and cleaned up CryptoUtil.recoverPoint

Moved the rest of crypto stuff to the crypto project

Moved crypto tests to crypto-test project

* Added documentation for crypto project
2020-04-30 12:34:53 -05:00
Ben Carman
fddca91e79 Neutrino Logging (#1382) 2020-04-30 09:05:26 -05:00
Ben Carman
6d7685b76e Add wallet creation time for rescans (#1353)
* Add wallet creation time for rescans

* Fix docs

* Clean up and add test

* Remove account bday

* Fix compile issue and docs

* Add more chain handler tests

* Use Instant over Long, add docs

* Fix docs
2020-04-29 09:49:41 -05:00
Ben Carman
b8331d4cf1 Re-enable NeutrinoNodeWithWalletTest for Linux (#1366)
* Re-enable NeutrinoNodeWithWalletTest with it disabled for mac

* Change to only Linux

* Only disable for CI runs

* Move IsCI to BitcoinSUtil

* Fix compile issue for earlier versions

* Fix syncing compact filters to not skip last filter

* Fix test to be compatible with new start state

* Use correct isCI

* Fix compile issue

* set CI env
2020-04-27 18:20:47 -05:00
Ben Carman
37c62369eb Batch processing compact filters (#1363)
* Batch processing compact filters

* Use one vector, rename param

* Fix compile issue on older versions

* Process sequentially
2020-04-26 09:34:41 -05:00
Chris Stewart
4c3f6f8e67 2020 04 08 multi db dao (#1355)
* Implement Slick's multi database support via our DAOs

WIP2 work on chain project

WIP make JdbcProfieComponent so we have a common JdbcProfile

WIP2

Clean up a few things

WIP got CRUDAutoInc compiling

Get closer to everything compiling in the chain project

Begin moving database code into JdbcProfileComponent

WIP source compiling

Get dbCommonsTest/ test cases passing

Get rest of tests compiling and passing

* Rebase onto master, fix conflicts

* Run scalafmt

* Run scalafmt again

* Cleanup a few compiler warnings by adding type annotations to thigns

* Explicitly cast tables where they are needed in the wallet project where we need TableQuery for foreignkey / joins in slick

* Redo definition of 'table' to use the profile.api.TableQuery in scope

* Rename all *Table.scala files to *Db.scala

* First crack at address ben's code review

* Fix docs compile issue

* Fixed casting (#30)

* Fixed AppConfig casting

* Fixed TableQuery casting in DbManagement subtypes

* Fixed casts in DAOs relating to internal types

* Address nadav's code review, move JdbcProfileComponent into it's own file

* Remove unused listTables() method

Co-authored-by: Nadav Kohen <nadavk25@gmail.com>
2020-04-25 11:28:58 -05:00
Ben Carman
39088475e3 Add sendrawtransaction CLI and Api commands 2020-04-21 13:14:02 -05:00
Chris Stewart
af4b6648b9 Use FutureUtil.foldLeftAsync() to process messages we parsed on the p2p network. This moves the blocking with Await.result() from inside of each message we process, to after the entire batch of messages is processed (#1326) 2020-04-20 15:34:14 -05:00
Ben Carman
b3250dcfba Update TxoState for transactions after they've been confirmed (#1178)
* Add onBlockHeadersReceived NodeCallback

* Add requiredConfirmations config option

* Update TxoState for transactions after they've been confirmed

* Response to review

* Fix compile issue
2020-04-08 16:51:17 -05:00
Ben Carman
7326fd5035 Change NodeCallbacks to Future[Unit] s (#1206)
* Change NodeCallbacks to Future[Unit] s

* Fix compile issue

* Change try to future

* Change Future.sucessful(()) to FutureUtil.unit

* Callback failure handling, callback docs

* Create functions for executing callbacks, make merkleblock a future

* Convert MerkleBuffersTest to BitcoinSAsyncTest

* Fix compiler errors

* Reorder UpdateBloomFilter tests so that txFromWalletP is a success for both calls and the other test does not wait on the promise to complete
2020-04-03 08:57:41 -05:00
Chris Stewart
de46e74f1a Actually add all files for 0.3.0 on the website so they show up (#1256) 2020-03-19 07:32:02 -05:00
Nadav Kohen
7169455eff Got rid of warning messages! (#1133)
* Got rid of warning messages!

* Reverted collection conversion changes because scala 2.11 is dumb
2020-02-19 08:02:33 -06:00
Nadav Kohen
099465f72a Multiple Logger Fix (#1086)
* An attempt to fix logging to file using MDC

* Responded to review
2020-02-11 11:35:28 -06:00
rorp
ad83fc9c56 Fix sync issues (#1090) 2020-02-04 10:16:16 -06:00
Ben Carman
ed428bd56c Txo state flyway (#1052)
* Add flyway migrations

* Make different project's migrations independent of each other

* Rework all AppConfig.initialize() to use migrations rather than what we were doing before

* TXO State migration

* Move to new file, drop old column

* Add block hash column

Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
2020-01-22 15:34:36 -06:00
rorp
93c02f02d0 Automated wallet recovery (#985)
* Automated wallet recovery

* responded to the PR comments

* some more changes

* fix docs

* cleanup
2020-01-02 13:18:41 -06:00
rorp
72ead16e5c Move rescan logic from node to wallet (#974)
* Move rescan logic from node to wallet
2019-12-23 08:57:55 -08:00
rorp
2c53a39fd1 Compute confirmations dynamically (#938)
* Compute confirmations dynamically
2019-12-14 12:06:22 -08:00
rorp
af70acb03b ChainQueryApi (#926)
* ChainQueryApi

* cleanup
2019-12-09 09:39:35 -06:00
rorp
cbd038b514 Neutrino Wallet: OnCompactFilter handler (#905)
* Neutrino Wallet: OnCompactFilter handler
2019-12-06 13:10:33 -08:00
Nadav Kohen
1578e2642f Nicer Satoshis.apply (#899)
* Replaced Satoshis(Int64(_)) with Satoshis(_)

* Fixed SignerTest
2019-11-26 14:43:14 -06:00
rorp
14d3878d01 Rescan RPC (#854)
* Rescan RPC

* cleanup

* fix optional args

* cleanup

* unit tests

* fix build error

* fix unit tests

* scalaMock

* cleanup

* more unit tests

* some more validation checks
2019-11-21 08:03:32 -06:00
rorp
9062e1b0cc Rescan and fetch blocks (#835)
* Rescan and fetch blocks

* unit test

* fix log level

* addessed the PR comments

* fix test timeout

* improve unit tests
2019-10-30 09:51:03 -05:00
Chris Stewart
780ac75bf0 Run scalafmt, i forgot to run on #783 (#788) 2019-10-07 08:16:28 -05:00
Chris Stewart
00eafd9970 Use the fact that network headers specify the number of bytes in the … (#783)
* Use the fact that network headers specify the number of bytes in the payload rather than just parsing from bytes.size, this should allow us to be more precise when parsing NetworkPayloads rather than _hoping_ that bytes.size does not land on pseudo-valid NetworkPayload. This hopefully resolves #782

* Add safety check around HeadersMessage.toString()

* Add invariant to NetworkMessage saying payloadSize in header must be the actual payload size
2019-10-06 09:48:53 -05:00
rorp
d390de323c Optimize org.bitcoins.chain.blockchain.BaseBlockChain (#781)
* Optimize org.bitcoins.chain.blockchain.BaseBlockChain

* remove toStream calls

* cleanup

* fix IndexOutOfBoundsException
2019-10-06 09:47:02 -05:00
Chris Stewart
56107ac13e Add a log at INFO level to indicate we are making progress while syncing (#780)
* Add a log at INFO level to indicate we are making progress while syncing

* Adjust sync log message to INFO in p2p code

* Fix off by one error

* Run scalafmt
2019-10-03 14:57:02 -05:00
rorp
dac3b0091c Remove bitcoind dependency from node (#770)
* Remove bitcoind dependency from node

* addded some comments
2019-10-01 14:11:47 -05:00
Chris Stewart
9b1caa6561 Remove isInitialized() check in sendMsg, which was causing a deadlock (#763)
* Remove isInitialized() check in sendMsg, which was causing a deadlock

* Enable akka logging to help debug NeutrinoNodeTest

* Revert to bypassing the isInitialized() check in sendMsg()

* Run scalafmt again
2019-10-01 06:25:03 -05:00
Chris Stewart
97472930d0 2019 09 27 logging refactor pt2 (#765)
* Remove AKKA_CONFIG that was preventing sane logging for akka, move db-commons reference.conf to testkit so we can control testkit applications, and then rename app/server/.../application.conf to reference.conf like good libraries should do

* Update contributing.md

* update a few more links inside of contributing.md

* Run scalafmt
2019-09-28 09:50:42 -05:00
Chris Stewart
f65f11aead Add akka logging documentation to our contributing.md (#764) 2019-09-27 10:56:16 -05:00