From 629793a24982858bf3c9e6eebf4fef267054f75a Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Thu, 10 Aug 2017 21:26:48 -0700 Subject: [PATCH] config: add configuration options for autopilot mode --- config.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/config.go b/config.go index f34d15c7..e9f8aad8 100644 --- a/config.go +++ b/config.go @@ -51,7 +51,7 @@ var ( ) type chainConfig struct { - Active bool `long:"active" destination:"If the chain should be active or not."` + Active bool `long:"active" description:"If the chain should be active or not."` ChainDir string `long:"chaindir" description:"The directory to store the chains's data within."` RPCHost string `long:"rpchost" description:"The daemon's rpc listening address. If a port is omitted, then the default port for the selected chain parameters will be used."` @@ -66,7 +66,7 @@ type chainConfig struct { } type neutrinoConfig struct { - Active bool `long:"active" destination:"If SPV mode should be active or not."` + Active bool `long:"active" description:"If SPV mode should be active or not."` AddPeers []string `short:"a" long:"addpeer" description:"Add a peer to connect with at startup"` ConnectPeers []string `long:"connect" description:"Connect only to the specified peers at startup"` MaxPeers int `long:"maxpeers" description:"Max number of inbound and outbound peers"` @@ -74,6 +74,13 @@ type neutrinoConfig struct { BanThreshold uint32 `long:"banthreshold" description:"Maximum allowed ban score before disconnecting and banning misbehaving peers."` } +type autoPilotConfig struct { + // TODO(roasbeef): add + Active bool `long:"active" description:"If the autopilot agent should be active or not."` + MaxChannels int `long:"maxchannels" description:"The maximum number of channels that should be created"` + Allocation float64 `long:"allocation" description:"The percentage of total funds that should be committed to automatic channel establishment"` +} + // config defines the configuration options for lnd. // // See loadConfig for further details regarding the configuration @@ -106,6 +113,8 @@ type config struct { DefaultNumChanConfs int `long:"defaultchanconfs" description:"The default number of confirmations a channel must have before it's considered open."` NeutrinoMode *neutrinoConfig `group:"neutrino" namespace:"neutrino"` + + Autopilot *autoPilotConfig `group:"autopilot" namespace:"autopilot"` } // loadConfig initializes and parses the config using a config file and command @@ -137,6 +146,10 @@ func loadConfig() (*config, error) { RPCHost: defaultRPCHost, RPCCert: defaultLtcdRPCCertFile, }, + Autopilot: &autoPilotConfig{ + MaxChannels: 5, + Allocation: 0.6, + }, } // Pre-parse the command line options to pick up an alternative config