Skip to content

Commit

Permalink
upgrade to scorex 1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gagarin55 committed Apr 18, 2016
1 parent 881a0c8 commit ebf1ba9
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 17 deletions.
6 changes: 5 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
4 changes: 2 additions & 2 deletions lock.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=0.13.9
sbt.version=0.13.11
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion settings-local2.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@
"authDataStorage": "authDataStorage2.mapDB"
},
"blockGenerationDelay": 1000
}
}
10 changes: 5 additions & 5 deletions settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
2 changes: 1 addition & 1 deletion src/main/resources/waves.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
app {
product = "Scorex"
release = "Waves"
version = "1.2.2"
version = "0.1.1"
consensusAlgo = "nxt"
}
14 changes: 8 additions & 6 deletions src/main/scala/scorex/waves/Application.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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}) : "
Expand All @@ -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)))
Expand Down

0 comments on commit ebf1ba9

Please sign in to comment.