var runNodeCmd = &cobra.Command{
Use: "node",
- Short: "Run the p2p node",
+ Short: "Run the bytomd",
RunE: runNode,
}
runNodeCmd.Flags().String("p2p.laddr", config.P2P.ListenAddress, "Node listen address. (0.0.0.0:0 means any interface, any port)")
runNodeCmd.Flags().String("p2p.seeds", config.P2P.Seeds, "Comma delimited host:port seed nodes")
runNodeCmd.Flags().Bool("p2p.skip_upnp", config.P2P.SkipUPNP, "Skip UPNP configuration")
- runNodeCmd.Flags().Bool("p2p.pex", config.P2P.PexReactor, "Enable Peer-Exchange (dev feature)")
+ runNodeCmd.Flags().Bool("p2p.pex", config.P2P.PexReactor, "Enable Peer-Exchange ")
+ runNodeCmd.Flags().Bool("wallet.enable", config.Wallet.Enable, "Enable wallet")
RootCmd.AddCommand(runNodeCmd)
}
"fmt"
"path/filepath"
"time"
- //"github.com/bytom/types"
)
type Config struct {
// Options for services
RPC *RPCConfig `mapstructure:"rpc"`
P2P *P2PConfig `mapstructure:"p2p"`
+ Wallet *WalletConfig `mapstructure:"wallet"`
}
func DefaultConfig() *Config {
BaseConfig: DefaultBaseConfig(),
RPC: DefaultRPCConfig(),
P2P: DefaultP2PConfig(),
+ Wallet: DefaultWalletConfig(),
}
}
BaseConfig: TestBaseConfig(),
RPC: TestRPCConfig(),
P2P: TestP2PConfig(),
+ Wallet: TestWalletConfig(),
}
}
}
//-----------------------------------------------------------------------------
+// WalletConfig
+
+type WalletConfig struct {
+ Enable bool `mapstructure:"enable"`
+}
+
+func DefaultWalletConfig() *WalletConfig {
+ return &WalletConfig{
+ Enable: false,
+ }
+}
+
+func TestWalletConfig() *WalletConfig {
+ conf := DefaultWalletConfig()
+ return conf
+}
+
+//-----------------------------------------------------------------------------
// Utils
// helper function to make config creation independent of root dir