Commit Graph

7 Commits

Author SHA1 Message Date
Chris Beams
b8db1cdf78
Organize grpc/protobuf imports properly 2020-03-26 17:10:59 +01:00
ghubstan
aed3453142
Move command & core proto defs to new subproject
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.
2020-03-26 10:14:33 -03:00
Chris Beams
d77ff101fb
Reflect higher security deposit in placeOffer RPC comment
Per review comment at
https://github.com/bisq-network/bisq/pull/3888#discussion_r368481607
2020-01-20 12:58:13 +01:00
Chris Beams
1e8633b03b
Organize io.grpc imports correctly
And remove entry for the no longer used io.bisq.generated package.
2020-01-20 12:16:57 +01:00
Chris Beams
aff760514b
Sever dependency from :desktop => :grpc
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).
2020-01-20 12:12:09 +01:00
Chris Beams
07d98a3aba
Move bisq.{grpc.BisqGrpcClient=>cli.BisqCliMain}
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.
2020-01-20 12:07:55 +01:00
Chris Beams
29698fd58a
Introduce 'cli' subproject
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!
2020-01-20 12:07:55 +01:00