configure.go raw
1 package podconfig
2
3 // // Configure loads and sanitises the configuration from urfave/cli
4 // func Configure(cx *pod.State, initial bool) {
5 // commandName := cx.Config.RunningCommand.Name
6 // D.Ln("running Configure", commandName, "DATADIR", cx.Config.DataDir.V())
7 // // initListeners(cx, commandName, initial)
8 // if ((cx.Config.Network.V())[0] == 'r') && cx.Config.AddPeers.Len() > 0 {
9 // cx.Config.AddPeers.Set(nil)
10 // }
11 // // normalizeAddresses(cx.Config)
12 // // configListener(cx.Config, cx.ActiveNet)
13 // // configRPC(cx.Config, cx.ActiveNet)
14 // // validatePolicies(cx.Config, cx.StateCfg)
15 // // validateOnions(cx.Config)
16 // // setDiallers(cx.Config, cx.StateCfg)
17 // if cx.StateCfg.Save || !apputil.FileExists(cx.Config.ConfigFile.V()) {
18 // cx.StateCfg.Save = false
19 // if commandName == "kopach" {
20 // return
21 // }
22 // D.Ln("saving configuration")
23 // var e error
24 // if e = cx.Config.WriteToFile(cx.Config.ConfigFile.V()); E.Chk(e) {
25 // }
26 // }
27 // if cx.ActiveNet.Name == chaincfg.TestNet3Params.Name {
28 // fork.IsTestnet = true
29 // }
30 // // initLogLevel(cx.Config)
31 // // spv.DisableDNSSeed = cx.Config.DisableDNSSeed.True()
32 // // initDictionary(cx.Config)
33 // // initParams(cx)
34 // // initDataDir(cx.Config)
35 // // initTLSStuffs(cx.Config, cx.StateCfg)
36 // // initConfigFile(cx.Config)
37 // // initLogDir(cx.Config)
38 // // initWalletFile(cx)
39 // // Don't add peers from the config file when in regression test mode.
40 // // setRelayReject(cx.Config)
41 // // validateDBtype(cx.Config)
42 // // validateProfilePort(cx.Config)
43 // // validateBanDuration(cx.Config)
44 // // validateWhitelists(cx.Config, cx.StateCfg)
45 // // validatePeerLists(cx.Config)
46 // // validateUsers(cx.Config)
47 // // validateMiningStuff(cx.Config, cx.StateCfg, cx.ActiveNet)
48 // // if the user set the save flag, or file doesn't exist save the file now
49 // }
50