Skip to content

Commit 81daf1a

Browse files
author
Łukasz Gąsior
committed
Remove faucet config from mantis conf
1 parent 6d9c794 commit 81daf1a

File tree

5 files changed

+10
-46
lines changed

5 files changed

+10
-46
lines changed

src/main/resources/application.conf

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -547,45 +547,6 @@ mantis {
547547
port = 8888
548548
}
549549
}
550-
551-
faucet {
552-
# Wallet address used to send transactions from
553-
wallet-address = "0x00"
554-
555-
# Password to unlock faucet wallet
556-
wallet-password = ""
557-
558-
# Path to directory where wallet key is stored
559-
keystore-dir = "~/.mantis-faucet-keystore"
560-
561-
# Transaction gas price
562-
tx-gas-price = 20000000000
563-
564-
# Transaction gas limit
565-
tx-gas-limit = 90000
566-
567-
# Transaction value
568-
tx-value = 1000000000000000000
569-
570-
# Faucet listen interface
571-
listen-interface = "127.0.0.1"
572-
573-
# Faucet listen port
574-
listen-port = 8099
575-
576-
# Faucet cors config
577-
cors-allowed-origins = "*"
578-
579-
# Address of Ethereum node used to send the transaction
580-
rpc-address = "http://127.0.0.1:8546/"
581-
582-
# How often can a single IP address send a request
583-
min-request-interval = 1.minute
584-
585-
# How many ip addr -> timestamp entries to store
586-
latest-timestamp-cache-size = 1024
587-
}
588-
589550
}
590551

591552
akka {

src/main/scala/io/iohk/ethereum/faucet/Faucet.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,18 @@ import java.security.SecureRandom
55
import akka.actor.ActorSystem
66
import akka.http.scaladsl.Http
77
import akka.stream.ActorMaterializer
8+
import com.typesafe.config.ConfigFactory
89
import io.iohk.ethereum.keystore.KeyStoreImpl
910
import io.iohk.ethereum.mallet.service.RpcClient
10-
import io.iohk.ethereum.utils.{Config, Logger}
11-
import scala.concurrent.ExecutionContext.Implicits.global
11+
import io.iohk.ethereum.utils.Logger
1212

13+
import scala.concurrent.ExecutionContext.Implicits.global
1314
import scala.util.{Failure, Success}
1415

1516
object Faucet extends Logger {
1617

1718
def main(args: Array[String]): Unit = {
18-
val config = FaucetConfig(Config.config)
19+
val config = FaucetConfig(ConfigFactory.load())
1920

2021
val rpcClient = new RpcClient(config.rpcAddress)
2122
val keyStore = new KeyStoreImpl(config.keyStoreDir, new SecureRandom())

src/main/scala/io/iohk/ethereum/faucet/FaucetConfig.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ case class FaucetConfig(
2222
latestTimestampCacheSize: Int)
2323

2424
object FaucetConfig {
25-
def apply(mantisConfig: TypesafeConfig): FaucetConfig = {
26-
val faucetConfig = mantisConfig.getConfig("faucet")
25+
def apply(typesafeConfig: TypesafeConfig): FaucetConfig = {
26+
val faucetConfig = typesafeConfig.getConfig("faucet")
2727

2828
val corsAllowedOrigins = ConfigUtils.parseCorsAllowedOrigins(faucetConfig, "cors-allowed-origins")
2929

src/universal/bin/faucet-server

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
#!/bin/bash
22

3-
./bin/mantis-app -Dconfig.file=./conf/mantis.conf -Dlogback.configurationFile=./conf/logback.xml -J-Xss10M faucet "$@"
3+
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
cd $DIR/..
5+
./bin/mantis -Dconfig.file=./conf/faucet.conf -- faucet "$@"

src/universal/conf/faucet.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mantis.faucet {
1+
faucet {
22
# Wallet address used to send transactions from
33
wallet-address = "0x00"
44

0 commit comments

Comments
 (0)