bitcoin-s/build.sbt
Chris Stewart 839d520206
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 09:53:00 -05:00

504 lines
No EOL
13 KiB
Scala

import sbt.Credentials
import sbt.Keys.publishTo
import com.typesafe.sbt.SbtGit.GitKeys._
import scala.util.Properties
cancelable in Global := true
//don't allow us to wipe all of our prod databases
flywayClean / aggregate := false
//allow us to wipe our test databases
Test / flywayClean / aggregate := true
lazy val timestamp = new java.util.Date().getTime
lazy val commonCompilerOpts = {
List(
"-Xmax-classfile-name",
"128"
)
}
//https://docs.scala-lang.org/overviews/compiler-options/index.html
lazy val compilerOpts = Seq(
"-target:jvm-1.8",
"-encoding",
"UTF-8",
"-unchecked",
"-feature",
"-deprecation",
"-Xfuture",
"-Ywarn-dead-code",
"-Ywarn-unused-import",
"-Ywarn-value-discard",
"-Ywarn-unused",
"-unchecked",
"-deprecation",
"-feature"
) ++ commonCompilerOpts
lazy val testCompilerOpts = commonCompilerOpts
lazy val commonSettings = List(
organization := "org.bitcoin-s",
homepage := Some(url("https://bitcoin-s.org")),
developers := List(
Developer(
"christewart",
"Chris Stewart",
"stewart.chris1234@gmail.com",
url("https://twitter.com/Chris_Stewart_5")
)
),
scalacOptions in Compile := compilerOpts,
scalacOptions in Test := testCompilerOpts,
//show full stack trace of failed tests
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oF"),
//show duration of tests
testOptions in Test += Tests.Argument(TestFrameworks.ScalaTest, "-oD"),
assemblyOption in assembly := (assemblyOption in assembly).value
.copy(includeScala = false),
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
/**
* Adding Ammonite REPL to test scope, can access both test and compile
* sources. Docs: http://ammonite.io/#Ammonite-REPL
* Creates an ad-hoc main file that can be run by doing
* test:run (or test:runMain amm if there's multiple main files
* in scope)
*/
Test / sourceGenerators += Def.task {
val file = (Test / sourceManaged).value / "amm.scala"
IO.write(file, """object amm extends App { ammonite.Main.main(args) }""")
Seq(file)
}.taskValue,
// Travis has performance issues on macOS
Test / parallelExecution := !(Properties.isMac && sys.props
.get("CI")
.isDefined)
)
lazy val commonTestSettings = Seq(
publish / skip := true,
) ++ commonSettings
lazy val commonTestWithDbSettings = Seq(
// To make in-memory DBs work properly
Test / fork := true,
// To avoid deadlock issues with SQLite
Test / parallelExecution := false
) ++ commonTestSettings
lazy val commonProdSettings = Seq(
Test / bloopGenerate := None
) ++ commonSettings
lazy val bitcoins = project
.in(file("."))
.aggregate(
secp256k1jni,
chain,
chainTest,
core,
coreTest,
bitcoindRpc,
bitcoindRpcTest,
bench,
eclairRpc,
eclairRpcTest,
node,
nodeTest,
wallet,
walletTest,
testkit,
scripts,
zmq
)
.settings(commonSettings: _*)
.settings(crossScalaVersions := Nil)
.settings(libraryDependencies ++= Deps.root)
.enablePlugins(ScalaUnidocPlugin, GitVersioning)
.settings(
// scaladoc settings
// TODO this is not working properly
inTask(unidoc)(
scalacOptions in Compile ++= List(
"-doc-title",
"Bitcoin-S",
"-doc-version",
version.value
)),
// we modify the unidoc task to move the generated Scaladocs into the
// website directory afterwards
Compile / unidoc := {
import java.nio.file._
import scala.collection.JavaConverters._
val logger = streams.value.log
def cleanPath(path: Path, isRoot: Boolean = true): Unit = {
if (Files.isDirectory(path)) {
path.toFile.list().map { file =>
val toClean = path.resolve(file)
cleanPath(toClean, isRoot = false)
}
if (isRoot) ()
else Files.deleteIfExists(path)
} else if (isRoot) {
()
} else if (path.toString.endsWith(".gitkeep")) {
()
} else {
Files.deleteIfExists(path)
}
}
val websiteScaladocDir =
Paths.get("website", "static", "api").toAbsolutePath
logger.info(s"Cleaning website Scaladoc directory $websiteScaladocDir")
cleanPath(websiteScaladocDir)
// returned value is a list of files,
// list has one element
val generatedDir = (Compile / unidoc).value.head
logger.info(s"Moving files in $generatedDir to $websiteScaladocDir")
try {
Files
.walk(generatedDir.toPath)
.iterator()
.asScala
.drop(1) // skip the root directory
.foreach { child =>
val pathDiff = generatedDir.toPath.relativize(child)
Files.copy(child,
websiteScaladocDir.resolve(pathDiff),
StandardCopyOption.REPLACE_EXISTING)
}
} catch {
case e: Throwable =>
logger.err(
"Error when copying Scaladocs to website folder: ${e.toString}")
throw e
}
Seq(generatedDir)
}
)
.settings(
name := "bitcoin-s",
gitRemoteRepo := "git@github.com:bitcoin-s/bitcoin-s-core.git"
)
lazy val secp256k1jni = project
.in(file("secp256k1jni"))
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Deps.secp256k1jni,
unmanagedResourceDirectories in Compile += 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
)
.enablePlugins(GitVersioning)
lazy val core = project
.in(file("core"))
.settings(commonProdSettings: _*)
.dependsOn(
secp256k1jni
)
.enablePlugins(GitVersioning)
lazy val coreTest = project
.in(file("core-test"))
.settings(commonTestSettings: _*)
.settings(
name := "bitcoin-s-core-test"
)
.dependsOn(
core,
testkit
)
.enablePlugins()
lazy val chainDbSettings = dbFlywaySettings("chaindb")
lazy val chain = project
.in(file("chain"))
.settings(commonProdSettings: _*)
.settings(chainDbSettings: _*)
.settings(
name := "bitcoin-s-chain",
libraryDependencies ++= Deps.chain
).dependsOn(core, dbCommons)
.enablePlugins(FlywayPlugin)
lazy val chainTest = project
.in(file("chain-test"))
.settings(commonTestWithDbSettings: _*)
.settings(chainDbSettings: _*)
.settings(
name := "bitcoin-s-chain-test",
libraryDependencies ++= Deps.chainTest,
).dependsOn(chain, core, testkit, zmq)
.enablePlugins(FlywayPlugin)
lazy val dbCommons = project
.in(file("db-commons"))
.settings(commonSettings: _*)
.settings(
name := "bitcoin-s-db-commons",
libraryDependencies ++= Deps.dbCommons
).dependsOn(core)
.enablePlugins()
lazy val zmq = project
.in(file("zmq"))
.settings(commonSettings: _*)
.settings(name := "bitcoin-s-zmq", libraryDependencies ++= Deps.bitcoindZmq)
.dependsOn(
core
).enablePlugins(GitVersioning)
lazy val bitcoindRpc = project
.in(file("bitcoind-rpc"))
.settings(commonProdSettings: _*)
.settings(name := "bitcoin-s-bitcoind-rpc",
libraryDependencies ++= Deps.bitcoindRpc)
.dependsOn(core)
.enablePlugins(GitVersioning)
lazy val bitcoindRpcTest = project
.in(file("bitcoind-rpc-test"))
.settings(commonTestSettings: _*)
.settings(libraryDependencies ++= Deps.bitcoindRpcTest,
name := "bitcoin-s-bitcoind-rpc-test")
.dependsOn(testkit)
.enablePlugins()
lazy val bench = project
.in(file("bench"))
.settings(commonSettings: _*)
.settings(assemblyOption in assembly := (assemblyOption in assembly).value
.copy(includeScala = true))
.settings(
libraryDependencies ++= Deps.bench,
name := "bitcoin-s-bench",
skip in publish := true
)
.dependsOn(core)
.enablePlugins(GitVersioning)
lazy val eclairRpc = project
.in(file("eclair-rpc"))
.settings(commonProdSettings: _*)
.settings(name := "bitcoin-s-eclair-rpc",
libraryDependencies ++= Deps.eclairRpc)
.dependsOn(
core,
bitcoindRpc
)
.enablePlugins(GitVersioning)
lazy val eclairRpcTest = project
.in(file("eclair-rpc-test"))
.settings(commonTestSettings: _*)
.settings(libraryDependencies ++= Deps.eclairRpcTest,
name := "bitcoin-s-eclair-rpc-test")
.dependsOn(testkit)
.enablePlugins()
lazy val nodeDbSettings = dbFlywaySettings("nodedb")
lazy val node = {
project
.in(file("node"))
.settings(commonSettings: _*)
.settings(nodeDbSettings: _*)
.settings(
name := "bitcoin-s-node",
libraryDependencies ++= Deps.node
)
.dependsOn(
core,
chain,
dbCommons,
bitcoindRpc
).enablePlugins(FlywayPlugin)
}
lazy val nodeTest = {
project
.in(file("node-test"))
.settings(commonTestWithDbSettings: _*)
.settings(nodeDbSettings: _*)
.settings(
name := "bitcoin-s-node-test",
// There's a weird issue with forking
// 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:
// https://github.com/scalatest/scalatest/issues/556
Test / fork := false,
libraryDependencies ++= Deps.nodeTest
).dependsOn(
node,
testkit
).enablePlugins(FlywayPlugin)
}
lazy val testkit = project
.in(file("testkit"))
.settings(commonProdSettings: _*)
.dependsOn(
core,
chain,
bitcoindRpc,
eclairRpc,
node,
wallet,
zmq
)
.enablePlugins(GitVersioning)
lazy val publishWebsite = taskKey[Unit]("Publish website")
lazy val docs = project
.in(file("bitcoin-s-docs")) // important: it must not be docs/
.settings(commonTestSettings: _*)
.settings(
// come back to visit this setting later
mdocExtraArguments := List("--no-link-hygiene"),
name := "bitcoin-s-docs",
mdocVariables := Map(
"STABLE_VERSION" -> previousStableVersion.value.get,
"UNSTABLE_VERSION" -> version.value
),
publishWebsite := Def
.sequential(
bitcoins / Compile / unidoc,
Compile / docusaurusPublishGhpages
)
.value
)
.dependsOn(
bitcoindRpc,
core,
eclairRpc,
secp256k1jni,
testkit,
zmq
)
.enablePlugins(MdocPlugin, DocusaurusPlugin)
lazy val walletDbSettings = dbFlywaySettings("walletdb")
lazy val wallet = project
.in(file("wallet"))
.settings(commonProdSettings: _*)
.settings(walletDbSettings: _*)
.settings(
name := "bitcoin-s-wallet",
libraryDependencies ++= Deps.wallet
)
.dependsOn(core, dbCommons)
.enablePlugins(FlywayPlugin)
lazy val walletTest = project
.in(file("wallet-test"))
.settings(commonTestWithDbSettings: _*)
.settings(walletDbSettings: _*)
.settings(
name := "bitcoin-s-wallet-test",
libraryDependencies ++= Deps.walletTest,
)
.dependsOn(core, testkit, wallet)
.enablePlugins(FlywayPlugin)
lazy val scripts = project
.in(file("scripts"))
.dependsOn(core, bitcoindRpc, eclairRpc, zmq)
.settings(commonTestSettings: _*)
.settings(
name := "bitcoin-s-scripts",
libraryDependencies ++= Deps.scripts
)
.dependsOn(
bitcoindRpc,
chain,
core,
eclairRpc,
node,
secp256k1jni,
testkit,
wallet,
zmq
)
// Ammonite is invoked through running
// a main class it places in test sources
// for us. This makes it a bit less awkward
// to start the Ammonite shell. Sadly,
// prepending the project and then doing
// `amm` (e.g. sbt coreTest/amm`) does not
// work. For that you either have to do
// `sbt coreTest/test:run` or:
// sbt
// project coreTest
// amm
addCommandAlias("amm", "test:run")
publishArtifact in bitcoins := false
def dbFlywaySettings(dbName: String): List[Setting[_]] = {
lazy val DB_HOST = "localhost"
lazy val DB_NAME = s"${dbName}.sqlite"
lazy val network = "unittest" //mainnet, testnet3, regtest, unittest
lazy val mainnetDir = s"${System.getenv("HOME")}/.bitcoin-s/mainnet/"
lazy val testnetDir = s"${System.getenv("HOME")}/.bitcoin-s/testnet3/"
lazy val regtestDir = s"${System.getenv("HOME")}/.bitcoin-s/regtest/"
lazy val unittestDir = s"${System.getenv("HOME")}/.bitcoin-s/unittest/"
lazy val dirs = List(mainnetDir,testnetDir,regtestDir,unittestDir)
//create directies if they DNE
dirs.foreach { d =>
val file = new File(d)
file.mkdirs()
val db = new File(d + DB_NAME)
db.createNewFile()
}
def makeNetworkSettings(directoryPath: String): List[Setting[_]] = List(
Test / flywayUrl := s"jdbc:sqlite:$directoryPath$DB_NAME",
Test / flywayLocations := List("nodedb/migration"),
Test / flywayUser := "nodedb",
Test / flywayPassword := "",
flywayUrl := s"jdbc:sqlite:$directoryPath$DB_NAME",
flywayUser := "nodedb",
flywayPassword := ""
)
lazy val mainnet = makeNetworkSettings(mainnetDir)
lazy val testnet3 = makeNetworkSettings(testnetDir)
lazy val regtest = makeNetworkSettings(regtestDir)
lazy val unittest = makeNetworkSettings(unittestDir)
network match {
case "mainnet" => mainnet
case "testnet3" => testnet3
case "regtest" => regtest
case "unittest" => unittest
case unknown: String => throw new IllegalArgumentException(s"Unknown network=${unknown}")
}
}
publishArtifact in bitcoins := false