forked from cerc-io/ipld-eth-server
Configure whether to dial secure connection to remote Nitro node
This commit is contained in:
@@ -57,6 +57,7 @@ func addNitroFlags(command *cobra.Command) {
|
||||
command.PersistentFlags().String("nitro-tls-key-filepath", "", "nitro tlsKeyFilepath")
|
||||
|
||||
command.PersistentFlags().String("nitro-endpoint", "", "nitro endpoint")
|
||||
command.PersistentFlags().Bool("nitro-is-secure", false, "nitro isSecure")
|
||||
|
||||
// nitro flag bindings
|
||||
viper.BindPFlag("nitro.runNodeInProcess", command.PersistentFlags().Lookup("nitro-run-node-in-process"))
|
||||
@@ -78,4 +79,5 @@ func addNitroFlags(command *cobra.Command) {
|
||||
viper.BindPFlag("nitro.inProcesssNode.tlsKeyFilepath", command.PersistentFlags().Lookup("nitro-tls-key-filepath"))
|
||||
|
||||
viper.BindPFlag("nitro.remoteNode.nitroEndpoint", command.PersistentFlags().Lookup("nitro-endpoint"))
|
||||
viper.BindPFlag("nitro.remoteNode.isSecure", command.PersistentFlags().Lookup("nitro-is-secure"))
|
||||
}
|
||||
|
||||
+1
-2
@@ -135,8 +135,7 @@ func serve() {
|
||||
} else {
|
||||
log.Info("Connecting to a remote Nitro node")
|
||||
|
||||
// TODO: Read from config file
|
||||
isSecure := false
|
||||
isSecure := nitroConfig.RemoteNode.IsSecure
|
||||
nitroRpcClient, err := nitroRpc.NewHttpRpcClient(nitroConfig.RemoteNode.NitroEndpoint, isSecure)
|
||||
if err != nil {
|
||||
logWithCommand.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user