Stop attempting to align Option and Method description columns with one
another. It's a moving target as we add options and method names, and
this help output format will probably change in the future anyway.
Don't instruct the user to create a fresh data directory every time, as
this takes quite a bit longer to initialize the wallet than running
against the same data directory repeatedly. Just be clear that the
requirement is an unencrypted wallet with 0 BTC balance.
The client was displaying
Error: UNAUTHENTICATED: incorrect 'password' rpc header value
from the StatusRuntimeException message.
Strip "UNAUTHENTICATED: " from the exception message string before
printing it.
There is actually no use case for both username and password forming the
authentication token. This change simplifies the arrangement such that a
single token is passed.
--rpcUser and --rpcPassword are no longer used and are replaced by
--apiToken on both cli and daemon sides.
* Renamed CliCommand to RpcCommand, differentiating it from cmd
string token(s)
* Added new CliConfig, based on :common Config
* Injected Config into CoreApi to make bisq.properties and cmd line
args available to server
* Added cleartext username:password BisqCallCredentials to :cli, and
an AuthenticationInterceptor to :core (server)
* Moved :daemon resources folder to expected location under src/main
* Duplicated CompositeOptionSet, ConfigException and BisqException
in :cli because they are not visible from :common. (TODO refactor?)
CompositeOptionSet will be used to let command line parameters
override params set in config file.
* Removed outdated references to :cli in a couple of comments in
:common Config
* gRPC parameters & command names are lowercase to mimic bitcoind/rpc
TBD
* Decide what rpc auth param names to use, to differentiate them from
bitcoind rpc user/passord param names
Change member name OptionParser cmdParser -> parser.
Change server listening port to 9998, client port to 9998.
Change constructor argument from String[] param -> args.
Print the result only, w/out exec time.
Handle help command & print that to stdout; print help
triggered by user error to stderr.
Use explicit system SUCCESS/FAIL codes in System.exit(0 || 1).
Replaced the Scanner input read loop with upgraded joptsimple
dependency. Cli now takes a single, non-option program argument, runs
it and exits. Also removed the "stop client" command because there is
no input loop, but shutdown() is called for orderly channel shudown
before the jvm terminates. Also changed cmd syntax from camel case
to lowercase, mimicking bitcoin-cli.
Configured logback to supress all debug & info level netty output, and
bypassed logback to print results to System.out.
This is done primarily for concision. This change also repackages
bisq.grpc => bisq.proto.grpc in anticipation of repackaging the
definitions in pb.proto from 'protobuf' to 'bisq.proto'. There should
not be any compatibility issues with doing this, but it's out of scope
here. When complete, the relationship between bisq.proto.grpc and
bisq.proto will be more intuitively clear, i.e. that bisq.proto.grpc has
certain dependencies on bisq.proto classes, but not the other way
around.
Protobuf definition files were moved from common and core to a new
protodefinition subproject.
The two main reasons for doing this are to speed up builds by not
having to regenerate common and core protobuf classes
every time a change is made in those subprojects, and to remove
the grpc cli's direct dependency on core, and the transitive dependency
on common.
In order to accomplish this, cli's BisqCliMain was stripped of
its dependencies on common and core. Cli can only get the version
and balance now.
gRPC stub boilerplate was moved from BisqCliMain to a CliCommand
class to avoid some of the bloat that is going to happen as the
read-response loop supports more rpc commands.
The :grpc module will soon be renamed to :daemon. These two modules
represent two separate and equal modes of running bisq, either as a
desktop GUI or as a daemon. They are both applications, and one should
not depend on the other as it would be illogical and confusing to model
things that way. The reason for the current dependency from :desktop to
:grpc is because :grpc is the home of BisqGrpcServer. This change moves
this class up to :core, in a new bisq.core.grpc package, such that both
the :desktop and :daemon applications can pull it in cleanly.
The CoreApi 'facade' that BisqGrpcServer uses to abstract away bisq
internals has been moved from bisq.core to bisq.core.grpc as well and
for the same reasons detailed in 8b30c22d6.
This change also renames the Java package for generated grpc types from
bisq.grpc.protobuf to bisq.core.grpc (the same new package that
BisqGrpcServer and CoreApi now live in). Again, this is for reasons of
cohesion: BisqGrpcServer is the only user of these grpc-generated types,
and they should logically live in the same package (even if they
physically live in separate source dirs at the build level).
This change replaces the previous "Hello, World!" :cli main stub with
the contents of the BisqGrpcClient as originally implemented in :grpc,
such that the following now works:
$ gradle build
$ ./bisq-daemon # in first terminal
$ ./bisq-cli # in second terminal
getVersion # user input to stdin
1.2.3 # rpc response
getBalance # user input to stdin
0.00 # rpc response
...
Or for a user experience closer to where things are headed:
$ echo getVersion | ./bisq-cli
1.2.3
Note that processing the above command is currently far too slow:
$ time echo getVersion | ./bisq-cli
1.2.3
real 0m1.634s # ouch
user 0m1.746s
sys 0m0.180s
Subsequent commits will work to bring this time down to a minimum.
Note: Includes the code quality changes originally made to
BisqGrpcClient in commit 7595387.
This change stubs out the `bisq-cli` utility with a placeholder main
method, such that the following now works:
$ gradle :cli:build
$ ./bisq-cli
Hello, World!