support custom chain config (#36)

* support custom chain config

* move loading config logic to a separate helper function
This commit was merged in pull request #36.
This commit is contained in:
Ramil Amerzyanov
2021-03-10 19:18:32 +03:00
committed by GitHub
parent 33bb152c04
commit d3f30b621b
3 changed files with 36 additions and 1 deletions
+2
View File
@@ -137,6 +137,7 @@ func init() {
serveCmd.PersistentFlags().String("eth-chain-id", "1", "eth chain id")
serveCmd.PersistentFlags().String("eth-default-sender", "", "default sender address")
serveCmd.PersistentFlags().String("eth-rpc-gas-cap", "", "rpc gas cap (for eth_Call execution)")
serveCmd.PersistentFlags().String("eth-chain-config", "", "json chain config file location")
// and their bindings
viper.BindPFlag("server.graphql", serveCmd.PersistentFlags().Lookup("server-graphql"))
@@ -153,4 +154,5 @@ func init() {
viper.BindPFlag("ethereum.chainID", serveCmd.PersistentFlags().Lookup("eth-chain-id"))
viper.BindPFlag("ethereum.defaultSender", serveCmd.PersistentFlags().Lookup("eth-default-sender"))
viper.BindPFlag("ethereum.rpcGasCap", serveCmd.PersistentFlags().Lookup("eth-rpc-gas-cap"))
viper.BindPFlag("ethereum.chainConfig", serveCmd.PersistentFlags().Lookup("eth-chain-config"))
}