From bf25aaec91a4d2a3a77f862085e2759f100bc7f0 Mon Sep 17 00:00:00 2001 From: HenrikJannsen Date: Thu, 6 Jun 2024 21:43:24 +0700 Subject: [PATCH] Add run instructions to readme Signed-off-by: HenrikJannsen --- restapi/README.md | 52 ++++++++++++++----- restapi/build.gradle | 2 + .../src/main/java/bisq/restapi/RestApi.java | 2 +- 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/restapi/README.md b/restapi/README.md index 1fb66399404..f6b1aa8b967 100644 --- a/restapi/README.md +++ b/restapi/README.md @@ -1,22 +1,48 @@ -# Rest API application +# Rest API node -The Rest API application provides access to Bisq network data as well as Bisq DAO data. +Simple headless node with a Rest API to provide access to Bisq network data as well as Bisq DAO data. It is used for Bisq 2 to request data about the DAO state as well as account age and account witness data for reputation use cases. -Program arguments to run 'RestApiMain' with Bitcoin Regtest and localhost mode: +To run 'RestApiMain' you need to have Bitcoin node running and have 'blocknotify' in the `bitcoin.conf` set up. + + +### Run Rest API node + +Run the Gradle task: + +```sh +./gradlew restapi:run +``` + +Or create a run scrip by: + +```sh +./gradlew restapi:startBisqApp ``` ---baseCurrencyNetwork=BTC_REGTEST ---useDevPrivilegeKeys=true ---useLocalhostForP2P=true ---appName=[your app name] ---fullDaoNode=true ---rpcUser=[Bitcoin rpc username] ---rpcPassword=[Bitcoin rpc password] ---rpcPort=18443 ---rpcBlockNotificationPort=[port used in blocknotify] + +And then run: + +```sh +./bisq-restapi +``` + +### Customize with program arguments + +Example program arguments for running at localhost with Regtest: +```sh +./bisq-restapi \ + --baseCurrencyNetwork=BTC_REGTEST \ + --useDevPrivilegeKeys=true \ + --useLocalhostForP2P=true \ + --nodePort=3333 \ + --appName=bisq-BTC_REGTEST_restapi \ + --fullDaoNode=true \ + --rpcUser=[RPC USER] \ + --rpcPassword=[RPC PW] \ + --rpcPort=18443 \ + --rpcBlockNotificationPort=5123 ``` -To run 'RestApiMain' you need to have Bitcoin node running and have 'blocknotify' in the `bitcoin.conf` set up. diff --git a/restapi/build.gradle b/restapi/build.gradle index d6715c5e4bd..042d22d2517 100644 --- a/restapi/build.gradle +++ b/restapi/build.gradle @@ -5,6 +5,8 @@ plugins { mainClassName = 'bisq.restapi.RestApiMain' +distTar.enabled = false + dependencies { implementation project(':common') implementation project(':p2p') diff --git a/restapi/src/main/java/bisq/restapi/RestApi.java b/restapi/src/main/java/bisq/restapi/RestApi.java index 06038ada4f5..55f76fa4430 100644 --- a/restapi/src/main/java/bisq/restapi/RestApi.java +++ b/restapi/src/main/java/bisq/restapi/RestApi.java @@ -69,7 +69,7 @@ public class RestApi extends ExecutableForAppWithP2p { private SignVerifyService signVerifyService; public RestApi() { - super("Bisq Data Node", "bisq-data-node", "bisq_data_node", Version.VERSION); + super("Bisq Rest Api", "bisq_restapi", "bisq_restapi", Version.VERSION); } public Config getConfig() {