Documentation ¶
Index ¶
- Constants
- func CreateSimulationWallet(activenet *netparams.Params, cfg *Config) (e error)
- func CreateWallet(activenet *netparams.Params, config *pod.Config) (e error)
- func GenerateRPCKeyPair(config *pod.Config, writeKey bool) (tls.Certificate, error)
- func LoadWallet(loader *wallet.Loader, cx *conte.Xt, legacyServer *legacy.Server) (e error)
- func Main(cx *conte.Xt) (e error)
- func NetworkDir(dataDir string, chainParams *netparams.Params) string
- func OpenRPCKeyPair(config *pod.Config) (tls.Certificate, error)
- func StartChainRPC(config *pod.Config, activeNet *netparams.Params, certs []byte, quit qu.C) (*chain.RPCClient, error)
- 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 ¶
This section is empty.
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 GenerateRPCKeyPair ¶
GenerateRPCKeyPair generates a new RPC TLS keypair and writes the cert and possibly also the key in PEM format to the paths specified by the config. If successful, the new keypair is returned.
func LoadWallet ¶ added in v0.4.14
LoadWallet ...
func Main ¶
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 OpenRPCKeyPair ¶ added in v0.4.14
func OpenRPCKeyPair(config *pod.Config) (tls.Certificate, error)
OpenRPCKeyPair creates or loads the RPC TLS keypair specified by the application config. This function respects the pod.Config.OneTimeTLSKey setting.
func StartChainRPC ¶ added in v0.4.14
func StartChainRPC(config *pod.Config, activeNet *netparams.Params, certs []byte, quit qu.C) (*chain.RPCClient, error)
StartChainRPC opens a RPC client connection to a pod server for blockchain services. This function uses the RPC options from the global config and there is no recovery in case the server is not available or if there is an authentication error. Instead, all requests to the client will simply error.
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:"__OLDgui" 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