diff --git a/server/app/com/xsn/explorer/config/ExplorerConfig.scala b/server/app/com/xsn/explorer/config/ExplorerConfig.scala new file mode 100644 index 0000000..b985e95 --- /dev/null +++ b/server/app/com/xsn/explorer/config/ExplorerConfig.scala @@ -0,0 +1,21 @@ +package com.xsn.explorer.config + +import com.xsn.explorer.models.Blockhash +import javax.inject.Inject +import play.api.Configuration + +trait ExplorerConfig { + + def genesisBlock: Blockhash +} + +class PlayExplorerConfig @Inject() (config: Configuration) extends ExplorerConfig { + + override val genesisBlock: Blockhash = { + Blockhash + .from(config.get[String]("explorer.genesisBlock")) + .getOrElse(throw new RuntimeException("The given genesisBlock is incorrect")) + } + +} + diff --git a/server/app/com/xsn/explorer/modules/ConfigModule.scala b/server/app/com/xsn/explorer/modules/ConfigModule.scala index b5df3b4..f790b79 100644 --- a/server/app/com/xsn/explorer/modules/ConfigModule.scala +++ b/server/app/com/xsn/explorer/modules/ConfigModule.scala @@ -8,5 +8,6 @@ class ConfigModule extends AbstractModule { override def configure(): Unit = { bind(classOf[RPCConfig]).to(classOf[PlayRPCConfig]) bind(classOf[LedgerSynchronizerConfig]).to(classOf[LedgerSynchronizerPlayConfig]) + bind(classOf[ExplorerConfig]).to(classOf[PlayExplorerConfig]) } } diff --git a/server/conf/application.conf b/server/conf/application.conf index 038c2b7..e919960 100644 --- a/server/conf/application.conf +++ b/server/conf/application.conf @@ -102,3 +102,7 @@ externalService.dispatcher { fixed-pool-size = 50 } } + +explorer { + genesisBlock = "00000c822abdbb23e28f79a49d29b41429737c6c7e15df40d1b1f1b35907ae34" +}