Skip to content

Commit ca05ea1

Browse files
committed
Merge pull request #93 from gagarin55/devel
added rpcAddress for HTTP API binding in settings file
2 parents 2df871a + fb90687 commit ca05ea1

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

scorex-basics/src/main/scala/scorex/app/Application.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ trait Application extends ScorexLogging {
7777

7878
checkGenesis()
7979

80-
Http().bindAndHandle(combinedRoute, "0.0.0.0", settings.rpcPort)
80+
Http().bindAndHandle(combinedRoute, settings.rpcAddress, settings.rpcPort)
8181

8282
historySynchronizer ! Unit
8383
historyReplier ! Unit

scorex-basics/src/main/scala/scorex/settings/Settings.scala

+2
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ trait Settings extends ScorexLogging {
7979
//todo: localOnly & declaredAddress
8080

8181
lazy val rpcPort = (settingsJSON \ "rpcPort").asOpt[Int].getOrElse(DefaultRpcPort)
82+
lazy val rpcAddress = (settingsJSON \ "rpcAddress").asOpt[String].getOrElse(DefaultRpcAddress)
8283
lazy val rpcAllowed: Seq[String] = (settingsJSON \ "rpcAllowed").asOpt[List[String]].getOrElse(DefaultRpcAllowed.split(""))
8384

8485
lazy val offlineGeneration = (settingsJSON \ "offlineGeneration").asOpt[Boolean].getOrElse(false)
@@ -113,6 +114,7 @@ trait Settings extends ScorexLogging {
113114
lazy val corsAllowed = (settingsJSON \ "cors").asOpt[Boolean].getOrElse(false)
114115

115116
private val DefaultRpcPort = 9085
117+
private val DefaultRpcAddress = "0.0.0.0"
116118
private val DefaultRpcAllowed = "127.0.0.1"
117119

118120
private val DefaultBlockGenerationDelay: FiniteDuration = 1.second

0 commit comments

Comments
 (0)