Commit graph

11 commits

Author SHA1 Message Date
Olaoluwa Osuntokun cdf737027b build: pin mid Go version to 1.16, run new go mod tidy
By running `go mod tidy -go=1.16`, we also automatically convert the
"legacy" build tag syntax to use the new Go 1.17 compatible variant.
2022-05-24 03:09:33 -07:00
Oliver Gugger b5fd915162
internal/prompt: allow compilation in js/wasm environment
The wallet loader has a dependency to the internal/prompt package for
prompting the user for certain inputs (e.g. wallet password or new
seed).
This makes it impossible for projects that use the wallet as a
dependency and always provide those inputs as parameters to compile for
JavaScript/WebAssembly targets because the prompt code uses some
terminal functionality that is not available in JS syscalls.
By providing a JS specific implementation that just returns an error we
can compile the dependent projects.
Adding acutal support for prompting the user in the browser is currently
not planned as that can easily be circumvented by providing all inputs
as parameters.
2021-05-14 12:41:35 +02:00
Oliver Gugger 3a5d9f84b0
multi: fix linter issues 2021-03-24 14:44:32 +01:00
Wilmer Paulino 26a58718a3
build: replace use of btcsuite/golangcrypto with golang.org/x/crypto
btcsuite/golangcrypto was created to cope with the lack of package
management for Go back in the day. This is no longer needed as we now
use modules.
2019-09-04 12:51:58 -07:00
Olaoluwa Osuntokun 7770cac383 multi: switch import paths back to upstream 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 e273e178dd Repoint repo to btcsuite on btcwalletln, and a few rebase fixes. 2018-05-23 19:38:56 -07:00
Olaoluwa Osuntokun 77b756c651 multi: point all imports towards roasbeef's forks 2018-05-23 19:38:56 -07:00
Josh Rickmar 5140086f6e Use LICENSE file and short license headers. 2016-02-28 22:22:34 -05:00
Josh Rickmar 2806a153df Use btcsuite vendored crypto repo. 2016-02-11 11:20:03 -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