-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add simple api trading script #5082
Conversation
Adds all the gRPC server boilerplate, and a simple help service that serves method help in man page format. Help text is maintained in text files located in core/src/main/resources/help. Only some of the method help text files are defined in this change, more to be added.
This helps reduce size of growing CLI class file.
Not needed anymore, and all method opts are posix style. (The opts parsing lib used to treat negative numbers as opt labels.)
Emulates Bob and Alice trading with each other with regtest BTC.
Get new btc core address before generating btc blocks.
Since the 1st check-in of these two scripts (commit d756d3d), several more commits were pushed, making a PR review seem more complex than it should be. These scripts have never been reviewed before, so I recommend any reviewer look at the latest version of the entire file(s) instead of individual commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to cancel stop the script if it fails at any step. My first time running Bob couldn't find any offers to take but still continued to try to take it. Just looks a bit odd that the script continues after it fails one step that it later depends on.
} | ||
|
||
createoffer() { | ||
CREATE_OFFER_CMD=$1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent
|
||
### This is an effort to handling any createoffer error. If error, should echo Error, and the calling script | ||
### should sleep awhile then exit 1. | ||
if [[ "$OFFER_DESC" != "Buy/Sell"* ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent
STRING=$1 | ||
NEW_STRING=$(sed 's/+/\\&/g' <<< ${STRING}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems there is inconsistent usage of tab vs space for indentation
Closing. There are too many changes to come, including re-defining the script opt labels, and creating payment accts for trading in a variety of country currencies. Will re-create a cleaner PR when ready. |
Emulates Bob and Alice trading regtest BTC with each other with.
The script output is intended to be a tutorial, not the script itself.
#5081 has to merged before this one.