adding rpc flags.
This commit is contained in:
@@ -11,10 +11,13 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
key string
|
||||
listeners []string
|
||||
seeds []string
|
||||
connectors []string
|
||||
key string
|
||||
listeners []string
|
||||
seeds []string
|
||||
connectors []string
|
||||
rpc_listeners []string
|
||||
rpc_key string
|
||||
rpc_whitelist []string
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -23,11 +26,17 @@ func init() {
|
||||
seedCmd.PersistentFlags().StringSliceVarP(&listeners, "listen", "l", []string{"/ip4/127.0.0.1/tcp/8337", "/ip6/::1/tcp/8337"}, "binds to an interface")
|
||||
seedCmd.PersistentFlags().StringSliceVarP(&seeds, "seed", "s", []string{}, "adds an additional seed connection (e.g /dns4/seed0.indra.org/tcp/8337/p2p/<pub_key>)")
|
||||
seedCmd.PersistentFlags().StringSliceVarP(&connectors, "connect", "c", []string{}, "connects only to the seed multi-addresses specified")
|
||||
seedCmd.PersistentFlags().StringSliceVarP(&rpc_listeners, "rpc-listen", "", []string{}, "binds rpc server to an interface (e.g /ip4/127.0.0.1/udp/<random_port>/quic)")
|
||||
seedCmd.PersistentFlags().StringVarP(&rpc_key, "rpc-key", "", "", "the base58 encoded pre-shared key for accessing the rpc")
|
||||
seedCmd.PersistentFlags().StringSliceVarP(&rpc_whitelist, "rpc-whitelist", "", []string{}, "adds a peer id to the whitelist for access")
|
||||
|
||||
viper.BindPFlag("key", seedCmd.PersistentFlags().Lookup("key"))
|
||||
viper.BindPFlag("listen", seedCmd.PersistentFlags().Lookup("listen"))
|
||||
viper.BindPFlag("seed", seedCmd.PersistentFlags().Lookup("seed"))
|
||||
viper.BindPFlag("connect", seedCmd.PersistentFlags().Lookup("connect"))
|
||||
viper.BindPFlag("rpc-listen", seedCmd.PersistentFlags().Lookup("rpc-listen"))
|
||||
viper.BindPFlag("rpc-key", seedCmd.PersistentFlags().Lookup("rpc-key"))
|
||||
viper.BindPFlag("rpc-whitelist", seedCmd.PersistentFlags().Lookup("rpc-whitelist"))
|
||||
|
||||
rootCmd.AddCommand(seedCmd)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user