Skip to content

Commit

Permalink
Merge branch 'master' into release/v1.9.18
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrogarcia83 committed Dec 23, 2024
2 parents 3b2b485 + 3e526c7 commit 6db1c9e
Show file tree
Hide file tree
Showing 254 changed files with 23,944 additions and 2,005 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@ jobs:
java: ['11']
name: Test Java ${{ matrix.Java }}, ${{ matrix.os }}
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
submodules: 'true'

- name: Set up JDK
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v4.5.0
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'

- name: Build with Gradle
uses: gradle/gradle-build-action@v3.3.2
uses: gradle/gradle-build-action@v3.5.0
with:
arguments: build --scan
6 changes: 3 additions & 3 deletions .github/workflows/codacy-coverage-reporter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@ jobs:
runs-on: ubuntu-latest
name: codacy-coverage-reporter
steps:
- uses: actions/checkout@v4.1.6
- uses: actions/checkout@v4.2.2

- name: Set up JDK
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v4.5.0
with:
java-version: '11'
distribution: 'zulu'

- name: Build with Gradle
uses: gradle/gradle-build-action@v3.3.2
uses: gradle/gradle-build-action@v3.5.0
with:
arguments: build jacocoTestReport testCodeCoverageReport --scan

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ jobs:
Feel free to reopen it if you think it is still relevant.
stale-issue-label: was:dropped
stale-pr-label: was:dropped
exempt-issue-labels: a:bug,re:security,re:privacy,re:Tor,in:dao,$BSQ bounty,good first issue,Epic,a:feature,is:priority
exempt-pr-labels: a:bug,re:security,re:privacy,re:Tor,in:dao,$BSQ bounty,good first issue,Epic,a:feature,is:priority
exempt-issue-labels: a:bug,re:security,re:privacy,re:Tor,in:dao,$BSQ bounty,good first issue,Epic,a:feature,is:priority,no-bot
exempt-pr-labels: a:bug,re:security,re:privacy,re:Tor,in:dao,$BSQ bounty,good first issue,Epic,a:feature,is:priority,no-bot
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ deploy
/apitest/src/main/resources/dao-setup*
/.run
/regtest/data_dirs
/build-logic/app-start-plugin/out/*
/build-logic/docker-image-builder/out/*
/build-logic/gradle-tasks/out/*
/build-logic/packaging/out/*
/build-logic/regtest/out/*
/build-logic/toolchain-resolver/out/*
/build-logic/tor-binary/out/*
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "bitcoind"]
path = bitcoind
url = https://github.com/bisq-network/bitcoind.git
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ seednode: seednode/build
--useLocalhostForP2P=true \
--useDevPrivilegeKeys=true \
--fullDaoNode=true \
--isBmFullNode=true \
--rpcUser=bisqdao \
--rpcPassword=bsq \
--rpcBlockNotificationPort=5120 \
Expand All @@ -208,6 +209,7 @@ seednode2: seednode/build
--useLocalhostForP2P=true \
--useDevPrivilegeKeys=true \
--fullDaoNode=true \
--isBmFullNode=true \
--rpcUser=bisqdao \
--rpcPassword=bsq \
--rpcBlockNotificationPort=5121 \
Expand All @@ -231,6 +233,7 @@ alice: setup
--useDevPrivilegeKeys=true \
--nodePort=5555 \
--fullDaoNode=true \
--isBmFullNode=true \
--rpcUser=bisqdao \
--rpcPassword=bsq \
--rpcBlockNotificationPort=5122 \
Expand Down
1 change: 1 addition & 0 deletions bitcoind
Submodule bitcoind added at 673775
25 changes: 25 additions & 0 deletions btcnodemonitor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Bitcoin node monitor

This is a simple headless node with a http server which connects periodically to the Bisq-provided Bitcoin nodes and
disconnect quickly afterwards.

### Run Bitcoin node monitor

Run the Gradle task:

```sh
./gradlew btcnodemonitor:run
```

Or create a run scrip by:

```sh
./gradlew btcnodemonitor:startBisqApp
```

And then run:

```sh
./bisq-btcnodemonitor
```

37 changes: 37 additions & 0 deletions btcnodemonitor/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
plugins {
id 'bisq.application'
id 'bisq.gradle.app_start_plugin.AppStartPlugin'
}

mainClassName = 'bisq.btcnodemonitor.BtcNodeMonitorMain'

distTar.enabled = true

dependencies {
implementation enforcedPlatform(project(':platform'))
implementation project(':proto')
implementation project(':common')
implementation project(':core')
implementation project(':p2p')
annotationProcessor libs.lombok
compileOnly libs.javax.annotation
compileOnly libs.lombok
implementation libs.logback.classic
implementation libs.logback.core
implementation libs.google.guava
implementation libs.apache.commons.lang3
implementation libs.jetbrains.annotations
implementation libs.slf4j.api
implementation(libs.netlayer.tor.external) {
exclude(module: 'slf4j-api')
}
implementation(libs.bitcoinj) {
exclude(module: 'bcprov-jdk15on')
exclude(module: 'guava')
exclude(module: 'jsr305')
exclude(module: 'okhttp')
exclude(module: 'okio')
exclude(module: 'slf4j-api')
}
implementation libs.spark.core
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.btcnodemonitor;


import bisq.core.btc.nodes.BtcNodes;

import bisq.common.config.Config;

import java.util.concurrent.CompletableFuture;

import lombok.extern.slf4j.Slf4j;



import bisq.btcnodemonitor.btc.PeerConncetionModel;
import bisq.btcnodemonitor.btc.PeerGroupService;
import bisq.btcnodemonitor.server.SimpleHttpServer;
import bisq.btcnodemonitor.socksProxy.ProxySetup;

@Slf4j
public class BtcNodeMonitor {
private final PeerGroupService peerGroupService;
private final ProxySetup proxySetup;
private final SimpleHttpServer simpleHttpServer;

public BtcNodeMonitor(Config config) {
PeerConncetionModel peerConncetionModel = new PeerConncetionModel(new BtcNodes().getProvidedBtcNodes(), this::onChange);
simpleHttpServer = new SimpleHttpServer(config, peerConncetionModel);
proxySetup = new ProxySetup(config);
peerGroupService = new PeerGroupService(config, peerConncetionModel);
}

public void onChange() {
simpleHttpServer.onChange();
}

public CompletableFuture<Void> start() {
return simpleHttpServer.start()
.thenCompose(nil -> proxySetup.createSocksProxy())
.thenAccept(peerGroupService::applySocks5Proxy)
.thenCompose(nil -> peerGroupService.start());
}

public CompletableFuture<Void> shutdown() {
return peerGroupService.shutdown()
.thenCompose(nil -> proxySetup.shutdown())
.thenCompose(nil -> simpleHttpServer.shutdown());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* This file is part of Bisq.
*
* Bisq is free software: you can redistribute it and/or modify it
* under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or (at
* your option) any later version.
*
* Bisq is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
* License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Bisq. If not, see <http://www.gnu.org/licenses/>.
*/

