diff --git a/src/main/resources/application.conf b/src/main/resources/application.conf index a4fc62e5d8..3e6a5cb29e 100644 --- a/src/main/resources/application.conf +++ b/src/main/resources/application.conf @@ -519,17 +519,6 @@ mantis { port = 13798 } - logging { - # Flag used to switch logs to the JSON format - json-output = false - - # Logs directory - logs-dir = ${mantis.datadir}"/logs" - - # Logs filename - logs-file = "mantis" - } - async { dispatchers { block-forger { @@ -596,3 +585,14 @@ validation-context { } throughput = 1 } + +logging { + # Flag used to switch logs to the JSON format + json-output = false + + # Logs directory + logs-dir = ${mantis.datadir}"/logs" + + # Logs filename + logs-file = "mantis" +} diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index a7f9cf5790..d919ff87ab 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -5,9 +5,9 @@ - - - + + + diff --git a/src/main/scala/io/iohk/ethereum/faucet/FaucetApi.scala b/src/main/scala/io/iohk/ethereum/faucet/FaucetApi.scala index 4cc1481dac..a9a5e0add8 100644 --- a/src/main/scala/io/iohk/ethereum/faucet/FaucetApi.scala +++ b/src/main/scala/io/iohk/ethereum/faucet/FaucetApi.scala @@ -17,18 +17,16 @@ import io.iohk.ethereum.rlp import io.iohk.ethereum.network.p2p.messages.CommonMessages.SignedTransactions.SignedTransactionEnc import org.bouncycastle.util.encoders.Hex -class FaucetApi( - rpcClient: RpcClient, - keyStore: KeyStore, - config: FaucetConfig, - clock: Clock = Clock.systemUTC()) - extends Logger { +class FaucetApi(rpcClient: RpcClient, keyStore: KeyStore, config: FaucetConfig, clock: Clock = Clock.systemUTC()) + extends Logger { private val latestRequestTimestamps = new LruMap[RemoteAddress, Long](config.latestTimestampCacheSize) private val wallet = keyStore.unlockAccount(config.walletAddress, config.walletPassword) match { case Right(w) => w - case Left(err) => throw new RuntimeException(s"Cannot unlock wallet for use in faucet (${config.walletAddress}), because of $err") + case Left(err) => + log.info("accounts " + keyStore.listAccounts().right.get.mkString(", ")) + throw new RuntimeException(s"Cannot unlock wallet for use in faucet (${config.walletAddress}), because of $err") } private val corsSettings = CorsSettings.defaultSettings @@ -67,13 +65,8 @@ class FaucetApi( } private def prepareTx(targetAddress: Address, nonce: BigInt): ByteString = { - val transaction = Transaction( - nonce, - config.txGasPrice, - config.txGasLimit, - Some(targetAddress), - config.txValue, - ByteString()) + val transaction = + Transaction(nonce, config.txGasPrice, config.txGasLimit, Some(targetAddress), config.txValue, ByteString()) val stx = wallet.signTx(transaction, None) ByteString(rlp.encode(stx.tx.toRLPEncodable)) diff --git a/src/universal/conf/faucet.conf b/src/universal/conf/faucet.conf index 5fce748c71..1101c1ce7d 100644 --- a/src/universal/conf/faucet.conf +++ b/src/universal/conf/faucet.conf @@ -1,4 +1,8 @@ faucet { + + # Base directory where all the data used by the fauced is stored + datadir = ${user.home}"/.mantis-faucet" + # Wallet address used to send transactions from wallet-address = "0x00" @@ -6,7 +10,7 @@ faucet { wallet-password = "" # Path to directory where wallet key is stored - keystore-dir = "~/.mantis-faucet-keystore" + keystore-dir = ${faucet.datadir}"/keystore" # Transaction gas price tx-gas-price = 20000000000 @@ -35,3 +39,14 @@ faucet { # How many ip addr -> timestamp entries to store latest-timestamp-cache-size = 1024 } + +logging { + # Flag used to switch logs to the JSON format + json-output = false + + # Logs directory + logs-dir = ${faucet.datadir}"/logs" + + # Logs filename + logs-file = "faucet" +} diff --git a/src/universal/conf/logging.conf b/src/universal/conf/logging.conf index b63b434bfc..b927e9cc43 100644 --- a/src/universal/conf/logging.conf +++ b/src/universal/conf/logging.conf @@ -1,12 +1,10 @@ -mantis { - logging { - # Flag used to switch logs to the JSON format - # json-output = false +logging { + # Flag used to switch logs to the JSON format + # json-output = false - # Logs directory - # logs-dir = ${mantis.datadir}"/logs" + # Logs directory + # logs-dir = ${mantis.datadir}"/logs" - # Logs filename - # logs-file = "mantis" - } + # Logs filename + # logs-file = "mantis" }