bitcoin-s/build.sbt

860 lines
23 KiB
Plaintext
Raw Normal View History

import com.github.sbt.git.SbtGit.GitKeys._
import sbt.Keys.{publish, publishLocal}
2019-01-18 13:34:27 +01:00
import scala.util.Properties
Global / cancelable := true
lazy val Benchmark = config("bench") extend Test
lazy val benchSettings: Seq[Def.SettingsDefinition] = {
//for scalameter
//https://scalameter.github.io/home/download/
//you can add benchmarking to a project by adding these to lines
//to the projects build definition
// .settings(benchSettings: _*)
// .configs(Benchmark)
List(
Test / unmanagedSourceDirectories += baseDirectory.value / "src" / "bench" / "scala",
testFrameworks += new TestFramework("org.scalameter.ScalaMeterFramework"),
Benchmark / parallelExecution := false,
Benchmark / outputStrategy := Some(StdoutOutput),
Benchmark / fork := true,
Benchmark / connectInput := true,
inConfig(Benchmark)(Defaults.testSettings)
)
}
lazy val commonJsSettings = {
Seq(
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.CommonJSModule)
}
) ++ CommonSettings.settings ++ Seq(
scalacOptions += "-P:scalajs:nowarnGlobalExecutionContext")
}
lazy val crypto = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.settings(scalacOptions += "-Xsource:3")
.settings(
name := "bitcoin-s-crypto",
libraryDependencies ++= Deps.crypto.value
)
.settings(CommonSettings.settings: _*)
.jvmSettings(
libraryDependencies ++= Deps.cryptoJVM
)
.jsSettings(
Compile / npmDependencies ++= Seq(
"bcrypto" -> "5.4.0"
)
)
.jvmSettings(CommonSettings.jvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.in(file("crypto"))
lazy val cryptoJS = crypto.js
.settings(Compile / scalacOptions += {
"-Wconf:cat=unused:site=org\\.bitcoins\\.crypto\\.facade\\..*:silent,cat=w-flag-dead-code:site=org\\.bitcoins\\.crypto\\.facade\\..*:silent"
})
.enablePlugins(ScalaJSBundlerPlugin)
lazy val cryptoJVM = crypto.jvm
.dependsOn(secp256k1jni)
lazy val core = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.settings(name := "bitcoin-s-core")
.settings(scalacOptions += "-Xsource:3")
.settings(libraryDependencies ++= Deps.core.value)
.settings(CommonSettings.prodSettings: _*)
.jvmSettings(CommonSettings.jvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.in(file("core"))
.dependsOn(crypto)
lazy val coreJVM = core.jvm
lazy val coreJS = core.js
.settings(libraryDependencies ++= Deps.coreJs.value)
.enablePlugins(ScalaJSBundlerPlugin)
lazy val asyncUtils = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("async-utils"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.settings(name := "bitcoin-s-async-utils",
libraryDependencies ++= Deps.asyncUtils.value)
.jvmSettings(CommonSettings.jvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.dependsOn(core)
lazy val asyncUtilsJVM = asyncUtils.jvm
lazy val asyncUtilsJS = asyncUtils.js
lazy val asyncUtilsTest = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("async-utils-test"))
.settings(CommonSettings.testSettings: _*)
.settings(name := "bitcoin-s-async-utils-test")
.jvmSettings(CommonSettings.jvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.dependsOn(asyncUtils, testkitCore)
lazy val asyncUtilsTestJVM = asyncUtilsTest.jvm
lazy val asyncUtilsTestJS = asyncUtilsTest.js
lazy val testkitCore = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("testkit-core"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.settings(name := "bitcoin-s-testkit-core",
libraryDependencies ++= Deps.testkitCore.value)
.jvmSettings(CommonSettings.jvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.dependsOn(asyncUtils, core, crypto)
lazy val testkitCoreJVM = testkitCore.jvm
lazy val testkitCoreJS = testkitCore.js
lazy val bitcoindRpc = project
.in(file("bitcoind-rpc"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.dependsOn(
asyncUtilsJVM,
appCommons,
tor
)
lazy val eclairRpc = project
.in(file("eclair-rpc"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.dependsOn(asyncUtilsJVM, bitcoindRpc)
lazy val lndRpc = project
.in(file("lnd-rpc"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.dependsOn(asyncUtilsJVM, appCommons)
lazy val clightningRpc = project
.in(file("clightning-rpc"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.dependsOn(asyncUtilsJVM, bitcoindRpc)
lazy val lnurl = project
.in(file("lnurl"))
.settings(scalacOptions += "-Xsource:3")
.settings(name := "bitcoin-s-lnurl")
.settings(CommonSettings.prodSettings: _*)
.dependsOn(appCommons, asyncUtilsJVM, tor)
lazy val lnurlTest = project
.in(file("lnurl-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(name := "bitcoin-s-lnurl-test")
.settings(CommonSettings.testSettings: _*)
.dependsOn(lnurl, testkit)
lazy val tor = project
.in(file("tor"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.dependsOn(coreJVM, appCommons, asyncUtilsJVM)
lazy val torTest = project
.in(file("tor-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.dependsOn(tor, testkit)
lazy val jsProjects: Vector[ProjectReference] =
Vector(asyncUtilsJS,
asyncUtilsTestJS,
cryptoJS,
coreJS,
cryptoTestJS,
coreTestJS,
testkitCoreJS)
// quoting the val name this way makes it appear as
// 'bitcoin-s' in sbt/bloop instead of 'bitcoins'
lazy val `bitcoin-s` = project
2018-12-09 20:43:31 +01:00
.in(file("."))
.aggregate(
asyncUtilsJVM,
2018-12-09 20:43:31 +01:00
secp256k1jni,
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
chain,
chainTest,
cli,
cliTest,
coreJVM,
coreJS,
coreTestJVM,
coreTestJS,
cryptoJVM,
cryptoJS,
cryptoTestJVM,
cryptoTestJS,
dbCommons,
dbCommonsTest,
feeProvider,
feeProviderTest,
esplora,
esploraTest,
dlcOracle,
dlcOracleTest,
bitcoindRpc,
bitcoindRpcTest,
2018-12-09 20:43:31 +01:00
bench,
eclairRpc,
eclairRpcTest,
keyManager,
keyManagerTest,
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
node,
nodeTest,
wallet,
walletTest,
dlcWallet,
dlcWalletTest,
dlcNode,
dlcNodeTest,
appServer,
appServerTest,
appCommons,
2020-06-16 22:21:33 +02:00
appCommonsTest,
testkitCoreJVM,
testkitCoreJS,
testkit,
zmq,
oracleServer,
2021-02-23 20:17:20 +01:00
oracleServerTest,
serverRoutes,
lndRpc,
lndRpcTest,
lnurl,
lnurlTest,
tor,
torTest,
scripts,
clightningRpc,
clightningRpcTest
2018-12-09 20:43:31 +01:00
)
.dependsOn(
secp256k1jni,
chain,
chainTest,
cli,
cliTest,
coreJVM,
coreJS,
coreTestJVM,
coreTestJS,
cryptoJVM,
cryptoJS,
cryptoTestJVM,
cryptoTestJS,
dbCommons,
dbCommonsTest,
feeProvider,
feeProviderTest,
esplora,
esploraTest,
dlcOracle,
dlcOracleTest,
bitcoindRpc,
bitcoindRpcTest,
bench,
eclairRpc,
eclairRpcTest,
keyManager,
keyManagerTest,
node,
nodeTest,
wallet,
walletTest,
dlcWallet,
dlcWalletTest,
dlcNode,
dlcNodeTest,
appServer,
appServerTest,
appCommons,
appCommonsTest,
testkit,
zmq,
oracleServer,
2021-02-23 20:17:20 +01:00
oracleServerTest,
serverRoutes,
lndRpc,
lndRpcTest,
lnurl,
lnurlTest,
tor,
torTest,
scripts,
clightningRpc,
clightningRpcTest
)
.settings(CommonSettings.settings: _*)
// unidoc aggregates Scaladocs for all subprojects into one big doc
.enablePlugins(ScalaUnidocPlugin)
.settings(
)
2019-01-18 13:34:27 +01:00
.settings(
name := "bitcoin-s",
gitRemoteRepo := "git@github.com:bitcoin-s/bitcoin-s-core.git",
publish / skip := true
2019-01-18 13:34:27 +01:00
)
lazy val secp256k1jni = project
.in(file("secp256k1jni"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.settings(
libraryDependencies ++= Deps.secp256k1jni,
// we place lib files in this directory
Compile / unmanagedResourceDirectories += baseDirectory.value / "natives",
//since this is not a scala module, we have no code coverage
//this also doesn't place nice with scoverage, see
//https://github.com/scoverage/sbt-scoverage/issues/275
coverageEnabled := false,
Compile / compile / javacOptions ++= {
//https://github.com/eclipse/jetty.project/issues/3244#issuecomment-495322586
Seq("--release", "8")
}
)
val testAndCompile = "compile->compile;test->test"
lazy val cryptoTest = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.in(file("crypto-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.jvmSettings(CommonSettings.jvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.settings(
name := "bitcoin-s-crypto-test",
libraryDependencies ++= Deps.cryptoTest.value
)
.dependsOn(crypto)
lazy val cryptoTestJVM = cryptoTest.jvm
lazy val cryptoTestJS = cryptoTest.js
.enablePlugins(ScalaJSBundlerPlugin)
lazy val coreTest = crossProject(JVMPlatform, JSPlatform)
.crossType(CrossType.Pure)
.settings(scalacOptions += "-Xsource:3")
.in(file("core-test"))
.settings(CommonSettings.testSettings: _*)
2019-02-19 21:44:44 +01:00
.settings(
name := "bitcoin-s-core-test",
libraryDependencies ++= Deps.coreTest.value
)
.jvmSettings(CommonSettings.jvmSettings: _*)
.jsSettings(commonJsSettings: _*)
.dependsOn(
core,
testkitCore
)
lazy val coreTestJVM = coreTest.jvm
.settings(libraryDependencies ++= Deps.coreTestJVM.value)
.dependsOn(testkit)
lazy val coreTestJS = coreTest.js
.enablePlugins(ScalaJSBundlerPlugin)
lazy val appCommons = project
.in(file("app-commons"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.dependsOn(
coreJVM % testAndCompile
)
2020-06-16 22:21:33 +02:00
lazy val appCommonsTest = project
.in(file("app-commons-test"))
.settings(scalacOptions += "-Xsource:3")
2020-06-16 22:21:33 +02:00
.settings(CommonSettings.testSettings: _*)
.dependsOn(appCommons, testkit)
lazy val oracleServer = project
.in(file("app/oracle-server"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.appSettings: _*)
.settings(CommonSettings.dockerSettings: _*)
.settings(CommonSettings.dockerBuildxSettings: _*)
.settings(jlinkModules ++= CommonSettings.jlinkModules)
.settings(jlinkModules --= CommonSettings.rmJlinkModules)
.settings(jlinkOptions ++= CommonSettings.jlinkOptions)
.settings(jlinkIgnoreMissingDependency := CommonSettings.oracleServerJlinkIgnore)
.settings(bashScriptExtraDefines ++= IO.readLines(baseDirectory.value / "src" / "universal" / "oracle-server-extra-startup-script.sh"))
.dependsOn(
dlcOracle,
serverRoutes
)
.enablePlugins(JavaAppPackaging, DockerPlugin, JlinkPlugin,
//needed for windows, else we have the 'The input line is too long` on windows OS
LauncherJarPlugin)
2021-02-23 20:17:20 +01:00
lazy val oracleServerTest = project
.in(file("app/oracle-server-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
2021-02-23 20:17:20 +01:00
.settings(libraryDependencies ++= Deps.walletServerTest)
.dependsOn(
oracleServer,
testkit
)
lazy val serverRoutes = project
.in(file("app/server-routes"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.settings(name := "bitcoin-s-server-routes")
.settings(libraryDependencies ++= Deps.serverRoutes)
.dependsOn(appCommons, dbCommons)
lazy val appServer = project
.in(file("app/server"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.appSettings: _*)
.settings(CommonSettings.dockerSettings: _*)
.settings(CommonSettings.dockerBuildxSettings: _*)
.settings(jlinkModules ++= CommonSettings.jlinkModules)
.settings(jlinkModules --= CommonSettings.rmJlinkModules)
.settings(jlinkOptions ++= CommonSettings.jlinkOptions)
.settings(jlinkIgnoreMissingDependency := CommonSettings.appServerJlinkIgnore)
.settings(bashScriptExtraDefines ++= IO.readLines(baseDirectory.value / "src" / "universal" / "wallet-server-extra-startup-script.sh"))
.dependsOn(
serverRoutes,
appCommons,
node,
chain,
wallet,
dlcWallet,
dlcNode,
bitcoindRpc,
feeProvider,
zmq
)
.enablePlugins(JavaAppPackaging, DockerPlugin, JlinkPlugin,
//needed for windows, else we have the 'The input line is too long` on windows OS
LauncherJarPlugin)
lazy val appServerTest = project
.in(file("app/server-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.settings(libraryDependencies ++= Deps.walletServerTest)
.dependsOn(
appServer,
testkit,
cli
)
lazy val cli = project
.in(file("app/cli"))
.settings(CommonSettings.prodSettings: _*)
.settings(scalacOptions += "-Xsource:3")
2020-12-24 03:16:38 +01:00
.settings(
name := "bitcoin-s-cli"
)
.settings(jlinkOptions ++= CommonSettings.jlinkOptions)
.settings(jlinkModules --= CommonSettings.rmCliJlinkModules)
.settings(jlinkIgnoreMissingDependency := CommonSettings.cliJlinkIgnore)
.settings(bashScriptExtraDefines ++= IO.readLines(baseDirectory.value / "src" / "universal" / "cli-extra-startup-script.sh"))
.dependsOn(
appCommons
).enablePlugins(JavaAppPackaging, NativeImagePlugin, JlinkPlugin)
lazy val cliTest = project
.in(file("app/cli-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.dependsOn(
cli,
testkit
)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
lazy val chain = project
.in(file("chain"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
.settings(
name := "bitcoin-s-chain",
libraryDependencies ++= Deps.chain
)
.dependsOn(coreJVM, dbCommons)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
lazy val chainTest = project
.in(file("chain-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
.settings(
name := "bitcoin-s-chain-test",
libraryDependencies ++= Deps.chainTest
)
.dependsOn(chain, coreJVM % testAndCompile, testkit, zmq)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
lazy val dbCommons = project
.in(file("db-commons"))
2024-05-11 14:24:00 +02:00
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
.settings(
name := "bitcoin-s-db-commons",
libraryDependencies ++= Deps.dbCommons.value
)
.dependsOn(coreJVM, appCommons, keyManager)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
lazy val dbCommonsTest = project
.in(file("db-commons-test"))
2024-05-11 14:24:00 +02:00
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.settings(
2020-06-16 22:21:33 +02:00
name := "bitcoin-s-db-commons-test"
)
.dependsOn(testkit)
lazy val esplora = project
.in(file("esplora"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.settings(
name := "bitcoin-s-esplora",
libraryDependencies ++= Deps.esplora.value
)
.dependsOn(coreJVM, appCommons, tor)
lazy val esploraTest = project
.in(file("esplora-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.settings(
name := "bitcoin-s-esplora-test",
libraryDependencies ++= Deps.esploraTest.value
)
.dependsOn(coreJVM % testAndCompile, esplora, testkit)
lazy val feeProvider = project
.in(file("fee-provider"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.settings(
name := "bitcoin-s-fee-provider",
libraryDependencies ++= Deps.feeProvider.value
)
.dependsOn(coreJVM, appCommons, tor)
lazy val feeProviderTest = project
.in(file("fee-provider-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.settings(
name := "bitcoin-s-fee-provider-test",
libraryDependencies ++= Deps.feeProviderTest.value
)
.dependsOn(coreJVM % testAndCompile, testkit)
lazy val zmq = project
.in(file("zmq"))
.settings(CommonSettings.prodSettings: _*)
.settings(name := "bitcoin-s-zmq",
libraryDependencies ++= Deps.bitcoindZmq.value)
.dependsOn(
coreJVM % testAndCompile,
appCommons
)
Implement caching of bitcoind in the walletTest,nodeTest, and partially bitcoindRpcTest project (#2792) * Create CachedBitcoind, implement it in FundTransactionHandlingTest * Add BaseWalletTest, extend it with BitcoinSWalletTest & BitcoinSWalletTestCachedBitcoind, add CachedBitcoinV19 and use it RescanHandlingTest * Make ProcessBlockTest work with cached bitcoind * Make trait for CachedBitcoindNewest for the newest version of bitcoind * Make UTXOLifeCycleTest use cached bitcoind * Add WalletBloom, WalletSyncTest to use cached bitcoinds * Add WalletIntegrationTest * Rework beforeAll() and afterAll() into the super trait like BaseWalletTest * Add standlone BitcoindFixtures, use it in BitcoindBackendTest * Use new BitcoindFixtures in BitcoindBlockPollingTest * Introduce BaseNodeTest, start implementing the usage of cached bitcoinds in the nodeTest project * Use cached bitcoind's with SpvNodeTest & SpvNodeWithWalletTest * Fix bug on postgres with reusing database, upsert the genesis header rather than create it * Get NeutrinoNode tests workign with cached bitcoinds * Fix NeutrinoNodeWithWallet by destroying wallet state for Postgres * Add teardown helper method for bitcoind * Teardown chain project when using node fixtures since node is dependent upon the chain project. * Turn off parallelExecution again * Switch the parallelExecution flag to only be set on CI, so we can get better performance when running locally * Start implementing BitcoindFixtures, use BitcoindFixturesCachedTriple on TestUtilRpcTest * Fix compiler errors, begin implementing NodePair * Refactor TestRpcUtilTest to use 2 bitcoinds rather than 2 * Reduce the number of bitcoinds that MultiWalletRpcTest needs from 3 -> 1 * Reduce number of bitcoinds used in WalletRpcTest from 3 -> 2 * Add some documentation * Try to re-add parallelExecution * Reduce the number of bitcoinds used in PsbtRpcTest from 3 -> 2 * Disable parallelExecution in Test again * Make BitcoindV21RpcClientTest & BitcoindV20RpcClientTest reduce bitcoind usage from 2 -> 1 * Make BitcoindV19RpcClienttest reduce bitcoind usage from 2 -> 1 * Rework MempoolRpcTest to use fixtures, add BitcoindVersion to CachedBitcoindCollection * Make sure clientAccumm has to be specified as a paramter now rather than filling in by default * Begin parameterizing NodePair/NodeTriple to retain type information for the specific version of bitcoind that was used * Don't implement version in super trait * Fix docs * Fix async issue in V21 test suite * Append to vectors in CachedBitcoinCollection rather than replace * Fix rebase issues * Add scaladocs * Fix BitcoindV18RpcClient address info test * Implement fixtures in BitcoindV17RpcClientTest fixtures * Cleanup v17 PsbtRpcTest * Reduce bitcoind usage from 3 -> 1 in BitcoindV18RpcClientTest * Remove abandon transaction test, this allows us to reduce the number of bitcoind's used in MempoolRpcTest from 3 -> 2 * Remove the requirement to inject BitcoinSAsyncFixtureTest, add it in the test traits explicitly to make things easier. Also add explicit afterAll() method to tear down both the CachedBitcoind & BitcoinSAsyncFixtureTest * Fix missing Await.result() in BitcoindRpcTest.afterAll() * Rework MultiWalletRpcTest to use a NodePair * Rework BlockchainRpcTest to use fixtures * Rework Client start()/stop() methods. Now use an AtomicBoolean to indicate when a user has requested a client to start/stop rather than sending pings to bitcoind that can fail because the conneciton pool has been shutdown in test cases * Try my luck with turning on parallelExecution in CI again * Revert parallelExecution, now testes do not run in parallel on CI * Only turn off parallelExecution for bitcoindRpcTest * Adjust build to only have bitcoindRpcTest NOT in run parallel on mac, reduce number of blocks used in BitcoindRpcTestUtil.createNodeSequence * Run less tests in the rpc test suite as that takes the longest, move them over to node/wallet/dlc test suite on mac osx CI * Don't run eclair tests in parallel either * Remove CachedBitcoind from BitcoinSWalletTest * Fix async bug in test case * Push to github to force re-run of CI * Push to github to force re-run of CI * Push to github to force re-run of CI
2021-03-19 12:37:53 +01:00
def isCI = {
Properties
.envOrNone("CI")
.isDefined
}
def isTor = {
Properties
.envOrNone("TOR")
.isDefined
}
lazy val bitcoindRpcTest = project
.in(file("bitcoind-rpc-test"))
.settings(CommonSettings.testSettings: _*)
.settings(name := "bitcoin-s-bitcoind-rpc-test",
libraryDependencies ++= Deps.bitcoindRpcTest.value
)
.dependsOn(coreJVM % testAndCompile, testkit)
2018-11-21 21:01:03 +01:00
lazy val bench = project
.in(file("bench"))
.settings(CommonSettings.prodSettings: _*)
.settings(
libraryDependencies ++= Deps.bench,
name := "bitcoin-s-bench",
publish / skip := true
)
.dependsOn(coreJVM % testAndCompile, testkit)
2018-11-21 21:01:03 +01:00
lazy val eclairRpcTest = project
.in(file("eclair-rpc-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.settings(
libraryDependencies ++= Deps.eclairRpcTest.value,
name := "bitcoin-s-eclair-rpc-test"
)
.dependsOn(coreJVM % testAndCompile, testkit)
Lightning Network (#256) * Implementation of LnCurrencyUnit Fix unary and unneeded comments. Refactor and change arithmetic to use PicoBitcoins. Add property based testing for LnCurrencyUnits Refactor LnCurrencyUnits after code review Fix case and change LnPolicy to val Remove division and add Unit tests * Add additional unit tests and deserialization * WIP: Implement LnHumanReadablePart (#190) * Initial Implementation of LnHumanReadablePart * Add unit tests and improve deserialization from string * Refactor LnParams and LnHrp. Add requirements for instantiating LnHrp. * Clean up and re-organize things Re-working LnHumanReadablePart.fromString Fix unnecessary pattern match Removing test case * Created eclairRpc project (#193) Added getinfo functionality Added connect functionality Added most of the rpcs Added send and checkpayment functionality Added updaterelayfee functionality Fixed compile errors Ran scalafmt Added DaemonInstance and start/stop methods Added TestUtil Added open test Fixed typo in allUpdates Fixed ChannelResult Add eclair prefix to rpc stuff open channel unit test passing Adding instructions to grab default eclair in build Add zmq config to bitcoin.conf rename test log files, bump timeouts on connections Add eclair-rpc README, rework some RpcUtil/TestUtil stuff for async fixing bug in precious block, addressing code review Address more code review comments * Add NodeId, NodeUri, ChannelId (#196) refactor json serializing methods to SerializerUtil, add more types * Adding LnCurrencyUnit types to rpc api, fixing bug where eclair tests were not binding to a random port for zmq (#198) Remove start stuff * Adding more rpc tests, testing open, payment over channel, and closing of the channel (#199) Add checkpayment tests Address code review, create EclairTestUtil.createNodPair * Two way eclair transactions sanity test (#200) * Added a test for sending payments in both directions * Updated travis bitcoin core version * Initial LnInvoice Implementation (#194) Start typing some ln invoice stuff Add support for Fallback Address encoding Part 1: Breaking out Bech32 specific functions into a util class, don't embed in Bech32Address re-naming fromBase8ToBase5 -> from8BitTo5bit Part 1: Breaking out Bech32 specific functions into a util class, don't embed in Bech32Address rework ln invoices tags fix more method names in Bech32 Rename ScriptPubKeyTag -> NodeIdTag All invoice tags tests passing except weird serialization order one Address code review, add some more comments rename 'LnInvoiceTags' -> 'LnInvoiceTaggedFields' create a UInt5 type to represent all of the bech32 data structures Passing all serialization in the BOLT11 examples First cut at deserialization * Adding bitcoin-s types to the eclair-rpc, fixing bug with decoding numbers, refactoring more things (#204) * Switch bech32 p2wpkh hash from RipdeMd160 -> Sha256Hash160Digest (#206) * Add testkit project / dependency (#209) fix core-gen build.sbt name * add correct dependencies to testkit (#210) * Get dep name right (#211) * Add serialization symmetry property for LnInvoice, fixing various bugs in LnInvoice data structures, adding generators for various LnInvoice data structures (#217) * Reworking AuthCredentials and Instances so that we can read from config files (#218) add core files that were missing * Reworking a lot of testkit data structures to be more helpful for testing (#219) Add missing EclairApi file remove noisy log * Rebase onto master, fix testkit compile issues * Simplify LnCurrencyUnit, add MilliSatoshis, refactor EclairRpc to use… (#226) * Simplify LnCurrencyUnit, add MilliSatoshis, refactor EclairRpc to use MilliSatoshis * Add some helper functions around millisatoshis for comparing them to other things * more tests / helper methods, at generator for millisatoshis * Fix typo * Fix comparison operators for millisatoshis, add Writes for MilliSatos… (#227) * Fix comparison operators for millisatoshis, add Writes for MilliSatoshis in JsonWriters * re-add comparison operators to LnCurrencyUnit for convinience * Add millisatoshi reads (#228) * Updating version of eclair to https://github.com/ACINQ/eclair/releases/download/v0.2-beta8/eclair-node-0.2-beta8-52821b8.jar (#229) * Derive nodeId from ln invoice signature, move nodeid case class into … (#230) * Derive nodeId from ln invoice signature, move nodeid case class into the core project * Add missing assert * Fix null pointer exception that could occurred during requiring the invoice's signature to valid. This could occurr if a user tried to construct an invoice with an invalid signature (#233) * Turn down logging / remove logging (#235) * Cleaned up eclair conf (#237) * Cleaned up eclair conf * Added test for bad auth and Reads for LnInvoice * WIP: rebase onto master with new compiler opts fix more compiler warnings with testkit * fix new compiler warnings for scalac 2.12.x on ln (#253) * fix new compiler warnings for scalac 2.12.x on ln * fix missing p2wpkhoutput in rawoutput testkit/CreditingTxGen.scala * First cut at code review for the ln branch (#258) Fix bug in parsing the LnTagPrefix.CltvExpiry, add properties that check if the NodeIdTag is given explicitly to the invoice remove dumb invariants revert version * 2018 12 4 ln code review rd2 (#259) * Amend EclairRpc test case for confirming that channel is closed * Add final check to test case to make sure the bitcoind wallet received funds when closing channel * Address Torkel's code review * Addresses some review on #256 (#260) * Docstring cleanup, small nits * Refactors some redudant data, nested if => switch * Fixes SO error by reversing remowal of `new` * Fixes a couple of bugs * map.get instead of list.find * StringBuilder in HRP * Rework NetworkParam to LnParam * Cleanup * Renames file to match trait/object name * Docstring cleanup, pure formatting * Simplifies a few expressions, doesn't change semantics * Adds overloaded findRoute method instead of Either[NodeId, LnInvoice] * Eclair cleanup * Address concerns from Chris * Type annotation to match case * Address nadav's code review
2018-12-08 17:03:24 +01:00
lazy val clightningRpcTest = project
.in(file("clightning-rpc-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.settings(
libraryDependencies ++= Deps.clightningRpcTest.value,
name := "bitcoin-s-clightning-rpc-test"
)
.dependsOn(coreJVM % testAndCompile, clightningRpc, testkit)
lazy val lndRpcTest = project
.in(file("lnd-rpc-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.settings(
libraryDependencies ++= Deps.eclairRpcTest.value,
name := "bitcoin-s-lnd-rpc-test"
)
.dependsOn(coreJVM % testAndCompile, testkit, lndRpc)
lazy val node =
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
project
.in(file("node"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
.settings(
name := "bitcoin-s-node",
libraryDependencies ++= Deps.node
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
)
.dependsOn(
asyncUtilsJVM,
coreJVM,
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
chain,
dbCommons,
bitcoindRpc,
tor
)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
lazy val nodeTest =
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
project
.in(file("node-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
.settings(
name := "bitcoin-s-node-test",
// There's a weird issue with forking
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
// in node tests, for example this CI
// error: https://travis-ci.org/bitcoin-s/bitcoin-s-core/jobs/525018199#L1252
// It seems to be related to this
// Scalatest issue:
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
// https://github.com/scalatest/scalatest/issues/556
Test / fork := false,
libraryDependencies ++= Deps.nodeTest.value
)
.dependsOn(
coreJVM % testAndCompile,
node,
testkit
)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
Lightning Network (#256) * Implementation of LnCurrencyUnit Fix unary and unneeded comments. Refactor and change arithmetic to use PicoBitcoins. Add property based testing for LnCurrencyUnits Refactor LnCurrencyUnits after code review Fix case and change LnPolicy to val Remove division and add Unit tests * Add additional unit tests and deserialization * WIP: Implement LnHumanReadablePart (#190) * Initial Implementation of LnHumanReadablePart * Add unit tests and improve deserialization from string * Refactor LnParams and LnHrp. Add requirements for instantiating LnHrp. * Clean up and re-organize things Re-working LnHumanReadablePart.fromString Fix unnecessary pattern match Removing test case * Created eclairRpc project (#193) Added getinfo functionality Added connect functionality Added most of the rpcs Added send and checkpayment functionality Added updaterelayfee functionality Fixed compile errors Ran scalafmt Added DaemonInstance and start/stop methods Added TestUtil Added open test Fixed typo in allUpdates Fixed ChannelResult Add eclair prefix to rpc stuff open channel unit test passing Adding instructions to grab default eclair in build Add zmq config to bitcoin.conf rename test log files, bump timeouts on connections Add eclair-rpc README, rework some RpcUtil/TestUtil stuff for async fixing bug in precious block, addressing code review Address more code review comments * Add NodeId, NodeUri, ChannelId (#196) refactor json serializing methods to SerializerUtil, add more types * Adding LnCurrencyUnit types to rpc api, fixing bug where eclair tests were not binding to a random port for zmq (#198) Remove start stuff * Adding more rpc tests, testing open, payment over channel, and closing of the channel (#199) Add checkpayment tests Address code review, create EclairTestUtil.createNodPair * Two way eclair transactions sanity test (#200) * Added a test for sending payments in both directions * Updated travis bitcoin core version * Initial LnInvoice Implementation (#194) Start typing some ln invoice stuff Add support for Fallback Address encoding Part 1: Breaking out Bech32 specific functions into a util class, don't embed in Bech32Address re-naming fromBase8ToBase5 -> from8BitTo5bit Part 1: Breaking out Bech32 specific functions into a util class, don't embed in Bech32Address rework ln invoices tags fix more method names in Bech32 Rename ScriptPubKeyTag -> NodeIdTag All invoice tags tests passing except weird serialization order one Address code review, add some more comments rename 'LnInvoiceTags' -> 'LnInvoiceTaggedFields' create a UInt5 type to represent all of the bech32 data structures Passing all serialization in the BOLT11 examples First cut at deserialization * Adding bitcoin-s types to the eclair-rpc, fixing bug with decoding numbers, refactoring more things (#204) * Switch bech32 p2wpkh hash from RipdeMd160 -> Sha256Hash160Digest (#206) * Add testkit project / dependency (#209) fix core-gen build.sbt name * add correct dependencies to testkit (#210) * Get dep name right (#211) * Add serialization symmetry property for LnInvoice, fixing various bugs in LnInvoice data structures, adding generators for various LnInvoice data structures (#217) * Reworking AuthCredentials and Instances so that we can read from config files (#218) add core files that were missing * Reworking a lot of testkit data structures to be more helpful for testing (#219) Add missing EclairApi file remove noisy log * Rebase onto master, fix testkit compile issues * Simplify LnCurrencyUnit, add MilliSatoshis, refactor EclairRpc to use… (#226) * Simplify LnCurrencyUnit, add MilliSatoshis, refactor EclairRpc to use MilliSatoshis * Add some helper functions around millisatoshis for comparing them to other things * more tests / helper methods, at generator for millisatoshis * Fix typo * Fix comparison operators for millisatoshis, add Writes for MilliSatos… (#227) * Fix comparison operators for millisatoshis, add Writes for MilliSatoshis in JsonWriters * re-add comparison operators to LnCurrencyUnit for convinience * Add millisatoshi reads (#228) * Updating version of eclair to https://github.com/ACINQ/eclair/releases/download/v0.2-beta8/eclair-node-0.2-beta8-52821b8.jar (#229) * Derive nodeId from ln invoice signature, move nodeid case class into … (#230) * Derive nodeId from ln invoice signature, move nodeid case class into the core project * Add missing assert * Fix null pointer exception that could occurred during requiring the invoice's signature to valid. This could occurr if a user tried to construct an invoice with an invalid signature (#233) * Turn down logging / remove logging (#235) * Cleaned up eclair conf (#237) * Cleaned up eclair conf * Added test for bad auth and Reads for LnInvoice * WIP: rebase onto master with new compiler opts fix more compiler warnings with testkit * fix new compiler warnings for scalac 2.12.x on ln (#253) * fix new compiler warnings for scalac 2.12.x on ln * fix missing p2wpkhoutput in rawoutput testkit/CreditingTxGen.scala * First cut at code review for the ln branch (#258) Fix bug in parsing the LnTagPrefix.CltvExpiry, add properties that check if the NodeIdTag is given explicitly to the invoice remove dumb invariants revert version * 2018 12 4 ln code review rd2 (#259) * Amend EclairRpc test case for confirming that channel is closed * Add final check to test case to make sure the bitcoind wallet received funds when closing channel * Address Torkel's code review * Addresses some review on #256 (#260) * Docstring cleanup, small nits * Refactors some redudant data, nested if => switch * Fixes SO error by reversing remowal of `new` * Fixes a couple of bugs * map.get instead of list.find * StringBuilder in HRP * Rework NetworkParam to LnParam * Cleanup * Renames file to match trait/object name * Docstring cleanup, pure formatting * Simplifies a few expressions, doesn't change semantics * Adds overloaded findRoute method instead of Either[NodeId, LnInvoice] * Eclair cleanup * Address concerns from Chris * Type annotation to match case * Address nadav's code review
2018-12-08 17:03:24 +01:00
lazy val testkit = project
.in(file("testkit"))
.settings(CommonSettings.prodSettings: _*)
.settings(scalacOptions += "-Xsource:3")
.settings(
name := "bitcoin-s-testkit",
libraryDependencies ++= Deps.testkit.value
)
Lightning Network (#256) * Implementation of LnCurrencyUnit Fix unary and unneeded comments. Refactor and change arithmetic to use PicoBitcoins. Add property based testing for LnCurrencyUnits Refactor LnCurrencyUnits after code review Fix case and change LnPolicy to val Remove division and add Unit tests * Add additional unit tests and deserialization * WIP: Implement LnHumanReadablePart (#190) * Initial Implementation of LnHumanReadablePart * Add unit tests and improve deserialization from string * Refactor LnParams and LnHrp. Add requirements for instantiating LnHrp. * Clean up and re-organize things Re-working LnHumanReadablePart.fromString Fix unnecessary pattern match Removing test case * Created eclairRpc project (#193) Added getinfo functionality Added connect functionality Added most of the rpcs Added send and checkpayment functionality Added updaterelayfee functionality Fixed compile errors Ran scalafmt Added DaemonInstance and start/stop methods Added TestUtil Added open test Fixed typo in allUpdates Fixed ChannelResult Add eclair prefix to rpc stuff open channel unit test passing Adding instructions to grab default eclair in build Add zmq config to bitcoin.conf rename test log files, bump timeouts on connections Add eclair-rpc README, rework some RpcUtil/TestUtil stuff for async fixing bug in precious block, addressing code review Address more code review comments * Add NodeId, NodeUri, ChannelId (#196) refactor json serializing methods to SerializerUtil, add more types * Adding LnCurrencyUnit types to rpc api, fixing bug where eclair tests were not binding to a random port for zmq (#198) Remove start stuff * Adding more rpc tests, testing open, payment over channel, and closing of the channel (#199) Add checkpayment tests Address code review, create EclairTestUtil.createNodPair * Two way eclair transactions sanity test (#200) * Added a test for sending payments in both directions * Updated travis bitcoin core version * Initial LnInvoice Implementation (#194) Start typing some ln invoice stuff Add support for Fallback Address encoding Part 1: Breaking out Bech32 specific functions into a util class, don't embed in Bech32Address re-naming fromBase8ToBase5 -> from8BitTo5bit Part 1: Breaking out Bech32 specific functions into a util class, don't embed in Bech32Address rework ln invoices tags fix more method names in Bech32 Rename ScriptPubKeyTag -> NodeIdTag All invoice tags tests passing except weird serialization order one Address code review, add some more comments rename 'LnInvoiceTags' -> 'LnInvoiceTaggedFields' create a UInt5 type to represent all of the bech32 data structures Passing all serialization in the BOLT11 examples First cut at deserialization * Adding bitcoin-s types to the eclair-rpc, fixing bug with decoding numbers, refactoring more things (#204) * Switch bech32 p2wpkh hash from RipdeMd160 -> Sha256Hash160Digest (#206) * Add testkit project / dependency (#209) fix core-gen build.sbt name * add correct dependencies to testkit (#210) * Get dep name right (#211) * Add serialization symmetry property for LnInvoice, fixing various bugs in LnInvoice data structures, adding generators for various LnInvoice data structures (#217) * Reworking AuthCredentials and Instances so that we can read from config files (#218) add core files that were missing * Reworking a lot of testkit data structures to be more helpful for testing (#219) Add missing EclairApi file remove noisy log * Rebase onto master, fix testkit compile issues * Simplify LnCurrencyUnit, add MilliSatoshis, refactor EclairRpc to use… (#226) * Simplify LnCurrencyUnit, add MilliSatoshis, refactor EclairRpc to use MilliSatoshis * Add some helper functions around millisatoshis for comparing them to other things * more tests / helper methods, at generator for millisatoshis * Fix typo * Fix comparison operators for millisatoshis, add Writes for MilliSatos… (#227) * Fix comparison operators for millisatoshis, add Writes for MilliSatoshis in JsonWriters * re-add comparison operators to LnCurrencyUnit for convinience * Add millisatoshi reads (#228) * Updating version of eclair to https://github.com/ACINQ/eclair/releases/download/v0.2-beta8/eclair-node-0.2-beta8-52821b8.jar (#229) * Derive nodeId from ln invoice signature, move nodeid case class into … (#230) * Derive nodeId from ln invoice signature, move nodeid case class into the core project * Add missing assert * Fix null pointer exception that could occurred during requiring the invoice's signature to valid. This could occurr if a user tried to construct an invoice with an invalid signature (#233) * Turn down logging / remove logging (#235) * Cleaned up eclair conf (#237) * Cleaned up eclair conf * Added test for bad auth and Reads for LnInvoice * WIP: rebase onto master with new compiler opts fix more compiler warnings with testkit * fix new compiler warnings for scalac 2.12.x on ln (#253) * fix new compiler warnings for scalac 2.12.x on ln * fix missing p2wpkhoutput in rawoutput testkit/CreditingTxGen.scala * First cut at code review for the ln branch (#258) Fix bug in parsing the LnTagPrefix.CltvExpiry, add properties that check if the NodeIdTag is given explicitly to the invoice remove dumb invariants revert version * 2018 12 4 ln code review rd2 (#259) * Amend EclairRpc test case for confirming that channel is closed * Add final check to test case to make sure the bitcoind wallet received funds when closing channel * Address Torkel's code review * Addresses some review on #256 (#260) * Docstring cleanup, small nits * Refactors some redudant data, nested if => switch * Fixes SO error by reversing remowal of `new` * Fixes a couple of bugs * map.get instead of list.find * StringBuilder in HRP * Rework NetworkParam to LnParam * Cleanup * Renames file to match trait/object name * Docstring cleanup, pure formatting * Simplifies a few expressions, doesn't change semantics * Adds overloaded findRoute method instead of Either[NodeId, LnInvoice] * Eclair cleanup * Address concerns from Chris * Type annotation to match case * Address nadav's code review
2018-12-08 17:03:24 +01:00
.dependsOn(
asyncUtilsJVM,
coreJVM % testAndCompile,
appServer,
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
chain,
cli,
bitcoindRpc,
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
eclairRpc,
lndRpc,
clightningRpc,
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
node,
wallet,
dlcWallet,
zmq,
dlcOracle,
testkitCoreJVM
)
lazy val docs = project
.in(file("bitcoin-s-docs")) // important: it must not be docs/
.settings(CommonSettings.testSettings: _*)
2024-05-10 19:37:02 +02:00
.settings(scalacOptions += "-Xsource:3")
.settings(libraryDependencies ++= Deps.docs.value)
.settings(
name := "bitcoin-s-docs",
moduleName := name.value,
//removes scalajs projects from unidoc, see
//https://github.com/bitcoin-s/bitcoin-s/issues/2740
ScalaUnidoc / unidoc / unidocProjectFilter := {
inAnyProject -- inProjects(jsProjects: _*)
},
ScalaUnidoc / unidoc / target := (LocalRootProject / baseDirectory).value / "website" / "static" / "api",
cleanFiles += (ScalaUnidoc / unidoc / target).value,
docusaurusCreateSite := docusaurusCreateSite
.dependsOn(Compile / unidoc)
.value,
docusaurusPublishGhpages := docusaurusPublishGhpages
.dependsOn(Compile / unidoc)
.value
)
.enablePlugins(MdocPlugin,
DocusaurusPlugin,
ScalaUnidocPlugin,
BuildInfoPlugin)
.dependsOn(
appCommons,
asyncUtilsJVM,
appServer,
bitcoindRpc,
chain,
cli,
cryptoJVM,
coreJVM,
dbCommons,
feeProvider,
dlcOracle,
eclairRpc,
keyManager,
node,
secp256k1jni,
testkitCoreJVM,
testkit,
wallet,
zmq
)
lazy val keyManager = project
.in(file("key-manager"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.dependsOn(coreJVM, appCommons)
lazy val keyManagerTest = project
.in(file("key-manager-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.settings(name := "bitcoin-s-keymanager-test",
2020-01-07 19:02:08 +01:00
libraryDependencies ++= Deps.keyManagerTest)
.dependsOn(keyManager, testkit)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
lazy val wallet = project
.in(file("wallet"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
.settings(
name := "bitcoin-s-wallet",
libraryDependencies ++= Deps.wallet(scalaVersion.value)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
)
.dependsOn(coreJVM, appCommons, dbCommons, keyManager, asyncUtilsJVM, feeProvider, tor)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
lazy val walletTest = project
.in(file("wallet-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
.settings(
name := "bitcoin-s-wallet-test",
libraryDependencies ++= Deps.walletTest
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
)
.dependsOn(coreJVM % testAndCompile, testkit, wallet)
Node (#490) * WIP: 2018 12 22 node project (#280) * Add files from old spv node project src compiling test files compiling ran scalafmt Fix serializer tests Get non networking test cases to work WIP: Debug peermessagehandler Update CRUD, remove all of the Actor craziness. Add DbManagement trait and unit test db WIP: Rewroking PeerMessageHandler, create Peer, DataMessageHandler, PeerHandler Reworking Client to handle all tcp messages and message alignment for bitcoin p2p messages * Wip: Node refactor * Create node test project, move all node tests into that project and move all generators for the node project into testkit * Rework ClientTest to use testkit, start minimizing akka usage, implement connect(),isConnected(), disconnect(), isDisconnected() in PeerMessageReceiver * Create Peer, PeerHandler, PeerMessageSender and PeerMessageReceiver * update readme about status of node project (#359) * Add flyway plugin to manage database schemas (#361) * Add flyway plugin to manage database schemas * Switch database driver to sqlite3 to be more portable, rework configs for sqlite3 * Set up sqlite database directories and files if they are not already created * Add torkel's review * Add chain, wallet, db-commons projects (#367) * Add chain, wallet, db-commons projects * Rework db creation logic if they db does not exist * Add config logging to try to debug travis ci * Pass explicit class loader for db config * Remove duplicate call to dbConfig * Make DbConfig.dbConfig a lazy val * Remove noisy log * Add scaladoc to DbConfig * Switch dbConfig readme paragraphs * Fix compile issues introduced during rebase onto master with rpc changes (#394) * WIP: 2019 03 12 tip validation (#378) * Implement blockchain handling data structures Add TipValidation happy path Add more test cases for TipValidation.checkNewTip for badPrevBlockHash and badPOW Add overflow check, fix endianness bug for checking proof of work Add pow transition check, refactor difficultyChangeInterval into chain params, add more tests fix a few nits Fix compile error, clean up unused import Remove redundant files from node project * Implement GetNextWorkRequrired/CalculateNextWorkRequired, move BlockHeaderDAOTest cases into chain project * Add full POW change check in TipValidation, address code review nits * Configure logging in chainTest, turn logging OFF in other test projects * Address code review pt2 * Add coverage minimum for chain project (#398) * Add coverage minimum for chain project * Add first Blockchain.connectTip() unit test, switch to a in memory sqlite database for unit tests, starting using fixtures for BlockHeaderDAO in unit tests * Add tests for ChainHandler.processNewHeader(), ChainHandler.getHeader(), Blockchain.connectTip(). Refactor redundant configurations being passed around excessivly * Address code review, fix a flaky test in ClientTest.scala * Test Fixtures (#403) * Working test fixtures * Removed ChainTestFixture trait in main code * Composing Fixtures (#413) * Downloaded over 9000 mainnet BlockHeaders into a json file * Added new fixture with populated blockHeaderDAO * Split writing to db into batches * Rebased * Simplified fixtures with makeFixture abstraction * Added util functions for composing builders * Add integration test between bitcoind <-> zmq <-> bitcoin-s-chain project. Test that we can relay a header from bitcoind over zmq into the bitcoin-s chain project. Redo ZmqConfig to use InetSocketAddress * Address code review * wip * A compiling withBitcoindZmqChainHandler fixture * Tests passing! * Made blockHeaderDAO private * Got 9000 new block headers from 562375 to 571375 * Added offset to populated blockHeaderDAO fixture * Added scaladocs to fixture things * Initial wallet: import UTXO and spend it (#391) * Updates ExtKeyVersion with fromChainParams method * Add equals to Address * Update BIP44 classes * Add ScriptType * Initial work on wallet support * Add foreign keys pragma for SQLite * Add UTXO models and DAO * Add addres P2WPKH generation and WIP for addUTXO * Add logging config for wallet * Add change address generation, proper-ish addUtxo and sendToAddress * Address code review on #391 * Add empty AES passphrase invariant * Add poor mans test fixtures * Add listUtxos, listAddresses and getBalance to wallet API * Use fixtures from chain project * Fix CI test failures * Fix broken up package path * Updates bloop config for new projects (#424) * Multi fixture file (#419) * Created FixtureTag and ChainFixture Used ChainFixture in BitcoinPowTest Added implicit conversions for nice syntactic sugar * Added documentation for multi-fixture * Made defaultTag a val * add a logback-test.xml to the wallet project (#433) * Introduce AppConfig that combines ChainParams and DbConfig (#432) * 2019 04 23 app config per project db config per project (#434) * Add DB conf file resolution that works across projects * Create applicatoin configurations for specific projects, rework DbConfig structures for individual projects. Force network to be mixed into DbConfig rather than DbConfig to be mixed into the network * Add ammonite to db-commons, remove noisy logs * remove mixin for DbConfig that required a NetworkDb. Now networkDb is just a field on 'DbConfig', this simplifies things downstream type wise when interacting with the projects AppConfig. This commit also removes a parameter from AppConfig, now only a DbConfig needs to be passed in, and we can derive the network and chain params from the DbConfig. The only exemption is UnitTestDbConfig as it is sometimes handy to specify a different network (i.e. mainnet) when testing * Turn DbConfig objects to case objects, wrap those case objects in their parent type companion object * remove cast in Wallet.scala * Add EnhancedEither class for 2.11 compat (#437) Add implicit conversion from Either to 2.11-compatible Either-wrapper. Also remove trailing comma in WalletTestUtil that breaks 2.11 build. * Fix CI tests hanging (#438) * Execute wallet tests sequentially to avoid SQLite deadlocks * Refactor logback config to reduce duplication * Use in-memory SQLite DB for unit tests * Debug prints for DatabaseConfig.forConfig * Fork JVMs in test to ensure proper in-memory DBs * Pass in Akka config to Eclair tests, avoid cluttering Akka log output * Don't fork JVM on node tests' * Move things out of ChainUnitTest (#448) * Move things out of ChainUnitTest * Remove printlns * 2019 04 29 client test (#449) * Bump timeout on connect to node test * Change from isConnected -> isInitialized to avoid the error trying to disconnect before we are fully initialized * Wrote tests for POW difficulty change calculation and header processing (#429) Fixed BitcoinPowTest Rebased onto AppConfig code Rewrote ChainHandler integration test Made chain handler test synchronous Fixed a couple test bugs Implmented a more efficient getAncestorByHeight Fixed ChainHandler integration test by using the correct starting conditions Responded to code review Responded to more code review Deleted redundant Pow test Made BlockHeaderDAO.getAncestorAtHeight use a List for its loop to improve performance * WIP: Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTes… (#450) * Create ChainSync, BitcoindChainHandlerViaRpc, add simple ChainSyncTest to sync one block from a external bitcoind instance via rpc * Add check for having the best block hash in our chain state already * Fix prev block hash to be empty hash if genesis block header * BlockchainBuilder (#439) * First commit for implementing a BlockchainBuilder * use Builder rather than ReusableBuilder to be compatible with scala 2.11.x * Decouple Blockchain & BlockHeaderDAO * Rebase onto node, incorporate changes in #429 * Add more comments * Reverse order of headers in builder * rebase onot node branch, refactor apis * DB: Add utility method for listing tables in a DB (#447) * Node rebase (#458) * Implement BIP32 path diffing * Rebase node onto newest HD changes in master * Fix 2.11 compile errors * 2019 05 01 wallet ammonite scripts pt2 (#452) * wip -- not finding testkit in doc worksheet Wip -- classdef not found for create-wallet.sc zmq bug Clean up some logs nest zmq start in bitcoindF update jeromq to 0.5.2-SNAPSHOT to get rid of annoying log to stdout Rebase onto node branch with new configs Successfully running ammonite script create-wallet.sc 2019 05 01 wallet ammonite scripts pt2 (#25) * Refactor Ammonite dep * Add basic error handling in AmmoniteBridge * Add very basic README for doc project Fix compile issues after rebasing onto master Add code to sync our wallet code with bitcoind after creating a tx * refactor ZMQSubscriber to _hopefully_ avoid hanging when we call context.term(). We do this by closing the socket before calling context.term() and using socket.setLinger() * Update doc/src/main/scala/org/bitcoins/doc/wallet/create-wallet.sc Co-Authored-By: Christewart <stewart.chris1234@gmail.com> * 2019 05 05 sync chain (#460) * Add code to sync our wallet code with bitcoind after creating a tx Add script to illustrate how the chain persisted and how to sync against a running bitcoind instance on regtest * fix bug relating to subtraction operator not being communative in Pow.getNextWorkRequired(). This kept us from being able to switch proof of work intervals correctly * rename script from persist-chain.sc -> sync-chain.sc * fix 2.11.x compile issues * Refactor chain, node, wallet config (#463) * Refactor chain, node, wallet config Get rid of NetworkDb, DbConfig Add proper structure to conf system, moving everything under the bitcoin-s root key. * Remove Scalacheck from node project * Add doc on configuration * Add override feature to AppConfig * Address code review in #463 * Throw if default data dir is used in tests, add Scaladoc to AppConfig * Add explanations for withOverrides, link to configuration.md from AppConfig * Fix compile error * Moves chain fixtures to testkit project (#475) reset node files * Store encrypted mnemonic to disk (#462) * Add WalletStorage object * Add encrypted mnemonic storage, locked wallet Add lock and unlock operations to wallet. Separate between locked and unlock wallet. * Handle non-existant seed file * Respond to code review from Chris * Use val instead of import * Add doc on how mnemonics are encrypted/stored * 2019 05 15 spv sync headers (#479) * Implement SpvNode skeleton, create NodeUnitTest and move it to the testkit * Implement test case to sync a header via spv into bitcoin-s * Fix compiler errors * Make node project Main runnable (#26) * Add logging configuration to node project * Make default config workable in non-test environments * Add more logging of config in BH DAO and AppConfig * Make Peer id optional * Make node Main.scala runnable * Implement Main.scala to sync with a locally running bitcoind instance. You can now run with 'bloop run node' and sync the node if you adjust the parameters inside of Main.scala. This also reworks the structure of 'AppConfig'. It turns the *AppConfig into a case class intead of case objects. This allows us to pass custom configs into those case classes * Address code review from torkel * Reintroduce withOverrides (#29) * Turn off chain validation logs * Make datadir a parameter to bitcoind config rather than having it implicitly written to the bitcoin.conf file. This was a difference that was occurring in the node branch which had a parameter for the datadir and master which was implicitly writing it to bitcoin.conf * Add ability to overrwrite conf file except in the case of overwriting the DEFAULT_DATADIR & DEFAULT_CONF * remove extra Bitcoind.stopServers in WalletIntegrationTest
2019-06-04 16:53:00 +02:00
lazy val dlcWallet = project
.in(file("dlc-wallet"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.settings(
name := "bitcoin-s-dlc-wallet",
libraryDependencies ++= Deps.dlcWallet
)
.dependsOn(wallet)
lazy val dlcWalletTest = project
.in(file("dlc-wallet-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.settings(
name := "bitcoin-s-dlc-wallet-test",
libraryDependencies ++= Deps.dlcWalletTest
)
.dependsOn(coreJVM % testAndCompile,
dlcWallet,
testkit,
testkitCoreJVM)
lazy val dlcNode = project
.in(file("dlc-node"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.prodSettings: _*)
.settings(
name := "bitcoin-s-dlc-node",
libraryDependencies ++= Deps.dlcNode
)
.dependsOn(coreJVM, tor, dbCommons)
lazy val dlcNodeTest = project
.in(file("dlc-node-test"))
.settings(scalacOptions += "-Xsource:3")
.settings(CommonSettings.testSettings: _*)
.settings(
name := "bitcoin-s-dlc-node-test",
libraryDependencies ++= Deps.dlcNodeTest
)
.dependsOn(coreJVM % testAndCompile, dlcNode, testkit)
lazy val dlcOracle = project
.in(file("dlc-oracle"))
.settings(CommonSettings.prodSettings: _*)
.settings(
name := "bitcoin-s-dlc-oracle",
libraryDependencies ++= Deps.dlcOracle
)
.dependsOn(coreJVM, keyManager, dbCommons)
lazy val dlcOracleTest = project
.in(file("dlc-oracle-test"))
.settings(CommonSettings.testSettings: _*)
.settings(
name := "bitcoin-s-dlc-oracle-test",
libraryDependencies ++= Deps.dlcOracleTest
)
.dependsOn(coreJVM % testAndCompile, dlcOracle, testkit)
lazy val scripts = project
.in(file("app/scripts"))
.settings(CommonSettings.settings: _*)
.settings(
name := "bitcoin-s-scripts",
publishArtifact := false //do not want to publish our scripts
)
.dependsOn(appServer)
.enablePlugins(JavaAppPackaging)