2015-12-26 07:11:39 +01:00
|
|
|
package lnwallet
|
2015-12-29 23:04:23 +01:00
|
|
|
|
|
|
|
import (
|
|
|
|
"path/filepath"
|
|
|
|
|
2016-05-15 16:17:44 +02:00
|
|
|
"github.com/roasbeef/btcd/chaincfg"
|
|
|
|
"github.com/roasbeef/btcutil"
|
2015-12-29 23:04:23 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
|
|
// TODO(roasbeef): lnwallet config file
|
|
|
|
lnwalletHomeDir = btcutil.AppDataDir("lnwallet", false)
|
|
|
|
defaultDataDir = lnwalletHomeDir
|
|
|
|
|
|
|
|
defaultLogFilename = "lnwallet.log"
|
|
|
|
defaultLogDirname = "logs"
|
|
|
|
defaultLogDir = filepath.Join(lnwalletHomeDir, defaultLogDirname)
|
|
|
|
|
|
|
|
btcdHomeDir = btcutil.AppDataDir("btcd", false)
|
|
|
|
btcdHomedirCAFile = filepath.Join(btcdHomeDir, "rpc.cert")
|
|
|
|
defaultRPCKeyFile = filepath.Join(lnwalletHomeDir, "rpc.key")
|
|
|
|
defaultRPCCertFile = filepath.Join(lnwalletHomeDir, "rpc.cert")
|
|
|
|
|
|
|
|
// defaultPubPassphrase is the default public wallet passphrase which is
|
|
|
|
// used when the user indicates they do not want additional protection
|
|
|
|
// provided by having all public data in the wallet encrypted by a
|
|
|
|
// passphrase only known to them.
|
|
|
|
defaultPubPassphrase = []byte("public")
|
|
|
|
|
|
|
|
walletDbName = "lnwallet.db"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Config...
|
|
|
|
type Config struct {
|
|
|
|
DataDir string
|
|
|
|
LogDir string
|
|
|
|
|
|
|
|
DebugLevel string
|
|
|
|
|
2016-05-15 16:17:44 +02:00
|
|
|
RpcHost string // localhost:18334
|
|
|
|
RpcUser string
|
|
|
|
RpcPass string
|
2016-02-23 03:24:56 +01:00
|
|
|
RpcNoTLS bool
|
2015-12-29 23:04:23 +01:00
|
|
|
|
|
|
|
RPCCert string
|
|
|
|
RPCKey string
|
|
|
|
|
|
|
|
CACert []byte
|
|
|
|
|
|
|
|
PrivatePass []byte
|
|
|
|
PublicPass []byte
|
|
|
|
HdSeed []byte
|
2016-02-03 04:09:54 +01:00
|
|
|
|
|
|
|
// Which bitcoin network are we using?
|
|
|
|
NetParams *chaincfg.Params
|
2015-12-29 23:04:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// setDefaults...
|
|
|
|
func setDefaults(confg *Config) {
|
|
|
|
}
|