Commit graph

102 commits

Author SHA1 Message Date
Roy Lee
1fa143fa0e wallet: update passphrase user experience.
For users don't want to set/manage a passphrase a default passphrase
"passphrase" will be used during wallet creation.

At startup, the wallet tries to unlock itself using the default
passphrase, or a user provided one (using -p).

Users that prefer a passphrase can override the default one at wallet
creation time using -p, or use the walletpassphrase rpc when
the wallet is running. This will prevent the wallet from auto-unlock,
and preserve the lock-by-default behavior.
2022-10-31 19:53:16 -07:00
Roy Lee
3aca0be46a consolidate: refactor prompt related code 2022-09-29 00:06:51 -07:00
Roy Lee
dc7f1e88eb config: remove SigNet and SimNet related code 2022-09-28 23:42:21 -07:00
Roy Lee
be7892a2ae config: unify lbcd and lbcwallet RPC credentails
1. remove lbcdusername and lbcdpassword
2. rename (username, password) to (rpcuser, rpcpass)

Most users are confused with the lbcduser and username at first,
and choose to use the same credentials between lbcd and lbcwallet.
2022-09-28 23:29:20 -07:00
Roy Lee
7a4cd602bb config: remove noinitload related configs 2022-09-28 23:04:56 -07:00
Roy Lee
10d58126b5 config: remove spv related configs 2022-09-28 23:04:32 -07:00
Roy Lee
08e57e9ee3 config: remove gRPC related configs 2022-09-28 23:04:22 -07:00
Roy Lee
79da868c74 wallet: remove public passphrase prompt
1. Remove passphrase support for public keys.
2. Rename privPassphrase to passphrase to avoid confusion.

Note:

There has been a bug in the prompt, which prevents users from
specifying a custom public passphrase. So, most wallet databases
have been using the default password for the public keys, anyway.
2022-09-28 22:12:38 -07:00
Roy Lee
efb8e0b699 consolidate: remove legacystore related code 2022-09-19 15:56:14 -07:00
Roy Lee
610ec20ea8 ci: run "make fmt" 2022-08-08 01:26:02 -07:00
Roy Lee
c21be77e05 configs: updated docs/comments about disabling tls for remote connections 2022-08-04 17:24:24 -07:00
Roy Lee
9d812ab865 [lbry] config: allow non-localhost connections with TLS disabled 2022-07-11 16:22:35 -07:00
Roy Lee
ce9b4eb809 [lbry] version: use version package 2022-05-24 11:00:43 -07:00
Roy Lee
49e78d88cb [lbry] rpc: support --skipverify on TLS connection to lbcd 2022-05-24 10:48:28 -07:00
Roy Lee
d6434b148a [lbry] enable regtest for --createtemp (temporary wallet) 2022-05-24 10:31:06 -07:00
Roy Lee
36554814e8 [lbry] align port settings between lbcd, lbcctl, and lbcwallet 2022-05-24 10:31:06 -07:00
Roy Lee
202374ebd8 [lbry] fork from btcsuite to lbryio
1. btcd -> lbcd
2. btcwallet -> lbcallet
3. btcutil -> lbcutil
2022-05-24 10:31:06 -07:00
Roy Lee
8701ecb329 [lbry] build: remove neutrino and bitcoind support 2022-05-24 03:09:34 -07:00
Oliver Gugger
1f1ffb56b5
multi: add signet params
With this commit we add the signet test network parameters to all switch
cases where we distinguish between the different networks.
2021-04-27 09:59:14 +02:00
Oliver Gugger
3a5d9f84b0
multi: fix linter issues 2021-03-24 14:44:32 +01:00
yyforyongyu
e34b43b938
multi: unify WalletDBName and DefaultDBTimeout in loader 2020-11-07 22:01:51 +08:00
yyforyongyu
1cacaac9ea
btcwallet: use db timeout param 2020-11-07 22:01:51 +08:00
Olaoluwa Osuntokun
e9b145c524 multi: run goimports 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
7770cac383 multi: switch import paths back to upstream 2018-05-23 19:38:56 -07:00
Alex
e8b5091725 log: update to new logging API 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun
3dc7a8529c multi: switch all imports to roasbeef's forks 2018-05-23 19:38:56 -07:00
Alex
b5873a5b2c Finish integration of Neutrino; still untested. 2018-05-23 19:38:56 -07:00
Alex
3d81f856fd Move spvchain into neutrino and start integration w/btcwallet 2018-05-23 19:38:56 -07:00
Alex
32adc3c43f Make rescan a struct, add spending tx to GetUtxo, start integration. 2018-05-23 19:38:56 -07:00
Josh Rickmar
4222c0464a Update project dependencies.
One change of note is that this pulls in the new btclog-based logger
and removes the seelog dependency.
2017-06-20 09:34:45 -04:00
David Hill
15635025c4 Drop fastsha256 in favor of crypto/sha256 (#468) 2017-01-12 09:47:46 -05:00
Alex Yocom-Piatt
127246fb22 Fix logic for CreateTemp needing either appdata or datadir 2016-06-16 16:03:28 -05:00
Josh Rickmar
f3df6c8bc9 Handle flags explicitly set to defaults.
This prevents treating a flag that was explicitly set to the default
as unchanged, since the explicit set is recorded in the new
*cfgutil.ExplicitString flag type.
2016-05-25 09:37:23 -04:00
Josh Rickmar
7704a6d5c3 Switch from forked to upstream flags package.
In https://github.com/btcsuite/btcwallet/pull/419#issuecomment-212482492
I mentioned that btcwallet should wait until btcd also switches back
to upstream package paths so that duplicate packages are not included
in and bloat the btcwallet binary.  Even while btcd has not yet
switched to the upstream flags package, this change can still be made
now since it is only used by btcd's main package, which is not
included in btcwallet.
2016-05-06 12:41:42 -04:00
Josh Rickmar
4d51f8358f Use -b for deprecated --datadir short option.
When 29f31725ee deprecated the datadir
option, replacing it with --appdata/-A, the short --datadir option was
unintentinally changed from -b to -D.  It was previously changed to -b
in fda2e14b99 for consistency with
btcd's --datadir short option.

This change reverts the unintentional switch back to -D.
2016-05-04 17:45:52 -04:00
Josh Rickmar
5e3613775d Make default config relative to appdata directory.
This modifies the default configuration file to be relative to the
application data directory (configuratble with --appdata).  If there
is no configuration file in this directory, then no additional
configuration options are applied (it does not fallback to
~/.btcwallet/btcwallet.conf).

Fixes #421.
2016-04-28 11:21:44 -04:00
Josh Rickmar
178717341e Expand several more config options.
This adds home directory and OS environment variable expansion for the
following configuration options: configfile, appdatadir, rpccert,
rpckey.
2016-04-28 11:16:17 -04:00
Josh Rickmar
f91303f507 Lookup actual home directory when expanding ~.
This fixes home directory expansion on Windows and OS X.  Previously
on these platforms, a leading ~ would expand to %LOCALAPPDATA% on
Windows or ~/Library/Application Support/ on OS X.

While here, add support for ~otheruser expansion to expand to
otheruser's home directory.
2016-04-28 11:16:17 -04:00
Josh Rickmar
c82b8bae20 Ignore config in current directory by default.
Fixes #415.
2016-04-20 11:08:14 -04:00
Josh Rickmar
29f31725ee Rename datadir/-b options to appdata/-A.
This removes an inconsistency with the datadir option from btcd, which
only set the directory containing the blockchain data and indexes.
2016-04-15 20:30:05 -04:00
Josh Rickmar
cee0411a2e Default to mainnet.
Note that this is a breaking change since it removes the mainnet
config option, replacing it with a testnet option.  Old configuration
files that set mainnet=1 will cause the wallet to error during startup
since extraneous flags are treated as errors.

Because configuration files will have to be updated for the change
regardless, the old deprecated (and unused) options `disallowfree` and
`keypoolsize` have also been removed.

Closes #383.
2016-03-11 09:08:38 -05:00
Josh Rickmar
f084802fec Refactor wallet transaction creation code.
This began as a change to improve the fee calculation code and evolved
into a much larger refactor which improves the readability and
modularity of all of the transaction creation code.

Transaction fee calculations have been switched from full increments
of the relay fee to a proportion based on the transaction size.  This
means that for a relay fee of 1e3 satoshis/kB, a 500 byte transaction
is only required to pay a 5e2 satoshi fee and a 1500 byte transaction
only need pay a 1.5e3 fee.  The previous code would end up estimating
these fees to be 1e3 and 2e3 respectively.

Because the previous code would add more fee than needed in almost
every case, the transaction size estimations were optimistic
(best/smallest case) and signing was done in a loop where the fee was
incremented by the relay fee again each time the actual size of the
signed transaction rendered the fee too low.  This has switched to
using worst case transaction size estimates rather than best case, and
signing is only performed once.

Transaction input signature creation has switched from using
txscript.SignatureScript to txscript.SignTxOutput.  The new API is
able to redeem outputs other than just P2PKH, so the previous
restrictions about P2SH outputs being unspendable (except through the
signrawtransaction RPC) no longer hold.

Several new public packages have been added:

wallet/txauthor - transaction authoring and signing
wallet/txfees - fee estimations and change output inclusion
wallet/txrules - simple consensus and mempool policy rule checks

Along with some internal packages:

wallet/internal/txsizes - transaction size estimation
internal/helpers - context free convenience functions

The txsizes package is internal as the estimations it provides are
specific for the algorithms used by these new packages.
2016-03-08 17:42:27 -05:00
Josh Rickmar
5140086f6e Use LICENSE file and short license headers. 2016-02-28 22:22:34 -05:00
John C. Vernaleo
2808c4fe40 If wallet already exists show path.
This was initially pointed out by davec in
decred/dcrwallet#18
2016-02-11 10:51:25 -05:00
Josh Rickmar
567752ea9b Add option for one time TLS keys.
This option prevents the RPC server TLS key from ever being written to
disk.  This is performed by generating a new certificate pair each
startup and writing (possibly overwriting) the certificate but not the
key.

Closes #359.
2016-02-11 00:15:30 -05:00
Josh Rickmar
fda2e14b99 Change datadir short option to -b.
Fixes #339.
2016-02-01 17:39:04 -05:00
Josh Rickmar
497ffc11f0 Modernize the RPC server.
This is a rather monolithic commit that moves the old RPC server to
its own package (rpc/legacyrpc), introduces a new RPC server using
gRPC (rpc/rpcserver), and provides the ability to defer wallet loading
until request at a later time by an RPC (--noinitialload).

The legacy RPC server remains the default for now while the new gRPC
server is not enabled by default.  Enabling the new server requires
setting a listen address (--experimenalrpclisten).  This experimental
flag is used to effectively feature gate the server until it is ready
to use as a default.  Both RPC servers can be run at the same time,
but require binding to different listen addresses.

In theory, with the legacy RPC server now living in its own package it
should become much easier to unit test the handlers.  This will be
useful for any future changes to the package, as compatibility with
Core's wallet is still desired.

Type safety has also been improved in the legacy RPC server.  Multiple
handler types are now used for methods that do and do not require the
RPC client as a dependency.  This can statically help prevent nil
pointer dereferences, and was very useful for catching bugs during
refactoring.

To synchronize the wallet loading process between the main package
(the default) and through the gRPC WalletLoader service (with the
--noinitialload option), as well as increasing the loose coupling of
packages, a new wallet.Loader type has been added.  All creating and
loading of existing wallets is done through a single Loader instance,
and callbacks can be attached to the instance to run after the wallet
has been opened.  This is how the legacy RPC server is associated with
a loaded wallet, even after the wallet is loaded by a gRPC method in a
completely unrelated package.

Documentation for the new RPC server has been added to the
rpc/documentation directory.  The documentation includes a
specification for the new RPC API, addresses how to make changes to
the server implementation, and provides short example clients in
several different languages.

Some of the new RPC methods are not implementated exactly as described
by the specification.  These are considered bugs with the
implementation, not the spec.  Known bugs are commented as such.
2016-01-29 11:18:26 -05:00
Josh Rickmar
b0566e09c8 Separate out default ports and utility funcs.
This change moves the chain and network parameter definitions, along
with the default client and server ports, to a package for reuse by
other utilities (most notably, tools in the cmd dir).  Along with it,
functions commonly used for config parsing and validation are moved to
an internal package since they will also be useful for distributed
tools.
2015-11-25 01:02:50 -05:00
Josh Rickmar
5843c0bc66 Move legacy under internal directory.
After Go 1.5, this will prevent consumers from importing these
packages since they are currently unmaintained.

Closes #232.
2015-05-27 10:12:24 -04:00
Dave Collins
c820c8a015 Relicense to the btcsuite developers. 2015-05-01 12:20:05 -05:00