package bisq.btcnodemonitor;


import bisq.common.UserThread;
import bisq.common.config.Config;
import bisq.common.handlers.ResultHandler;
import bisq.common.setup.CommonSetup;
import bisq.common.setup.GracefulShutDownHandler;
import bisq.common.util.SingleThreadExecutorUtils;
import bisq.common.util.Utilities;

import lombok.Getter;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class BtcNodeMonitorMain implements GracefulShutDownHandler {
public static void main(String[] args) {
new BtcNodeMonitorMain(args);
}

private final Config config;
@Getter
private final BtcNodeMonitor btcNodeMonitor;

public BtcNodeMonitorMain(String[] args) {
config = new Config("bisq_btc_node_monitor", Utilities.getUserDataDir(), args);
CommonSetup.setup(config, this);
configUserThread();

btcNodeMonitor = new BtcNodeMonitor(config);
btcNodeMonitor.start().join();
keepRunning();
}

@Override
public void gracefulShutDown(ResultHandler resultHandler) {
log.info("gracefulShutDown");
btcNodeMonitor.shutdown().join();
System.exit(0);
resultHandler.handleResult();
}

private void keepRunning() {
try {
Thread.currentThread().setName("BtcNodeMonitorMain");
Thread.currentThread().join();
} catch (InterruptedException e) {
log.error("BtcNodeMonitorMain Thread interrupted", e);
gracefulShutDown(() -> {
});
}
}

private void configUserThread() {
UserThread.setExecutor(SingleThreadExecutorUtils.getSingleThreadExecutor("UserThread"));
}
}
Loading

0 comments on commit 6db1c9e

Please sign in to comment.