Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor, document Java API takeoffer bots #12

Merged
merged 41 commits into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
49a8c61
Refactor the TakeBestPricedOfferTo*Btc bots
ghubstan Jun 28, 2022
02000c0
Create runnable jars for new XMR bots
ghubstan Jun 28, 2022
1f09060
Extend option help col-width (no wrapping)
ghubstan Jun 29, 2022
c9443d1
Fill out TakeBestPricedOfferToSellXmr class level doc
ghubstan Jun 29, 2022
897401b
Add null checks to print payacct/offer/trade utils
ghubstan Jun 29, 2022
9307c08
Treat some wallet-is-locked errors as trivial
ghubstan Jun 29, 2022
8ed39eb
Improve some of the progress logging
ghubstan Jun 29, 2022
e87d3e3
Move some log statements to debug level
ghubstan Jun 29, 2022
9cb798f
Back out log statement
ghubstan Jun 29, 2022
a355138
Remove some verbose log statements, and a sleep.
ghubstan Jun 29, 2022
195b62c
Tidy up and javadoc the TakeBestPricedOfferToSellXmr bot
ghubstan Jun 29, 2022
28deeb8
[WIP] Save java-examples/README.md
ghubstan Jun 29, 2022
44ca04a
Log a CLI gettrade command for a simulated trading peer
ghubstan Jun 30, 2022
dd2619b
Tidy up "Here are today's completed trades" logging
ghubstan Jun 30, 2022
dee8e5b
Add convenience for lgging combination of copy/paste CLI cmds for peer
ghubstan Jun 30, 2022
d59dc72
Tweak class javadoc, log more bot config details
ghubstan Jun 30, 2022
fdc96bc
Document and tidy up TakeBestPricedOfferToBuyXmr bot
ghubstan Jun 30, 2022
4f3ff57
Log comparison of margin price based offers' prices, not margins
ghubstan Jun 30, 2022
52a6d29
Show how to set preferredTradingPeers config
ghubstan Jun 30, 2022
e138d35
Tidy up and document TakeBestPricedOfferToBuyBtc bot
ghubstan Jun 30, 2022
034172b
Tweak comment about encrypting wallet with CLI
ghubstan Jul 1, 2022
1f45116
Tidy up and document TakeBestPricedOfferToSellBtc bot
ghubstan Jul 1, 2022
5384d3a
Fix logging in AbstractBot's maybeShutdownAfterSuccessfulSwap()
ghubstan Jul 1, 2022
7df2533
Tidy up and document TakeBestPricedOfferToBuyBsq bot
ghubstan Jul 1, 2022
661ef2f
Add link to Config.java in class docs
ghubstan Jul 1, 2022
3c08b0b
Tweak log statement
ghubstan Jul 1, 2022
9907d8f
Fix javadoc about maximum tx fee rate constraint
ghubstan Jul 1, 2022
8456fd9
Tweak log statement
ghubstan Jul 1, 2022
4133a4c
Tidy up and document TakeBestPricedOfferToSellBsq bot
ghubstan Jul 1, 2022
483b2d8
Save README work in progress
ghubstan Jul 2, 2022
24a7e09
Improve logging, fix bad file list (ls) cmd
ghubstan Jul 3, 2022
fd31922
Explain runnable jars, create header links
ghubstan Jul 3, 2022
6182688
Describe btc bots, refer to class javadocs
ghubstan Jul 4, 2022
25b6e57
Fix header links
ghubstan Jul 4, 2022
ed1b5f7
Fix javadoc
ghubstan Jul 4, 2022
566013d
Fill out bsq/xmr bot descriptions
ghubstan Jul 4, 2022
e8e4cc0
Improve bot Purpose
ghubstan Jul 4, 2022
23b0993
Add warning and java-example bot link
ghubstan Jul 4, 2022
aa88b90
Fix internal link
ghubstan Jul 4, 2022
0e7eeae
Add link to Java bots
ghubstan Jul 4, 2022
7da06a3
Change links from PR branch to main branch
ghubstan Jul 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,23 @@ client example code, and developing new Java and Python clients and bots.

It contains four subprojects:

