diff --git a/build.sbt b/build.sbt index da0be35a64a..ca3d2db4778 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,12 @@ +import com.typesafe.config.ConfigFactory + organization := "org.consensusresearch" +val appConf = ConfigFactory.parseFile(new File("src/main/resources/waves.conf")).resolve().getConfig("app") + name := "waves" -version := "0.0.1" +version := appConf.getString("version") scalaVersion := "2.11.8" diff --git a/lock.sbt b/lock.sbt index c819ed180fe..343487e5443 100644 --- a/lock.sbt +++ b/lock.sbt @@ -38,11 +38,11 @@ dependencyOverrides in ThisBuild ++= Set( "io.spray" % "spray-routing_2.11" % "1.3.3", "io.spray" % "spray-util_2.11" % "1.3.3", "javax.ws.rs" % "jsr311-api" % "1.1.1", + "jline" % "jline" % "2.12.1", "joda-time" % "joda-time" % "2.8.1", "org.bitlet" % "weupnp" % "0.1.4", "org.consensusresearch" % "scorex-basics_2.11" % "1.2.3", "org.consensusresearch" % "scorex-consensus_2.11" % "1.2.3", - "org.consensusresearch" % "scorex-perma_2.11" % "1.2.3", "org.consensusresearch" % "scorex-transaction_2.11" % "1.2.3", "org.consensusresearch" % "scrypto_2.11" % "1.0.4", "org.joda" % "joda-convert" % "1.7", @@ -62,4 +62,4 @@ dependencyOverrides in ThisBuild ++= Set( "org.slf4j" % "slf4j-api" % "1.7.20", "org.whispersystems" % "curve25519-java" % "0.2.4" ) -// LIBRARY_DEPENDENCIES_HASH 111038646dc7c922ca4f2f8b646d0e96e0d35c99 +// LIBRARY_DEPENDENCIES_HASH 5b625a793a072e5a62d77b63dc92ab28046f14c9 diff --git a/project/build.properties b/project/build.properties index 176a863a562..59e7c05b62f 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.9 \ No newline at end of file +sbt.version=0.13.11 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index c36b1490ddb..5aea8d34a2c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,3 +5,5 @@ addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.13.0") addSbtPlugin("com.github.tkawachi" % "sbt-lock" % "0.2.3") addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.0.6") + +libraryDependencies += "com.typesafe" % "config" % "1.3.0" \ No newline at end of file diff --git a/settings-local2.json b/settings-local2.json index 110396253c1..2ccd5b5f992 100644 --- a/settings-local2.json +++ b/settings-local2.json @@ -24,4 +24,4 @@ "authDataStorage": "authDataStorage2.mapDB" }, "blockGenerationDelay": 1000 -} \ No newline at end of file +} diff --git a/settings.json b/settings.json index b2869373d96..f9809bfcfe9 100644 --- a/settings.json +++ b/settings.json @@ -5,18 +5,18 @@ "upnpGatewayTimeout": 7000, "upnpDiscoverTimeout": 3000, "port": 6868, - "maxConnections": 10, - "knownPeers":[] + "knownPeers": ["52.58.115.4:6868"], + "maxConnections": 10 }, - "walletDir": "/tmp/scorex/waves/wallet", + "walletDir": "C:/tmp/scorex/waves/wallet", "walletSeed": "FQgbSAm6swGbtqA3NE8PttijPhT4N3Ufh4bHFAkyVnQz", "walletPassword": "mycookies", - "dataDir": "/tmp/scorex/waves/data", + "dataDir": "C:/tmp/scorex/waves/data", "rpcPort": 6869, "rpcAllowed": [], "blockGenerationDelay": 1000, "cors": true, "maxRollback": 100, "history": "blockchain", - "offlineGeneration": true + "offlineGeneration": false } \ No newline at end of file diff --git a/src/main/resources/waves.conf b/src/main/resources/waves.conf index 7c054e9b759..4497cb77fc0 100644 --- a/src/main/resources/waves.conf +++ b/src/main/resources/waves.conf @@ -1,6 +1,6 @@ app { product = "Scorex" release = "Waves" - version = "1.2.2" + version = "0.1.1" consensusAlgo = "nxt" } \ No newline at end of file diff --git a/src/main/scala/scorex/waves/Application.scala b/src/main/scala/scorex/waves/Application.scala index bb8bdbb01c9..56177f36810 100644 --- a/src/main/scala/scorex/waves/Application.scala +++ b/src/main/scala/scorex/waves/Application.scala @@ -86,16 +86,18 @@ object Application extends App with ScorexLogging { log.debug("Waves has been started") application.run() - val wallet = application.wallet + if (application.wallet.privateKeyAccounts().isEmpty) application.wallet.generateNewAccounts(1) - if (wallet.privateKeyAccounts().isEmpty) { - wallet.generateNewAccounts(3) - log.info("Generated Accounts:\n" + wallet.privateKeyAccounts().toList.map(_.address).mkString("\n")) - } def testingScript(application: Application): Unit = { log.info("Going to execute testing scenario") log.info("Current state is:" + application.blockStorage.state) + val wallet = application.wallet + + if (wallet.privateKeyAccounts().isEmpty) { + wallet.generateNewAccounts(3) + log.info("Generated Accounts:\n" + wallet.privateKeyAccounts().toList.map(_.address).mkString("\n")) + } log.info("Executing testing scenario with accounts" + s"(${wallet.privateKeyAccounts().size}) : " @@ -118,7 +120,7 @@ object Application extends App with ScorexLogging { val pkAccs = wallet.privateKeyAccounts().ensuring(_.nonEmpty) val senderAcc = pkAccs(Random.nextInt(pkAccs.size)) val senderBalance = application.blockStorage.state.asInstanceOf[BalanceSheet].generationBalance(senderAcc) - val recipientAcc = recipient.getOrElse(genesisAccs(Random.nextInt(genesisAccs.size))) + val recipientAcc = recipient.getOrElse(pkAccs(Random.nextInt(pkAccs.size))) val fee = Random.nextInt(5).toLong + 1 if (senderBalance - fee > 0) { val amt = amtOpt.getOrElse(Math.abs(Random.nextLong() % (senderBalance - fee)))