WIP Produce the simplest-possible getting started guide for the Bisq HTTP API #54
Changes from 1 commit
95a2f88
e778141
37f2b19
70ce251
7ee80ee
ae5b54a
24ffd06
eea7498
911f6ca
17a48d1
d73a565
b73db83
10be120
7d8e78c
7eb1466
56d3185
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
This guide walks you through the process of creating a bot that monitors available offers and sends email notifications. | ||
|
||
|
||
== What you'll build | ||
|
||
You'll build a NodeJS based script that connects to Bisq over HTTP API to get offers and market prices and sends email notification in case any interesting offer is found. | ||
|
@@ -15,7 +14,6 @@ You'll build a NodeJS based script that connects to Bisq over HTTP API to get of | |
* gmail account | ||
* Bisq-api source code (and Maven) or Docker | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
== Starting the API | ||
|
||
There are two alternative ways you can run Bisq HTTP API, either from docker image or from sources. | ||
|
@@ -34,7 +32,6 @@ For more hard core developers that want to run from sources: | |
cd bisq-api | ||
mvn compile exec:java -Dexec.mainClass="io.bisq.api.app.ApiMain" | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
=== Verify if API is running | ||
|
||
In both cases the API should be running on port 8080. You can verify that by executing: | ||
|
@@ -44,7 +41,6 @@ In both cases the API should be running on port 8080. You can verify that by exe | |
[NOTE] | ||
API documentation is available at http://localhost:8080/swagger. | ||
|
||
|
||
== Getting the offers | ||
|
||
Open offers are available under following URL http://localhost:8080/api/v1/offers. | ||
|
@@ -146,7 +142,6 @@ Let's install some dependencies: | |
|
||
npm install lodash http-as-promised nodemailer | ||
|
||
|
||
In general our script will look like this: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In the sections that follow, I recommend that all source code snippets:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. both done |
||
|
||
[source,javascript] | ||
|
@@ -216,7 +211,6 @@ function getPriceFilter(marketPrice) { | |
|
||
We are multiplying `marketPrice` by `10000` because that is the format in which the API returns the price. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
|
||
|
||
Here is a full script. You must substitute EMAIL_ACCOUNT_USERNAME, EMAIL_ACCOUNT_PASSWORD, EMAIL_FROM_ADDRESS and EMAIL_TO_ADDRESS | ||
with appropriate values. | ||
|
||
|
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'd like to drop the email notifications. It makes sense for a script you'd actually want to run in real life, but here in a "let's build the simplest possible bot that could actually work for the purposes of getting our heads around the Bisq HTTP API" guide, all the stuff around GMail and email libraries and usernames and passwords and the code required to bootstrap it all is just noise and makes the whole thing longer and more complicated than it needs to be. As I walked through this guide myself, I punted when I got to this point; I just didn't want to deal. Because: (a) I never use my GMail account, (b) it's set up for 2FA anyway so a simple username / password won't work, (c) I don't want to set up a test account just for the purposes of this guide that told me it would take 15 minutes and is now in fact going to suck up more of my time than I want it to.
As an alternative, just print interesting offers (i.e. those that match the filter) to the command line whenever they show up, or if for some reason that is not idiomatic, then to a file that the user can tail.