1. [reference-doc-builder](https://github.com/bisq-network/bisq-api-reference/tree/main/reference-doc-builder) -- The Java
application that produces the [API Reference](https://bisq-network.github.io/slate) content, from Bisq protobuf
1. [reference-doc-builder](https://github.com/bisq-network/bisq-api-reference/tree/main/reference-doc-builder) -- The
Java application that produces the [API Reference](https://bisq-network.github.io/slate) content, from Bisq protobuf
definition files.
2. [cli-examples](https://github.com/bisq-network/bisq-api-reference/tree/main/cli-examples) -- A folder of bash scripts
demonstrating how to run API CLI commands. Each script is named for the RPC method call being demonstrated.
3. [java-examples](https://github.com/bisq-network/bisq-api-reference/tree/main/java-examples) -- A Java project
demonstrating how to call the API from Java gRPC clients. Each class in
the [bisq.rpccalls](https://github.com/bisq-network/bisq-api-reference/tree/main/java-examples/src/main/java/bisq/rpccalls)
package is named for the RPC method call being demonstrated.
4. [python-examples](https://github.com/bisq-network/bisq-api-reference/tree/main/python-examples) -- A Python3 project
demonstrating how to call the API from Java gRPC clients. Each class in the
[bisq.rpccalls](https://github.com/bisq-network/bisq-api-reference/tree/main/java-examples/src/main/java/bisq/rpccalls)
package is named for the RPC method call being demonstrated. There are also some mainnet-ready Java API bots in the
[bisq.bots](https://github.com/bisq-network/bisq-api-reference/tree/main/java-examples/src/main/java/bisq/bots)
package.
5. [python-examples](https://github.com/bisq-network/bisq-api-reference/tree/main/python-examples) -- A Python3 project
demonstrating how to call the API from Python3 gRPC clients. Each class in
the [bisq.rpccalls](https://github.com/bisq-network/bisq-api-reference/tree/main/python-examples/bisq/rpccalls) package
is named for the RPC method call being demonstrated. There are also some simple bot examples in
the [bisq.bots](https://github.com/bisq-network/bisq-api-reference/tree/main/python-examples/bisq/bots) package.
the [bisq.rpccalls](https://github.com/bisq-network/bisq-api-reference/tree/main/python-examples/bisq/rpccalls)
package is named for the RPC method call being demonstrated. There are also some simple (not-ready-for-mainnet) bot
examples in the [bisq.bots](https://github.com/bisq-network/bisq-api-reference/tree/main/python-examples/bisq/bots)
package.

The RPC method examples are also displayed in the [API Reference](https://bisq-network.github.io/slate). While
navigating the RPC method links in the reference's table of contents on the left side of the page, they appear in the
Expand Down
403 changes: 398 additions & 5 deletions java-examples/README.md

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions java-examples/scripts/create-bot-jars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ extractdistribution
./create-runnable-jar.sh "$GRADLE_DIST_NAME" bisq.bots.TakeBestPricedOfferToBuyBtc
./create-runnable-jar.sh "$GRADLE_DIST_NAME" bisq.bots.TakeBestPricedOfferToSellBtc

./create-runnable-jar.sh "$GRADLE_DIST_NAME" bisq.bots.TakeBestPricedOfferToBuyXmr
./create-runnable-jar.sh "$GRADLE_DIST_NAME" bisq.bots.TakeBestPricedOfferToSellXmr

./create-runnable-jar.sh "$GRADLE_DIST_NAME" bisq.bots.TakeBestPricedOfferToBuyBsq
./create-runnable-jar.sh "$GRADLE_DIST_NAME" bisq.bots.TakeBestPricedOfferToSellBsq

Expand Down
10 changes: 5 additions & 5 deletions java-examples/scripts/create-runnable-jar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ MAINCLASS_FILE_PATH=$(getmainclassfilepath "$FULLY_QUALIFIED_CLASSNAME")

# Extract the Main-Class from the distribution jar, to the current working directory.
jar xfv "lib/$GRADLE_DIST_NAME.jar" "$MAINCLASS_FILE_PATH" "$SIMPLE_CLASSNAME.properties"
echo "Extracted one class:"
ls -l bisq/bots/pazza
echo "Extracted $SIMPLE_CLASSNAME.class:"
ls -l "bisq/bots/$SIMPLE_CLASSNAME.class"
mv "$SIMPLE_CLASSNAME.properties" "$JAR_BASENAME.conf"
echo "Extracted one properties file and renamed it $JAR_BASENAME.conf"
ls -l *.conf
echo "Extracted $SIMPLE_CLASSNAME.properties and renamed it $JAR_BASENAME.conf"
ls -l "$JAR_BASENAME.conf"

# Now it can be added to the empty jar with the correct path.
jar uf "$JAR_BASENAME.jar" "$MAINCLASS_FILE_PATH"
# Remove bisq (bisq/bots/junk).
# Remove workarea.
rm -rf bisq

echo "Runnable $JAR_BASENAME.jar is ready to use."
Expand Down
Loading