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

Add simple api trading script #5082

Closed
wants to merge 15 commits into from

Conversation

ghubstan
Copy link
Contributor

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.

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.
@ghubstan
Copy link
Contributor Author

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.

@ghubstan ghubstan changed the title [WIP] Add simple api trading script Add simple api trading script Jan 15, 2021
@ghubstan ghubstan marked this pull request as ready for review January 15, 2021 17:03
Copy link
Member

@sqrrm sqrrm left a 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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent

Comment on lines 238 to 239
STRING=$1
NEW_STRING=$(sed 's/+/\\&/g' <<< ${STRING})
Copy link
Member

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

@ghubstan
Copy link
Contributor Author

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.

@ghubstan ghubstan closed this Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants