Branch: refs/heads/grpc
Home: https://github.com/btcsuite/btcwallet
Commit: fb07251d24d9604cf75bf84a4bc4483742431a17
https://github.com/btcsuite/btcwallet/commit/fb07251d24d9604cf75bf84a4bc4483742431a17
Author: Josh Rickmar <[email protected]>
Date: 2016-01-08 (Fri, 08 Jan 2016)
Changed paths:
M btcwallet.go
M chain/chain.go
M config.go
A internal/prompt/prompt.go
M internal/rpchelp/genrpcserverhelp.go
M log.go
A rpc/api.proto
A rpc/legacyrpc/config.go
A rpc/legacyrpc/errors.go
A rpc/legacyrpc/log.go
A rpc/legacyrpc/methods.go
A rpc/legacyrpc/rpcserver_test.go
A rpc/legacyrpc/rpcserverhelp.go
A rpc/legacyrpc/server.go
A rpc/regen.sh
A rpc/rpcserver/server.go
A rpc/walletrpc/api.pb.go
R rpchelp_test.go
M rpcserver.go
R rpcserver_test.go
R rpcserverhelp.go
M sample-btcwallet.conf
M signal.go
M waddrmgr/error.go
M waddrmgr/error_test.go
M waddrmgr/manager.go
M wallet/chainntfns.go
M wallet/createtx.go
A wallet/loader.go
A wallet/notifications.go
M wallet/rescan.go
M wallet/wallet.go
M walletsetup.go
M wtxmgr/tx.go
M wtxmgr/unconfirmed.go
Log Message:
-----------
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).
Both RPC servers can run at the same time, but the legacy server is
now disabled by default. Enabling it again requires setting the
legacyrpclisten option. Listen addresses can not be shared between the
legacy and gRPC servers.
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 planned.
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.
Work on the new gRPC services are ongoing. Several TODOs are left for
unfinished methods, and more methods will be added to replace all the
(useful) functionality of the legacy RPC server. This API is
considered unstable.
Commit: 103130e6ee3d4da4f198e98d7aa664a205d4b4aa
https://github.com/btcsuite/btcwallet/commit/103130e6ee3d4da4f198e98d7aa664a205d4b4aa
Author: Josh Rickmar <[email protected]>
Date: 2016-01-08 (Fri, 08 Jan 2016)
Changed paths:
M config.go
M internal/cfgutil/file.go
M log.go
M rpc/api.proto
A rpc/documentation/README.md
A rpc/documentation/api.md
A rpc/documentation/clientusage.md
A rpc/documentation/serverchanges.md
M rpc/legacyrpc/config.go
M rpc/legacyrpc/errors.go
M rpc/legacyrpc/log.go
M rpc/legacyrpc/methods.go
M rpc/legacyrpc/server.go
A rpc/rpcserver/log.go
M rpc/rpcserver/server.go
M rpc/walletrpc/api.pb.go
M rpcserver.go
M waddrmgr/manager.go
M wallet/loader.go
M wallet/notifications.go
M wallet/wallet.go
M walletsetup.go
Log Message:
-----------
Address review items and add RPC documentation.
Compare:
https://github.com/btcsuite/btcwallet/compare/fb07251d24d9^...103130e6ee3d