Documentation
¶
Index ¶
- Constants
- Variables
- func CreateSimulationWallet(activenet *netparams.Params, cfg *Config) error
- func CreateWallet(activenet *netparams.Params, config *pod.Config) error
- func Main(config *pod.Config, stateCfg *state.Config, activeNet *netparams.Params, ...) error
- func NetworkDir(dataDir string, chainParams *netparams.Params) string
- func ReadCAFile(config *pod.Config) []byte
- func Version() string
- type Config
Constants ¶
const ( DefaultAppDataDirname = "wallet" DefaultCAFilename = "wallet.cert" DefaultConfigFilename = "conf.json" DefaultLogLevel = "info" DefaultLogDirname = "" DefaultLogFilename = "wallet/log" DefaultRPCMaxClients = 10 DefaultRPCMaxWebsockets = 25 WalletDbName = "wallet.db" )
A bunch of constants
Variables ¶
var Log = cl.NewSubSystem(pkgs.Name(_d), "info")
Functions ¶
func CreateSimulationWallet ¶
CreateSimulationWallet is intended to be called from the rpcclient and used to create a wallet for actors involved in simulations.
func CreateWallet ¶
CreateWallet prompts the user for information needed to generate a new wallet and generates the wallet accordingly. The new wallet will reside at the provided path.
func Main ¶
func Main(config *pod.Config, stateCfg *state.Config, activeNet *netparams.Params, walletChan chan *wallet.Wallet, killswitch chan struct{}, wg *sync.WaitGroup) error
Main is a work-around main function that is required since deferred functions (such as log flushing) are not called with calls to os.Exit. Instead, main runs this function and checks for a non-nil error, at point any defers have already run, and if the error is non-nil, the program can be exited with an error exit status.
func NetworkDir ¶
NetworkDir returns the directory name of a network directory to hold wallet files.
func Version ¶
func Version() string
Version returns the application version as a properly formed string per the semantic versioning 2.0.0 spec (http://semver.org/).
Types ¶
type Config ¶
type Config struct {
// General application behavior
ConfigFile *string `short:"C" long:"configfile" description:"Path to configuration file"`
ShowVersion *bool `short:"V" long:"version" description:"Display version information and exit"`
LogLevel *string
Create *bool `long:"create" description:"Create the wallet if it does not exist"`
CreateTemp *bool `` /* 142-byte string literal not displayed */
AppDataDir *string `short:"A" long:"appdata" description:"Application data directory for wallet config, databases and logs"`
TestNet3 *bool `long:"testnet" description:"Use the test Bitcoin network (version 3) (default mainnet)"`
SimNet *bool `long:"simnet" description:"Use the simulation test network (default mainnet)"`
NoInitialLoad *bool `long:"noinitialload" description:"Defer wallet creation/opening on startup and enable loading wallets over RPC"`
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"`
// GUI *bool `long:"gui" description:"Launch GUI"`
// Wallet options
WalletPass *string `` /* 127-byte string literal not displayed */
// RPC client options
RPCConnect *string `` /* 171-byte string literal not displayed */
CAFile *string `long:"cafile" description:"File containing root certificates to authenticate a TLS connections with pod"`
EnableClientTLS *bool `long:"clienttls" description:"Enable TLS for the RPC client"`
PodUsername *string `long:"podusername" description:"Username for pod authentication"`
PodPassword *string `long:"podpassword" default-mask:"-" description:"Password for pod 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 *cli.StringSlice `short:"a" long:"addpeer" description:"Add a peer to connect with at startup"`
ConnectPeers *cli.StringSlice `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 *int `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 *string `long:"rpccert" description:"File containing the certificate file"`
RPCKey *string `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"`
EnableServerTLS *bool `long:"servertls" description:"Enable TLS for the RPC server"`
LegacyRPCListeners *cli.StringSlice `` /* 140-byte string literal not displayed */
LegacyRPCMaxClients *int `long:"rpcmaxclients" description:"Max number of legacy RPC clients for standard connections"`
LegacyRPCMaxWebsockets *int `long:"rpcmaxwebsockets" description:"Max number of legacy RPC websocket connections"`
Username *string `short:"u" long:"username" description:"Username for legacy RPC and pod authentication (if podusername is unset)"`
Password *string `` /* 129-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 *cli.StringSlice `long:"experimentalrpclisten" description:"Listen for RPC connections on this interface/port"`
// Deprecated options
DataDir *string `short:"b" long:"datadir" default-mask:"-" description:"DEPRECATED -- use appdata instead"`
}
Config is the main configuration for wallet
Source Files
¶
- config.go
- log.go
- main.go
- rpcserver.go
- version.go
- walletsetup.go
