added logging for configurations.
This commit is contained in:
@@ -2,7 +2,6 @@ package rpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
"github.com/spf13/viper"
|
||||
"google.golang.org/grpc"
|
||||
"os"
|
||||
@@ -59,12 +58,15 @@ func configureTunnel() {
|
||||
|
||||
log.I.Ln("enabling rpc tunnel")
|
||||
|
||||
configureTunnelKey()
|
||||
configureTunnelPort()
|
||||
|
||||
log.I.Ln("rpc tunnel listeners:")
|
||||
log.I.F("- [/ip4/0.0.0.0/udp/%d /ip6/:::/udp/%d]", viper.GetUint16(tunPortFlag), viper.GetUint16(tunPortFlag))
|
||||
|
||||
configureTunnelKey()
|
||||
|
||||
configurePeerWhitelist()
|
||||
|
||||
spew.Dump(viper.AllSettings())
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
func configureTunnelKey() {
|
||||
@@ -81,7 +83,7 @@ func configureTunnelKey() {
|
||||
tunKey = &RPCPrivateKey{}
|
||||
tunKey.Decode(viper.GetString(tunKeyFlag))
|
||||
|
||||
log.I.Ln("rpc public key:")
|
||||
log.I.Ln("rpc tunnel public key:")
|
||||
log.I.Ln("-", tunKey.PubKey().Encode())
|
||||
}
|
||||
|
||||
@@ -98,6 +100,12 @@ func configureTunnelPort() {
|
||||
|
||||
func configurePeerWhitelist() {
|
||||
|
||||
if len(viper.GetStringSlice(tunPeersFlag)) == 0 {
|
||||
return
|
||||
}
|
||||
|
||||
log.I.Ln("rpc tunnel whitelisted peers:")
|
||||
|
||||
for _, peer := range viper.GetStringSlice(tunPeersFlag) {
|
||||
|
||||
var pubKey RPCPublicKey
|
||||
@@ -105,5 +113,8 @@ func configurePeerWhitelist() {
|
||||
pubKey.Decode(peer)
|
||||
|
||||
tunWhitelist = append(tunWhitelist, pubKey)
|
||||
|
||||
log.I.Ln("-", pubKey.Encode())
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user