Documentation ¶
Index ¶
- Variables
- func Example()
- func InitWallet(config *BtcwalletConfig) (*wallet.Wallet, error)
- func InitWalletWithConfig(config *BtcwalletConfig) (*wallet.Wallet, error)
- func SafeInitWallet(config *BtcwalletConfig) (*wallet.Wallet, error)
- func SafeInitWalletWithConfig(config *BtcwalletConfig) (*wallet.Wallet, error)
- type BtcwalletConfig
- type Config
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ExampleLog = backendLog.Logger("EXMPL")
)
Loggers per subsystem. A single backend logger is created and all subsytem loggers created from it will write to the backend. When adding new subsystems, add the subsystem logger variable here and to the subsystemLoggers map.
Loggers can not be used before the log rotator has been initialized with a log file. This must be performed early during application startup by calling initLogRotator.
Functions ¶
func InitWallet ¶
func InitWallet(config *BtcwalletConfig) (*wallet.Wallet, error)
InitWallet Load configuration and parse command line. This function also initializes logging and configures it accordingly.
func InitWalletWithConfig ¶ added in v0.0.6
func InitWalletWithConfig(config *BtcwalletConfig) (*wallet.Wallet, error)
InitWalletWithConfig creates a new instance of the wallet with provided config
func SafeInitWallet ¶ added in v0.0.7
func SafeInitWallet(config *BtcwalletConfig) (*wallet.Wallet, error)
func SafeInitWalletWithConfig ¶ added in v0.0.7
func SafeInitWalletWithConfig(config *BtcwalletConfig) (*wallet.Wallet, error)
Types ¶
type BtcwalletConfig ¶ added in v0.0.9
type BtcwalletConfig struct { Signer frost.Signer Pk1, Pk2 *btcec.PublicKey BitcoindConfig *chain.BitcoindConfig Config *Config InitTimeout time.Duration FeeCoefficient float64 }
func NewBtcwalletConfig ¶ added in v0.0.9
func NewBtcwalletConfig(signer frost.Signer, pk1, pk2 *btcec.PublicKey, bitcoindConfig *chain.BitcoindConfig, config *Config, initTimeout time.Duration, feeCoefficient float64) *BtcwalletConfig
type Config ¶ added in v0.0.6
type Config struct { // General application behavior ConfigFile *cfgutil.ExplicitString `short:"C" long:"configfile" description:"Path to configuration file"` ShowVersion bool `short:"V" long:"version" description:"Display version information and exit"` Create bool `long:"create" description:"Create the wallet if it does not exist"` CreateTemp bool `` /* 142-byte string literal not displayed */ AppDataDir *cfgutil.ExplicitString `short:"A" long:"appdata" description:"Application data directory for wallet config, databases and logs"` Regtest bool `long:"regtest" description:"Use the test Bitcoin regtest network (default mainnet)"` TestNet3 bool `long:"testnet" description:"Use the test Bitcoin network (version 3) (default mainnet)"` TestNet4 bool `long:"testnet4" description:"Use the test Bitcoin network (version 4) (default mainnet)"` SimNet bool `long:"simnet" description:"Use the simulation test network (default mainnet)"` SigNet bool `long:"signet" description:"Use the signet test network (default mainnet)"` SigNetChallenge string `` /* 188-byte string literal not displayed */ SigNetSeedNode []string `` /* 140-byte string literal not displayed */ NoInitialLoad bool `long:"noinitialload" description:"Defer wallet creation/opening on startup and enable loading wallets over RPC"` DebugLevel string `short:"d" long:"debuglevel" description:"Logging level {trace, debug, info, warn, error, critical}"` LogDir string `long:"logdir" description:"Directory to log output."` Profile string `long:"profile" description:"Enable HTTP profiling on given port -- NOTE port must be between 1024 and 65536"` DBTimeout time.Duration `long:"dbtimeout" description:"The timeout value to use when opening the wallet database."` // Feature flags used for fallback to the original implementation CanConsolePrompt bool `` /* 138-byte string literal not displayed */ // Wallet options WalletPrivatePass string `long:"walletprivatepass" default-mask:"-" description:"The private wallet passphrase"` WalletPass string `` /* 129-byte string literal not displayed */ // RPC client options RPCConnect string `` /* 171-byte string literal not displayed */ CAFile *cfgutil.ExplicitString `long:"cafile" description:"File containing root certificates to authenticate a TLS connections with btcd"` DisableClientTLS bool `` /* 138-byte string literal not displayed */ BtcdUsername string `long:"btcdusername" description:"Username for btcd authentication"` BtcdPassword string `long:"btcdpassword" default-mask:"-" description:"Password for btcd authentication"` Proxy string `long:"proxy" description:"Connect via SOCKS5 proxy (eg. 127.0.0.1:9050)"` ProxyUser string `long:"proxyuser" description:"Username for proxy server"` ProxyPass string `long:"proxypass" default-mask:"-" description:"Password for proxy server"` // SPV client options UseSPV bool `long:"usespv" description:"Enables the experimental use of SPV rather than RPC for chain synchronization"` 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"` BanDuration time.Duration `long:"banduration" description:"How long to ban misbehaving peers. Valid time units are {s, m, h}. Minimum 1 second"` BanThreshold uint32 `long:"banthreshold" description:"Maximum allowed ban score before disconnecting and banning misbehaving peers."` // RPC server options // // The legacy server is still enabled by default (and eventually will be // replaced with the experimental server) so prepare for that change by // renaming the struct fields (but not the configuration options). // // Usernames can also be used for the consensus RPC client, so they // aren't considered legacy. RPCCert *cfgutil.ExplicitString `long:"rpccert" description:"File containing the certificate file"` RPCKey *cfgutil.ExplicitString `long:"rpckey" description:"File containing the certificate key"` OneTimeTLSKey bool `long:"onetimetlskey" description:"Generate a new TLS certpair at startup, but only write the certificate to disk"` DisableServerTLS bool `` /* 133-byte string literal not displayed */ LegacyRPCListeners []string `` /* 139-byte string literal not displayed */ LegacyRPCMaxClients int64 `long:"rpcmaxclients" description:"Max number of legacy RPC clients for standard connections"` LegacyRPCMaxWebsockets int64 `long:"rpcmaxwebsockets" description:"Max number of legacy RPC websocket connections"` Username string `short:"u" long:"username" description:"Username for legacy RPC and btcd authentication (if btcdusername is unset)"` Password string `` /* 131-byte string literal not displayed */ // EXPERIMENTAL RPC server options // // These options will change (and require changes to config files, etc.) // when the new gRPC server is enabled. ExperimentalRPCListeners []string `long:"experimentalrpclisten" description:"Listen for RPC connections on this interface/port"` // Deprecated options DataDir *cfgutil.ExplicitString `short:"b" long:"datadir" default-mask:"-" description:"DEPRECATED -- use appdata instead"` }
func DefaultConfig ¶ added in v0.0.6
func DefaultConfig() *Config
Click to show internal directories.
Click to hide internal directories.