Compare commits
3 Commits
dragonx
...
compliant-
| Author | SHA1 | Date | |
|---|---|---|---|
| 10906597d4 | |||
| c05134e77e | |||
| 4cb5a86056 |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -167,4 +167,8 @@ REGTEST_7776
|
||||
src/cc/librogue.so
|
||||
src/cc/games/prices
|
||||
src/cc/games/tetris
|
||||
release-linux/
|
||||
release-linux/
|
||||
release/
|
||||
src/dragonxd
|
||||
src/dragonx-cli
|
||||
src/dragonx-tx
|
||||
4
AUTHORS
4
AUTHORS
@@ -1,3 +1,7 @@
|
||||
# The DragonX Developers
|
||||
|
||||
Dan S https://git.dragonx.is/dan
|
||||
|
||||
# The Hush Developers
|
||||
|
||||
Duke Leto https://git.hush.is/duke https://github.com/leto
|
||||
|
||||
1
COPYING
1
COPYING
@@ -1,3 +1,4 @@
|
||||
Copyright (c) 2024-2026 The DragonX developers
|
||||
Copyright (c) 2018-2025 The Hush developers
|
||||
Copyright (c) 2009-2017 The Bitcoin Core developers
|
||||
Copyright (c) 2009-2018 Bitcoin Developers
|
||||
|
||||
26
LICENSE
26
LICENSE
@@ -1,4 +1,4 @@
|
||||
GENERAL GENERAL PUBLIC LICENSE
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
@@ -7,15 +7,15 @@
|
||||
|
||||
Preamble
|
||||
|
||||
The GENERAL General Public License is a free, copyleft license for
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GENERAL General Public License is intended to guarantee your freedom to
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GENERAL General Public License for most of our software; it applies also to
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
@@ -37,7 +37,7 @@ freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GENERAL GPL protect your rights with two steps:
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
@@ -72,7 +72,7 @@ modification follow.
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GENERAL General Public License.
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
@@ -549,35 +549,35 @@ to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GENERAL Affero General Public License.
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GENERAL Affero General Public License into a single
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GENERAL Affero General Public License,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GENERAL General Public License from time to time. Such new versions will
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GENERAL General
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GENERAL General Public License, you may choose any version ever published
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GENERAL General Public License can be used, that proxy's
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
|
||||
209
README.md
209
README.md
@@ -1,196 +1,107 @@
|
||||
<p align="center">
|
||||
<img src="doc/hush/hush0.png">
|
||||
</p>
|
||||
# DragonX
|
||||
|
||||
<h3>
|
||||
DragonX is a privacy-focused cryptocurrency full node using RandomX proof-of-work.
|
||||
All transactions are shielded (z-to-z) by default, providing strong on-chain privacy.
|
||||
|
||||
| Introduction | Install | Compile | FAQ | Documentation |
|
||||
| :---: | :---: | :---: | :---: | :---: |
|
||||
| [What is Hush?](#what-is-hush) | [Windows 10 - Video Tutorial](#install-on-windows-10) | [Build on Debian or Ubuntu](#build-on-debian-or-ubuntu) | [Where can I buy Hush?](#where-can-i-buy-hush) | [Cross compiling Windows binaries](#windows-cross-compiled-on-linux)
|
||||
| [Why not GitHub?](#banned-by-github) | [Build on Mac](#build-on-mac) | [Build on Arch](#build-on-arch) | [Can I mine with CPU or GPU?](#can-i-mine-with-cpu-or-gpu) | [Hush DevOps for pools and CEXs](https://git.hush.is/hush/docs/src/branch/master/advanced/devops.md)
|
||||
| [What is HushChat?](#what-is-hushchat) | [Debian and Ubuntu](#installing-hush-binaries) | [Build on Fedora](#build-on-fedora) | [Claiming funds from old Hush wallets](https://git.hush.is/hush/hush3/src/branch/master/doc/OLD_WALLETS.md) | [Earn Hush bounty](#earn-hush-bounty)
|
||||
| [What is SilentDagon?](#what-is-silentdagon) | [Raspberry Pi](#install-on-arm-architecture) | [Build on Ubuntu 16.04 or older](#building-on-ubuntu-16-04-and-older-systems) | [Where can I spend Hush?](#where-can-i-spend-hush) | [Cross compiling from amd64 to arm64](https://git.hush.is/hush/docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md)
|
||||
| | |
|
||||
|---|---|
|
||||
| **Algorithm** | RandomX (CPU-mineable) |
|
||||
| **Block time** | 36 seconds |
|
||||
| **Block reward** | 3 DRAGONX |
|
||||
| **Halving** | Every 3,500,000 blocks |
|
||||
| **Privacy** | All transactions shielded (`-ac_private=1`) |
|
||||
| **P2P port** | 21768 |
|
||||
| **RPC port** | 21769 |
|
||||
|
||||
</h3>
|
||||
|
||||
# What is Hush?
|
||||
|
||||
Hush implements Extreme Privacy via blockchain tech. We have our own
|
||||
genesis block. We are not a chain fork (copy) of another coin. We are based on
|
||||
Bitcoin code, with sophisticated zero-knowledge mathematics added for privacy.
|
||||
This keeps your transaction metadata private!
|
||||
|
||||
# What is this repository?
|
||||
|
||||
This software is the Hush node and command-line client. It downloads and stores
|
||||
the entire history of Hush transactions; depending on the speed of your
|
||||
computer and network connection, it will likely take a few hours at least, but
|
||||
some people report full nodes syncing in less than 1.5 hours.
|
||||
|
||||
# Banned by GitHub
|
||||
|
||||
In working on this release, Duke Leto was suspended from Github, which gave Hush developers
|
||||
the impetus to completely leave that racist and censorship-loving platform. Hush now has it's own [git.hush.is](https://git.hush.is/hush) Gitea instance,
|
||||
because we will not be silenced by Microsoft. All Hush software will be released from git.hush.is and hush.is, downloads from any other
|
||||
domains should be assumed to be backdoored.
|
||||
|
||||
**Hush is unfinished and highly experimental.** Use at your own risk! Just like Bitcoin.
|
||||
|
||||
# Build on Debian or Ubuntu
|
||||
## Build on Debian or Ubuntu
|
||||
|
||||
```sh
|
||||
# install build dependencies
|
||||
# Install build dependencies
|
||||
sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib \
|
||||
autoconf libtool ncurses-dev unzip git zlib1g-dev wget \
|
||||
bsdmainutils automake curl unzip nano libsodium-dev cmake
|
||||
# clone git repo
|
||||
git clone https://git.hush.is/hush/hush3
|
||||
cd hush3
|
||||
# Build
|
||||
# This uses 3 build processes, you need 2GB of RAM for each.
|
||||
bsdmainutils automake curl unzip libsodium-dev cmake
|
||||
|
||||
# Clone the repo
|
||||
git clone https://git.dragonx.is/DragonX/dragonx
|
||||
cd dragonx
|
||||
|
||||
# Build (uses ~2GB RAM per -j thread)
|
||||
./build.sh -j3
|
||||
```
|
||||
Video Tutorial: https://videos.hush.is/videos/how-to-install-on-linux
|
||||
|
||||
# Build on Arch
|
||||
## Build on Arch
|
||||
|
||||
```sh
|
||||
# install build dependencies
|
||||
sudo pacman -S gcc libsodium lib32-zlib unzip wget git python rust curl autoconf cmake
|
||||
# clone git repo
|
||||
git clone https://git.hush.is/hush/hush3
|
||||
cd hush3
|
||||
# Build
|
||||
# This uses 3 build processes, you need 2GB of RAM for each.
|
||||
|
||||
git clone https://git.dragonx.is/DragonX/dragonx
|
||||
cd dragonx
|
||||
./build.sh -j3
|
||||
```
|
||||
|
||||
# Build on Fedora
|
||||
## Build on Fedora
|
||||
|
||||
```sh
|
||||
# install build dependencies
|
||||
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libtool ncurses-devel patch -y
|
||||
# clone git repo
|
||||
git clone https://git.hush.is/hush/hush3
|
||||
cd hush3
|
||||
# Build
|
||||
# This uses 3 build processes, you need 2GB of RAM for each.
|
||||
|
||||
git clone https://git.dragonx.is/DragonX/dragonx
|
||||
cd dragonx
|
||||
./build.sh -j3
|
||||
```
|
||||
|
||||
# Install on Windows 10
|
||||
## Build on macOS
|
||||
|
||||
Video Tutorial: https://videos.hush.is/videos/how-to-install-on-windows
|
||||
|
||||
# Install on ARM Architecture
|
||||
|
||||
Use this if you have a Raspberry Pi or similar computer. Currently, any ARMv7 machine will not be able to build this repo, because the underlying tech (zcash and the zksnark library) do not support that instruction set. This also means that old RaspberryPi devices will not work, unless they have a newer ARMv8-based Raspberry Pi. Raspberry Pi 4 and newer are known to work.
|
||||
|
||||
1. [Download the latest Debian package with the AARCH64 designation from the releases page](https://git.hush.is/hush/hush3/releases).
|
||||
1. Install the Debian package, substituting "VERSION-NUMBER" for the version you have downloaded: `sudo dpkg -i hush-VERSION-NUMBER-aarch64.deb`.
|
||||
1. Run with: `hushd`.
|
||||
|
||||
If you would like to compile this for ARM yourself, then please refer to the [Cross compiling a Hush full node daemon from AMD64 to ARM64(aarch64) CPU architecture with Docker](https://git.hush.is/jahway603/hush-docs/src/branch/master/advanced/cross-compile-hush-full-node-to-aarch64-with-docker.md) documentation to do that.
|
||||
|
||||
# Building On Ubuntu 16.04 and older systems
|
||||
|
||||
Some older compilers may not be able to compile modern code, such as gcc 5.4 which comes with Ubuntu 16.04 by default. Here is how to install gcc 7 on Ubuntu 16.04. Run these commands as root:
|
||||
|
||||
```
|
||||
add-apt-repository ppa:ubuntu-toolchain-r/test && \
|
||||
apt update && \
|
||||
apt-get install -y gcc-7 g++-7 && \
|
||||
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60 && \
|
||||
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60
|
||||
```
|
||||
|
||||
# Build on Mac
|
||||
|
||||
```
|
||||
sudo port update
|
||||
sudo port upgrade outdated
|
||||
```sh
|
||||
sudo port update && sudo port upgrade outdated
|
||||
sudo port install qt5
|
||||
|
||||
# clone git repo
|
||||
git clone https://git.hush.is/hush/hush3
|
||||
cd hush3
|
||||
# Build
|
||||
# This uses 3 build processes, you need 2GB of RAM for each.
|
||||
git clone https://git.dragonx.is/DragonX/dragonx
|
||||
cd dragonx
|
||||
./build.sh -j3
|
||||
```
|
||||
|
||||
# Installing Hush binaries
|
||||
## Cross-compile for Windows (on Linux)
|
||||
|
||||
1. [Download the release](https://git.hush.is/hush/hush3/releases) with a .deb file extension.
|
||||
1. Install the Debian package, substituting "VERSION-NUMBER" for the version you have downloaded: `sudo dpkg -i hush-VERSION-NUMBER-amd64.deb`.
|
||||
1. Run with: `hushd`.
|
||||
|
||||
# Windows (cross-compiled on Linux)
|
||||
Get dependencies:
|
||||
```ssh
|
||||
```sh
|
||||
sudo apt-get install \
|
||||
build-essential pkg-config libc6-dev m4 g++-multilib libdb++-dev \
|
||||
autoconf libtool ncurses-dev unzip git zip \
|
||||
zlib1g-dev wget bsdmainutils automake mingw-w64 cmake libsodium-dev
|
||||
|
||||
git clone https://git.dragonx.is/DragonX/dragonx
|
||||
cd dragonx
|
||||
./util/build-win.sh -j$(nproc)
|
||||
```
|
||||
|
||||
Downloading Git source repo, building and running Hush:
|
||||
## Running
|
||||
|
||||
```sh
|
||||
# pull
|
||||
git clone https://git.hush.is/hush/hush3
|
||||
cd hush3
|
||||
# Build
|
||||
./util/build-win.sh -j$(nproc)
|
||||
# Run a HUSH node
|
||||
./src/hushd
|
||||
# Start the daemon
|
||||
./src/dragonxd
|
||||
|
||||
# In another terminal, interact via CLI
|
||||
./src/dragonx-cli getinfo
|
||||
./src/dragonx-cli z_getnewaddress
|
||||
```
|
||||
|
||||
# Official Explorers
|
||||
Data directory: `~/.hush/DRAGONX/`
|
||||
Config file: `~/.hush/DRAGONX/DRAGONX.conf`
|
||||
|
||||
The links for the Official Hush explorers:
|
||||
* [explorer.hush.is](https://explorer.hush.is)
|
||||
## Mining
|
||||
|
||||
# What is SilentDragon?
|
||||
DragonX uses the RandomX algorithm and is CPU-mineable. Point any RandomX-compatible
|
||||
miner (e.g. XMRig) at a DragonX stratum pool, or solo-mine with:
|
||||
|
||||
* [SilentDragon](https://git.hush.is/hush/SilentDragon) is a desktop wallet for HUSH full node.<br>
|
||||
* [SilentDragonLite](https://git.hush.is/hush/SilentDragonLite) is a desktop wallet that does not require you to download the full blockchain.
|
||||
* [SilentDragonAndroid](https://git.hush.is/hush/SilentDragonAndroid) is a wallet for Android devices.
|
||||
* [SilentDragonPaper](https://git.hush.is/hush/SilentDragonPaper) is a paper wallet generator that can be run completely offline.
|
||||
```sh
|
||||
./src/dragonxd -gen -genproclimit=$(nproc) -mineraddress=<your_zaddr>
|
||||
```
|
||||
|
||||
# What is HushChat?
|
||||
## Attribution
|
||||
|
||||
HushChat is a protocol inspired by the design of Signal Protocol, it uses many of the same cryptography and ideas, but does not actually use any code from Signal. Signal requires phone numbers and is a centralized service. HushChat is completely anonymous and decentralized and requires absolutely no metadata be given to any centralized third parties.
|
||||
DragonX is a fork of the [Hush Full Node](https://hush.is).
|
||||
Based on code from Zcash, Komodo, and Bitcoin Core.
|
||||
Licensed under GPLv3 — see [COPYING](COPYING) and [LICENSE](LICENSE).
|
||||
|
||||
# Can I mine with CPU or GPU?
|
||||
|
||||
Hush cannot be efficiently mined with CPU or GPU, only ASIC mining is recommended. HUSH uses Equihash (200,9) algo, as does Zcash, Horizen or Komodo.
|
||||
|
||||
# Where can I buy Hush?
|
||||
|
||||
1. https://nonkyc.io/market/HUSH_BTC
|
||||
1. https://tradeogre.com/exchange/BTC-HUSH
|
||||
|
||||
# Where can I spend Hush?
|
||||
|
||||
AgoraX market: https://agorax.is
|
||||
|
||||
# Earn Hush bounty
|
||||
|
||||
Developers can earn bounty by fixing bugs or solving feature requests listed in `Issues->Label`:
|
||||
- https://git.hush.is/hush/hush3/issues
|
||||
- https://git.hush.is/hush/SilentDragon/issues
|
||||
- https://git.hush.is/hush/SilentDragonLite/issues
|
||||
|
||||

|
||||
|
||||
# Support and Socials
|
||||
|
||||
* Telegram: [https://hush.is/tg](https://hush.is/tg)
|
||||
* Matrix: [https://hush.is/matrix](https://hush.is/matrix)
|
||||
* Twitter: [https://hush.is/twitter](https://hush.is/twitter)
|
||||
* PeerTube [https://hush.is/peertube](https://hush.is/peertube)
|
||||
|
||||
# License
|
||||
## License
|
||||
|
||||
For license information see the file [COPYING](COPYING).
|
||||
|
||||
145
build.sh
145
build.sh
@@ -1,19 +1,152 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2016-2024 The Hush developers
|
||||
# Copyright (c) 2024-2026 The DragonX developers
|
||||
# Distributed under the GPLv3 software license, see the accompanying
|
||||
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
|
||||
set -eu -o pipefail
|
||||
|
||||
# run correct build script for detected OS
|
||||
VERSION="1.0.0"
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
RELEASE_DIR="$SCRIPT_DIR/release"
|
||||
|
||||
# Parse release flags
|
||||
BUILD_LINUX_RELEASE=0
|
||||
BUILD_WIN_RELEASE=0
|
||||
BUILD_MAC_RELEASE=0
|
||||
REMAINING_ARGS=()
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--linux-release)
|
||||
BUILD_LINUX_RELEASE=1
|
||||
;;
|
||||
--win-release)
|
||||
BUILD_WIN_RELEASE=1
|
||||
;;
|
||||
--mac-release)
|
||||
BUILD_MAC_RELEASE=1
|
||||
;;
|
||||
--all-release)
|
||||
BUILD_LINUX_RELEASE=1
|
||||
BUILD_WIN_RELEASE=1
|
||||
BUILD_MAC_RELEASE=1
|
||||
;;
|
||||
*)
|
||||
REMAINING_ARGS+=("$arg")
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Clean artifacts that may conflict between platform builds
|
||||
clean_for_platform() {
|
||||
local platform="$1"
|
||||
echo "Cleaning build artifacts for $platform build..."
|
||||
|
||||
# Use make clean if Makefile exists (safer than manual deletion)
|
||||
if [ -f src/Makefile ]; then
|
||||
make -C src clean 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Remove final binaries
|
||||
if [ -d src ]; then
|
||||
rm -f src/dragonxd src/dragonx-cli src/dragonx-tx 2>/dev/null || true
|
||||
rm -f src/dragonxd.exe src/dragonx-cli.exe src/dragonx-tx.exe 2>/dev/null || true
|
||||
rm -f src/hushd src/hush-cli src/hush-tx 2>/dev/null || true
|
||||
rm -f src/hushd.exe src/hush-cli.exe src/hush-tx.exe 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Clean RandomX build for cross-platform compatibility
|
||||
rm -rf src/RandomX/build 2>/dev/null || true
|
||||
|
||||
# Clean cryptoconditions
|
||||
rm -rf src/cc/*.o src/cc/*.a 2>/dev/null || true
|
||||
|
||||
# Clean config cache (forces reconfigure for cross-platform)
|
||||
rm -f config.status config.log 2>/dev/null || true
|
||||
|
||||
echo "Clean complete for $platform"
|
||||
}
|
||||
|
||||
# Package release for a platform
|
||||
package_release() {
|
||||
local platform="$1"
|
||||
local release_subdir="$RELEASE_DIR/dragonx-$VERSION-$platform"
|
||||
|
||||
echo "Packaging release for $platform..."
|
||||
mkdir -p "$release_subdir"
|
||||
|
||||
# Copy bootstrap script
|
||||
cp "$SCRIPT_DIR/util/bootstrap-dragonx.sh" "$release_subdir/"
|
||||
|
||||
# Copy common files
|
||||
cp "$SCRIPT_DIR/contrib/asmap/asmap.dat" "$release_subdir/" 2>/dev/null || true
|
||||
cp "$SCRIPT_DIR/sapling-output.params" "$release_subdir/" 2>/dev/null || true
|
||||
cp "$SCRIPT_DIR/sapling-spend.params" "$release_subdir/" 2>/dev/null || true
|
||||
|
||||
case "$platform" in
|
||||
linux-amd64)
|
||||
cp "$SCRIPT_DIR/src/dragonxd" "$release_subdir/"
|
||||
cp "$SCRIPT_DIR/src/dragonx-cli" "$release_subdir/"
|
||||
cp "$SCRIPT_DIR/src/dragonx-tx" "$release_subdir/"
|
||||
strip "$release_subdir/dragonxd" "$release_subdir/dragonx-cli" "$release_subdir/dragonx-tx"
|
||||
;;
|
||||
win64)
|
||||
cp "$SCRIPT_DIR/src/dragonxd.exe" "$release_subdir/"
|
||||
cp "$SCRIPT_DIR/src/dragonx-cli.exe" "$release_subdir/"
|
||||
cp "$SCRIPT_DIR/src/dragonx-tx.exe" "$release_subdir/"
|
||||
x86_64-w64-mingw32-strip "$release_subdir/"*.exe 2>/dev/null || strip "$release_subdir/"*.exe 2>/dev/null || true
|
||||
;;
|
||||
macos)
|
||||
cp "$SCRIPT_DIR/src/dragonxd" "$release_subdir/"
|
||||
cp "$SCRIPT_DIR/src/dragonx-cli" "$release_subdir/"
|
||||
cp "$SCRIPT_DIR/src/dragonx-tx" "$release_subdir/"
|
||||
strip "$release_subdir/dragonxd" "$release_subdir/dragonx-cli" "$release_subdir/dragonx-tx" 2>/dev/null || true
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "Release packaged: $release_subdir"
|
||||
ls -la "$release_subdir"
|
||||
}
|
||||
|
||||
# Handle release builds
|
||||
if [ $BUILD_LINUX_RELEASE -eq 1 ] || [ $BUILD_WIN_RELEASE -eq 1 ] || [ $BUILD_MAC_RELEASE -eq 1 ]; then
|
||||
mkdir -p "$RELEASE_DIR"
|
||||
|
||||
if [ $BUILD_LINUX_RELEASE -eq 1 ]; then
|
||||
echo "=== Building Linux release ==="
|
||||
clean_for_platform linux
|
||||
./util/build.sh --disable-tests "${REMAINING_ARGS[@]}"
|
||||
package_release linux-amd64
|
||||
fi
|
||||
|
||||
if [ $BUILD_WIN_RELEASE -eq 1 ]; then
|
||||
echo "=== Building Windows release ==="
|
||||
clean_for_platform windows
|
||||
./util/build-win.sh --disable-tests "${REMAINING_ARGS[@]}"
|
||||
package_release win64
|
||||
fi
|
||||
|
||||
if [ $BUILD_MAC_RELEASE -eq 1 ]; then
|
||||
echo "=== Building macOS release ==="
|
||||
clean_for_platform macos
|
||||
./util/build-mac.sh --disable-tests "${REMAINING_ARGS[@]}"
|
||||
package_release macos
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "=== Release builds complete ==="
|
||||
ls -la "$RELEASE_DIR"/
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Standard build (auto-detect OS)
|
||||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
|
||||
./util/build.sh --disable-tests $@
|
||||
./util/build.sh --disable-tests "${REMAINING_ARGS[@]}"
|
||||
elif [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
./util/build-mac.sh --disable-tests $@
|
||||
./util/build-mac.sh --disable-tests "${REMAINING_ARGS[@]}"
|
||||
elif [[ "$OSTYPE" == "msys"* ]]; then
|
||||
./util/build-win.sh --disable-tests $@
|
||||
#elif [[ "$OSTYPE" == "freebsd"* ]]; then
|
||||
# placeholder
|
||||
./util/build-win.sh --disable-tests "${REMAINING_ARGS[@]}"
|
||||
else
|
||||
echo "Unable to detect your OS. What are you using?"
|
||||
fi
|
||||
|
||||
18
configure.ac
18
configure.ac
@@ -1,23 +1,27 @@
|
||||
dnl Copyright (c) 2024-2026 The DragonX developers
|
||||
dnl Copyright (c) 2016-2024 The Hush developers
|
||||
dnl Distributed under the GPLv3 software license, see the accompanying
|
||||
dnl file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
|
||||
AC_PREREQ([2.60])
|
||||
define(_CLIENT_VERSION_MAJOR, 3)
|
||||
define(_CLIENT_VERSION_MAJOR, 1)
|
||||
dnl Must be kept in sync with src/clientversion.h , ugh!
|
||||
define(_CLIENT_VERSION_MINOR, 10)
|
||||
define(_CLIENT_VERSION_REVISION, 5)
|
||||
define(_CLIENT_VERSION_MINOR, 0)
|
||||
define(_CLIENT_VERSION_REVISION, 0)
|
||||
define(_CLIENT_VERSION_BUILD, 50)
|
||||
define(_ZC_BUILD_VAL, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, m4_incr(_CLIENT_VERSION_BUILD), m4_eval(_CLIENT_VERSION_BUILD < 50), 1, m4_eval(_CLIENT_VERSION_BUILD - 24), m4_eval(_CLIENT_VERSION_BUILD == 50), 1, , m4_eval(_CLIENT_VERSION_BUILD - 50)))
|
||||
define(_CLIENT_VERSION_SUFFIX, m4_if(m4_eval(_CLIENT_VERSION_BUILD < 25), 1, _CLIENT_VERSION_REVISION-beta$1, m4_eval(_CLIENT_VERSION_BUILD < 50), 1, _CLIENT_VERSION_REVISION-rc$1, m4_eval(_CLIENT_VERSION_BUILD == 50), 1, _CLIENT_VERSION_REVISION, _CLIENT_VERSION_REVISION-$1)))
|
||||
define(_CLIENT_VERSION_IS_RELEASE, true)
|
||||
define(_COPYRIGHT_YEAR, 2026)
|
||||
AC_INIT([Hush],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_SUFFIX(_ZC_BUILD_VAL)],[https://git.hush.is/hush/hush3],[hush])
|
||||
AC_INIT([DragonX],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_SUFFIX(_ZC_BUILD_VAL)],[https://git.dragonx.is/DragonX/dragonx],[dragonx])
|
||||
AC_CONFIG_SRCDIR([src/main.cpp])
|
||||
AC_CONFIG_HEADERS([src/config/bitcoin-config.h])
|
||||
AC_CONFIG_AUX_DIR([build-aux])
|
||||
AC_CONFIG_MACRO_DIR([build-aux/m4])
|
||||
|
||||
BITCOIN_DAEMON_NAME=hushd
|
||||
BITCOIN_CLI_NAME=hush-cli
|
||||
BITCOIN_TX_NAME=hush-tx
|
||||
BITCOIN_DAEMON_NAME=dragonxd
|
||||
BITCOIN_CLI_NAME=dragonx-cli
|
||||
BITCOIN_TX_NAME=dragonx-tx
|
||||
|
||||
dnl Unless the user specified ARFLAGS, force it to be cr
|
||||
AC_ARG_VAR(ARFLAGS, [Flags for the archiver, defaults to <cr> if not set])
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
dragonx (1.0.0) stable; urgency=medium
|
||||
|
||||
* Initial release of DragonX, forked from Hush Full Node
|
||||
* Full legal-compliant rebrand: binaries, config, documentation
|
||||
* RandomX proof-of-work, 36-second block time, fully shielded transactions
|
||||
* New binary names: dragonxd, dragonx-cli, dragonx-tx
|
||||
|
||||
-- DragonX <dan-s-dev@proton.me> Mon, 03 Mar 2026 00:00:00 +0000
|
||||
|
||||
hush (3.10.5) stable; urgency=medium
|
||||
|
||||
* DragonX is no longer supported by this codebase
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
Source: hush
|
||||
Source: dragonx
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Hush <myhushteam@gmail.com>
|
||||
Homepage: https://hush.is
|
||||
Maintainer: DragonX <dan-s-dev@proton.me>
|
||||
Homepage: https://dragonx.is
|
||||
Build-Depends: autoconf, automake, bsdmainutils, build-essential,
|
||||
cmake, curl, git, g++-multilib, libc6-dev, libsodium-dev,
|
||||
libtool, m4, ncurses-dev, pkg-config, python,
|
||||
unzip, wget, zlib1g-dev
|
||||
Vcs-Git: https://git.hush.is/hush/hush3.git
|
||||
Vcs-Browser: https://git.hush.is/hush/hush3
|
||||
Vcs-Git: https://git.dragonx.is/DragonX/dragonx.git
|
||||
Vcs-Browser: https://git.dragonx.is/DragonX/dragonx
|
||||
|
||||
Package: hush
|
||||
Package: dragonx
|
||||
Architecture: amd64 arm64
|
||||
Depends: ${shlibs:Depends}
|
||||
Description: Cryptocoin full node for Hush
|
||||
Speak And Transact Freely with Hush, which inherits from Bitcoin Protocol and
|
||||
Zcash Protocol and is focused on private communications.
|
||||
Description: Privacy-focused cryptocurrency full node for DragonX
|
||||
DragonX is a privacy-focused cryptocurrency using RandomX proof-of-work.
|
||||
All transactions are shielded by default. Fork of the Hush Full Node.
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
Files: *
|
||||
Copyright: 2016-2026, The Hush developers
|
||||
Copyright: 2024-2026, The DragonX developers
|
||||
2016-2026, The Hush developers
|
||||
2009-2016, Bitcoin Core developers
|
||||
License: GPLv3
|
||||
Comment: https://hush.is
|
||||
Comment: https://dragonx.is
|
||||
|
||||
Files: depends/sources/libsodium-*.tar.gz
|
||||
Copyright: 2013-2016 Frank Denis
|
||||
|
||||
1
contrib/debian/dragonx.example
Normal file
1
contrib/debian/dragonx.example
Normal file
@@ -0,0 +1 @@
|
||||
DEBIAN/examples/DRAGONX.conf
|
||||
3
contrib/debian/dragonx.install
Normal file
3
contrib/debian/dragonx.install
Normal file
@@ -0,0 +1,3 @@
|
||||
usr/bin/dragonxd
|
||||
usr/bin/dragonx-cli
|
||||
usr/bin/dragonx-tx
|
||||
3
contrib/debian/dragonx.manpages
Normal file
3
contrib/debian/dragonx.manpages
Normal file
@@ -0,0 +1,3 @@
|
||||
DEBIAN/manpages/dragonx-cli.1
|
||||
DEBIAN/manpages/dragonx-tx.1
|
||||
DEBIAN/manpages/dragonxd.1
|
||||
209
contrib/debian/examples/DRAGONX.conf
Normal file
209
contrib/debian/examples/DRAGONX.conf
Normal file
@@ -0,0 +1,209 @@
|
||||
## DRAGONX.conf configuration file. Lines beginning with # are comments.
|
||||
|
||||
# Network-related settings:
|
||||
|
||||
# Run a regression test network
|
||||
#regtest=0
|
||||
# Run a test node (which means you can mine with no peers)
|
||||
#testnode=1
|
||||
|
||||
#set a custom client name/user agent
|
||||
#clientName=GoldenSandtrout
|
||||
|
||||
# Rescan from block height
|
||||
#rescan=123
|
||||
|
||||
# Connect via a SOCKS5 proxy
|
||||
#proxy=127.0.0.1:9050
|
||||
|
||||
# Automatically create Tor hidden service
|
||||
#listenonion=1
|
||||
|
||||
#Use separate SOCKS5 proxy to reach peers via Tor hidden services
|
||||
#onion=1.2.3.4:9050
|
||||
|
||||
# Only connect to nodes in network <net> (ipv4, ipv6, onion or i2p)"));
|
||||
#onlynet=<net>
|
||||
|
||||
#Tor control port to use if onion listening enabled
|
||||
#torcontrol=127.0.0.1:9051
|
||||
|
||||
# Bind to given address and always listen on it. Use [host]:port notation for IPv6
|
||||
#bind=<addr>
|
||||
|
||||
# Bind to given address and allowlist peers connecting to it. Use [host]:port notation for IPv6
|
||||
#allowbind=<addr>
|
||||
|
||||
##############################################################
|
||||
## Quick Primer on addnode vs connect ##
|
||||
## Let's say for instance you use addnode=4.2.2.4 ##
|
||||
## addnode will connect you to and tell you about the ##
|
||||
## nodes connected to 4.2.2.4. In addition it will tell ##
|
||||
## the other nodes connected to it that you exist so ##
|
||||
## they can connect to you. ##
|
||||
## connect will not do the above when you 'connect' to it. ##
|
||||
## It will *only* connect you to 4.2.2.4 and no one else.##
|
||||
## ##
|
||||
## So if you're behind a firewall, or have other problems ##
|
||||
## finding nodes, add some using 'addnode'. ##
|
||||
## ##
|
||||
## If you want to stay private, use 'connect' to only ##
|
||||
## connect to "trusted" nodes. ##
|
||||
## ##
|
||||
## If you run multiple nodes on a LAN, there's no need for ##
|
||||
## all of them to open lots of connections. Instead ##
|
||||
## 'connect' them all to one node that is port forwarded ##
|
||||
## and has lots of connections. ##
|
||||
## Thanks goes to [Noodle] on Freenode. ##
|
||||
##############################################################
|
||||
|
||||
# Use as many addnode= settings as you like to connect to specific peers
|
||||
#addnode=69.164.218.197
|
||||
#addnode=10.0.0.2:8233
|
||||
|
||||
# Alternatively use as many connect= settings as you like to connect ONLY to specific peers
|
||||
#connect=69.164.218.197
|
||||
#connect=10.0.0.1:8233
|
||||
|
||||
# Listening mode, enabled by default except when 'connect' is being used
|
||||
#listen=1
|
||||
|
||||
# Maximum number of inbound+outbound connections.
|
||||
#maxconnections=
|
||||
|
||||
#
|
||||
# JSON-RPC options (for controlling a running dragonxd process)
|
||||
#
|
||||
|
||||
# server=1 tells node to accept JSON-RPC commands (set as default if not specified)
|
||||
#server=1
|
||||
|
||||
# Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6.
|
||||
# This option can be specified multiple times (default: bind to all interfaces)
|
||||
#rpcbind=<addr>
|
||||
|
||||
# You must set rpcuser and rpcpassword to secure the JSON-RPC api
|
||||
# These will automatically be created for you
|
||||
#rpcuser=user
|
||||
#rpcpassword=supersecretpassword
|
||||
|
||||
# How many seconds node will wait for a complete RPC HTTP request.
|
||||
# after the HTTP connection is established.
|
||||
#rpcclienttimeout=30
|
||||
|
||||
# By default, only RPC connections from localhost are allowed.
|
||||
# Specify as many rpcallowip= settings as you like to allow connections from other hosts,
|
||||
# either as a single IPv4/IPv6 or with a subnet specification.
|
||||
|
||||
# NOTE: opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED,
|
||||
# because the rpcpassword is transmitted over the network unencrypted and also because anyone
|
||||
# that can authenticate on the RPC port can steal your keys + take over the account running dragonxd
|
||||
|
||||
#rpcallowip=10.1.1.34/255.255.255.0
|
||||
#rpcallowip=1.2.3.4/24
|
||||
#rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96
|
||||
|
||||
# Listen for RPC connections on this TCP port:
|
||||
#rpcport=1234
|
||||
|
||||
# You can use dragonxd to send commands to dragonxd
|
||||
# running on another host using this option:
|
||||
#rpcconnect=127.0.0.1
|
||||
|
||||
# Transaction Fee
|
||||
|
||||
# Send transactions as zero-fee transactions if possible (default: 0)
|
||||
#sendfreetransactions=0
|
||||
|
||||
# Create transactions that have enough fees (or priority) so they are likely to # begin confirmation within n blocks (default: 1).
|
||||
# This setting is overridden by the -paytxfee option.
|
||||
#txconfirmtarget=n
|
||||
|
||||
# Miscellaneous options
|
||||
|
||||
# Enable mining at startup
|
||||
#gen=1
|
||||
|
||||
# Set the number of threads to be used for mining (-1 = all cores).
|
||||
#genproclimit=1
|
||||
|
||||
# Specify a different Equihash solver (e.g. "tromp") to try to mine
|
||||
# faster when gen=1.
|
||||
#equihashsolver=default
|
||||
|
||||
# Pre-generate this many public/private key pairs, so wallet backups will be valid for
|
||||
# both prior transactions and several dozen future transactions.
|
||||
#keypool=100
|
||||
|
||||
# Pay an optional transaction fee every time you send a tx. Transactions with fees
|
||||
# are more likely than free transactions to be included in generated blocks, so may
|
||||
# be validated sooner. This setting does not affect private transactions created with
|
||||
# 'z_sendmany'.
|
||||
#paytxfee=0.00
|
||||
|
||||
#Rewind the chain to specific block height. This is useful for creating snapshots at a given block height.
|
||||
#rewind=555
|
||||
|
||||
#Stop the chain a specific block height. This is useful for creating snapshots at a given block height.
|
||||
#stopat=1000000
|
||||
|
||||
#Set an address to use as change address for all transactions. This value must be set to a 33 byte pubkey. All mined coins will also be sent to this address.
|
||||
#pubkey=027dc7b5cfb5efca96674b45e9fda18df069d040b9fd9ff32c35df56005e330392
|
||||
|
||||
# Disable clearnet (ipv4 and ipv6) connections to this node
|
||||
#clearnet=0
|
||||
|
||||
# Disable ipv4
|
||||
#disableipv4=1
|
||||
# Disable ipv6
|
||||
#disableipv6=1
|
||||
|
||||
# Enable transaction index
|
||||
#txindex=1
|
||||
# Enable address index
|
||||
#addressindex=1
|
||||
# Enable timestamp index
|
||||
#timestampindex=1
|
||||
# Enable spent index
|
||||
#spentindex=1
|
||||
|
||||
# Enable shielded stats index
|
||||
#zindex=1
|
||||
|
||||
# Attempt to salvage a corrupt wallet
|
||||
# salvagewallet=1
|
||||
|
||||
# Mine all blocks to this address (not good for your privacy and not recommended!)
|
||||
# Disallowed if clearnet=0
|
||||
# mineraddress=XXX
|
||||
|
||||
# Disable wallet
|
||||
#disablewallet=1
|
||||
|
||||
# Allow mining to an address that is not in the current wallet
|
||||
#minetolocalwallet=0
|
||||
|
||||
# Delete all wallet transactions
|
||||
#zapwallettxes=1
|
||||
|
||||
# Enable sapling consolidation
|
||||
# consolidation=1
|
||||
|
||||
# Enable stratum server
|
||||
# stratum=1
|
||||
|
||||
# Run a command each time a new block is seen
|
||||
# %s in command is replaced by block hash
|
||||
#blocknotify=/my/awesome/script.sh %s
|
||||
|
||||
# Run a command when wallet gets a new tx
|
||||
# %s in command is replaced with txid
|
||||
#walletnotify=/my/cool/script.sh %s
|
||||
|
||||
# Run a command when tx expires
|
||||
# %s in command is replaced with txid
|
||||
#txexpirynotify=/my/elite/script.sh %s
|
||||
|
||||
# Execute this commend to send a tx
|
||||
# %s is replaced with tx hex
|
||||
#txsend=/send/it.sh %s
|
||||
@@ -1 +1 @@
|
||||
DEBIAN/examples/HUSH3.conf
|
||||
DEBIAN/examples/DRAGONX.conf
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
usr/bin/hushd
|
||||
usr/bin/hush-cli
|
||||
usr/bin/hush-tx
|
||||
usr/bin/dragonxd
|
||||
usr/bin/dragonx-cli
|
||||
usr/bin/dragonx-tx
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
DEBIAN/manpages/hush-cli.1
|
||||
DEBIAN/manpages/hush-tx.1
|
||||
DEBIAN/manpages/hushd.1
|
||||
DEBIAN/manpages/dragonx-cli.1
|
||||
DEBIAN/manpages/dragonx-tx.1
|
||||
DEBIAN/manpages/dragonxd.1
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
Sample configuration files for:
|
||||
|
||||
SystemD: hushd.service
|
||||
Upstart: hushd.conf
|
||||
OpenRC: hushd.openrc
|
||||
hushd.openrcconf
|
||||
CentOS: hushd.init
|
||||
SystemD: dragonxd.service
|
||||
Upstart: dragonxd.conf
|
||||
OpenRC: dragonxd.openrc
|
||||
dragonxd.openrcconf
|
||||
CentOS: dragonxd.init
|
||||
|
||||
have been made available to assist packagers in creating node packages here.
|
||||
|
||||
|
||||
59
contrib/init/dragonxd.conf
Normal file
59
contrib/init/dragonxd.conf
Normal file
@@ -0,0 +1,59 @@
|
||||
description "Hush Daemon"
|
||||
|
||||
start on runlevel [2345]
|
||||
stop on starting rc RUNLEVEL=[016]
|
||||
|
||||
env HUSHD_BIN="/usr/bin/dragonxd"
|
||||
env HUSHD_USER="hush"
|
||||
env HUSHD_GROUP="hush"
|
||||
env HUSHD_PIDDIR="/var/run/dragonxd"
|
||||
# upstart can't handle variables constructed with other variables
|
||||
env HUSHD_PIDFILE="/var/run/dragonxd/dragonxd.pid"
|
||||
env HUSHD_CONFIGFILE="/etc/hush/hush.conf"
|
||||
env HUSHD_DATADIR="/var/lib/dragonxd"
|
||||
|
||||
expect fork
|
||||
|
||||
respawn
|
||||
respawn limit 5 120
|
||||
kill timeout 60
|
||||
|
||||
pre-start script
|
||||
# this will catch non-existent config files
|
||||
# dragonxd will check and exit with this very warning, but it can do so
|
||||
# long after forking, leaving upstart to think everything started fine.
|
||||
# since this is a commonly encountered case on install, just check and
|
||||
# warn here.
|
||||
if ! grep -qs '^rpcpassword=' "$HUSHD_CONFIGFILE" ; then
|
||||
echo "ERROR: You must set a secure rpcpassword to run dragonxd."
|
||||
echo "The setting must appear in $HUSHD_CONFIGFILE"
|
||||
echo
|
||||
echo "This password is security critical to securing wallets "
|
||||
echo "and must not be the same as the rpcuser setting."
|
||||
echo "You can generate a suitable random password using the following"
|
||||
echo "command from the shell:"
|
||||
echo
|
||||
echo "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'"
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$HUSHD_PIDDIR"
|
||||
chmod 0755 "$HUSHD_PIDDIR"
|
||||
chown $HUSHD_USER:$HUSHD_GROUP "$HUSHD_PIDDIR"
|
||||
chown $HUSHD_USER:$HUSHD_GROUP "$HUSHD_CONFIGFILE"
|
||||
chmod 0660 "$HUSHD_CONFIGFILE"
|
||||
end script
|
||||
|
||||
exec start-stop-daemon \
|
||||
--start \
|
||||
--pidfile "$HUSHD_PIDFILE" \
|
||||
--chuid $HUSHD_USER:$HUSHD_GROUP \
|
||||
--exec "$HUSHD_BIN" \
|
||||
-- \
|
||||
-pid="$HUSHD_PIDFILE" \
|
||||
-conf="$HUSHD_CONFIGFILE" \
|
||||
-datadir="$HUSHD_DATADIR" \
|
||||
-disablewallet \
|
||||
-daemon
|
||||
|
||||
67
contrib/init/dragonxd.init
Normal file
67
contrib/init/dragonxd.init
Normal file
@@ -0,0 +1,67 @@
|
||||
#!/usr/bin/env bash
|
||||
#
|
||||
# dragonxd The hush core server.
|
||||
#
|
||||
#
|
||||
# chkconfig: 345 80 20
|
||||
# description: dragonxd
|
||||
# processname: dragonxd
|
||||
#
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
# you can override defaults in /etc/sysconfig/dragonxd, see below
|
||||
if [ -f /etc/sysconfig/dragonxd ]; then
|
||||
. /etc/sysconfig/dragonxd
|
||||
fi
|
||||
|
||||
RETVAL=0
|
||||
|
||||
prog=dragonxd
|
||||
# you can override the lockfile via HUSHD_LOCKFILE in /etc/sysconfig/dragonxd
|
||||
lockfile=${HUSHD_LOCKFILE-/var/lock/subsys/dragonxd}
|
||||
|
||||
# dragonxd defaults to /usr/bin/dragonxd, override with HUSHD_BIN
|
||||
dragonxd=${HUSHD_BIN-/usr/bin/dragonxd}
|
||||
|
||||
# dragonxd opts default to -disablewallet, override with HUSHD_OPTS
|
||||
dragonxd_opts=${HUSHD_OPTS--disablewallet}
|
||||
|
||||
start() {
|
||||
echo -n $"Starting $prog: "
|
||||
daemon $DAEMONOPTS $dragonxd $dragonxd_opts
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch $lockfile
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop() {
|
||||
echo -n $"Stopping $prog: "
|
||||
killproc $prog
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f $lockfile
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
start
|
||||
;;
|
||||
stop)
|
||||
stop
|
||||
;;
|
||||
status)
|
||||
status $prog
|
||||
;;
|
||||
restart)
|
||||
stop
|
||||
start
|
||||
;;
|
||||
*)
|
||||
echo "Usage: service $prog {start|stop|status|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
87
contrib/init/dragonxd.openrc
Normal file
87
contrib/init/dragonxd.openrc
Normal file
@@ -0,0 +1,87 @@
|
||||
#!/sbin/runscript
|
||||
|
||||
# backward compatibility for existing gentoo layout
|
||||
#
|
||||
if [ -d "/var/lib/hush/.hush" ]; then
|
||||
HUSHD_DEFAULT_DATADIR="/var/lib/hush/.hush"
|
||||
else
|
||||
HUSHD_DEFAULT_DATADIR="/var/lib/dragonxd"
|
||||
fi
|
||||
|
||||
HUSHD_CONFIGFILE=${HUSHD_CONFIGFILE:-/etc/hush/hush.conf}
|
||||
HUSHD_PIDDIR=${HUSHD_PIDDIR:-/var/run/dragonxd}
|
||||
HUSHD_PIDFILE=${HUSHD_PIDFILE:-${HUSHD_PIDDIR}/dragonxd.pid}
|
||||
HUSHD_DATADIR=${HUSHD_DATADIR:-${HUSHD_DEFAULT_DATADIR}}
|
||||
HUSHD_USER=${HUSHD_USER:-${HUSH_USER:-hush}}
|
||||
HUSHD_GROUP=${HUSHD_GROUP:-hush}
|
||||
HUSHD_BIN=${HUSHD_BIN:-/usr/bin/dragonxd}
|
||||
HUSHD_NICE=${HUSHD_NICE:-${NICELEVEL:-0}}
|
||||
HUSHD_OPTS="${HUSHD_OPTS:-${HUSH_OPTS}}"
|
||||
|
||||
name="Hush Full Node Daemon"
|
||||
description="Hush cryptocurrency P2P network daemon"
|
||||
|
||||
command="/usr/bin/dragonxd"
|
||||
command_args="-pid=\"${HUSHD_PIDFILE}\" \
|
||||
-conf=\"${HUSHD_CONFIGFILE}\" \
|
||||
-datadir=\"${HUSHD_DATADIR}\" \
|
||||
-daemon \
|
||||
${HUSHD_OPTS}"
|
||||
|
||||
required_files="${HUSHD_CONFIGFILE}"
|
||||
start_stop_daemon_args="-u ${HUSHD_USER} \
|
||||
-N ${HUSHD_NICE} -w 2000"
|
||||
pidfile="${HUSHD_PIDFILE}"
|
||||
|
||||
# The retry schedule to use when stopping the daemon. Could be either
|
||||
# a timeout in seconds or multiple signal/timeout pairs (like
|
||||
# "SIGKILL/180 SIGTERM/300")
|
||||
retry="${HUSHD_SIGTERM_TIMEOUT}"
|
||||
|
||||
depend() {
|
||||
need localmount net
|
||||
}
|
||||
|
||||
# verify
|
||||
# 1) that the datadir exists and is writable (or create it)
|
||||
# 2) that a directory for the pid exists and is writable
|
||||
# 3) ownership and permissions on the config file
|
||||
start_pre() {
|
||||
checkpath \
|
||||
-d \
|
||||
--mode 0750 \
|
||||
--owner "${HUSHD_USER}:${HUSHD_GROUP}" \
|
||||
"${HUSHD_DATADIR}"
|
||||
|
||||
checkpath \
|
||||
-d \
|
||||
--mode 0755 \
|
||||
--owner "${HUSHD_USER}:${HUSHD_GROUP}" \
|
||||
"${HUSHD_PIDDIR}"
|
||||
|
||||
checkpath -f \
|
||||
-o ${HUSHD_USER}:${HUSHD_GROUP} \
|
||||
-m 0660 \
|
||||
${HUSHD_CONFIGFILE}
|
||||
|
||||
checkconfig || return 1
|
||||
}
|
||||
|
||||
checkconfig()
|
||||
{
|
||||
if ! grep -qs '^rpcpassword=' "${HUSHD_CONFIGFILE}" ; then
|
||||
eerror ""
|
||||
eerror "ERROR: You must set a secure rpcpassword to run dragonxd."
|
||||
eerror "The setting must appear in ${HUSHD_CONFIGFILE}"
|
||||
eerror ""
|
||||
eerror "This password is security critical to securing wallets "
|
||||
eerror "and must not be the same as the rpcuser setting."
|
||||
eerror "You can generate a suitable random password using the following"
|
||||
eerror "command from the shell:"
|
||||
eerror ""
|
||||
eerror "bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'"
|
||||
eerror ""
|
||||
eerror ""
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
33
contrib/init/dragonxd.openrcconf
Normal file
33
contrib/init/dragonxd.openrcconf
Normal file
@@ -0,0 +1,33 @@
|
||||
# /etc/conf.d/dragonxd: config file for /etc/init.d/dragonxd
|
||||
|
||||
# Config file location
|
||||
#HUSHD_CONFIGFILE="/etc/hush/hush.conf"
|
||||
|
||||
# What directory to write pidfile to? (created and owned by $HUSHD_USER)
|
||||
#HUSHD_PIDDIR="/var/run/dragonxd"
|
||||
|
||||
# What filename to give the pidfile
|
||||
#HUSHD_PIDFILE="${HUSHD_PIDDIR}/dragonxd.pid"
|
||||
|
||||
# Where to write dragonxd data (be mindful that the blockchain is large)
|
||||
#HUSHD_DATADIR="/var/lib/dragonxd"
|
||||
|
||||
# User and group to own dragonxd process
|
||||
#HUSHD_USER="hush"
|
||||
#HUSHD_GROUP="hush"
|
||||
|
||||
# Path to dragonxd executable
|
||||
#HUSHD_BIN="/usr/bin/dragonxd"
|
||||
|
||||
# Nice value to run dragonxd under
|
||||
#HUSHD_NICE=0
|
||||
|
||||
# Additional options (avoid -conf and -datadir, use flags above)
|
||||
HUSHD_OPTS="-disablewallet"
|
||||
|
||||
# The timeout in seconds OpenRC will wait for dragonxd to terminate
|
||||
# after a SIGTERM has been raised.
|
||||
# Note that this will be mapped as argument to start-stop-daemon's
|
||||
# '--retry' option, which means you can specify a retry schedule
|
||||
# here. For more information see man 8 start-stop-daemon.
|
||||
HUSHD_SIGTERM_TIMEOUT=60
|
||||
22
contrib/init/dragonxd.service
Normal file
22
contrib/init/dragonxd.service
Normal file
@@ -0,0 +1,22 @@
|
||||
[Unit]
|
||||
Description=Hush: Speak And Transact Freely
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=hush
|
||||
Group=hush
|
||||
|
||||
Type=forking
|
||||
PIDFile=/var/lib/dragonxd/dragonxd.pid
|
||||
ExecStart=/usr/bin/dragonxd -daemon -pid=/var/lib/dragonxd/dragonxd.pid \
|
||||
-conf=/etc/hush/hush.conf -datadir=/var/lib/dragonxd -disablewallet
|
||||
|
||||
Restart=always
|
||||
PrivateTmp=true
|
||||
TimeoutStopSec=60s
|
||||
TimeoutStartSec=2s
|
||||
StartLimitInterval=120s
|
||||
StartLimitBurst=5
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
7
doc/beefy-DRAGONX.conf
Normal file
7
doc/beefy-DRAGONX.conf
Normal file
@@ -0,0 +1,7 @@
|
||||
rpcuser=dontuseweakusernameoryougetrobbed
|
||||
rpcpassword=dontuseweakpasswordoryougetrobbed
|
||||
txindex=1
|
||||
server=1
|
||||
rpcworkqueue=64
|
||||
addnode=1.2.3.4
|
||||
addnode=5.6.7.8
|
||||
29
doc/dragonxd-systemd.md
Normal file
29
doc/dragonxd-systemd.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# Systemd script for the DragonX daemon
|
||||
|
||||
## Set it up
|
||||
|
||||
First set it up as follows:
|
||||
* Copy dragonxd.service to the systemd user directory, which is /usr/lib/systemd/user directory
|
||||
|
||||
## Basic Usage
|
||||
|
||||
How to start the script:
|
||||
`systemctl start --user dragonxd.service`
|
||||
|
||||
How to stop the script:
|
||||
`systemctl stop --user dragonxd.service`
|
||||
|
||||
How to restart the script:
|
||||
`systemctl restart --user dragonxd.service`
|
||||
|
||||
## How to watch it as it starts
|
||||
|
||||
Use the following on most Linux distros:
|
||||
`watch systemctl status --user dragonxd.service`
|
||||
|
||||
Or watch the log directly:
|
||||
`tail -f ~/.hush/DRAGONX/debug.log`
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
* Don't run it with sudo or root, or it won't work with the wallet.
|
||||
9
doc/dragonxd.service
Normal file
9
doc/dragonxd.service
Normal file
@@ -0,0 +1,9 @@
|
||||
[Unit]
|
||||
Description=DragonX daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/dragonxd
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
62
doc/init.md
62
doc/init.md
@@ -1,37 +1,37 @@
|
||||
*** Warning: This document has not been updated for Hush and may be inaccurate. ***
|
||||
|
||||
Sample init scripts and service configuration for bitcoind
|
||||
|
||||
Sample init scripts and service configuration for dragonxd
|
||||
==========================================================
|
||||
|
||||
Sample scripts and configuration files for systemd, Upstart and OpenRC
|
||||
can be found in the contrib/init folder.
|
||||
|
||||
contrib/init/bitcoind.service: systemd service unit configuration
|
||||
contrib/init/bitcoind.openrc: OpenRC compatible SysV style init script
|
||||
contrib/init/bitcoind.openrcconf: OpenRC conf.d file
|
||||
contrib/init/bitcoind.conf: Upstart service configuration file
|
||||
contrib/init/bitcoind.init: CentOS compatible SysV style init script
|
||||
contrib/init/dragonxd.service: systemd service unit configuration
|
||||
contrib/init/dragonxd.openrc: OpenRC compatible SysV style init script
|
||||
contrib/init/dragonxd.openrcconf: OpenRC conf.d file
|
||||
contrib/init/dragonxd.conf: Upstart service configuration file
|
||||
contrib/init/dragonxd.init: CentOS compatible SysV style init script
|
||||
|
||||
1. Service User
|
||||
---------------------------------
|
||||
|
||||
All three startup configurations assume the existence of a "bitcoin" user
|
||||
All three startup configurations assume the existence of a "dragonx" user
|
||||
and group. They must be created before attempting to use these scripts.
|
||||
|
||||
2. Configuration
|
||||
---------------------------------
|
||||
|
||||
At a bare minimum, bitcoind requires that the rpcpassword setting be set
|
||||
At a bare minimum, dragonxd requires that the rpcpassword setting be set
|
||||
when running as a daemon. If the configuration file does not exist or this
|
||||
setting is not set, bitcoind will shutdown promptly after startup.
|
||||
setting is not set, dragonxd will shutdown promptly after startup.
|
||||
|
||||
This password does not have to be remembered or typed as it is mostly used
|
||||
as a fixed token that bitcoind and client programs read from the configuration
|
||||
as a fixed token that dragonxd and client programs read from the configuration
|
||||
file, however it is recommended that a strong and secure password be used
|
||||
as this password is security critical to securing the wallet should the
|
||||
wallet be enabled.
|
||||
|
||||
If bitcoind is run with "-daemon" flag, and no rpcpassword is set, it will
|
||||
If dragonxd is run with "-daemon" flag, and no rpcpassword is set, it will
|
||||
print a randomly generated suitable password to stderr. You can also
|
||||
generate one from the shell yourself like this:
|
||||
|
||||
@@ -39,24 +39,24 @@ bash -c 'tr -dc a-zA-Z0-9 < /dev/urandom | head -c32 && echo'
|
||||
|
||||
|
||||
For an example configuration file that describes the configuration settings,
|
||||
see contrib/debian/examples/bitcoin.conf.
|
||||
see contrib/debian/examples/DRAGONX.conf.
|
||||
|
||||
3. Paths
|
||||
---------------------------------
|
||||
|
||||
All three configurations assume several paths that might need to be adjusted.
|
||||
|
||||
Binary: /usr/bin/bitcoind
|
||||
Configuration file: /etc/bitcoin/bitcoin.conf
|
||||
Data directory: /var/lib/bitcoind
|
||||
PID file: /var/run/bitcoind/bitcoind.pid (OpenRC and Upstart)
|
||||
/var/lib/bitcoind/bitcoind.pid (systemd)
|
||||
Lock file: /var/lock/subsys/bitcoind (CentOS)
|
||||
Binary: /usr/bin/dragonxd
|
||||
Configuration file: /etc/dragonx/DRAGONX.conf
|
||||
Data directory: /var/lib/dragonxd
|
||||
PID file: /var/run/dragonxd/dragonxd.pid (OpenRC and Upstart)
|
||||
/var/lib/dragonxd/dragonxd.pid (systemd)
|
||||
Lock file: /var/lock/subsys/dragonxd (CentOS)
|
||||
|
||||
The configuration file, PID directory (if applicable) and data directory
|
||||
should all be owned by the bitcoin user and group. It is advised for security
|
||||
should all be owned by the dragonx user and group. It is advised for security
|
||||
reasons to make the configuration file and data directory only readable by the
|
||||
bitcoin user and group. Access to bitcoin-cli and other bitcoind rpc clients
|
||||
dragonx user and group. Access to dragonx-cli and other dragonxd rpc clients
|
||||
can then be controlled by group membership.
|
||||
|
||||
4. Installing Service Configuration
|
||||
@@ -68,19 +68,19 @@ Installing this .service file consists of just copying it to
|
||||
/usr/lib/systemd/system directory, followed by the command
|
||||
"systemctl daemon-reload" in order to update running systemd configuration.
|
||||
|
||||
To test, run "systemctl start bitcoind" and to enable for system startup run
|
||||
"systemctl enable bitcoind"
|
||||
To test, run "systemctl start dragonxd" and to enable for system startup run
|
||||
"systemctl enable dragonxd"
|
||||
|
||||
4b) OpenRC
|
||||
|
||||
Rename bitcoind.openrc to bitcoind and drop it in /etc/init.d. Double
|
||||
Rename dragonxd.openrc to dragonxd and drop it in /etc/init.d. Double
|
||||
check ownership and permissions and make it executable. Test it with
|
||||
"/etc/init.d/bitcoind start" and configure it to run on startup with
|
||||
"rc-update add bitcoind"
|
||||
"/etc/init.d/dragonxd start" and configure it to run on startup with
|
||||
"rc-update add dragonxd"
|
||||
|
||||
4c) Upstart (for Debian/Ubuntu based distributions)
|
||||
|
||||
Drop bitcoind.conf in /etc/init. Test by running "service bitcoind start"
|
||||
Drop dragonxd.conf in /etc/init. Test by running "service dragonxd start"
|
||||
it will automatically start on reboot.
|
||||
|
||||
NOTE: This script is incompatible with CentOS 5 and Amazon Linux 2014 as they
|
||||
@@ -88,11 +88,11 @@ use old versions of Upstart and do not supply the start-stop-daemon utility.
|
||||
|
||||
4d) CentOS
|
||||
|
||||
Copy bitcoind.init to /etc/init.d/bitcoind. Test by running "service bitcoind start".
|
||||
Copy dragonxd.init to /etc/init.d/dragonxd. Test by running "service dragonxd start".
|
||||
|
||||
Using this script, you can adjust the path and flags to the bitcoind program by
|
||||
setting the BITCOIND and FLAGS environment variables in the file
|
||||
/etc/sysconfig/bitcoind. You can also use the DAEMONOPTS environment variable here.
|
||||
Using this script, you can adjust the path and flags to the dragonxd program by
|
||||
setting the DRAGONXD and FLAGS environment variables in the file
|
||||
/etc/sysconfig/dragonxd. You can also use the DAEMONOPTS environment variable here.
|
||||
|
||||
5. Auto-respawn
|
||||
-----------------------------------
|
||||
|
||||
@@ -1 +1 @@
|
||||
dist_man1_MANS=hushd.1 hush-cli.1 hush-tx.1
|
||||
dist_man1_MANS=dragonxd.1 dragonx-cli.1 dragonx-tx.1
|
||||
|
||||
91
doc/man/dragonx-cli.1
Normal file
91
doc/man/dragonx-cli.1
Normal file
@@ -0,0 +1,91 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DRAGONX-CLI "1" "March 2026" "dragonx-cli v1.0.0" "User Commands"
|
||||
.SH NAME
|
||||
dragonx-cli \- manual page for dragonx-cli v1.0.0
|
||||
.SH DESCRIPTION
|
||||
DragonX RPC client version v1.0.0\-04916cdf5
|
||||
.PP
|
||||
In order to ensure you are adequately protecting your privacy when using DragonX,
|
||||
please see <https://dragonx.is>.
|
||||
.SS "Usage:"
|
||||
.TP
|
||||
dragonx\-cli [options] <command> [params]
|
||||
Send command to DragonX
|
||||
.TP
|
||||
dragonx\-cli [options] help
|
||||
List commands
|
||||
.TP
|
||||
dragonx\-cli [options] help <command>
|
||||
Get help for a command
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
.IP
|
||||
This help message
|
||||
.HP
|
||||
\fB\-conf=\fR<file>
|
||||
.IP
|
||||
Specify configuration file (default: DRAGONX.conf)
|
||||
.HP
|
||||
\fB\-datadir=\fR<dir>
|
||||
.IP
|
||||
Specify data directory (this path cannot use '~')
|
||||
.HP
|
||||
\fB\-testnet\fR
|
||||
.IP
|
||||
Use the test network
|
||||
.HP
|
||||
\fB\-regtest\fR
|
||||
.IP
|
||||
Enter regression test mode, which uses a special chain in which blocks
|
||||
can be solved instantly. This is intended for regression testing
|
||||
tools and app development.
|
||||
.HP
|
||||
\fB\-rpcconnect=\fR<ip>
|
||||
.IP
|
||||
Send commands to node running on <ip> (default: 127.0.0.1)
|
||||
.HP
|
||||
\fB\-rpcport=\fR<port>
|
||||
.IP
|
||||
Connect to JSON\-RPC on <port> (default: 18030 )
|
||||
.HP
|
||||
\fB\-rpcwait\fR
|
||||
.IP
|
||||
Wait for RPC server to start
|
||||
.HP
|
||||
\fB\-rpcuser=\fR<user>
|
||||
.IP
|
||||
Username for JSON\-RPC connections
|
||||
.HP
|
||||
\fB\-rpcpassword=\fR<pw>
|
||||
.IP
|
||||
Password for JSON\-RPC connections
|
||||
.HP
|
||||
\fB\-rpcclienttimeout=\fR<n>
|
||||
.IP
|
||||
Timeout in seconds during HTTP requests, or 0 for no timeout. (default:
|
||||
900)
|
||||
.HP
|
||||
\fB\-stdin\fR
|
||||
.IP
|
||||
Read extra arguments from standard input, one per line until EOF/Ctrl\-D
|
||||
(recommended for sensitive information such as passphrases)
|
||||
.SH COPYRIGHT
|
||||
|
||||
In order to ensure you are adequately protecting your privacy when using DragonX,
|
||||
please see <https://dragonx.is>.
|
||||
|
||||
Copyright (C) 2024-2026 The DragonX Developers
|
||||
|
||||
Copyright (C) 2016-2026 Duke Leto and The Hush Developers
|
||||
|
||||
Copyright (C) 2016-2020 jl777 and SuperNET developers
|
||||
|
||||
Copyright (C) 2016-2018 The Zcash developers
|
||||
|
||||
Copyright (C) 2009-2014 The Bitcoin Core developers
|
||||
|
||||
This is experimental Free Software! Fuck Yeah!!!!!
|
||||
|
||||
Distributed under the GPLv3 software license, see the accompanying file COPYING
|
||||
or <https://www.gnu.org/licenses/gpl-3.0.en.html>.
|
||||
105
doc/man/dragonx-tx.1
Normal file
105
doc/man/dragonx-tx.1
Normal file
@@ -0,0 +1,105 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DRAGONX-TX "1" "March 2026" "dragonx-tx v1.0.0" "User Commands"
|
||||
.SH NAME
|
||||
dragonx-tx \- manual page for dragonx-tx v1.0.0
|
||||
.SH DESCRIPTION
|
||||
DragonX TX utility version v1.0.0\-04916cdf5
|
||||
.SS "Usage:"
|
||||
.TP
|
||||
dragonx\-tx [options] <hex\-tx> [commands]
|
||||
Update hex\-encoded DragonX transaction
|
||||
.TP
|
||||
dragonx\-tx [options] \fB\-create\fR [commands]
|
||||
Create hex\-encoded DragonX transaction
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
.IP
|
||||
This help message
|
||||
.HP
|
||||
\fB\-create\fR
|
||||
.IP
|
||||
Create new, empty TX.
|
||||
.HP
|
||||
\fB\-json\fR
|
||||
.IP
|
||||
Select JSON output
|
||||
.HP
|
||||
\fB\-txid\fR
|
||||
.IP
|
||||
Output only the hex\-encoded transaction id of the resultant transaction.
|
||||
.HP
|
||||
\fB\-regtest\fR
|
||||
.IP
|
||||
Enter regression test mode, which uses a special chain in which blocks
|
||||
can be solved instantly.
|
||||
.HP
|
||||
\fB\-testnet\fR
|
||||
.IP
|
||||
Use the test network
|
||||
.PP
|
||||
Commands:
|
||||
.IP
|
||||
delin=N
|
||||
.IP
|
||||
Delete input N from TX
|
||||
.IP
|
||||
delout=N
|
||||
.IP
|
||||
Delete output N from TX
|
||||
.IP
|
||||
in=TXID:VOUT(:SEQUENCE_NUMBER)
|
||||
.IP
|
||||
Add input to TX
|
||||
.IP
|
||||
locktime=N
|
||||
.IP
|
||||
Set TX lock time to N
|
||||
.IP
|
||||
nversion=N
|
||||
.IP
|
||||
Set TX version to N
|
||||
.IP
|
||||
outaddr=VALUE:ADDRESS
|
||||
.IP
|
||||
Add address\-based output to TX
|
||||
.IP
|
||||
outscript=VALUE:SCRIPT
|
||||
.IP
|
||||
Add raw script output to TX
|
||||
.IP
|
||||
sign=HEIGHT:SIGHASH\-FLAGS
|
||||
.IP
|
||||
Add zero or more signatures to transaction. This command requires JSON
|
||||
registers:prevtxs=JSON object, privatekeys=JSON object. See
|
||||
signrawtransaction docs for format of sighash flags, JSON
|
||||
objects.
|
||||
.PP
|
||||
Register Commands:
|
||||
.IP
|
||||
load=NAME:FILENAME
|
||||
.IP
|
||||
Load JSON file FILENAME into register NAME
|
||||
.IP
|
||||
set=NAME:JSON\-STRING
|
||||
.IP
|
||||
Set register NAME to given JSON\-STRING
|
||||
.SH COPYRIGHT
|
||||
|
||||
In order to ensure you are adequately protecting your privacy when using DragonX,
|
||||
please see <https://dragonx.is>.
|
||||
|
||||
Copyright (C) 2024-2026 The DragonX Developers
|
||||
|
||||
Copyright (C) 2016-2026 Duke Leto and The Hush Developers
|
||||
|
||||
Copyright (C) 2016-2020 jl777 and SuperNET developers
|
||||
|
||||
Copyright (C) 2016-2018 The Zcash developers
|
||||
|
||||
Copyright (C) 2009-2014 The Bitcoin Core developers
|
||||
|
||||
This is experimental Free Software! Fuck Yeah!!!!!
|
||||
|
||||
Distributed under the GPLv3 software license, see the accompanying file COPYING
|
||||
or <https://www.gnu.org/licenses/gpl-3.0.en.html>.
|
||||
781
doc/man/dragonxd.1
Normal file
781
doc/man/dragonxd.1
Normal file
@@ -0,0 +1,781 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.49.3.
|
||||
.TH DRAGONXD "1" "March 2026" "dragonxd v1.0.0" "User Commands"
|
||||
.SH NAME
|
||||
dragonxd \- manual page for dragonxd v1.0.0
|
||||
.SH DESCRIPTION
|
||||
DragonX Daemon version v1.0.0\-04916cdf5
|
||||
.PP
|
||||
In order to ensure you are adequately protecting your privacy when using DragonX,
|
||||
please see <https://dragonx.is>.
|
||||
.SS "Usage:"
|
||||
.TP
|
||||
dragonxd [options]
|
||||
Start a DragonX Daemon
|
||||
.SH OPTIONS
|
||||
.HP
|
||||
\-?
|
||||
.IP
|
||||
This help message
|
||||
.HP
|
||||
\fB\-blocknotify=\fR<cmd>
|
||||
.IP
|
||||
Execute command when the best block changes (%s in cmd is replaced by
|
||||
block hash)
|
||||
.HP
|
||||
\fB\-checkblocks=\fR<n>
|
||||
.IP
|
||||
How many blocks to check at startup (default: 288, 0 = all)
|
||||
.HP
|
||||
\fB\-checklevel=\fR<n>
|
||||
.IP
|
||||
How thorough the block verification of \fB\-checkblocks\fR is (0\-4, default: 3)
|
||||
.HP
|
||||
\fB\-clientname=\fR<SomeName>
|
||||
.IP
|
||||
Full node client name, default 'GoldenSandtrout'
|
||||
.HP
|
||||
\fB\-conf=\fR<file>
|
||||
.IP
|
||||
Specify configuration file (default: DRAGONX.conf)
|
||||
.HP
|
||||
\fB\-daemon\fR
|
||||
.IP
|
||||
Run in the background as a daemon and accept commands
|
||||
.HP
|
||||
\fB\-datadir=\fR<dir>
|
||||
.IP
|
||||
Specify data directory (this path cannot use '~')
|
||||
.HP
|
||||
\fB\-exportdir=\fR<dir>
|
||||
.IP
|
||||
Specify directory to be used when exporting data
|
||||
.HP
|
||||
\fB\-dbcache=\fR<n>
|
||||
.IP
|
||||
Set database cache size in megabytes (4 to 16384, default: 512)
|
||||
.HP
|
||||
\fB\-loadblock=\fR<file>
|
||||
.IP
|
||||
Imports blocks from external blk000??.dat file on startup
|
||||
.HP
|
||||
\fB\-maxdebugfilesize=\fR<n>
|
||||
.IP
|
||||
Set the max size of the debug.log file (default: 15)
|
||||
.HP
|
||||
\fB\-maxorphantx=\fR<n>
|
||||
.IP
|
||||
Keep at most <n> unconnectable transactions in memory (default: 100)
|
||||
.HP
|
||||
\fB\-maxreorg=\fR<n>
|
||||
.IP
|
||||
Specify the maximum length of a blockchain re\-organization
|
||||
.HP
|
||||
\fB\-mempooltxinputlimit=\fR<n>
|
||||
.IP
|
||||
[DEPRECATED/IGNORED] Set the maximum number of transparent inputs in a
|
||||
transaction that the mempool will accept (default: 0 = no limit
|
||||
applied)
|
||||
.HP
|
||||
\fB\-par=\fR<n>
|
||||
.IP
|
||||
Set the number of script verification threads (\fB\-32\fR to 16, 0 = auto, <0 =
|
||||
leave that many cores free, default: 0)
|
||||
.HP
|
||||
\fB\-pid=\fR<file>
|
||||
.IP
|
||||
Specify pid file (default: dragonxd.pid)
|
||||
.HP
|
||||
\fB\-txexpirynotify=\fR<cmd>
|
||||
.IP
|
||||
Execute command when transaction expires (%s in cmd is replaced by
|
||||
transaction id)
|
||||
.HP
|
||||
\fB\-prune=\fR<n>
|
||||
.IP
|
||||
Reduce storage requirements by pruning (deleting) old blocks. This mode
|
||||
disables wallet support and is incompatible with \fB\-txindex\fR.
|
||||
Warning: Reverting this setting requires re\-downloading the
|
||||
entire blockchain. (default: 0 = disable pruning blocks, >550 =
|
||||
target size in MiB to use for block files)
|
||||
.HP
|
||||
\fB\-reindex\fR
|
||||
.IP
|
||||
Rebuild block chain index from current blk000??.dat files on startup
|
||||
.HP
|
||||
\fB\-sysperms\fR
|
||||
.IP
|
||||
Create new files with system default permissions, instead of umask 077
|
||||
(only effective with disabled wallet functionality)
|
||||
.HP
|
||||
\fB\-txindex\fR
|
||||
.IP
|
||||
Maintain a full transaction index, used by the getrawtransaction rpc
|
||||
call (default: 0)
|
||||
.HP
|
||||
\fB\-txsend=\fR<cmd>
|
||||
.IP
|
||||
Execute command to send a transaction instead of broadcasting (%s in cmd
|
||||
is replaced by transaction hex)
|
||||
.HP
|
||||
\fB\-addressindex\fR
|
||||
.IP
|
||||
Maintain a full address index, used to query for the balance, txids and
|
||||
unspent outputs for addresses (default: 0)
|
||||
.HP
|
||||
\fB\-timestampindex\fR
|
||||
.IP
|
||||
Maintain a timestamp index for block hashes, used to query blocks hashes
|
||||
by a range of timestamps (default: 0)
|
||||
.HP
|
||||
\fB\-spentindex\fR
|
||||
.IP
|
||||
Maintain a full spent index, used to query the spending txid and input
|
||||
index for an outpoint (default: 0)
|
||||
.HP
|
||||
\fB\-zindex\fR
|
||||
.IP
|
||||
Maintain extra statistics about shielded transactions and payments
|
||||
(default: 0)
|
||||
.PP
|
||||
Connection options:
|
||||
.HP
|
||||
\fB\-addnode=\fR<ip>
|
||||
.IP
|
||||
Add a node to connect to and attempt to keep the connection open
|
||||
.HP
|
||||
\fB\-asmap=\fR<file>
|
||||
.IP
|
||||
Specify ASN mapping used for bucketing of the peers (default:
|
||||
asmap.dat). Relative paths will be prefixed by the net\-specific
|
||||
datadir location.
|
||||
.HP
|
||||
\fB\-banscore=\fR<n>
|
||||
.IP
|
||||
Threshold for disconnecting misbehaving peers (default: 100)
|
||||
.HP
|
||||
\fB\-bantime=\fR<n>
|
||||
.IP
|
||||
Number of seconds to keep misbehaving peers from reconnecting (default:
|
||||
86400)
|
||||
.HP
|
||||
\fB\-bind=\fR<addr>
|
||||
.IP
|
||||
Bind to given address and always listen on it. Use [host]:port notation
|
||||
for IPv6
|
||||
.HP
|
||||
\fB\-connect=\fR<ip>
|
||||
.IP
|
||||
Connect only to the specified node(s)
|
||||
.HP
|
||||
\fB\-discover\fR
|
||||
.IP
|
||||
Discover own IP addresses (default: 1 when listening and no \fB\-externalip\fR
|
||||
or \fB\-proxy\fR)
|
||||
.HP
|
||||
\fB\-dns\fR
|
||||
.IP
|
||||
Allow DNS lookups for \fB\-addnode\fR, \fB\-seednode\fR and \fB\-connect\fR (default: 1)
|
||||
.HP
|
||||
\fB\-dnsseed\fR
|
||||
.IP
|
||||
Query for peer addresses via DNS lookup, if low on addresses (default: 1
|
||||
unless \fB\-connect\fR)
|
||||
.HP
|
||||
\fB\-externalip=\fR<ip>
|
||||
.IP
|
||||
Specify your own public address
|
||||
.HP
|
||||
\fB\-forcednsseed\fR
|
||||
.IP
|
||||
Always query for peer addresses via DNS lookup (default: 0)
|
||||
.HP
|
||||
\fB\-listen\fR
|
||||
.IP
|
||||
Accept connections from outside (default: 1 if no \fB\-proxy\fR or \fB\-connect\fR)
|
||||
.HP
|
||||
\fB\-listenonion\fR
|
||||
.IP
|
||||
Automatically create Tor hidden service (default: 1)
|
||||
.HP
|
||||
\fB\-maxconnections=\fR<n>
|
||||
.IP
|
||||
Maintain at most <n> connections to peers (default: 384)
|
||||
.HP
|
||||
\fB\-maxreceivebuffer=\fR<n>
|
||||
.IP
|
||||
Maximum per\-connection receive buffer, <n>*1000 bytes (default: 5000)
|
||||
.HP
|
||||
\fB\-maxsendbuffer=\fR<n>
|
||||
.IP
|
||||
Maximum per\-connection send buffer, <n>*1000 bytes (default: 1000)
|
||||
.HP
|
||||
\fB\-onion=\fR<ip:port>
|
||||
.IP
|
||||
Use separate SOCKS5 proxy to reach peers via Tor hidden services
|
||||
(default: \fB\-proxy\fR)
|
||||
.HP
|
||||
\fB\-nspv_msg\fR
|
||||
.IP
|
||||
Enable NSPV messages processing (default: true when \fB\-ac_private\fR=\fI\,1\/\fR,
|
||||
otherwise false)
|
||||
.HP
|
||||
\fB\-i2psam=\fR<ip:port>
|
||||
.IP
|
||||
I2P SAM proxy to reach I2P peers and accept I2P connections (default:
|
||||
none)
|
||||
.HP
|
||||
\fB\-i2pacceptincoming\fR
|
||||
.IP
|
||||
If set and \fB\-i2psam\fR is also set then incoming I2P connections are
|
||||
accepted via the SAM proxy. If this is not set but \fB\-i2psam\fR is set
|
||||
then only outgoing connections will be made to the I2P network.
|
||||
Ignored if \fB\-i2psam\fR is not set. Listening for incoming I2P
|
||||
connections is done through the SAM proxy, not by binding to a
|
||||
local address and port (default: 1)
|
||||
.HP
|
||||
\fB\-onlynet=\fR<net>
|
||||
.IP
|
||||
Only connect to nodes in network <net> (ipv4, ipv6, onion or i2p)
|
||||
.HP
|
||||
\fB\-disableipv4\fR
|
||||
.IP
|
||||
Disable Ipv4 network connections (default: 0)
|
||||
.HP
|
||||
\fB\-disableipv6\fR
|
||||
.IP
|
||||
Disable Ipv6 network connections (default: 0)
|
||||
.HP
|
||||
\fB\-clearnet\fR
|
||||
.IP
|
||||
Enable clearnet connections. Setting to 0 will disable clearnet and use
|
||||
sane defaults for Tor/i2p (default: 1)
|
||||
.HP
|
||||
\fB\-permitbaremultisig\fR
|
||||
.IP
|
||||
Relay non\-P2SH multisig (default: 1)
|
||||
.HP
|
||||
\fB\-peerbloomfilters\fR
|
||||
.IP
|
||||
Support filtering of blocks and transaction with Bloom filters (default:
|
||||
1)
|
||||
.HP
|
||||
\fB\-port=\fR<port>
|
||||
.IP
|
||||
Listen for connections on <port> (default: 55555 or testnet: 55420)
|
||||
.HP
|
||||
\fB\-proxy=\fR<ip:port>
|
||||
.IP
|
||||
Connect through SOCKS5 proxy
|
||||
.HP
|
||||
\fB\-proxyrandomize\fR
|
||||
.IP
|
||||
Randomize credentials for every proxy connection. This enables Tor
|
||||
stream isolation (default: 1)
|
||||
.HP
|
||||
\fB\-seednode=\fR<ip>
|
||||
.IP
|
||||
Connect to a node to retrieve peer addresses, and disconnect
|
||||
.HP
|
||||
\fB\-timeout=\fR<n>
|
||||
.IP
|
||||
Specify connection timeout in milliseconds (minimum: 1, default: 60000)
|
||||
.HP
|
||||
\fB\-torcontrol=\fR<ip>:<port>
|
||||
.IP
|
||||
Tor control port to use if onion listening enabled (default:
|
||||
127.0.0.1:9051)
|
||||
.HP
|
||||
\fB\-torpassword=\fR<pass>
|
||||
.IP
|
||||
Tor control port password (default: empty)
|
||||
.HP
|
||||
\fB\-tls=\fR<option>
|
||||
.IP
|
||||
Specify TLS usage (default: 1 => enabled and required); Cannot be turned
|
||||
off.
|
||||
.HP
|
||||
\fB\-tlsvalidate=\fR<0 or 1>
|
||||
.IP
|
||||
Connect to peers only with valid certificates (default: 0)
|
||||
.HP
|
||||
\fB\-tlskeypath=\fR<path>
|
||||
.IP
|
||||
Full path to a private key
|
||||
.HP
|
||||
\fB\-tlskeypwd=\fR<password>
|
||||
.IP
|
||||
Password for a private key encryption (default: not set, i.e. private
|
||||
key will be stored unencrypted)
|
||||
.HP
|
||||
\fB\-tlscertpath=\fR<path>
|
||||
.IP
|
||||
Full path to a certificate
|
||||
.HP
|
||||
\fB\-tlstrustdir=\fR<path>
|
||||
.IP
|
||||
Full path to a trusted certificates directory
|
||||
.HP
|
||||
\fB\-allowbind=\fR<addr>
|
||||
.IP
|
||||
Bind to given address and allowlist peers connecting to it. Use
|
||||
[host]:port notation for IPv6
|
||||
.HP
|
||||
\fB\-allowlist=\fR<netmask>
|
||||
.IP
|
||||
Allowlist peers connecting from the given netmask or IP address. Can be
|
||||
specified multiple times. Allowlisted peers cannot be DoS banned
|
||||
and their transactions are always relayed, even if they are
|
||||
already in the mempool, useful e.g. for a gateway
|
||||
.PP
|
||||
Wallet options:
|
||||
.HP
|
||||
\fB\-disablewallet\fR
|
||||
.IP
|
||||
Do not load the wallet and disable wallet RPC calls
|
||||
.HP
|
||||
\fB\-keypool=\fR<n>
|
||||
.IP
|
||||
Set key pool size to <n> (default: 100)
|
||||
.HP
|
||||
\fB\-consolidation\fR
|
||||
.IP
|
||||
Enable auto Sapling note consolidation (default: false)
|
||||
.HP
|
||||
\fB\-consolidationinterval\fR
|
||||
.IP
|
||||
Block interval between consolidations (default: 25)
|
||||
.HP
|
||||
\fB\-consolidatesaplingaddress=\fR<zaddr>
|
||||
.IP
|
||||
Specify Sapling Address to Consolidate. (default: all)
|
||||
.HP
|
||||
\fB\-consolidationtxfee\fR
|
||||
.IP
|
||||
Fee amount in Puposhis used send consolidation transactions. (default
|
||||
10000)
|
||||
.HP
|
||||
\fB\-zsweep\fR
|
||||
.IP
|
||||
Enable zaddr sweeping, automatically move all shielded funds to a one
|
||||
address once per X blocks
|
||||
.HP
|
||||
\fB\-zsweepaddress=\fR<zaddr>
|
||||
.IP
|
||||
Specify the shielded address where swept funds will be sent)
|
||||
.HP
|
||||
\fB\-zsweepfee\fR
|
||||
.IP
|
||||
Fee amount in puposhis used send sweep transactions. (default 10000)
|
||||
.HP
|
||||
\fB\-zsweepinterval\fR
|
||||
.IP
|
||||
Sweep shielded funds every X blocks (default 5)
|
||||
.HP
|
||||
\fB\-zsweepmaxinputs\fR
|
||||
.IP
|
||||
Maximum number of shielded inputs to sweep per transaction (default 8)
|
||||
.HP
|
||||
\fB\-zsweepexternal\fR
|
||||
.IP
|
||||
Enable sweeping to an external wallet (default false)
|
||||
.HP
|
||||
\fB\-zsweepexclude\fR
|
||||
.IP
|
||||
Addresses to exclude from sweeping (default none)
|
||||
.HP
|
||||
\fB\-deletetx\fR
|
||||
.IP
|
||||
Enable Old Transaction Deletion
|
||||
.HP
|
||||
\fB\-deleteinterval\fR
|
||||
.IP
|
||||
Delete transaction every <n> blocks during inital block download
|
||||
(default: 1000)
|
||||
.HP
|
||||
\fB\-keeptxnum\fR
|
||||
.IP
|
||||
Keep the last <n> transactions (default: 200)
|
||||
.HP
|
||||
\fB\-keeptxfornblocks\fR
|
||||
.IP
|
||||
Keep transactions for at least <n> blocks (default: 10000)
|
||||
.HP
|
||||
\fB\-paytxfee=\fR<amt>
|
||||
.IP
|
||||
Fee (in HUSH/kB) to add to transactions you send (default: 0.00)
|
||||
.HP
|
||||
\fB\-keepnotewitnesscache\fR
|
||||
.IP
|
||||
Keep partial Sapling Note Witness cache. Must be used with \fB\-rescanheight\fR
|
||||
to find missing cache items.
|
||||
.HP
|
||||
\fB\-rescan\fR
|
||||
.IP
|
||||
Rescan the block chain for missing wallet transactions on startup
|
||||
.HP
|
||||
\fB\-rescanheight\fR
|
||||
.IP
|
||||
Rescan from specified height when rescan=1 on startup
|
||||
.HP
|
||||
\fB\-salvagewallet\fR
|
||||
.IP
|
||||
Attempt to recover private keys from a corrupt wallet.dat on startup
|
||||
.HP
|
||||
\fB\-sendfreetransactions\fR
|
||||
.IP
|
||||
Send transactions as zero\-fee transactions if possible (default: 0)
|
||||
.HP
|
||||
\fB\-spendzeroconfchange\fR
|
||||
.IP
|
||||
Spend unconfirmed change when sending transactions (default: 1)
|
||||
.HP
|
||||
\fB\-txconfirmtarget=\fR<n>
|
||||
.IP
|
||||
If paytxfee is not set, include enough fee so transactions begin
|
||||
confirmation on average within n blocks (default: 2)
|
||||
.HP
|
||||
\fB\-txexpirydelta\fR
|
||||
.IP
|
||||
Set the number of blocks after which a transaction that has not been
|
||||
mined will become invalid (default: 200)
|
||||
.HP
|
||||
\fB\-maxtxfee=\fR<amt>
|
||||
.IP
|
||||
Maximum total fees (in HUSH) to use in a single wallet transaction;
|
||||
setting this too low may abort large transactions (default: 0.10)
|
||||
.HP
|
||||
\fB\-upgradewallet\fR
|
||||
.IP
|
||||
Upgrade wallet to latest format on startup
|
||||
.HP
|
||||
\fB\-wallet=\fR<file>
|
||||
.IP
|
||||
Specify wallet file absolute path or a path relative to the data
|
||||
directory (default: wallet.dat)
|
||||
.HP
|
||||
\fB\-walletbroadcast\fR
|
||||
.IP
|
||||
Make the wallet broadcast transactions (default: 1)
|
||||
.HP
|
||||
\fB\-walletnotify=\fR<cmd>
|
||||
.IP
|
||||
Execute command when a wallet transaction changes (%s in cmd is replaced
|
||||
by TxID)
|
||||
.HP
|
||||
\fB\-allowlistaddress=\fR<Raddress>
|
||||
.IP
|
||||
Enable the wallet filter for notary nodes and add one Raddress to the
|
||||
allowlist of the wallet filter. If \fB\-allowlistaddress=\fR is used,
|
||||
then the wallet filter is automatically activated. Several
|
||||
Raddresses can be defined using several \fB\-allowlistaddress=\fR
|
||||
(similar to \fB\-addnode\fR). The wallet filter will filter the utxo to
|
||||
only ones coming from my own Raddress (derived from pubkey) and
|
||||
each Raddress defined using \fB\-allowlistaddress=\fR this option is
|
||||
mostly for Notary Nodes).
|
||||
.HP
|
||||
\fB\-zapwallettxes=\fR<mode>
|
||||
.IP
|
||||
Delete all wallet transactions and only recover those parts of the
|
||||
blockchain through \fB\-rescan\fR on startup (1 = keep tx meta data e.g.
|
||||
account owner and payment request information, 2 = drop tx meta
|
||||
data)
|
||||
.PP
|
||||
Debugging/Testing options:
|
||||
.HP
|
||||
\fB\-debug=\fR<category>
|
||||
.IP
|
||||
Output debugging information (default: 0, supplying <category> is
|
||||
optional). If <category> is not supplied or if <category> = 1,
|
||||
output all debugging information. <category> can be: addrman,
|
||||
bench, coindb, db, deletetx, estimatefee, http, libevent, lock,
|
||||
mempool, net, tls, partitioncheck, pow, proxy, prune, rand,
|
||||
randomx, reindex, rpc, selectcoins, stratum, tor, zrpc,
|
||||
zrpcunsafe (implies zrpc).
|
||||
.HP
|
||||
\fB\-experimentalfeatures\fR
|
||||
.IP
|
||||
Enable use of experimental features
|
||||
.HP
|
||||
\fB\-help\-debug\fR
|
||||
.IP
|
||||
Show all debugging options (usage: \fB\-\-help\fR \fB\-help\-debug\fR)
|
||||
.HP
|
||||
\fB\-logips\fR
|
||||
.IP
|
||||
Include IP addresses in debug output (default: 0)
|
||||
.HP
|
||||
\fB\-logtimestamps\fR
|
||||
.IP
|
||||
Prepend debug output with timestamp (default: 1)
|
||||
.HP
|
||||
\fB\-minrelaytxfee=\fR<amt>
|
||||
.IP
|
||||
Fees (in HUSH/kB) smaller than this are considered zero fee for relaying
|
||||
(default: 0.000001)
|
||||
.HP
|
||||
\fB\-printtoconsole\fR
|
||||
.IP
|
||||
Send trace/debug info to console instead of debug.log file
|
||||
.HP
|
||||
\fB\-shrinkdebugfile\fR
|
||||
.IP
|
||||
Shrink debug.log file on client startup (default: 1 when no \fB\-debug\fR)
|
||||
.HP
|
||||
\fB\-testnet\fR
|
||||
.IP
|
||||
Use the test network
|
||||
.PP
|
||||
Node relay options:
|
||||
.HP
|
||||
\fB\-datacarrier\fR
|
||||
.IP
|
||||
Relay and mine data carrier transactions (default: 1)
|
||||
.HP
|
||||
\fB\-datacarriersize\fR
|
||||
.IP
|
||||
Maximum size of data in data carrier transactions we relay and mine
|
||||
(default: 8192)
|
||||
.PP
|
||||
Block creation options:
|
||||
.HP
|
||||
\fB\-blockminsize=\fR<n>
|
||||
.IP
|
||||
Set minimum block size in bytes (default: 0)
|
||||
.HP
|
||||
\fB\-blockmaxsize=\fR<n>
|
||||
.IP
|
||||
Set maximum block size in bytes (default: 2000000)
|
||||
.HP
|
||||
\fB\-blockprioritysize=\fR<n>
|
||||
.IP
|
||||
Set maximum size of high\-priority/low\-fee transactions in bytes
|
||||
(default: 1000000)
|
||||
.PP
|
||||
Mining options:
|
||||
.HP
|
||||
\fB\-gen\fR
|
||||
.IP
|
||||
Mine/generate coins (default: 0)
|
||||
.HP
|
||||
\fB\-genproclimit=\fR<n>
|
||||
.IP
|
||||
Set the number of threads for coin mining if enabled (\fB\-1\fR = all cores,
|
||||
default: 0)
|
||||
.HP
|
||||
\fB\-equihashsolver=\fR<name>
|
||||
.IP
|
||||
Specify the Equihash solver to be used if enabled (default: "default")
|
||||
.HP
|
||||
\fB\-mineraddress=\fR<addr>
|
||||
.IP
|
||||
Send mined coins to a specific single address
|
||||
.HP
|
||||
\fB\-minetolocalwallet\fR
|
||||
.IP
|
||||
Require that mined blocks use a coinbase address in the local wallet
|
||||
(default: 1)
|
||||
.PP
|
||||
RPC server options:
|
||||
.HP
|
||||
\fB\-server\fR
|
||||
.IP
|
||||
Accept command line and JSON\-RPC commands
|
||||
.HP
|
||||
\fB\-rest\fR
|
||||
.IP
|
||||
Accept public REST requests (default: 0)
|
||||
.HP
|
||||
\fB\-rpcbind=\fR<addr>
|
||||
.IP
|
||||
Bind to given address to listen for JSON\-RPC connections. Use
|
||||
[host]:port notation for IPv6. This option can be specified
|
||||
multiple times (default: bind to all interfaces)
|
||||
.HP
|
||||
\fB\-rpcuser=\fR<user>
|
||||
.IP
|
||||
Username for JSON\-RPC connections
|
||||
.HP
|
||||
\fB\-rpcpassword=\fR<pw>
|
||||
.IP
|
||||
Password for JSON\-RPC connections
|
||||
.HP
|
||||
\fB\-rpcport=\fR<port>
|
||||
.IP
|
||||
Listen for JSON\-RPC connections on <port> (default: 0 or testnet: 10000)
|
||||
.HP
|
||||
\fB\-rpcallowip=\fR<ip>
|
||||
.IP
|
||||
Allow JSON\-RPC connections from specified source. Valid for <ip> are a
|
||||
single IP (e.g. 1.2.3.4), a network/netmask (e.g.
|
||||
1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This
|
||||
option can be specified multiple times
|
||||
.HP
|
||||
\fB\-rpcthreads=\fR<n>
|
||||
.IP
|
||||
Set the number of threads to service RPC calls (default: 8)
|
||||
.PP
|
||||
Metrics Options (only if \fB\-daemon\fR and \fB\-printtoconsole\fR are not set):
|
||||
.HP
|
||||
\fB\-showmetrics\fR
|
||||
.IP
|
||||
Show metrics on stdout (default: 1 if running in a console, 0 otherwise)
|
||||
.HP
|
||||
\fB\-metricsui\fR
|
||||
.IP
|
||||
Set to 1 for a persistent metrics screen, 0 for sequential metrics
|
||||
output (default: 1 if running in a console, 0 otherwise)
|
||||
.HP
|
||||
\fB\-metricsrefreshtime\fR
|
||||
.IP
|
||||
Number of seconds between metrics refreshes (default: 1 if running in a
|
||||
console, 600 otherwise)
|
||||
.PP
|
||||
Stratum server options:
|
||||
.HP
|
||||
\fB\-stratum\fR
|
||||
.IP
|
||||
Enable stratum server (default: off)
|
||||
.HP
|
||||
\fB\-stratumaddress=\fR<address>
|
||||
.IP
|
||||
Mining address to use when special address of 'x' is sent by miner
|
||||
(default: none)
|
||||
.HP
|
||||
\fB\-stratumbind=\fR<ipaddr>
|
||||
.IP
|
||||
Bind to given address to listen for Stratum work requests. Use
|
||||
[host]:port notation for IPv6. This option can be specified
|
||||
multiple times (default: bind to all interfaces)
|
||||
.HP
|
||||
\fB\-stratumport=\fR<port>
|
||||
.IP
|
||||
Listen for Stratum work requests on <port> (default: 19031 or testnet:
|
||||
19031)
|
||||
.HP
|
||||
\fB\-stratumallowip=\fR<ip>
|
||||
.IP
|
||||
Allow Stratum work requests from specified source. Valid for <ip> are a
|
||||
single IP (e.g. 1.2.3.4), a network/netmask (e.g.
|
||||
1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This
|
||||
option can be specified multiple times
|
||||
.PP
|
||||
DragonX Chain options:
|
||||
.HP
|
||||
\fB\-ac_algo\fR
|
||||
.IP
|
||||
Choose PoW mining algorithm, either 'equihash' or 'randomx'. default is
|
||||
Equihash (200,9)
|
||||
.HP
|
||||
\fB\-ac_blocktime\fR
|
||||
.IP
|
||||
Block time in seconds, default is 60
|
||||
.HP
|
||||
\fB\-ac_beam\fR
|
||||
.IP
|
||||
BEAM integration
|
||||
.HP
|
||||
\fB\-ac_burn\fR
|
||||
.IP
|
||||
Allow sending funds to the transparent burn address when \fB\-ac_private\fR=\fI\,1\/\fR
|
||||
.HP
|
||||
\fB\-ac_minopreturnfee\fR
|
||||
.IP
|
||||
OP_RETURN minimum fee per tx, regardless of tx size, default is 1 coin
|
||||
.HP
|
||||
\fB\-ac_coda\fR
|
||||
.IP
|
||||
CODA integration
|
||||
.HP
|
||||
\fB\-ac_clearnet\fR
|
||||
.IP
|
||||
Enable or disable clearnet connections for the entire blockchain.
|
||||
Setting to 0 will disable clearnet and use sane defaults for
|
||||
Tor/i2p and require all nodes to do the same (default: 1)
|
||||
.HP
|
||||
\fB\-ac_decay\fR
|
||||
.IP
|
||||
Percentage of block reward decrease at each halving
|
||||
.HP
|
||||
\fB\-ac_end\fR
|
||||
.IP
|
||||
Block height at which block rewards will end
|
||||
.HP
|
||||
\fB\-ac_eras\fR
|
||||
.IP
|
||||
Block reward eras
|
||||
.HP
|
||||
\fB\-ac_founders\fR
|
||||
.IP
|
||||
Number of blocks between founders reward payouts
|
||||
.HP
|
||||
\fB\-ac_halving\fR
|
||||
.IP
|
||||
Number of blocks between each block reward halving
|
||||
.HP
|
||||
\fB\-ac_name\fR
|
||||
.IP
|
||||
Name of asset chain
|
||||
.HP
|
||||
\fB\-ac_notarypay\fR
|
||||
.IP
|
||||
Pay notaries, default 0
|
||||
.HP
|
||||
\fB\-ac_perc\fR
|
||||
.IP
|
||||
Percentage of block rewards paid to the founder
|
||||
.HP
|
||||
\fB\-ac_private\fR
|
||||
.IP
|
||||
Shielded transactions only (except coinbase + notaries), default is 0
|
||||
.HP
|
||||
\fB\-ac_pubkey\fR
|
||||
.IP
|
||||
Public key for receiving payments on the network
|
||||
.HP
|
||||
\fB\-ac_public\fR
|
||||
.IP
|
||||
Transparent transactions only, default 0
|
||||
.HP
|
||||
\fB\-ac_randomx_interval\fR
|
||||
.IP
|
||||
Controls how often the RandomX key block will change, default is 1024
|
||||
.HP
|
||||
\fB\-ac_randomx_lag\fR
|
||||
.IP
|
||||
Sets the number of RandomX blocks to wait before updating the key block,
|
||||
default is 64
|
||||
.HP
|
||||
\fB\-ac_reward\fR
|
||||
.IP
|
||||
Block reward in satoshis, default is 0
|
||||
.HP
|
||||
\fB\-ac_script\fR
|
||||
.IP
|
||||
P2SH/multisig address to receive founders rewards
|
||||
.HP
|
||||
\fB\-ac_supply\fR
|
||||
.IP
|
||||
Starting supply, default is 10
|
||||
.HP
|
||||
\fB\-ac_txpow\fR
|
||||
.IP
|
||||
Enforce transaction\-rate limit, default 0
|
||||
.SH COPYRIGHT
|
||||
|
||||
In order to ensure you are adequately protecting your privacy when using DragonX,
|
||||
please see <https://dragonx.is>.
|
||||
|
||||
Copyright (C) 2024-2026 The DragonX Developers
|
||||
|
||||
Copyright (C) 2016-2026 Duke Leto and The Hush Developers
|
||||
|
||||
Copyright (C) 2016-2020 jl777 and SuperNET developers
|
||||
|
||||
Copyright (C) 2016-2018 The Zcash developers
|
||||
|
||||
Copyright (C) 2009-2014 The Bitcoin Core developers
|
||||
|
||||
This is experimental Free Software! Fuck Yeah!!!!!
|
||||
|
||||
Distributed under the GPLv3 software license, see the accompanying file COPYING
|
||||
or <https://www.gnu.org/licenses/gpl-3.0.en.html>.
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright 2016-2024 The Hush developers
|
||||
# Copyright (c) 2024-2026 The DragonX developers
|
||||
# Distributed under the GPLv3 software license, see the accompanying
|
||||
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
|
||||
@@ -94,11 +95,11 @@ noinst_PROGRAMS =
|
||||
TESTS =
|
||||
|
||||
#if BUILD_BITCOIND
|
||||
bin_PROGRAMS += hushd
|
||||
bin_PROGRAMS += dragonxd
|
||||
#endif
|
||||
|
||||
if BUILD_BITCOIN_UTILS
|
||||
bin_PROGRAMS += hush-cli hush-tx
|
||||
bin_PROGRAMS += dragonx-cli dragonx-tx
|
||||
endif
|
||||
if ENABLE_WALLET
|
||||
bin_PROGRAMS += wallet-utility
|
||||
@@ -453,16 +454,16 @@ nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h
|
||||
#
|
||||
|
||||
# hushd binary #
|
||||
hushd_SOURCES = bitcoind.cpp
|
||||
hushd_CPPFLAGS = -fPIC $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||
hushd_CXXFLAGS = -fPIC $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
hushd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
dragonxd_SOURCES = bitcoind.cpp
|
||||
dragonxd_CPPFLAGS = -fPIC $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||
dragonxd_CXXFLAGS = -fPIC $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
dragonxd_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
|
||||
if TARGET_WINDOWS
|
||||
hushd_SOURCES += bitcoind-res.rc
|
||||
dragonxd_SOURCES += bitcoind-res.rc
|
||||
endif
|
||||
|
||||
hushd_LDADD = \
|
||||
dragonxd_LDADD = \
|
||||
$(LIBBITCOIN_SERVER) \
|
||||
$(LIBBITCOIN_COMMON) \
|
||||
$(LIBUNIVALUE) \
|
||||
@@ -476,10 +477,10 @@ hushd_LDADD = \
|
||||
$(LIBRANDOMX)
|
||||
|
||||
if ENABLE_WALLET
|
||||
hushd_LDADD += $(LIBBITCOIN_WALLET)
|
||||
dragonxd_LDADD += $(LIBBITCOIN_WALLET)
|
||||
endif
|
||||
|
||||
hushd_LDADD += \
|
||||
dragonxd_LDADD += \
|
||||
$(BOOST_LIBS) \
|
||||
$(BDB_LIBS) \
|
||||
$(SSL_LIBS) \
|
||||
@@ -490,27 +491,27 @@ hushd_LDADD += \
|
||||
$(LIBZCASH_LIBS)
|
||||
|
||||
if TARGET_DARWIN
|
||||
hushd_LDADD += libcc.dylib $(LIBSECP256K1)
|
||||
dragonxd_LDADD += libcc.dylib $(LIBSECP256K1)
|
||||
endif
|
||||
if TARGET_WINDOWS
|
||||
hushd_LDADD += libcc.dll $(LIBSECP256K1)
|
||||
dragonxd_LDADD += libcc.dll $(LIBSECP256K1)
|
||||
endif
|
||||
if TARGET_LINUX
|
||||
hushd_LDADD += libcc.so $(LIBSECP256K1)
|
||||
dragonxd_LDADD += libcc.so $(LIBSECP256K1)
|
||||
endif
|
||||
|
||||
# [+] Decker: use static linking for libstdc++.6.dylib, libgomp.1.dylib, libgcc_s.1.dylib
|
||||
if TARGET_DARWIN
|
||||
hushd_LDFLAGS += -static-libgcc
|
||||
dragonxd_LDFLAGS += -static-libgcc
|
||||
endif
|
||||
|
||||
# hush-cli binary #
|
||||
hush_cli_SOURCES = bitcoin-cli.cpp
|
||||
hush_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
|
||||
hush_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
hush_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
dragonx_cli_SOURCES = bitcoin-cli.cpp
|
||||
dragonx_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS)
|
||||
dragonx_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
dragonx_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
if TARGET_DARWIN
|
||||
hush_cli_LDFLAGS += -static-libgcc
|
||||
dragonx_cli_LDFLAGS += -static-libgcc
|
||||
endif
|
||||
|
||||
# wallet-utility binary #
|
||||
@@ -522,10 +523,10 @@ wallet_utility_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
endif
|
||||
|
||||
if TARGET_WINDOWS
|
||||
hush_cli_SOURCES += bitcoin-cli-res.rc
|
||||
dragonx_cli_SOURCES += bitcoin-cli-res.rc
|
||||
endif
|
||||
|
||||
hush_cli_LDADD = \
|
||||
dragonx_cli_LDADD = \
|
||||
$(LIBBITCOIN_CLI) \
|
||||
$(LIBUNIVALUE) \
|
||||
$(LIBBITCOIN_UTIL) \
|
||||
@@ -554,16 +555,16 @@ wallet_utility_LDADD = \
|
||||
endif
|
||||
|
||||
# hush-tx binary #
|
||||
hush_tx_SOURCES = hush-tx.cpp
|
||||
hush_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||
hush_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
hush_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
dragonx_tx_SOURCES = hush-tx.cpp
|
||||
dragonx_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
|
||||
dragonx_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
|
||||
dragonx_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS)
|
||||
|
||||
if TARGET_WINDOWS
|
||||
hush_tx_SOURCES += bitcoin-tx-res.rc
|
||||
dragonx_tx_SOURCES += bitcoin-tx-res.rc
|
||||
endif
|
||||
|
||||
hush_tx_LDADD = \
|
||||
dragonx_tx_LDADD = \
|
||||
$(LIBUNIVALUE) \
|
||||
$(LIBBITCOIN_COMMON) \
|
||||
$(LIBBITCOIN_UTIL) \
|
||||
@@ -574,7 +575,7 @@ hush_tx_LDADD = \
|
||||
$(LIBZCASH_LIBS) \
|
||||
$(LIBRANDOMX)
|
||||
|
||||
hush_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
|
||||
dragonx_tx_LDADD += $(BOOST_LIBS) $(CRYPTO_LIBS)
|
||||
|
||||
# Zcash Protocol Primitives
|
||||
libzcash_a_SOURCES = \
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"ac_perc": "11111111",
|
||||
"ac_eras": "3",
|
||||
"ac_script": "76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac",
|
||||
"clientname": "GoldenSandtrout",
|
||||
"clientname": "DragonX",
|
||||
"addnode": [
|
||||
"node1.hush.is",
|
||||
"node2.hush.is",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2013 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -29,8 +30,8 @@
|
||||
#include <event2/keyvalq_struct.h>
|
||||
#include "support/events.h"
|
||||
|
||||
uint16_t ASSETCHAINS_RPCPORT = 18031;
|
||||
uint16_t BITCOIND_RPCPORT = 18031;
|
||||
uint16_t ASSETCHAINS_RPCPORT = 21769;
|
||||
uint16_t BITCOIND_RPCPORT = 21769;
|
||||
char SMART_CHAIN_SYMBOL[65];
|
||||
|
||||
extern uint16_t ASSETCHAINS_RPCPORT;
|
||||
@@ -47,7 +48,7 @@ std::string HelpMessageCli()
|
||||
std::string strUsage;
|
||||
strUsage += HelpMessageGroup(_("Options:"));
|
||||
strUsage += HelpMessageOpt("-?", _("This help message"));
|
||||
strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), "HUSH3.conf"));
|
||||
strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), "DRAGONX.conf"));
|
||||
strUsage += HelpMessageOpt("-datadir=<dir>", _("Specify data directory (this path cannot use '~')"));
|
||||
strUsage += HelpMessageOpt("-testnet", _("Use the test network"));
|
||||
strUsage += HelpMessageOpt("-regtest", _("Enter regression test mode, which uses a special chain in which blocks can be "
|
||||
@@ -87,19 +88,19 @@ static int AppInitRPC(int argc, char* argv[])
|
||||
ParseParameters(argc, argv);
|
||||
std:string name;
|
||||
|
||||
// default HAC is HUSH3 itself, which to the internals, is also a HAC
|
||||
name = GetArg("-ac_name","HUSH3");
|
||||
// default HAC is DRAGONX itself, which to the internals, is also a HAC
|
||||
name = GetArg("-ac_name","DRAGONX");
|
||||
|
||||
if ( !name.empty() )
|
||||
strncpy(SMART_CHAIN_SYMBOL,name.c_str(),sizeof(SMART_CHAIN_SYMBOL)-1);
|
||||
|
||||
if (argc<2 || mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version")) {
|
||||
std::string strUsage = _("Hush RPC client version") + " " + FormatFullVersion() + "\n" + PrivacyInfo();
|
||||
std::string strUsage = _("DragonX RPC client version") + " " + FormatFullVersion() + "\n" + PrivacyInfo();
|
||||
if (!mapArgs.count("-version")) {
|
||||
strUsage += "\n" + _("Usage:") + "\n" +
|
||||
" hush-cli [options] <command> [params] " + _("Send command to Hush") + "\n" +
|
||||
" hush-cli [options] help " + _("List commands") + "\n" +
|
||||
" hush-cli [options] help <command> " + _("Get help for a command") + "\n";
|
||||
" dragonx-cli [options] <command> [params] " + _("Send command to DragonX") + "\n" +
|
||||
" dragonx-cli [options] help " + _("List commands") + "\n" +
|
||||
" dragonx-cli [options] help <command> " + _("Get help for a command") + "\n";
|
||||
|
||||
strUsage += "\n" + HelpMessageCli();
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2013 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -117,14 +118,14 @@ bool AppInit(int argc, char* argv[])
|
||||
// Process help and version before taking care about datadir
|
||||
if (mapArgs.count("-?") || mapArgs.count("-h") || mapArgs.count("-help") || mapArgs.count("-version"))
|
||||
{
|
||||
std::string strUsage = _("Hush Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n" + PrivacyInfo();
|
||||
std::string strUsage = _("DragonX Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n" + PrivacyInfo();
|
||||
|
||||
if (mapArgs.count("-version"))
|
||||
{
|
||||
strUsage += LicenseInfo();
|
||||
} else {
|
||||
strUsage += "\n" + _("Usage:") + "\n" +
|
||||
" hushd [options] " + _("Start a Hush Daemon") + "\n";
|
||||
" dragonxd [options] " + _("Start DragonX Daemon") + "\n";
|
||||
|
||||
strUsage += "\n" + HelpMessage(HMM_BITCOIND);
|
||||
}
|
||||
@@ -167,13 +168,13 @@ bool AppInit(int argc, char* argv[])
|
||||
"\n"
|
||||
"You can look at the example configuration file for suggestions of default\n"
|
||||
"options that you may want to change. It should be in one of these locations,\n"
|
||||
"depending on how you installed Hush\n") +
|
||||
"depending on how you installed DragonX\n") +
|
||||
_("- Source code: %s\n"
|
||||
"- .deb package: %s\n")).c_str(),
|
||||
GetConfigFile().string().c_str(),
|
||||
"contrib/debian/examples/HUSH3.conf",
|
||||
"/usr/share/doc/hush/examples/HUSH3.conf",
|
||||
"https://git.hush.is/hush/hush3/src/branch/master/contrib/debian/examples/HUSH3.conf");
|
||||
"contrib/debian/examples/DRAGONX.conf",
|
||||
"/usr/share/doc/dragonx/examples/DRAGONX.conf",
|
||||
"https://git.dragonx.is/DragonX/dragonx/src/branch/main/contrib/debian/examples/DRAGONX.conf");
|
||||
return false;
|
||||
} catch (const std::exception& e) {
|
||||
fprintf(stderr,"Error reading configuration file: %s\n", e.what());
|
||||
@@ -183,15 +184,15 @@ bool AppInit(int argc, char* argv[])
|
||||
// Command-line RPC
|
||||
bool fCommandLine = false;
|
||||
for (int i = 1; i < argc; i++) {
|
||||
// detect accidental use of RPC in hushd
|
||||
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "hush:")) {
|
||||
// detect accidental use of RPC in dragonxd
|
||||
if (!IsSwitchChar(argv[i][0]) && !boost::algorithm::istarts_with(argv[i], "dragonx:")) {
|
||||
fCommandLine = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (fCommandLine)
|
||||
{
|
||||
fprintf(stderr, "Error: Ooops! There is no RPC client functionality in hushd. Use the hush-cli utility instead.\n");
|
||||
fprintf(stderr, "Error: Ooops! There is no RPC client functionality in dragonxd. Use the dragonx-cli utility instead.\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
@@ -199,7 +200,7 @@ bool AppInit(int argc, char* argv[])
|
||||
fDaemon = GetBoolArg("-daemon", false);
|
||||
if (fDaemon)
|
||||
{
|
||||
fprintf(stdout, "Hush %s server starting\n",SMART_CHAIN_SYMBOL);
|
||||
fprintf(stdout, "DragonX %s server starting\n",SMART_CHAIN_SYMBOL);
|
||||
|
||||
// Daemonize
|
||||
pid_t pid = fork();
|
||||
|
||||
2866
src/chainparams.cpp
2866
src/chainparams.cpp
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -30,7 +31,7 @@ class CBaseMainParams : public CBaseChainParams
|
||||
public:
|
||||
CBaseMainParams()
|
||||
{
|
||||
nRPCPort = 18031;
|
||||
nRPCPort = 21769;
|
||||
}
|
||||
};
|
||||
static CBaseMainParams mainParams;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) 2012-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -32,7 +33,7 @@
|
||||
* for both bitcoind and bitcoin-core, to make it harder for attackers to
|
||||
* target servers or GUI users specifically.
|
||||
*/
|
||||
const std::string CLIENT_NAME = GetArg("-clientname", "GoldenSandtrout");
|
||||
const std::string CLIENT_NAME = GetArg("-clientname", "DragonX");
|
||||
|
||||
/**
|
||||
* Client version number
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2017 The Zcash developers
|
||||
// Copyright (c) 2016-2026 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
// What happened to the SuperNET developers, who cared about privacy?
|
||||
@@ -28,9 +29,9 @@
|
||||
// client versioning and copyright year
|
||||
//! These need to be macros, as clientversion.cpp's and bitcoin*-res.rc's voodoo requires it
|
||||
// Must be kept in sync with configure.ac , ugh!
|
||||
#define CLIENT_VERSION_MAJOR 3
|
||||
#define CLIENT_VERSION_MINOR 10
|
||||
#define CLIENT_VERSION_REVISION 5
|
||||
#define CLIENT_VERSION_MAJOR 1
|
||||
#define CLIENT_VERSION_MINOR 0
|
||||
#define CLIENT_VERSION_REVISION 0
|
||||
#define CLIENT_VERSION_BUILD 50
|
||||
|
||||
//! Set to true for release, false for prerelease or test build
|
||||
@@ -40,7 +41,7 @@
|
||||
* Copyright year (2009-this)
|
||||
* Todo: update this when changing our copyright comments in the source
|
||||
*/
|
||||
#define COPYRIGHT_YEAR 2024
|
||||
#define COPYRIGHT_YEAR 2026
|
||||
|
||||
#endif //HAVE_CONFIG_H
|
||||
|
||||
|
||||
@@ -40,8 +40,8 @@
|
||||
|
||||
// XXX: There are potential crashes wherever we access chainActive without a lock,
|
||||
// because it might be disconnecting blocks at the same time.
|
||||
// TODO: this assumes a blocktime of 75 seconds for HUSH and 60 seconds for other chains
|
||||
int NOTARISATION_SCAN_LIMIT_BLOCKS = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? 1152 : 1440;
|
||||
// TODO: this assumes a blocktime of 75 seconds for DRAGONX and 60 seconds for other chains
|
||||
int NOTARISATION_SCAN_LIMIT_BLOCKS = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? 1152 : 1440;
|
||||
CBlockIndex *hush_getblockindex(uint256 hash);
|
||||
|
||||
/* On HUSH */
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2016-2024 The Hush Developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -403,7 +404,7 @@ int32_t notarizedtxid_height(char *dest,char *txidstr,int32_t *hushnotarized_hei
|
||||
params[0] = 0;
|
||||
*hushnotarized_heightp = 0;
|
||||
if ( strcmp(dest,"HUSH3") == 0 ) {
|
||||
port = HUSH3_PORT;
|
||||
port = DRAGONX_PORT;
|
||||
userpass = HUSHUSERPASS;
|
||||
} else if ( strcmp(dest,"BTC") == 0 )
|
||||
{
|
||||
@@ -488,7 +489,7 @@ int32_t hush_verifynotarization(char *symbol,char *dest,int32_t height,int32_t N
|
||||
sprintf(¶ms[i*2 + 2],"%02x",((uint8_t *)&NOTARIZED_DESTTXID)[31-i]);
|
||||
strcat(params,"\", 1]");*/
|
||||
sprintf(params,"[\"%s\", 1]",NOTARIZED_DESTTXID.ToString().c_str());
|
||||
if ( strcmp(symbol,SMART_CHAIN_SYMBOL[0]==0?(char *)"HUSH3":SMART_CHAIN_SYMBOL) != 0 )
|
||||
if ( strcmp(symbol,SMART_CHAIN_SYMBOL[0]==0?(char *)"DRAGONX":SMART_CHAIN_SYMBOL) != 0 )
|
||||
return(0);
|
||||
if ( 0 && SMART_CHAIN_SYMBOL[0] != 0 )
|
||||
printf("[%s] src.%s dest.%s params.[%s] ht.%d notarized.%d\n",SMART_CHAIN_SYMBOL,symbol,dest,params,height,NOTARIZED_HEIGHT);
|
||||
@@ -498,7 +499,7 @@ int32_t hush_verifynotarization(char *symbol,char *dest,int32_t height,int32_t N
|
||||
{
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 )
|
||||
{
|
||||
jsonstr = hush_issuemethod(HUSHUSERPASS,(char *)"getrawtransaction",params,HUSH3_PORT);
|
||||
jsonstr = hush_issuemethod(HUSHUSERPASS,(char *)"getrawtransaction",params,DRAGONX_PORT);
|
||||
//printf("userpass.(%s) got (%s)\n",HUSHUSERPASS,jsonstr);
|
||||
}
|
||||
}//else jsonstr = _dex_getrawtransaction();
|
||||
@@ -940,7 +941,7 @@ int32_t hush_nextheight()
|
||||
int32_t hush_isrealtime(int32_t *hushheightp)
|
||||
{
|
||||
struct hush_state *sp; CBlockIndex *pindex;
|
||||
if ( (sp= hush_stateptrget((char *)"HUSH3")) != 0 )
|
||||
if ( (sp= hush_stateptrget((char *)"DRAGONX")) != 0 )
|
||||
*hushheightp = sp->CURRENT_HEIGHT;
|
||||
else *hushheightp = 0;
|
||||
if ( (pindex= chainActive.LastTip()) != 0 && pindex->GetHeight() >= (int32_t)hush_longestchain() )
|
||||
@@ -1074,12 +1075,12 @@ uint64_t hush_commission(int height)
|
||||
uint64_t the_commission(const CBlock *pblock,int32_t height)
|
||||
{
|
||||
//fprintf(stderr,"%s at height=%d\n",__func__,height);
|
||||
static bool didinit = false, ishush3 = false;
|
||||
static bool didinit = false, isdragonx = false;
|
||||
|
||||
if (!didinit) {
|
||||
ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false;
|
||||
didinit = true;
|
||||
fprintf(stderr,"%s: didinit ishush3=%d\n", __func__, ishush3);
|
||||
fprintf(stderr,"%s: didinit isdragonx=%d\n", __func__, isdragonx);
|
||||
}
|
||||
|
||||
int32_t i,j,n=0,txn_count; int64_t nSubsidy; uint64_t commission,total = 0;
|
||||
@@ -1090,7 +1091,7 @@ uint64_t the_commission(const CBlock *pblock,int32_t height)
|
||||
fprintf(stderr,"ht.%d nSubsidy %.8f prod %llu\n",height,(double)nSubsidy/COIN,(long long)(nSubsidy * ASSETCHAINS_COMMISSION));
|
||||
commission = ((nSubsidy * ASSETCHAINS_COMMISSION) / COIN);
|
||||
|
||||
if (ishush3) {
|
||||
if (isdragonx) {
|
||||
commission = hush_commission(height);
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ struct hush_event *hush_eventadd(struct hush_state *sp,int32_t height,char *symb
|
||||
void hush_eventadd_notarized(struct hush_state *sp,char *symbol,int32_t height,char *dest,uint256 notarized_hash,uint256 notarized_desttxid,int32_t notarizedheight,uint256 MoM,int32_t MoMdepth)
|
||||
{
|
||||
static uint32_t counter; int32_t verified=0; char *coin; struct hush_event_notarized N;
|
||||
coin = (SMART_CHAIN_SYMBOL[0] == 0) ? (char *)"HUSH3" : SMART_CHAIN_SYMBOL;
|
||||
coin = (SMART_CHAIN_SYMBOL[0] == 0) ? (char *)"DRAGONX" : SMART_CHAIN_SYMBOL;
|
||||
if ( IS_HUSH_NOTARY != 0 && (verified= hush_verifynotarization(symbol,dest,height,notarizedheight,notarized_hash,notarized_desttxid)) < 0 )
|
||||
{
|
||||
if ( counter++ < 100 )
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright 2016-2024 The Hush Developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -102,7 +103,7 @@ int32_t ASSETCHAINS_OVERWINTER = -1;
|
||||
int32_t ASSETCHAINS_STAKED;
|
||||
uint64_t ASSETCHAINS_COMMISSION,ASSETCHAINS_SUPPLY = 10,ASSETCHAINS_FOUNDERS_REWARD;
|
||||
uint32_t HUSH_INITDONE;
|
||||
char HUSHUSERPASS[8192+512+1],BTCUSERPASS[8192]; uint16_t HUSH3_PORT = 18031,BITCOIND_RPCPORT = 18031;
|
||||
char HUSHUSERPASS[8192+512+1],BTCUSERPASS[8192]; uint16_t DRAGONX_PORT = 21769,BITCOIND_RPCPORT = 21769;
|
||||
uint64_t PENDING_HUSH_TX;
|
||||
extern int32_t HUSH_LOADINGBLOCKS;
|
||||
unsigned int MAX_BLOCK_SIGOPS = 20000;
|
||||
@@ -314,20 +315,20 @@ std::string DEVTAX_DATA[DEVTAX_NUM][2] = {
|
||||
// this is a deterministic consensus-changing function. All miners must be able
|
||||
// to predict the scriptpub for the next block
|
||||
std::string devtax_scriptpub_for_height(uint32_t nHeight) {
|
||||
bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false;
|
||||
bool istush3 = strncmp(SMART_CHAIN_SYMBOL, "TUSH3",5) == 0 ? true : false;
|
||||
// Fork height for HUSH3 mainnet needs to be decided just before code is merged
|
||||
// Fork height for DRAGONX mainnet needs to be decided just before code is merged
|
||||
// Since it requires all full nodes on the network to have enough time to update.
|
||||
// For testing, we choose an early blockheight so we can observe the value changing
|
||||
// from the old fixed value to the new values which cycle
|
||||
const int DEVTAX_FORK_HEIGHT = ishush3 ? nHushHardforkHeight4 : 5;
|
||||
const int DEVTAX_FORK_HEIGHT = isdragonx ? nHushHardforkHeight4 : 5;
|
||||
|
||||
// Decentralized devtax is height-activated
|
||||
if (nHeight >= DEVTAX_FORK_HEIGHT) {
|
||||
if (ishush3 || istush3) {
|
||||
if (isdragonx || istush3) {
|
||||
return DEVTAX_DATA[ nHeight % DEVTAX_NUM ][1];
|
||||
} else {
|
||||
// if this is not HUSH3 or a testchain for HUSH3, return it unchanged
|
||||
// if this is not DRAGONX or a testchain for DRAGONX, return it unchanged
|
||||
return ASSETCHAINS_SCRIPTPUB;
|
||||
}
|
||||
}
|
||||
@@ -339,20 +340,20 @@ std::string devtax_scriptpub_for_height(uint32_t nHeight) {
|
||||
// blocks < DEVTAX_FORK_HEIGHT but it could affect consensus of later blocks
|
||||
std::string devtax_address_for_height(uint32_t nHeight) {
|
||||
const std::string legacy_devtax_address = "RHushEyeDm7XwtaTWtyCbjGQumYyV8vMjn";
|
||||
bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false;
|
||||
bool istush3 = strncmp(SMART_CHAIN_SYMBOL, "TUSH3",5) == 0 ? true : false;
|
||||
// Fork height for HUSH3 mainnet needs to be decided just before code is merged
|
||||
// Fork height for DRAGONX mainnet needs to be decided just before code is merged
|
||||
// Since it requires all full nodes on the network to have enough time to update.
|
||||
// For testing, we choose an early blockheight so we can observe the value changing
|
||||
// from the old fixed value to the new values which cycle
|
||||
const int DEVTAX_FORK_HEIGHT = ishush3 ? nHushHardforkHeight4 : 5;
|
||||
const int DEVTAX_FORK_HEIGHT = isdragonx ? nHushHardforkHeight4 : 5;
|
||||
|
||||
// Decentralized devtax is height-activated
|
||||
if (nHeight >= DEVTAX_FORK_HEIGHT) {
|
||||
if (ishush3 || istush3) {
|
||||
if (isdragonx || istush3) {
|
||||
return DEVTAX_DATA[ nHeight % DEVTAX_NUM ][0];
|
||||
} else {
|
||||
// if this is not HUSH3 or TUSH3, return legacy
|
||||
// if this is not DRAGONX or TUSH3, return legacy
|
||||
return legacy_devtax_address;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,7 +578,7 @@ int32_t NSPV_notarizationextract(int32_t verifyntz,int32_t *ntzheightp,uint256 *
|
||||
int32_t numsigs=0; uint8_t elected[64][33]; char *symbol; std::vector<uint8_t> opret; uint32_t nTime;
|
||||
if ( tx.vout.size() >= 2 )
|
||||
{
|
||||
symbol = (SMART_CHAIN_SYMBOL[0] == 0) ? (char *)"HUSH3" : SMART_CHAIN_SYMBOL;
|
||||
symbol = (SMART_CHAIN_SYMBOL[0] == 0) ? (char *)"DRAGONX" : SMART_CHAIN_SYMBOL;
|
||||
GetOpReturnData(tx.vout[1].scriptPubKey,opret);
|
||||
if ( opret.size() >= 32*2+4 )
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ struct NSPV_ntzargs
|
||||
int32_t NSPV_notarization_find(struct NSPV_ntzargs *args,int32_t height,int32_t dir)
|
||||
{
|
||||
int32_t ntzheight = 0; uint256 hashBlock; CTransaction tx; Notarization nota; char *symbol; std::vector<uint8_t> opret;
|
||||
symbol = (SMART_CHAIN_SYMBOL[0] == 0) ? (char *)"HUSH3" : SMART_CHAIN_SYMBOL;
|
||||
symbol = (SMART_CHAIN_SYMBOL[0] == 0) ? (char *)"DRAGONX" : SMART_CHAIN_SYMBOL;
|
||||
memset(args,0,sizeof(*args));
|
||||
if ( dir > 0 )
|
||||
height += 10;
|
||||
|
||||
@@ -110,13 +110,13 @@ int32_t hush_notaries(uint8_t pubkeys[64][33],int32_t height,uint32_t timestamp)
|
||||
|
||||
// Find the correct DPoW Notary pubkeys for this season
|
||||
int32_t hush_season = 0;
|
||||
bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false;
|
||||
bool istush = strncmp(SMART_CHAIN_SYMBOL, "TUSH",4) == 0 ? true : false;
|
||||
// TUSH uses height activation like HUSH3, other HACs use timestamps
|
||||
hush_season = (ishush3 || istush) ? gethushseason(height) : getacseason(timestamp);
|
||||
// TUSH uses height activation like DRAGONX, other HACs use timestamps
|
||||
hush_season = (isdragonx || istush) ? gethushseason(height) : getacseason(timestamp);
|
||||
|
||||
if(IS_HUSH_NOTARY) {
|
||||
fprintf(stderr,"%s: [%s] season=%d height=%d time=%d\n", __func__, ishush3 ? "HUSH3" : SMART_CHAIN_SYMBOL, hush_season, height, timestamp);
|
||||
fprintf(stderr,"%s: [%s] season=%d height=%d time=%d\n", __func__, isdragonx ? "DRAGONX" : SMART_CHAIN_SYMBOL, hush_season, height, timestamp);
|
||||
}
|
||||
|
||||
if ( hush_season != 0 )
|
||||
|
||||
134
src/hush_utils.h
134
src/hush_utils.h
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -1413,20 +1414,20 @@ void hush_configfile(char *symbol,uint16_t rpcport)
|
||||
#ifdef _WIN32
|
||||
while ( fname[strlen(fname)-1] != '\\' )
|
||||
fname[strlen(fname)-1] = 0;
|
||||
strcat(fname,"HUSH3.conf");
|
||||
strcat(fname,"DRAGONX.conf");
|
||||
#else
|
||||
while ( fname[strlen(fname)-1] != '/' )
|
||||
fname[strlen(fname)-1] = 0;
|
||||
#ifdef __APPLE__
|
||||
strcat(fname,"HUSH3.conf");
|
||||
strcat(fname,"DRAGONX.conf");
|
||||
#else
|
||||
strcat(fname,"HUSH3.conf");
|
||||
strcat(fname,"DRAGONX.conf");
|
||||
#endif
|
||||
#endif
|
||||
if ( (fp= fopen(fname,"rb")) != 0 )
|
||||
{
|
||||
if ( (hushport= _hush_userpass(username,password,fp)) != 0 )
|
||||
HUSH3_PORT = hushport;
|
||||
DRAGONX_PORT = hushport;
|
||||
sprintf(HUSHUSERPASS,"%s:%s",username,password);
|
||||
fclose(fp);
|
||||
//printf("HUSH.(%s) -> userpass.(%s)\n",fname,HUSHUSERPASS);
|
||||
@@ -1473,9 +1474,12 @@ uint32_t hush_smartmagic(char *symbol,uint64_t supply,uint8_t *extraptr,int32_t
|
||||
}
|
||||
|
||||
//TODO: why is this needed?
|
||||
const bool ishush3 = strncmp(symbol, "HUSH3",5) == 0 ? true : false;
|
||||
if(ishush3) {
|
||||
return HUSH_MAGIC;
|
||||
const bool isdragonx = strncmp(symbol, "DRAGONX",7) == 0 ? true : false;
|
||||
if(isdragonx) {
|
||||
// Use the same CRC-based magic as all other chains so that the
|
||||
// network magic bytes match between old wrapper-launched nodes
|
||||
// and the new standalone binary.
|
||||
return(calc_crc32(crc0,buf,len));
|
||||
} else {
|
||||
return(calc_crc32(crc0,buf,len));
|
||||
}
|
||||
@@ -1619,8 +1623,8 @@ uint64_t hush_sc_block_subsidy(int nHeight)
|
||||
int64_t subsidyDifference;
|
||||
int32_t numhalvings = 0, curEra = 0, sign = 1;
|
||||
static uint64_t cached_subsidy; static int32_t cached_numhalvings; static int cached_era;
|
||||
const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
// fprintf(stderr,"%s: ht=%d ishush3=%d\n", __func__, nHeight, ishush3);
|
||||
const bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false;
|
||||
// fprintf(stderr,"%s: ht=%d isdragonx=%d\n", __func__, nHeight, isdragonx);
|
||||
|
||||
// check for backwards compat, older chains with no explicit rewards had 0.0001 block reward
|
||||
if ( ASSETCHAINS_ENDSUBSIDY[0] == 0 && ASSETCHAINS_REWARD[0] == 0 ) {
|
||||
@@ -1649,14 +1653,12 @@ uint64_t hush_sc_block_subsidy(int nHeight)
|
||||
if(fDebug) {
|
||||
fprintf(stderr,"%s: subsidy=%ld at height=%d with ASSETCHAINS_HALVING[curEra]=%lu\n",__func__,subsidy,nHeight, ASSETCHAINS_HALVING[curEra]);
|
||||
}
|
||||
if ( ASSETCHAINS_HALVING[curEra] != 0 )
|
||||
if (ASSETCHAINS_HALVING[curEra] != 0)
|
||||
{
|
||||
if (ishush3) {
|
||||
subsidy = hush_block_subsidy(nHeight);
|
||||
if(fDebug)
|
||||
fprintf(stderr,"%s: HUSH3 subsidy=%ld at height=%d\n",__func__,subsidy,nHeight);
|
||||
} else if ( (numhalvings = ((nHeight - nStart) / ASSETCHAINS_HALVING[curEra])) > 0 ) {
|
||||
// The code below is not compatible with HUSH3 mainnet
|
||||
// hush_block_subsidy() is HUSH3-specific with hardcoded reward schedule
|
||||
// DragonX uses generic halving logic with ASSETCHAINS_REWARD/ASSETCHAINS_HALVING
|
||||
if ( (numhalvings = ((nHeight - nStart) / ASSETCHAINS_HALVING[curEra])) > 0 ) {
|
||||
// The code below is not compatible with DRAGONX mainnet
|
||||
if ( ASSETCHAINS_DECAY[curEra] == 0 ) {
|
||||
subsidy >>= numhalvings;
|
||||
// fprintf(stderr,"%s: no decay, numhalvings.%d curEra.%d subsidy.%ld nStart.%ld\n",__func__, numhalvings, curEra, subsidy, nStart);
|
||||
@@ -1790,38 +1792,28 @@ void hush_args(char *argv0)
|
||||
}
|
||||
|
||||
|
||||
name = GetArg("-ac_name","HUSH3");
|
||||
name = GetArg("-ac_name","DRAGONX");
|
||||
fprintf(stderr,".oO Starting %s Full Node (Extreme Privacy!) with genproc=%d notary=%d\n",name.c_str(),HUSH_MININGTHREADS, IS_HUSH_NOTARY);
|
||||
|
||||
vector<string> HUSH_nodes = {};
|
||||
// Only HUSH3 uses these by default, other HACs must opt-in via -connect/-addnode
|
||||
const bool ishush3 = strncmp(name.c_str(), "HUSH3",5) == 0 ? true : false;
|
||||
vector<string> DRAGONX_nodes = {};
|
||||
// Only DRAGONX connects to these by default, other chains must opt-in via -connect/-addnode
|
||||
const bool isdragonx = strncmp(name.c_str(), "DRAGONX",7) == 0 ? true : false;
|
||||
|
||||
LogPrint("net", "%s: ishush3=%d\n", __func__, ishush3);
|
||||
if (ishush3) {
|
||||
HUSH_nodes = {"node1.hush.is","node2.hush.is","node3.hush.is",
|
||||
"node4.hush.is","node5.hush.is","node6.hush.is",
|
||||
"node7.hush.is","node8.hush.is",
|
||||
"178.250.189.141",
|
||||
"31.202.19.157",
|
||||
"45.132.75.69",
|
||||
"45.63.58.167",
|
||||
"b2dln7mw7ydnuopls444tuixujhcw5kn5o22cna6gqfmw2fl6drb5nad.onion",
|
||||
"dslbaa5gut5kapqtd44pbg65tpl5ydsamfy62hjbldhfsvk64qs57pyd.onion",
|
||||
"vsqdumnh5khjbrzlxoeucbkiuaictdzyc3ezjpxpp2ph3gfwo2ptjmyd.onion",
|
||||
"plrobkepqjxs2cmig273mxnqh3qhuhdaioyb2n5kafn264ramb7tqxid.onion"
|
||||
LogPrint("net", "%s: isdragonx=%d\n", __func__, isdragonx);
|
||||
if (isdragonx) {
|
||||
DRAGONX_nodes = {"node1.dragonx.is","node2.dragonx.is","node3.dragonx.is",
|
||||
"node4.dragonx.is","node5.dragonx.is"
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
vector<string> more_nodes = mapMultiArgs["-addnode"];
|
||||
if (more_nodes.size() > 0) {
|
||||
fprintf(stderr,"%s: Adding %lu more nodes via custom -addnode arguments\n", __func__, more_nodes.size() );
|
||||
}
|
||||
// Add default HUSH nodes after custom addnodes, if applicable
|
||||
if(HUSH_nodes.size() > 0) {
|
||||
LogPrint("net", "%s: adding %d HUSH3 hostname-based nodes\n", __func__, HUSH_nodes.size() );
|
||||
more_nodes.insert( more_nodes.end(), HUSH_nodes.begin(), HUSH_nodes.end() );
|
||||
// Add default DRAGONX nodes after custom addnodes, if applicable
|
||||
if(DRAGONX_nodes.size() > 0) {
|
||||
LogPrint("net", "%s: adding %d DRAGONX hostname-based nodes\n", __func__, DRAGONX_nodes.size() );
|
||||
more_nodes.insert( more_nodes.end(), DRAGONX_nodes.begin(), DRAGONX_nodes.end() );
|
||||
}
|
||||
|
||||
mapMultiArgs["-addnode"] = more_nodes;
|
||||
@@ -1830,10 +1822,15 @@ void hush_args(char *argv0)
|
||||
WITNESS_CACHE_SIZE = MAX_REORG_LENGTH+10;
|
||||
ASSETCHAINS_CC = GetArg("-ac_cc",0);
|
||||
HUSH_CCACTIVATE = GetArg("-ac_ccactivate",0);
|
||||
ASSETCHAINS_BLOCKTIME = GetArg("-ac_blocktime",60);
|
||||
// We do not support ac_public=1 chains, Hush is a platform for privacy
|
||||
|
||||
// Set defaults based on chain
|
||||
int default_blocktime = isdragonx ? 36 : 60;
|
||||
int default_private = isdragonx ? 1 : 0;
|
||||
|
||||
ASSETCHAINS_BLOCKTIME = GetArg("-ac_blocktime", default_blocktime);
|
||||
// We do not support ac_public=1 chains, DragonX is a platform for privacy
|
||||
ASSETCHAINS_PUBLIC = 0;
|
||||
ASSETCHAINS_PRIVATE = GetArg("-ac_private",0);
|
||||
ASSETCHAINS_PRIVATE = GetArg("-ac_private", default_private);
|
||||
HUSH_SNAPSHOT_INTERVAL = GetArg("-ac_snapshot",0);
|
||||
Split(GetArg("-ac_nk",""), sizeof(ASSETCHAINS_NK)/sizeof(*ASSETCHAINS_NK), ASSETCHAINS_NK, 0);
|
||||
|
||||
@@ -1871,7 +1868,9 @@ void hush_args(char *argv0)
|
||||
ASSETCHAINS_EARLYTXIDCONTRACT = GetArg("-ac_earlytxidcontract",0);
|
||||
if ( name.c_str()[0] != 0 )
|
||||
{
|
||||
std::string selectedAlgo = GetArg("-ac_algo", std::string(ASSETCHAINS_ALGORITHMS[0]));
|
||||
// Default algo is randomx for DRAGONX, equihash for others
|
||||
std::string default_algo = isdragonx ? "randomx" : std::string(ASSETCHAINS_ALGORITHMS[0]);
|
||||
std::string selectedAlgo = GetArg("-ac_algo", default_algo);
|
||||
|
||||
for ( int i = 0; i < ASSETCHAINS_NUMALGOS; i++ )
|
||||
{
|
||||
@@ -1900,7 +1899,6 @@ void hush_args(char *argv0)
|
||||
|
||||
// Set our symbol from -ac_name value
|
||||
strncpy(SMART_CHAIN_SYMBOL,name.c_str(),sizeof(SMART_CHAIN_SYMBOL)-1);
|
||||
const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
|
||||
// Set RandomX validation activation height per chain
|
||||
if (ASSETCHAINS_ALGO == ASSETCHAINS_RANDOMX) {
|
||||
@@ -1915,9 +1913,6 @@ void hush_args(char *argv0)
|
||||
}
|
||||
|
||||
ASSETCHAINS_LASTERA = GetArg("-ac_eras", 1);
|
||||
if(ishush3) {
|
||||
ASSETCHAINS_LASTERA = 3;
|
||||
}
|
||||
if ( ASSETCHAINS_LASTERA < 1 || ASSETCHAINS_LASTERA > ASSETCHAINS_MAX_ERAS )
|
||||
{
|
||||
ASSETCHAINS_LASTERA = 1;
|
||||
@@ -1951,33 +1946,13 @@ void hush_args(char *argv0)
|
||||
ASSETCHAINS_SCRIPTPUB = GetArg("-ac_script","");
|
||||
|
||||
|
||||
fprintf(stderr,"%s: Setting custom %s reward HUSH3=%d reward,halving,subsidy chain values...\n",__func__, SMART_CHAIN_SYMBOL, ishush3);
|
||||
if(ishush3) {
|
||||
// Migrated from hushd script
|
||||
ASSETCHAINS_CC = 2;
|
||||
ASSETCHAINS_BLOCKTIME = 150; // this will change to 75 at the correct block
|
||||
ASSETCHAINS_COMMISSION = 11111111;
|
||||
// 6250000 - (Sprout pool at block 500,000)
|
||||
ASSETCHAINS_SUPPLY = 6178674;
|
||||
ASSETCHAINS_FOUNDERS = 1;
|
||||
fprintf(stderr,"%s: Setting custom %s reward isdragonx=%d reward,halving,subsidy chain values...\n",__func__, SMART_CHAIN_SYMBOL, isdragonx);
|
||||
if(isdragonx) {
|
||||
// DragonX chain parameters (previously set via wrapper script)
|
||||
// -ac_name=DRAGONX -ac_algo=randomx -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=36 -ac_private=1
|
||||
ASSETCHAINS_SAPLING = 1;
|
||||
// this corresponds to FR address RHushEyeDm7XwtaTWtyCbjGQumYyV8vMjn
|
||||
ASSETCHAINS_SCRIPTPUB = "76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac";
|
||||
// we do not want to change the magic of HUSH3 mainnet so we do not call devtax_scriptpub_for_height() here,
|
||||
// instead we call it whenever ASSETCHAINS_SCRIPTPUB is used later on
|
||||
|
||||
// Over-ride HUSH3 values from CLI params. Changing our blocktime to 75s changes things
|
||||
ASSETCHAINS_REWARD[0] = 0;
|
||||
ASSETCHAINS_REWARD[1] = 1125000000;
|
||||
ASSETCHAINS_REWARD[2] = 281250000; // 2.8125 HUSH goes to miners per block after 1st halving at Block 340K
|
||||
ASSETCHAINS_REWARD[3] = 140625000; // 1.40625 HUSH after 2nd halving at Block 2020000
|
||||
ASSETCHAINS_HALVING[0] = 129;
|
||||
ASSETCHAINS_HALVING[1] = GetArg("-z2zheight",340000);
|
||||
ASSETCHAINS_HALVING[2] = 2020000; // 2020000 = 340000 + 1680000 (1st halving block plus new halving interval)
|
||||
ASSETCHAINS_HALVING[3] = 3700000; // ASSETCHAINS_HALVING[2] + 1680000;
|
||||
ASSETCHAINS_ENDSUBSIDY[0] = 129;
|
||||
ASSETCHAINS_ENDSUBSIDY[1] = GetArg("-z2zheight",340000);
|
||||
ASSETCHAINS_ENDSUBSIDY[2] = 2*5422111; // TODO: Fix this, twice the previous end of rewards is an estimate
|
||||
ASSETCHAINS_REWARD[0] = 300000000; // 3 DRAGONX per block
|
||||
ASSETCHAINS_HALVING[0] = 3500000; // halving every 3.5M blocks
|
||||
}
|
||||
Split(GetArg("-ac_decay",""), sizeof(ASSETCHAINS_DECAY)/sizeof(*ASSETCHAINS_DECAY), ASSETCHAINS_DECAY, 0);
|
||||
Split(GetArg("-ac_notarypay",""), sizeof(ASSETCHAINS_NOTARY_PAY)/sizeof(*ASSETCHAINS_NOTARY_PAY), ASSETCHAINS_NOTARY_PAY, 0);
|
||||
@@ -2375,13 +2350,14 @@ void hush_args(char *argv0)
|
||||
fprintf(stderr,"MAX_MONEY %llu %.8f\n",(long long)MAX_MONEY,(double)MAX_MONEY/SATOSHIDEN);
|
||||
//printf("baseid.%d MAX_MONEY.%s %.8f\n",baseid,SMART_CHAIN_SYMBOL,(double)MAX_MONEY/SATOSHIDEN);
|
||||
uint16_t tmpport = hush_port(SMART_CHAIN_SYMBOL,ASSETCHAINS_SUPPLY,&ASSETCHAINS_MAGIC,extraptr,extralen);
|
||||
// DragonX P2P port is 21768 (RPC=21769). The HUSH_MAGIC shortcut in
|
||||
// hush_smartmagic() produces 18030 which is wrong, so override here.
|
||||
if(isdragonx) {
|
||||
tmpport = 21768;
|
||||
}
|
||||
if ( GetArg("-port",0) != 0 )
|
||||
{
|
||||
ASSETCHAINS_P2PPORT = GetArg("-port",0);
|
||||
if(ishush3) {
|
||||
fprintf(stderr,"set HUSH3 p2pport.%u\n",ASSETCHAINS_P2PPORT);
|
||||
ASSETCHAINS_P2PPORT = 18030;
|
||||
}
|
||||
if(fDebug)
|
||||
fprintf(stderr,"set p2pport.%u\n",ASSETCHAINS_P2PPORT);
|
||||
} else ASSETCHAINS_P2PPORT = tmpport;
|
||||
@@ -2479,7 +2455,7 @@ void hush_args(char *argv0)
|
||||
//fprintf(stderr,"(%s) port.%u chain params initialized\n",SMART_CHAIN_SYMBOL,BITCOIND_RPCPORT);
|
||||
|
||||
// Set custom cc rulse for chains here
|
||||
if ( strcmp("HUSH3",SMART_CHAIN_SYMBOL) == 0 ) {
|
||||
if ( strcmp("DRAGONX",SMART_CHAIN_SYMBOL) == 0 ) {
|
||||
// Disable all CC's
|
||||
if(GetArg("-ac_disable_cc",false)) {
|
||||
CCDISABLEALL;
|
||||
@@ -2492,11 +2468,11 @@ void hush_args(char *argv0)
|
||||
void hush_nameset(char *symbol,char *dest,char *source)
|
||||
{
|
||||
if ( source[0] == 0 ) {
|
||||
strcpy(symbol,(char *)"HUSH3");
|
||||
strcpy(symbol,(char *)"DRAGONX");
|
||||
strcpy(dest,(char *)"BTC");
|
||||
} else {
|
||||
strcpy(symbol,source);
|
||||
strcpy(dest,(char *)"HUSH3");
|
||||
strcpy(dest,(char *)"DRAGONX");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
15
src/init.cpp
15
src/init.cpp
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
// What happened to the SuperNET devs, who were dedicated to privacy???
|
||||
@@ -206,12 +207,12 @@ void Shutdown()
|
||||
/// Be sure that anything that writes files or flushes caches only does this if the respective
|
||||
/// module was initialized.
|
||||
static char shutoffstr[128];
|
||||
sprintf(shutoffstr,"%s-shutoff","hush");
|
||||
sprintf(shutoffstr,"%s-shutoff","dragonx");
|
||||
RenameThread(shutoffstr);
|
||||
mempool.AddTransactionsUpdated(1);
|
||||
|
||||
if(fDebug) {
|
||||
fprintf(stderr,"%s: stopping HUSH HTTP/REST/RPC\n", __FUNCTION__);
|
||||
fprintf(stderr,"%s: stopping DragonX HTTP/REST/RPC\n", __FUNCTION__);
|
||||
}
|
||||
StopHTTPRPC();
|
||||
StopREST();
|
||||
@@ -377,8 +378,8 @@ std::string HelpMessage(HelpMessageMode mode)
|
||||
strUsage += HelpMessageOpt("-blocknotify=<cmd>", _("Execute command when the best block changes (%s in cmd is replaced by block hash)"));
|
||||
strUsage += HelpMessageOpt("-checkblocks=<n>", strprintf(_("How many blocks to check at startup (default: %u, 0 = all)"), 288));
|
||||
strUsage += HelpMessageOpt("-checklevel=<n>", strprintf(_("How thorough the block verification of -checkblocks is (0-4, default: %u)"), 3));
|
||||
strUsage += HelpMessageOpt("-clientname=<SomeName>", _("Full node client name, default 'GoldenSandtrout'"));
|
||||
strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), "HUSH3.conf"));
|
||||
strUsage += HelpMessageOpt("-clientname=<SomeName>", _("Full node client name, default 'DragonX'"));
|
||||
strUsage += HelpMessageOpt("-conf=<file>", strprintf(_("Specify configuration file (default: %s)"), "DRAGONX.conf"));
|
||||
if (mode == HMM_BITCOIND)
|
||||
{
|
||||
#if !defined(WIN32)
|
||||
@@ -396,7 +397,7 @@ std::string HelpMessage(HelpMessageMode mode)
|
||||
strUsage += HelpMessageOpt("-par=<n>", strprintf(_("Set the number of script verification threads (%u to %d, 0 = auto, <0 = leave that many cores free, default: %d)"),
|
||||
-(int)boost::thread::hardware_concurrency(), MAX_SCRIPTCHECK_THREADS, DEFAULT_SCRIPTCHECK_THREADS));
|
||||
#ifndef _WIN32
|
||||
strUsage += HelpMessageOpt("-pid=<file>", strprintf(_("Specify pid file (default: %s)"), "hushd.pid"));
|
||||
strUsage += HelpMessageOpt("-pid=<file>", strprintf(_("Specify pid file (default: %s)"), "dragonxd.pid"));
|
||||
#endif
|
||||
strUsage += HelpMessageOpt("-txexpirynotify=<cmd>", _("Execute command when transaction expires (%s in cmd is replaced by transaction id)"));
|
||||
strUsage += HelpMessageOpt("-prune=<n>", strprintf(_("Reduce storage requirements by pruning (deleting) old blocks. This mode disables wallet support and is incompatible with -txindex. "
|
||||
@@ -605,7 +606,7 @@ std::string HelpMessage(HelpMessageMode mode)
|
||||
strUsage += HelpMessageOpt("-stratumallowip=<ip>", _("Allow Stratum work requests from specified source. Valid for <ip> are a single IP (e.g. 1.2.3.4), a network/netmask (e.g. 1.2.3.4/255.255.255.0) or a network/CIDR (e.g. 1.2.3.4/24). This option can be specified multiple times"));
|
||||
|
||||
// "ac" stands for "affects consensus" or Arrakis Chain
|
||||
strUsage += HelpMessageGroup(_("Hush Arrakis Chain options:"));
|
||||
strUsage += HelpMessageGroup(_("DragonX Chain options:"));
|
||||
strUsage += HelpMessageOpt("-ac_algo", _("Choose PoW mining algorithm, either 'equihash' or 'randomx'. default is Equihash (200,9)"));
|
||||
strUsage += HelpMessageOpt("-ac_blocktime", _("Block time in seconds, default is 60"));
|
||||
strUsage += HelpMessageOpt("-ac_beam", _("BEAM integration"));
|
||||
@@ -1619,7 +1620,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
||||
return InitError(strprintf("User Agent comment (%s) contains unsafe characters.", cmt));
|
||||
uacomments.push_back(SanitizeString(cmt, SAFE_CHARS_UA_COMMENT));
|
||||
}
|
||||
strSubVersion = FormatSubVersion(GetArg("-clientname","GoldenSandtrout"), CLIENT_VERSION, uacomments);
|
||||
strSubVersion = FormatSubVersion(GetArg("-clientname","DragonX"), CLIENT_VERSION, uacomments);
|
||||
if (strSubVersion.size() > MAX_SUBVERSION_LENGTH) {
|
||||
return InitError(strprintf("Total length of network version string %i exceeds maximum of %i characters. Reduce the number and/or size of uacomments.",
|
||||
strSubVersion.size(), MAX_SUBVERSION_LENGTH));
|
||||
|
||||
62
src/main.cpp
62
src/main.cpp
@@ -107,7 +107,7 @@ size_t nCoinCacheUsage = 5000 * 300;
|
||||
uint64_t nPruneTarget = 0;
|
||||
// If the tip is older than this (in seconds), the node is considered to be in initial block download.
|
||||
int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;
|
||||
const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
const bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false;
|
||||
int32_t nFirstHalvingHeight = 340000;
|
||||
|
||||
unsigned int expiryDelta = DEFAULT_TX_EXPIRY_DELTA;
|
||||
@@ -1414,10 +1414,10 @@ bool CheckTransaction(uint32_t tiptime,const CTransaction& tx, CValidationState
|
||||
|
||||
// This is and hush_notaries()/gethushseason/getacseason are all consensus code
|
||||
int32_t hush_isnotaryvout(char *coinaddr,uint32_t tiptime) {
|
||||
bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false;
|
||||
bool istush = strncmp(SMART_CHAIN_SYMBOL, "TUSH",4) == 0 ? true : false;
|
||||
int32_t height = chainActive.LastTip()->GetHeight();
|
||||
int32_t season = (ishush3 || istush) ? gethushseason(height) : getacseason(tiptime);
|
||||
int32_t season = (isdragonx || istush) ? gethushseason(height) : getacseason(tiptime);
|
||||
fprintf(stderr,"%s: coinaddr=%s season=%d, tiptime=%d\n", __func__, coinaddr, season,tiptime);
|
||||
if ( NOTARY_ADDRESSES[season-1][0][0] == 0 ) {
|
||||
uint8_t pubkeys[64][33];
|
||||
@@ -1708,8 +1708,8 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa
|
||||
const uint32_t z2zTransitionStart = 340000 - z2zTransitionWindow;
|
||||
const uint32_t nHeight = chainActive.Height();
|
||||
|
||||
// This only applies to HUSH3, other chains can start off z2z via ac_private=1
|
||||
if(ishush3) {
|
||||
// This only applies to DRAGONX, other chains can start off z2z via ac_private=1
|
||||
if(isdragonx) {
|
||||
if((nHeight >= z2zTransitionStart) || (nHeight <= 340000)) {
|
||||
// During the z2z transition window, only coinbase tx's as part of blocks are allowed
|
||||
// Theory: We want an empty mempool at our fork block height, and the only way to assure that
|
||||
@@ -3062,15 +3062,8 @@ bool DisconnectBlock(CBlock& block, CValidationState& state, CBlockIndex* pindex
|
||||
// move best block pointer to prevout block
|
||||
view.SetBestBlock(pindex->pprev->GetBlockHash());
|
||||
|
||||
// If disconnecting a block brings us back before our blocktime halving height, go back
|
||||
// to our original blocktime so our DAA has the correct target for that height
|
||||
// DragonX has a fixed 36s blocktime - no blocktime halving needed
|
||||
int nHeight = pindex->pprev->GetHeight();
|
||||
nFirstHalvingHeight = GetArg("-z2zheight",340000);
|
||||
if (ishush3 && (ASSETCHAINS_BLOCKTIME != 150) && (nHeight < nFirstHalvingHeight)) {
|
||||
LogPrintf("%s: Setting blocktime to 150s at height %d!\n",__func__,nHeight);
|
||||
ASSETCHAINS_BLOCKTIME = 150;
|
||||
hush_changeblocktime();
|
||||
}
|
||||
|
||||
|
||||
if (pfClean) {
|
||||
@@ -3142,23 +3135,19 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
|
||||
//fprintf(stderr,"connectblock ht.%d\n",(int32_t)pindex->GetHeight());
|
||||
AssertLockHeld(cs_main);
|
||||
|
||||
const bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
const bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false;
|
||||
|
||||
// At startup, HUSH3 doesn't know a block height yet and so we must wait until
|
||||
// At startup, DRAGONX doesn't know a block height yet and so we must wait until
|
||||
// connecting a block to set our private/blocktime flags, which are height-dependent
|
||||
nFirstHalvingHeight = GetArg("-z2zheight",340000);
|
||||
if(!ASSETCHAINS_PRIVATE && ishush3) {
|
||||
if(!ASSETCHAINS_PRIVATE && isdragonx) {
|
||||
unsigned int nHeight = pindex->GetHeight();
|
||||
if(nHeight >= nFirstHalvingHeight) {
|
||||
fprintf(stderr, "%s: Going full z2z at height %d!\n",__func__,pindex->GetHeight());
|
||||
ASSETCHAINS_PRIVATE = 1;
|
||||
}
|
||||
}
|
||||
if (ishush3 && (ASSETCHAINS_BLOCKTIME != 75) && (chainActive.Height() >= nFirstHalvingHeight)) {
|
||||
LogPrintf("%s: Blocktime halving to 75s at height %d!\n",__func__,pindex->GetHeight());
|
||||
ASSETCHAINS_BLOCKTIME = 75;
|
||||
hush_changeblocktime();
|
||||
}
|
||||
// DragonX has a fixed 36s blocktime - no blocktime halving needed
|
||||
|
||||
bool fExpensiveChecks = true;
|
||||
if (fCheckpointsEnabled) {
|
||||
@@ -3754,21 +3743,14 @@ void static UpdateTip(CBlockIndex *pindexNew) {
|
||||
mempool.AddTransactionsUpdated(1);
|
||||
HUSH_NEWBLOCKS++;
|
||||
double progress;
|
||||
if ( ishush3 ) {
|
||||
if ( isdragonx ) {
|
||||
progress = Checkpoints::GuessVerificationProgress(chainParams.Checkpoints(), chainActive.LastTip());
|
||||
} else {
|
||||
int32_t longestchain = hush_longestchain();
|
||||
progress = (longestchain > 0 ) ? (double) chainActive.Height() / longestchain : 1.0;
|
||||
}
|
||||
|
||||
nFirstHalvingHeight = GetArg("-z2zheight",340000);
|
||||
if(ishush3) {
|
||||
if (ASSETCHAINS_BLOCKTIME != 75 && (chainActive.Height() >= nFirstHalvingHeight)) {
|
||||
LogPrintf("%s: Blocktime halving to 75s at height %d!\n",__func__,chainActive.Height());
|
||||
ASSETCHAINS_BLOCKTIME = 75;
|
||||
hush_changeblocktime();
|
||||
}
|
||||
}
|
||||
// DragonX has a fixed 36s blocktime - no blocktime halving needed
|
||||
|
||||
LogPrintf("%s: new best=%s height=%d log2_work=%.8g tx=%lu date=%s progress=%f cache=%.1fMiB(%utx)\n", __func__,
|
||||
chainActive.LastTip()->GetBlockHash().ToString(), chainActive.Height(),
|
||||
@@ -5109,19 +5091,11 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
|
||||
|
||||
int daaForkHeight = GetArg("-daaforkheight", 450000);
|
||||
int nHeight = pindexPrev->GetHeight()+1;
|
||||
bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false;
|
||||
// Check Proof-of-Work difficulty
|
||||
if (ishush3) {
|
||||
if (isdragonx) {
|
||||
|
||||
// Difficulty (nBits) relies on the current blocktime of this block
|
||||
if ((ASSETCHAINS_BLOCKTIME != 75) && (nHeight >= nFirstHalvingHeight)) {
|
||||
LogPrintf("%s: Blocktime halving to 75s at height %d!\n",__func__,nHeight);
|
||||
ASSETCHAINS_BLOCKTIME = 75;
|
||||
hush_changeblocktime();
|
||||
}
|
||||
// The change of blocktime from 150s to 75s caused incorrect AWT of 34 blocks instead of 17
|
||||
// caused by the fact that Difficulty Adjustment Algorithms do not take into account blocktime
|
||||
// changing at run-time, from Consensus::Params being a const struct
|
||||
// DragonX has a fixed 36s blocktime - no blocktime halving needed
|
||||
unsigned int nNextWork = GetNextWorkRequired(pindexPrev, &block, consensusParams);
|
||||
|
||||
if (fDebug) {
|
||||
@@ -5959,7 +5933,7 @@ bool static LoadBlockIndexDB()
|
||||
|
||||
// Try to detect if we are z2z based on height of blocks on disk
|
||||
// This helps to set it correctly on startup before a new block is connected
|
||||
if(ishush3 && chainActive.Height() >= 340000) {
|
||||
if(isdragonx && chainActive.Height() >= 340000) {
|
||||
LogPrintf("%s: enabled ac_private=1 at height=%d\n", __func__, chainActive.Height());
|
||||
ASSETCHAINS_PRIVATE = 1;
|
||||
}
|
||||
@@ -5972,7 +5946,7 @@ bool static LoadBlockIndexDB()
|
||||
PruneBlockIndexCandidates();
|
||||
|
||||
double progress;
|
||||
if ( ishush3 ) {
|
||||
if ( isdragonx ) {
|
||||
progress = Checkpoints::GuessVerificationProgress(chainparams.Checkpoints(), chainActive.LastTip());
|
||||
} else {
|
||||
int32_t longestchain = hush_longestchain();
|
||||
@@ -6900,7 +6874,7 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv,
|
||||
CAddress addrFrom;
|
||||
uint64_t nNonce = 1;
|
||||
int nVersion; // use temporary for version, don't set version number until validated as connected
|
||||
const int minVersion = ishush3 ? MIN_HUSH_PEER_PROTO_VERSION : MIN_PEER_PROTO_VERSION;
|
||||
const int minVersion = isdragonx ? MIN_HUSH_PEER_PROTO_VERSION : MIN_PEER_PROTO_VERSION;
|
||||
vRecv >> nVersion >> pfrom->nServices >> nTime >> addrMe;
|
||||
|
||||
if (nVersion < minVersion)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Copyright (c) 2016 The Zcash developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
@@ -289,7 +290,7 @@ int printMiningStatus(bool mining)
|
||||
lines++;
|
||||
} else {
|
||||
std::cout << _("You are currently not mining.") << std::endl;
|
||||
std::cout << _("To enable mining, add 'gen=1' to your HUSH3.conf and restart.") << std::endl;
|
||||
std::cout << _("To enable mining, add 'gen=1' to your DRAGONX.conf and restart.") << std::endl;
|
||||
lines += 2;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
|
||||
386
src/miner.cpp
386
src/miner.cpp
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -23,6 +24,7 @@
|
||||
#include "pow/tromp/equi_miner.h"
|
||||
#endif
|
||||
|
||||
#include <atomic>
|
||||
#include "amount.h"
|
||||
#include "chainparams.h"
|
||||
#include "consensus/consensus.h"
|
||||
@@ -51,6 +53,7 @@
|
||||
#include "transaction_builder.h"
|
||||
#include "sodium.h"
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/thread/shared_mutex.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
#ifdef ENABLE_MINING
|
||||
#include <functional>
|
||||
@@ -1011,8 +1014,213 @@ enum RandomXSolverCancelCheck
|
||||
Reason2
|
||||
};
|
||||
|
||||
int GetRandomXInterval() { return GetArg("-ac_randomx_interval",1024); }
|
||||
int GetRandomXBlockLag() { return GetArg("-ac_randomx_lag", 64); }
|
||||
int GetRandomXInterval();
|
||||
int GetRandomXBlockLag();
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
static void LogProcessMemory(const char* label) {
|
||||
// Use K32GetProcessMemoryInfo from kernel32.dll (available on Win7+)
|
||||
// to avoid linking psapi.lib
|
||||
typedef struct {
|
||||
DWORD cb;
|
||||
DWORD PageFaultCount;
|
||||
SIZE_T PeakWorkingSetSize;
|
||||
SIZE_T WorkingSetSize;
|
||||
SIZE_T QuotaPeakPagedPoolUsage;
|
||||
SIZE_T QuotaPagedPoolUsage;
|
||||
SIZE_T QuotaPeakNonPagedPoolUsage;
|
||||
SIZE_T QuotaNonPagedPoolUsage;
|
||||
SIZE_T PagefileUsage;
|
||||
SIZE_T PeakPagefileUsage;
|
||||
SIZE_T PrivateUsage;
|
||||
} PMC_EX;
|
||||
typedef BOOL (WINAPI *PFN)(HANDLE, PMC_EX*, DWORD);
|
||||
static PFN pfn = (PFN)GetProcAddress(GetModuleHandleA("kernel32.dll"), "K32GetProcessMemoryInfo");
|
||||
if (pfn) {
|
||||
PMC_EX pmc = {};
|
||||
pmc.cb = sizeof(pmc);
|
||||
if (pfn(GetCurrentProcess(), &pmc, sizeof(pmc))) {
|
||||
LogPrintf("MemDiag [%s]: WorkingSet=%.1fMB, PrivateUsage=%.1fMB, PagefileUsage=%.1fMB\n",
|
||||
label,
|
||||
pmc.WorkingSetSize / (1024.0 * 1024.0),
|
||||
pmc.PrivateUsage / (1024.0 * 1024.0),
|
||||
pmc.PagefileUsage / (1024.0 * 1024.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void LogProcessMemory(const char* label) {
|
||||
// Linux: read /proc/self/status
|
||||
FILE *f = fopen("/proc/self/status", "r");
|
||||
if (f) {
|
||||
char line[256];
|
||||
while (fgets(line, sizeof(line), f)) {
|
||||
if (strncmp(line, "VmRSS:", 6) == 0 || strncmp(line, "VmSize:", 7) == 0) {
|
||||
// Remove newline
|
||||
line[strlen(line)-1] = '\0';
|
||||
LogPrintf("MemDiag [%s]: %s\n", label, line);
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Shared RandomX dataset manager — all miner threads share a single ~2GB dataset
|
||||
// instead of each allocating their own. The dataset is read-only after initialization
|
||||
// and RandomX explicitly supports multiple VMs sharing one dataset.
|
||||
struct RandomXDatasetManager {
|
||||
randomx_flags flags;
|
||||
randomx_cache *cache;
|
||||
randomx_dataset *dataset;
|
||||
unsigned long datasetItemCount;
|
||||
std::string currentKey;
|
||||
std::mutex mtx; // protects Init/Shutdown/CreateVM
|
||||
boost::shared_mutex datasetMtx; // readers-writer lock: shared for hashing, exclusive for rebuild
|
||||
bool initialized;
|
||||
|
||||
RandomXDatasetManager() : flags(randomx_get_flags()), cache(nullptr), dataset(nullptr),
|
||||
datasetItemCount(0), initialized(false) {}
|
||||
|
||||
bool Init() {
|
||||
std::lock_guard<std::mutex> lock(mtx);
|
||||
if (initialized) return true;
|
||||
|
||||
flags |= RANDOMX_FLAG_FULL_MEM;
|
||||
LogPrintf("RandomXDatasetManager: flags=0x%x (JIT=%d, HARD_AES=%d, FULL_MEM=%d, LARGE_PAGES=%d)\n",
|
||||
(int)flags,
|
||||
!!(flags & RANDOMX_FLAG_JIT), !!(flags & RANDOMX_FLAG_HARD_AES),
|
||||
!!(flags & RANDOMX_FLAG_FULL_MEM), !!(flags & RANDOMX_FLAG_LARGE_PAGES));
|
||||
|
||||
LogProcessMemory("before cache alloc");
|
||||
|
||||
cache = randomx_alloc_cache(flags | RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_SECURE);
|
||||
if (cache == nullptr) {
|
||||
LogPrintf("RandomXDatasetManager: cache alloc failed with large pages, trying without...\n");
|
||||
cache = randomx_alloc_cache(flags | RANDOMX_FLAG_SECURE);
|
||||
if (cache == nullptr) {
|
||||
LogPrintf("RandomXDatasetManager: cache alloc failed with secure, trying basic...\n");
|
||||
cache = randomx_alloc_cache(flags);
|
||||
if (cache == nullptr) {
|
||||
LogPrintf("RandomXDatasetManager: cannot allocate cache!\n");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
LogProcessMemory("after cache alloc");
|
||||
|
||||
// Try to allocate dataset with large pages first for better performance
|
||||
dataset = randomx_alloc_dataset(flags | RANDOMX_FLAG_LARGE_PAGES);
|
||||
if (dataset == nullptr) {
|
||||
LogPrintf("RandomXDatasetManager: dataset alloc failed with large pages, trying without...\n");
|
||||
dataset = randomx_alloc_dataset(flags);
|
||||
if (dataset == nullptr) {
|
||||
LogPrintf("RandomXDatasetManager: cannot allocate dataset!\n");
|
||||
randomx_release_cache(cache);
|
||||
cache = nullptr;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
datasetItemCount = randomx_dataset_item_count();
|
||||
initialized = true;
|
||||
LogProcessMemory("after dataset alloc");
|
||||
// Log the actual memory addresses to help diagnose sharing issues
|
||||
uint8_t *datasetMemory = (uint8_t*)randomx_get_dataset_memory(dataset);
|
||||
size_t datasetSize = datasetItemCount * RANDOMX_DATASET_ITEM_SIZE;
|
||||
LogPrintf("RandomXDatasetManager: allocated shared dataset:\n");
|
||||
LogPrintf(" - Dataset struct at: %p\n", (void*)dataset);
|
||||
LogPrintf(" - Dataset memory at: %p (size: %.2f GB)\n", (void*)datasetMemory, datasetSize / (1024.0 * 1024.0 * 1024.0));
|
||||
LogPrintf(" - Items: %lu, Item size: %d bytes\n", datasetItemCount, RANDOMX_DATASET_ITEM_SIZE);
|
||||
LogPrintf(" - Expected total process memory: ~%.2f GB + ~2MB per mining thread\n", datasetSize / (1024.0 * 1024.0 * 1024.0));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Initialize cache with a key and rebuild the dataset.
|
||||
// Thread-safe: acquires exclusive lock so all hashing threads must finish first.
|
||||
void UpdateKey(const void *key, size_t keySize) {
|
||||
std::string newKey((const char*)key, keySize);
|
||||
|
||||
// Fast check with shared lock — skip if key hasn't changed
|
||||
{
|
||||
boost::shared_lock<boost::shared_mutex> readLock(datasetMtx);
|
||||
if (newKey == currentKey) return; // already up to date
|
||||
}
|
||||
|
||||
// Acquire exclusive lock — blocks until all hashing threads release their shared locks
|
||||
boost::unique_lock<boost::shared_mutex> writeLock(datasetMtx);
|
||||
// Double-check after acquiring exclusive lock (another thread may have rebuilt first)
|
||||
if (newKey == currentKey) return;
|
||||
|
||||
LogPrintf("RandomXDatasetManager: updating key (size=%lu)\n", keySize);
|
||||
randomx_init_cache(cache, key, keySize);
|
||||
currentKey = newKey;
|
||||
|
||||
// Rebuild dataset using all available CPU threads
|
||||
const int initThreadCount = std::thread::hardware_concurrency();
|
||||
if (initThreadCount > 1) {
|
||||
std::vector<std::thread> threads;
|
||||
uint32_t startItem = 0;
|
||||
const auto perThread = datasetItemCount / initThreadCount;
|
||||
const auto remainder = datasetItemCount % initThreadCount;
|
||||
for (int i = 0; i < initThreadCount; ++i) {
|
||||
const auto count = perThread + (i == initThreadCount - 1 ? remainder : 0);
|
||||
threads.push_back(std::thread(&randomx_init_dataset, dataset, cache, startItem, count));
|
||||
startItem += count;
|
||||
}
|
||||
for (unsigned i = 0; i < threads.size(); ++i) {
|
||||
threads[i].join();
|
||||
}
|
||||
} else {
|
||||
randomx_init_dataset(dataset, cache, 0, datasetItemCount);
|
||||
}
|
||||
LogPrintf("RandomXDatasetManager: dataset rebuilt\n");
|
||||
LogProcessMemory("after dataset init");
|
||||
}
|
||||
|
||||
// Creates a per-thread VM using the shared dataset.
|
||||
// Caller must hold a shared lock on datasetMtx.
|
||||
// The VM itself is small (~2MB scratchpad + ~84KB JIT code) — the ~2GB dataset is shared via pointer.
|
||||
// VMs should be created ONCE per thread and reused across blocks to avoid
|
||||
// heap fragmentation on Windows (repeated 2MB alloc/free causes address-space bloat).
|
||||
randomx_vm *CreateVM() {
|
||||
static std::atomic<int> vmCount{0};
|
||||
LogProcessMemory("before CreateVM");
|
||||
randomx_vm *vm = randomx_create_vm(flags, nullptr, dataset);
|
||||
if (vm != nullptr) {
|
||||
int id = ++vmCount;
|
||||
uint8_t *datasetMemory = (uint8_t*)randomx_get_dataset_memory(dataset);
|
||||
LogPrintf("RandomXDatasetManager: VM #%d created — VM at %p, shared dataset at %p\n",
|
||||
id, (void*)vm, (void*)datasetMemory);
|
||||
LogPrintf(" Per-thread overhead: ~2MB scratchpad + ~84KB JIT (dataset NOT copied)\n");
|
||||
LogProcessMemory("after CreateVM");
|
||||
}
|
||||
return vm;
|
||||
}
|
||||
|
||||
void Shutdown() {
|
||||
std::lock_guard<std::mutex> lock(mtx);
|
||||
if (dataset != nullptr) {
|
||||
randomx_release_dataset(dataset);
|
||||
dataset = nullptr;
|
||||
}
|
||||
if (cache != nullptr) {
|
||||
randomx_release_cache(cache);
|
||||
cache = nullptr;
|
||||
}
|
||||
initialized = false;
|
||||
currentKey.clear();
|
||||
LogPrintf("RandomXDatasetManager: shutdown complete\n");
|
||||
}
|
||||
|
||||
~RandomXDatasetManager() {
|
||||
Shutdown();
|
||||
}
|
||||
};
|
||||
|
||||
// Global shared dataset manager, created by GenerateBitcoins before spawning miner threads
|
||||
static RandomXDatasetManager *g_rxDatasetManager = nullptr;
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
void static RandomXMiner(CWallet *pwallet)
|
||||
@@ -1050,33 +1258,12 @@ void static RandomXMiner()
|
||||
);
|
||||
miningTimer.start();
|
||||
|
||||
randomx_flags flags = randomx_get_flags();
|
||||
flags |= RANDOMX_FLAG_FULL_MEM;
|
||||
randomx_cache *randomxCache = randomx_alloc_cache(flags | RANDOMX_FLAG_LARGE_PAGES | RANDOMX_FLAG_SECURE );
|
||||
if (randomxCache == NULL) {
|
||||
LogPrintf("RandomX cache is null, trying without large pages...\n");
|
||||
randomxCache = randomx_alloc_cache(flags | RANDOMX_FLAG_SECURE);
|
||||
if (randomxCache == NULL) {
|
||||
LogPrintf("RandomX cache is null, trying without secure...\n");
|
||||
}
|
||||
randomxCache = randomx_alloc_cache(flags);
|
||||
if (randomxCache == NULL) {
|
||||
LogPrintf("RandomX cache is null, cannot mine!\n");
|
||||
}
|
||||
}
|
||||
|
||||
rxdebug("%s: created randomx flags + cache\n");
|
||||
randomx_dataset *randomxDataset = randomx_alloc_dataset(flags);
|
||||
rxdebug("%s: created dataset\n");
|
||||
|
||||
if( randomxDataset == nullptr) {
|
||||
LogPrintf("%s: allocating randomx dataset failed!\n", __func__);
|
||||
// Use the shared dataset manager — no per-thread dataset allocation
|
||||
if (g_rxDatasetManager == nullptr || !g_rxDatasetManager->initialized) {
|
||||
LogPrintf("HushRandomXMiner: shared dataset manager not initialized, aborting!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
auto datasetItemCount = randomx_dataset_item_count();
|
||||
rxdebug("%s: dataset items=%lu\n", datasetItemCount);
|
||||
|
||||
char randomxHash[RANDOMX_HASH_SIZE];
|
||||
rxdebug("%s: created randomxHash of size %d\n", RANDOMX_HASH_SIZE);
|
||||
char randomxKey[82]; // randomx spec says keysize of >60 bytes is implementation-specific
|
||||
@@ -1147,48 +1334,37 @@ void static RandomXMiner()
|
||||
|
||||
// fprintf(stderr,"RandomXMiner: using initial key with interval=%d and lag=%d\n", randomxInterval, randomxBlockLag);
|
||||
rxdebug("%s: using initial key, interval=%d, lag=%d, Mining_height=%u\n", randomxInterval, randomxBlockLag, Mining_height);
|
||||
// Use the initial key at the start of the chain, until the first key block
|
||||
// Update the shared dataset key — only one thread will actually rebuild,
|
||||
// others will see the key is already current and skip.
|
||||
if( (Mining_height) < randomxInterval + randomxBlockLag) {
|
||||
randomx_init_cache(randomxCache, &randomxKey, sizeof randomxKey);
|
||||
rxdebug("%s: initialized cache with initial key\n");
|
||||
g_rxDatasetManager->UpdateKey(randomxKey, strlen(randomxKey));
|
||||
rxdebug("%s: updated shared dataset with initial key\n");
|
||||
} else {
|
||||
rxdebug("%s: calculating keyHeight with randomxInterval=%d\n", randomxInterval);
|
||||
// At heights between intervals, we use the same block key and wait randomxBlockLag blocks until changing
|
||||
const int keyHeight = ((Mining_height - randomxBlockLag) / randomxInterval) * randomxInterval;
|
||||
uint256 randomxBlockKey = chainActive[keyHeight]->GetBlockHash();
|
||||
|
||||
randomx_init_cache(randomxCache, &randomxBlockKey, sizeof randomxBlockKey);
|
||||
rxdebug("%s: initialized cache with keyHeight=%d, randomxBlockKey=%s\n", keyHeight, randomxBlockKey.ToString().c_str());
|
||||
g_rxDatasetManager->UpdateKey(&randomxBlockKey, sizeof randomxBlockKey);
|
||||
rxdebug("%s: updated shared dataset with keyHeight=%d, randomxBlockKey=%s\n", keyHeight, randomxBlockKey.ToString().c_str());
|
||||
}
|
||||
|
||||
const int initThreadCount = std::thread::hardware_concurrency();
|
||||
if(initThreadCount > 1) {
|
||||
rxdebug("%s: initializing dataset with %d threads\n", initThreadCount);
|
||||
std::vector<std::thread> threads;
|
||||
uint32_t startItem = 0;
|
||||
const auto perThread = datasetItemCount / initThreadCount;
|
||||
const auto remainder = datasetItemCount % initThreadCount;
|
||||
for (int i = 0; i < initThreadCount; ++i) {
|
||||
const auto count = perThread + (i == initThreadCount - 1 ? remainder : 0);
|
||||
threads.push_back(std::thread(&randomx_init_dataset, randomxDataset, randomxCache, startItem, count));
|
||||
startItem += count;
|
||||
// Create a per-thread VM once and reuse across blocks.
|
||||
// The VM just stores a pointer to the shared dataset — the pointer
|
||||
// remains valid across key changes since UpdateKey rebuilds the dataset
|
||||
// contents in-place without reallocating. Reusing the VM avoids
|
||||
// repeated 2MB scratchpad + 84KB JIT alloc/free churn that causes
|
||||
// Windows heap fragmentation and apparent memory growth per thread.
|
||||
if (myVM == nullptr) {
|
||||
// First iteration: acquire shared lock briefly to create VM
|
||||
boost::shared_lock<boost::shared_mutex> initLock(g_rxDatasetManager->datasetMtx);
|
||||
myVM = g_rxDatasetManager->CreateVM();
|
||||
if (myVM == nullptr) {
|
||||
LogPrintf("RandomXMiner: Cannot create RandomX VM, aborting!\n");
|
||||
return;
|
||||
}
|
||||
for (unsigned i = 0; i < threads.size(); ++i) {
|
||||
threads[i].join();
|
||||
}
|
||||
threads.clear();
|
||||
} else {
|
||||
rxdebug("%s: initializing dataset with 1 thread\n");
|
||||
randomx_init_dataset(randomxDataset, randomxCache, 0, datasetItemCount);
|
||||
}
|
||||
|
||||
rxdebug("%s: dataset initialized\n");
|
||||
|
||||
myVM = randomx_create_vm(flags, nullptr, randomxDataset);
|
||||
if(myVM == NULL) {
|
||||
LogPrintf("RandomXMiner: Cannot create RandomX VM, aborting!\n");
|
||||
return;
|
||||
}
|
||||
// Acquire shared lock to prevent dataset rebuild while we're hashing
|
||||
boost::shared_lock<boost::shared_mutex> datasetLock(g_rxDatasetManager->datasetMtx);
|
||||
//fprintf(stderr,"RandomXMiner: Mining_start=%u\n", Mining_start);
|
||||
#ifdef ENABLE_WALLET
|
||||
CBlockTemplate *ptr = CreateNewBlockWithKey(reservekey, pindexPrev->GetHeight()+1, gpucount, 0);
|
||||
@@ -1268,16 +1444,17 @@ void static RandomXMiner()
|
||||
arith_uint256 hashTarget;
|
||||
hashTarget = HASHTarget;
|
||||
|
||||
CRandomXInput rxInput(pblocktemplate->block);
|
||||
CDataStream randomxInput(SER_NETWORK, PROTOCOL_VERSION);
|
||||
// Use the current block as randomx input
|
||||
randomxInput << pblocktemplate->block;
|
||||
// Serialize block header without nSolution but with nNonce for deterministic RandomX input
|
||||
randomxInput << rxInput;
|
||||
|
||||
// std::cerr << "RandomXMiner: randomxInput=" << HexStr(randomxInput) << "\n";
|
||||
// fprintf(stderr,"RandomXMiner: created randomxKey=%s , randomxInput.size=%lu\n", randomxKey, randomxInput.size() ); //randomxInput);
|
||||
rxdebug("%s: randomxKey=%s randomxInput=%s\n", randomxKey, HexStr(randomxInput).c_str());
|
||||
|
||||
rxdebug("%s: calculating randomx hash\n");
|
||||
randomx_calculate_hash(myVM, &randomxInput, sizeof randomxInput, randomxHash);
|
||||
randomx_calculate_hash(myVM, &randomxInput[0], randomxInput.size(), randomxHash);
|
||||
rxdebug("%s: calculated randomx hash\n");
|
||||
|
||||
rxdebug("%s: randomxHash=");
|
||||
@@ -1324,14 +1501,28 @@ void static RandomXMiner()
|
||||
|
||||
CValidationState state;
|
||||
//{ LOCK(cs_main);
|
||||
if ( !TestBlockValidity(state,B, chainActive.LastTip(), true, false))
|
||||
// Skip RandomX re-validation during TestBlockValidity — we already
|
||||
// computed the correct hash, and re-verifying allocates ~256MB which
|
||||
// can trigger the OOM killer on memory-constrained systems.
|
||||
SetSkipRandomXValidation(true);
|
||||
bool fValid = TestBlockValidity(state,B, chainActive.LastTip(), true, false);
|
||||
SetSkipRandomXValidation(false);
|
||||
if ( !fValid )
|
||||
{
|
||||
h = UintToArith256(B.GetHash());
|
||||
fprintf(stderr,"RandomXMiner: Invalid randomx block mined, try again ");
|
||||
fprintf(stderr,"RandomXMiner: TestBlockValidity FAILED at ht.%d nNonce=%s hash=",
|
||||
Mining_height, pblock->nNonce.ToString().c_str());
|
||||
for (z=31; z>=0; z--)
|
||||
fprintf(stderr,"%02x",((uint8_t *)&h)[z]);
|
||||
gotinvalid = 1;
|
||||
fprintf(stderr," nSolution.size=%lu\n", B.nSolution.size());
|
||||
// Dump nSolution hex for comparison with validator
|
||||
fprintf(stderr,"RandomXMiner: nSolution=");
|
||||
for (unsigned i = 0; i < B.nSolution.size(); i++)
|
||||
fprintf(stderr,"%02x", B.nSolution[i]);
|
||||
fprintf(stderr,"\n");
|
||||
LogPrintf("RandomXMiner: TestBlockValidity FAILED at ht.%d, gotinvalid=1, state=%s\n",
|
||||
Mining_height, state.GetRejectReason());
|
||||
gotinvalid = 1;
|
||||
return(false);
|
||||
}
|
||||
//}
|
||||
@@ -1399,21 +1590,24 @@ void static RandomXMiner()
|
||||
pblock->nBits = savebits;
|
||||
}
|
||||
|
||||
rxdebug("%s: going to destroy rx VM\n");
|
||||
randomx_destroy_vm(myVM);
|
||||
rxdebug("%s: destroyed VM\n");
|
||||
// Release shared lock so UpdateKey can acquire exclusive lock for dataset rebuild
|
||||
// VM is kept alive — its dataset pointer remains valid across rebuilds
|
||||
datasetLock.unlock();
|
||||
}
|
||||
|
||||
} catch (const boost::thread_interrupted&) {
|
||||
miningTimer.stop();
|
||||
c.disconnect();
|
||||
|
||||
randomx_destroy_vm(myVM);
|
||||
LogPrintf("%s: destroyed vm via thread interrupt\n", __func__);
|
||||
randomx_release_dataset(randomxDataset);
|
||||
rxdebug("%s: released dataset via thread interrupt\n");
|
||||
randomx_release_cache(randomxCache);
|
||||
rxdebug("%s: released cache via thread interrupt\n");
|
||||
if (myVM != nullptr) {
|
||||
randomx_destroy_vm(myVM);
|
||||
myVM = nullptr;
|
||||
LogPrintf("%s: destroyed vm via thread interrupt\n", __func__);
|
||||
} else {
|
||||
LogPrintf("%s: WARNING myVM already null in thread interrupt handler, skipping destroy (would double-free)\n", __func__);
|
||||
fprintf(stderr, "%s: WARNING myVM already null in thread interrupt, would have double-freed!\n", __func__);
|
||||
}
|
||||
// Dataset and cache are owned by g_rxDatasetManager — do NOT release here
|
||||
|
||||
LogPrintf("HushRandomXMiner terminated\n");
|
||||
throw;
|
||||
@@ -1422,20 +1616,21 @@ void static RandomXMiner()
|
||||
c.disconnect();
|
||||
fprintf(stderr,"RandomXMiner: runtime error: %s\n", e.what());
|
||||
|
||||
randomx_destroy_vm(myVM);
|
||||
LogPrintf("%s: destroyed vm because of error\n", __func__);
|
||||
randomx_release_dataset(randomxDataset);
|
||||
rxdebug("%s: released dataset because of error\n");
|
||||
randomx_release_cache(randomxCache);
|
||||
rxdebug("%s: released cache because of error\n");
|
||||
if (myVM != nullptr) {
|
||||
randomx_destroy_vm(myVM);
|
||||
myVM = nullptr;
|
||||
LogPrintf("%s: destroyed vm because of error\n", __func__);
|
||||
}
|
||||
// Dataset and cache are owned by g_rxDatasetManager — do NOT release here
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
randomx_release_dataset(randomxDataset);
|
||||
rxdebug("%s: released dataset in normal exit\n");
|
||||
randomx_release_cache(randomxCache);
|
||||
rxdebug("%s: released cache in normal exit\n");
|
||||
// Only destroy per-thread VM, dataset/cache are shared
|
||||
if (myVM != nullptr) {
|
||||
randomx_destroy_vm(myVM);
|
||||
myVM = nullptr;
|
||||
}
|
||||
miningTimer.stop();
|
||||
c.disconnect();
|
||||
}
|
||||
@@ -1879,8 +2074,18 @@ void static BitcoinMiner()
|
||||
if (minerThreads != NULL)
|
||||
{
|
||||
minerThreads->interrupt_all();
|
||||
// Wait for all miner threads to fully terminate before destroying shared resources
|
||||
minerThreads->join_all();
|
||||
delete minerThreads;
|
||||
minerThreads = NULL;
|
||||
|
||||
// Shutdown shared RandomX dataset manager after all threads are done
|
||||
if (g_rxDatasetManager != nullptr) {
|
||||
g_rxDatasetManager->Shutdown();
|
||||
delete g_rxDatasetManager;
|
||||
g_rxDatasetManager = nullptr;
|
||||
LogPrintf("%s: destroyed shared RandomX dataset manager\n", __func__);
|
||||
}
|
||||
}
|
||||
|
||||
if(fDebug)
|
||||
@@ -1895,6 +2100,21 @@ void static BitcoinMiner()
|
||||
|
||||
minerThreads = new boost::thread_group();
|
||||
|
||||
// Initialize shared RandomX dataset manager before spawning miner threads
|
||||
if (ASSETCHAINS_ALGO == ASSETCHAINS_RANDOMX) {
|
||||
g_rxDatasetManager = new RandomXDatasetManager();
|
||||
if (!g_rxDatasetManager->Init()) {
|
||||
LogPrintf("%s: FATAL - Failed to initialize shared RandomX dataset manager\n", __func__);
|
||||
fprintf(stderr, "%s: FATAL - Failed to initialize shared RandomX dataset manager\n", __func__);
|
||||
delete g_rxDatasetManager;
|
||||
g_rxDatasetManager = nullptr;
|
||||
delete minerThreads;
|
||||
minerThreads = NULL;
|
||||
return;
|
||||
}
|
||||
LogPrintf("%s: shared RandomX dataset manager initialized\n", __func__);
|
||||
}
|
||||
|
||||
for (int i = 0; i < nThreads; i++) {
|
||||
#ifdef ENABLE_WALLET
|
||||
if ( ASSETCHAINS_ALGO == ASSETCHAINS_EQUIHASH ) {
|
||||
|
||||
@@ -16,11 +16,11 @@ NotarizationsInBlock ScanBlockNotarizations(const CBlock &block, int nHeight) {
|
||||
EvalRef eval;
|
||||
NotarizationsInBlock vNotarizations;
|
||||
int timestamp = block.nTime;
|
||||
bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
bool isdragonx = strncmp(SMART_CHAIN_SYMBOL, "DRAGONX",7) == 0 ? true : false;
|
||||
|
||||
// No valid ntz's before this height
|
||||
int minheight = ishush3 ? 365420 : 1;
|
||||
if(ishush3 && (nHeight <= GetArg("-dpow-start-height",minheight))) {
|
||||
int minheight = isdragonx ? 365420 : 1;
|
||||
if(isdragonx && (nHeight <= GetArg("-dpow-start-height",minheight))) {
|
||||
return vNotarizations;
|
||||
}
|
||||
|
||||
|
||||
15
src/pow.cpp
15
src/pow.cpp
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -339,6 +340,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead
|
||||
memset(zflags,0,sizeof(zflags));
|
||||
if ( pindexLast != 0 )
|
||||
height = (int32_t)pindexLast->GetHeight() + 1;
|
||||
|
||||
if ( ASSETCHAINS_ADAPTIVEPOW > 0 && pindexFirst != 0 && pblock != 0 && height >= (int32_t)(sizeof(ct)/sizeof(*ct)) )
|
||||
{
|
||||
tipdiff = (pblock->nTime - pindexFirst->nTime);
|
||||
@@ -531,9 +533,9 @@ unsigned int CalculateNextWorkRequired(arith_uint256 bnAvg,
|
||||
int64_t nActualTimespan = nLastBlockTime - nFirstBlockTime;
|
||||
LogPrint("pow", " nActualTimespan = %d before dampening\n", nActualTimespan);
|
||||
|
||||
bool ishush3 = strncmp(SMART_CHAIN_SYMBOL, "HUSH3",5) == 0 ? true : false;
|
||||
// If this is HUSH3, use AWT function defined above, else use the one in params
|
||||
int64_t AWT = ishush3 ? AveragingWindowTimespan() : params.AveragingWindowTimespan();
|
||||
// DragonX uses params.AveragingWindowTimespan() = nPowAveragingWindow * nPowTargetSpacing = 17 * 36 = 612
|
||||
// The standalone AveragingWindowTimespan() returns 1275 which is HUSH3-specific (17 * 75s)
|
||||
int64_t AWT = params.AveragingWindowTimespan();
|
||||
|
||||
nActualTimespan = AWT + (nActualTimespan - AWT)/4;
|
||||
LogPrint("pow", " nActualTimespan = %d before bounds\n", nActualTimespan);
|
||||
@@ -685,7 +687,10 @@ bool CheckEquihashSolution(const CBlockHeader *pblock, const CChainParams& param
|
||||
return true;
|
||||
}
|
||||
|
||||
// Static objects for CheckRandomXSolution
|
||||
int GetRandomXInterval() { return GetArg("-ac_randomx_interval", 1024); }
|
||||
int GetRandomXBlockLag() { return GetArg("-ac_randomx_lag", 64); }
|
||||
|
||||
// Cached RandomX validation state — reused across calls, protected by mutex
|
||||
static std::mutex cs_randomx_validator;
|
||||
static randomx_cache *s_rxCache = nullptr;
|
||||
static randomx_vm *s_rxVM = nullptr;
|
||||
@@ -862,6 +867,7 @@ bool CheckProofOfWork(const CBlockHeader &blkHeader, uint8_t *pubkey33, int32_t
|
||||
if ( HUSH_LOADINGBLOCKS != 0 )
|
||||
return true;
|
||||
|
||||
/*
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 || height > 792000 )
|
||||
{
|
||||
if ( Params().NetworkIDString() != "regtest" )
|
||||
@@ -881,6 +887,7 @@ bool CheckProofOfWork(const CBlockHeader &blkHeader, uint8_t *pubkey33, int32_t
|
||||
}
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
/*for (i=31; i>=0; i--)
|
||||
fprintf(stderr,"%02x",((uint8_t *)&hash)[i]);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -169,7 +170,7 @@ UniValue getgenerate(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
throw runtime_error(
|
||||
"getgenerate\n"
|
||||
"\nReturn if the server is set to mine coins or not. The default is false.\n"
|
||||
"It is set with the command line argument -gen (or HUSH3.conf setting gen).\n"
|
||||
"It is set with the command line argument -gen (or DRAGONX.conf setting gen).\n"
|
||||
"It can also be set with the setgenerate call.\n"
|
||||
"\nResult\n"
|
||||
"{\n"
|
||||
|
||||
@@ -253,12 +253,12 @@ UniValue getinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
obj.push_back(Pair("notarizedtxid", notarized_desttxid.ToString()));
|
||||
if ( HUSH_NSPV_FULLNODE )
|
||||
{
|
||||
txid_height = notarizedtxid_height( (char *)"HUSH3" ,(char *)notarized_desttxid.ToString().c_str(),&hushnotarized_height);
|
||||
txid_height = notarizedtxid_height( (char *)"DRAGONX" ,(char *)notarized_desttxid.ToString().c_str(),&hushnotarized_height);
|
||||
if ( txid_height > 0 )
|
||||
obj.push_back(Pair("notarizedtxid_height", txid_height));
|
||||
else obj.push_back(Pair("notarizedtxid_height", "mempool"));
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 ) {
|
||||
obj.push_back(Pair("HUSHnotarized_height", hushnotarized_height));
|
||||
obj.push_back(Pair("DRAGONXnotarized_height", hushnotarized_height));
|
||||
}
|
||||
obj.push_back(Pair("notarized_confirms", txid_height < hushnotarized_height ? (hushnotarized_height - txid_height + 1) : 0));
|
||||
//fprintf(stderr,"after notarized_confirms %u\n",(uint32_t)time(NULL));
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -133,7 +134,7 @@ UniValue getpeerinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
" \"pingtime\": n, (numeric) ping time\n"
|
||||
" \"pingwait\": n, (numeric) ping wait\n"
|
||||
" \"version\": v, (numeric) The peer version, such as 170002\n"
|
||||
" \"subver\": \"/GoldenSandtrout:x.y.z[-v]/\", (string) The string version\n"
|
||||
" \"subver\": \"/DragonX:x.y.z[-v]/\", (string) The string version\n"
|
||||
" \"inbound\": true|false, (boolean) Inbound (true) or Outbound (false)\n"
|
||||
" \"startingheight\": n, (numeric) The starting height (block) of the peer\n"
|
||||
" \"banscore\": n, (numeric) The ban score\n"
|
||||
@@ -505,7 +506,7 @@ UniValue getnetworkinfo(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
"\nResult:\n"
|
||||
"{\n"
|
||||
" \"version\": xxxxx, (numeric) the server version\n"
|
||||
" \"subversion\": \"/GoldenSandtrout:x.y.z[-v]/\", (string) the server subversion string\n"
|
||||
" \"subversion\": \"/DragonX:x.y.z[-v]/\", (string) the server subversion string\n"
|
||||
" \"protocolversion\": xxxxx, (numeric) the protocol version\n"
|
||||
" \"localservices\": \"xxxxxxxxxxxxxxxx\", (string) the services we offer to the network\n"
|
||||
" \"timeoffset\": xxxxx, (numeric) the time offset (deprecated, always 0)\n"
|
||||
|
||||
@@ -276,8 +276,8 @@ UniValue stop(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
// Shutdown will take long enough that the response should get back
|
||||
StartShutdown();
|
||||
|
||||
if ((strncmp(SMART_CHAIN_SYMBOL, "HUSH3", 5) == 0) ) {
|
||||
sprintf(buf,"Hush server stopping, for now...");
|
||||
if ((strncmp(SMART_CHAIN_SYMBOL, "DRAGONX", 7) == 0) ) {
|
||||
sprintf(buf,"DragonX server stopping, for now...");
|
||||
} else {
|
||||
sprintf(buf,"%s server stopping...",SMART_CHAIN_SYMBOL);
|
||||
}
|
||||
@@ -694,10 +694,10 @@ UniValue CRPCTable::execute(const std::string &strMethod, const UniValue ¶ms
|
||||
|
||||
std::string HelpExampleCli(const std::string& methodname, const std::string& args)
|
||||
{
|
||||
if ((strncmp(SMART_CHAIN_SYMBOL, "HUSH3", 5) == 0) ) {
|
||||
return "> hush-cli " + methodname + " " + args + "\n";
|
||||
if ((strncmp(SMART_CHAIN_SYMBOL, "DRAGONX", 7) == 0) ) {
|
||||
return "> dragonx-cli " + methodname + " " + args + "\n";
|
||||
} else {
|
||||
return "> hush-cli -ac_name=" + strprintf("%s", SMART_CHAIN_SYMBOL) + " " + methodname + " " + args + "\n";
|
||||
return "> dragonx-cli -ac_name=" + strprintf("%s", SMART_CHAIN_SYMBOL) + " " + methodname + " " + args + "\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"ac_perc": "11111111",
|
||||
"ac_eras": "3",
|
||||
"ac_script": "76a9145eb10cf64f2bab1b457f1f25e658526155928fac88ac",
|
||||
"clientname": "GoldenSandtrout",
|
||||
"clientname": "DragonX",
|
||||
"addnode": [
|
||||
"1.1.1.1"
|
||||
]
|
||||
|
||||
15
src/util.cpp
15
src/util.cpp
@@ -1,6 +1,7 @@
|
||||
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
||||
// Copyright (c) 2009-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2025 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
|
||||
@@ -710,7 +711,7 @@ boost::filesystem::path GetConfigFile()
|
||||
if ( SMART_CHAIN_SYMBOL[0] != 0 ) {
|
||||
sprintf(confname,"%s.conf",SMART_CHAIN_SYMBOL);
|
||||
} else {
|
||||
strcpy(confname,"HUSH3.conf");
|
||||
strcpy(confname,"DRAGONX.conf");
|
||||
}
|
||||
boost::filesystem::path pathConfigFile(GetArg("-conf",confname));
|
||||
if (!pathConfigFile.is_complete())
|
||||
@@ -731,7 +732,7 @@ void ReadConfigFile(map<string, string>& mapSettingsRet,
|
||||
|
||||
for (boost::program_options::detail::config_file_iterator it(streamConfig, setOptions), end; it != end; ++it)
|
||||
{
|
||||
// Don't overwrite existing settings so command line settings override HUSH3.conf
|
||||
// Don't overwrite existing settings so command line settings override DRAGONX.conf
|
||||
string strKey = string("-") + it->string_key;
|
||||
if (mapSettingsRet.count(strKey) == 0)
|
||||
{
|
||||
@@ -750,7 +751,7 @@ void ReadConfigFile(map<string, string>& mapSettingsRet,
|
||||
#ifndef _WIN32
|
||||
boost::filesystem::path GetPidFile()
|
||||
{
|
||||
boost::filesystem::path pathPidFile(GetArg("-pid", "hushd.pid"));
|
||||
boost::filesystem::path pathPidFile(GetArg("-pid", "dragonxd.pid"));
|
||||
if (!pathPidFile.is_complete()) pathPidFile = GetDataDir() / pathPidFile;
|
||||
return pathPidFile;
|
||||
}
|
||||
@@ -1029,14 +1030,16 @@ void SetThreadPriority(int nPriority)
|
||||
std::string PrivacyInfo()
|
||||
{
|
||||
return "\n" +
|
||||
FormatParagraph(strprintf(_("In order to ensure you are adequately protecting your privacy when using Hush, please see <%s>."),
|
||||
"https://hush.is/security/")) + "\n";
|
||||
FormatParagraph(strprintf(_("In order to ensure you are adequately protecting your privacy when using DragonX, please see <%s>."),
|
||||
"https://dragonx.is/security/")) + "\n";
|
||||
}
|
||||
|
||||
std::string LicenseInfo()
|
||||
{
|
||||
return "\n" +
|
||||
FormatParagraph(strprintf(_("Copyright (C) 2016-%i Duke Leto and The Hush Developers"), COPYRIGHT_YEAR)) + "\n" +
|
||||
FormatParagraph(strprintf(_("Copyright (C) 2024-%i The DragonX Developers"), COPYRIGHT_YEAR)) + "\n" +
|
||||
"\n" +
|
||||
FormatParagraph(strprintf(_("Copyright (C) 2016-2024 Duke Leto and The Hush Developers"))) + "\n" +
|
||||
"\n" +
|
||||
FormatParagraph(strprintf(_("Copyright (C) 2016-2020 jl777 and SuperNET developers"))) + "\n" +
|
||||
"\n" +
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) 2012-2014 The Bitcoin Core developers
|
||||
// Copyright (c) 2016-2026 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
/******************************************************************************
|
||||
@@ -21,7 +22,8 @@
|
||||
#define HUSH_VERSION_H
|
||||
|
||||
// network protocol versioning
|
||||
static const int PROTOCOL_VERSION = 1987429;
|
||||
// DragonX 1.0.0 - bumped to separate from old HUSH/DragonX nodes with RandomX bug
|
||||
static const int PROTOCOL_VERSION = 2000000;
|
||||
//! initial proto version, to be increased after version/verack negotiation
|
||||
static const int INIT_PROTO_VERSION = 209;
|
||||
//! In this version, 'getheaders' was introduced.
|
||||
@@ -30,8 +32,9 @@ static const int GETHEADERS_VERSION = 31800;
|
||||
//! disconnect from peers older than this proto version (HUSH mainnet)
|
||||
static const int MIN_HUSH_PEER_PROTO_VERSION = 1987426;
|
||||
|
||||
//! disconnect from peers older than this proto version (HACs)
|
||||
static const int MIN_PEER_PROTO_VERSION = 1987420;
|
||||
//! disconnect from peers older than this proto version (DragonX/HACs)
|
||||
//! Set to 2000000 to reject nodes without RandomX validation fix
|
||||
static const int MIN_PEER_PROTO_VERSION = 2000000;
|
||||
|
||||
//! nTime field added to CAddress, starting with this version;
|
||||
//! if possible, avoid requesting addresses nodes older than this
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// Copyright (c) 2016-2024 The Hush developers
|
||||
// Copyright (c) 2024-2026 The DragonX developers
|
||||
// Distributed under the GPLv3 software license, see the accompanying
|
||||
// file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
#include <iostream>
|
||||
@@ -13,7 +14,7 @@
|
||||
char SMART_CHAIN_SYMBOL[HUSH_SMART_CHAIN_MAXLEN];
|
||||
int64_t MAX_MONEY = 200000000 * 100000000LL;
|
||||
uint64_t ASSETCHAINS_SUPPLY;
|
||||
uint16_t BITCOIND_RPCPORT = 18031;
|
||||
uint16_t BITCOIND_RPCPORT = 21769;
|
||||
uint16_t ASSETCHAINS_P2PPORT,ASSETCHAINS_RPCPORT;
|
||||
uint32_t ASSETCHAIN_INIT,ASSETCHAINS_CC;
|
||||
uint32_t ASSETCHAINS_MAGIC = 2387029918;
|
||||
|
||||
@@ -712,7 +712,7 @@ UniValue kvupdate(const UniValue& params, bool fHelp, const CPubKey& mypk)
|
||||
//for (i=0; i<32; i++)
|
||||
// printf("%02x",((uint8_t *)&sig)[i]);
|
||||
//printf(" sig for keylen.%d + valuesize.%d\n",keylen,refvaluesize);
|
||||
ret.push_back(Pair("coin",(char *)(SMART_CHAIN_SYMBOL[0] == 0 ? "HUSH3" : SMART_CHAIN_SYMBOL)));
|
||||
ret.push_back(Pair("coin",(char *)(SMART_CHAIN_SYMBOL[0] == 0 ? "DRAGONX" : SMART_CHAIN_SYMBOL)));
|
||||
height = chainActive.LastTip()->GetHeight();
|
||||
if ( memcmp(&zeroes,&refpubkey,sizeof(refpubkey)) != 0 )
|
||||
ret.push_back(Pair("owner",refpubkey.GetHex()));
|
||||
|
||||
227
util/bootstrap-dragonx.sh
Executable file
227
util/bootstrap-dragonx.sh
Executable file
@@ -0,0 +1,227 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright 2024 The Hush Developers
|
||||
# Copyright 2024 The DragonX Developers
|
||||
# Released under the GPLv3
|
||||
#
|
||||
# Download and apply a DRAGONX blockchain bootstrap.
|
||||
# Safely preserves wallet.dat and configuration files.
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
BOOTSTRAP_BASE_URL="https://bootstrap.dragonx.is"
|
||||
BOOTSTRAP_FILE="DRAGONX.zip"
|
||||
CHAIN_NAME="DRAGONX"
|
||||
|
||||
# Determine data directory
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
DATADIR="$HOME/Library/Application Support/Hush/$CHAIN_NAME"
|
||||
else
|
||||
DATADIR="$HOME/.hush/$CHAIN_NAME"
|
||||
fi
|
||||
|
||||
CLI="dragonx-cli"
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
info() { echo -e "${GREEN}[INFO]${NC} $*" >&2; }
|
||||
warn() { echo -e "${YELLOW}[WARN]${NC} $*" >&2; }
|
||||
error() { echo -e "${RED}[ERROR]${NC} $*" >&2; exit 1; }
|
||||
|
||||
# Find dragonx-cli in PATH or relative to this script
|
||||
find_cli() {
|
||||
if command -v "$CLI" &>/dev/null; then
|
||||
CLI=$(command -v "$CLI")
|
||||
elif [[ -x "$(dirname "$0")/../../src/$CLI" ]]; then
|
||||
CLI="$(dirname "$0")/../../src/$CLI"
|
||||
else
|
||||
CLI=""
|
||||
fi
|
||||
}
|
||||
|
||||
# Stop the daemon if running
|
||||
stop_daemon() {
|
||||
find_cli
|
||||
if [[ -n "$CLI" ]]; then
|
||||
if "$CLI" getinfo &>/dev/null 2>&1; then
|
||||
info "Stopping DragonX daemon..."
|
||||
"$CLI" stop 2>/dev/null || true
|
||||
# Wait for daemon to exit
|
||||
local tries=0
|
||||
while "$CLI" getinfo &>/dev/null 2>&1; do
|
||||
sleep 2
|
||||
tries=$((tries + 1))
|
||||
if [[ $tries -ge 60 ]]; then
|
||||
error "Daemon did not stop after 120 seconds. Please stop it manually and retry."
|
||||
fi
|
||||
done
|
||||
info "Daemon stopped."
|
||||
else
|
||||
info "Daemon is not running."
|
||||
fi
|
||||
else
|
||||
warn "dragonx-cli not found. Please make sure the daemon is stopped before continuing."
|
||||
read -rp "Is the DragonX daemon stopped? (y/N): " answer
|
||||
if [[ "${answer,,}" != "y" ]]; then
|
||||
error "Please stop the daemon first and run this script again."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Files/dirs to preserve (never delete these)
|
||||
PRESERVE_LIST=(
|
||||
"wallet.dat"
|
||||
"DRAGONX.conf"
|
||||
"peers.dat"
|
||||
)
|
||||
|
||||
# Remove blockchain data while preserving wallet and config
|
||||
clean_chain_data() {
|
||||
if [[ ! -d "$DATADIR" ]]; then
|
||||
info "Data directory does not exist yet, creating it."
|
||||
mkdir -p "$DATADIR"
|
||||
return
|
||||
fi
|
||||
|
||||
info "Cleaning blockchain data from $DATADIR ..."
|
||||
|
||||
# Move preserved files to a temp location
|
||||
local tmpdir
|
||||
tmpdir=$(mktemp -d)
|
||||
for f in "${PRESERVE_LIST[@]}"; do
|
||||
if [[ -e "$DATADIR/$f" ]]; then
|
||||
cp -a "$DATADIR/$f" "$tmpdir/"
|
||||
fi
|
||||
done
|
||||
|
||||
# Remove blockchain directories
|
||||
local dirs_to_remove=("blocks" "chainstate" "notarizations" "komodo" "db.log" "debug.log" "fee_estimates.dat" "banlist.dat")
|
||||
for d in "${dirs_to_remove[@]}"; do
|
||||
if [[ -e "$DATADIR/$d" ]]; then
|
||||
rm -rf "$DATADIR/$d"
|
||||
fi
|
||||
done
|
||||
|
||||
# Restore preserved files
|
||||
for f in "${PRESERVE_LIST[@]}"; do
|
||||
if [[ -e "$tmpdir/$f" ]]; then
|
||||
cp -a "$tmpdir/$f" "$DATADIR/"
|
||||
fi
|
||||
done
|
||||
rm -rf "$tmpdir"
|
||||
|
||||
info "Blockchain data cleaned."
|
||||
}
|
||||
|
||||
# Download a file via wget or curl
|
||||
download_file() {
|
||||
local url="$1"
|
||||
local outfile="$2"
|
||||
|
||||
if command -v wget &>/dev/null; then
|
||||
wget --progress=bar:force -O "$outfile" "$url" || error "Download failed: $url"
|
||||
elif command -v curl &>/dev/null; then
|
||||
curl -L --progress-bar -o "$outfile" "$url" || error "Download failed: $url"
|
||||
else
|
||||
error "Neither wget nor curl found. Please install one and retry."
|
||||
fi
|
||||
}
|
||||
|
||||
# Download the bootstrap and verify checksums
|
||||
download_bootstrap() {
|
||||
local outfile="$DATADIR/$BOOTSTRAP_FILE"
|
||||
local md5file="$DATADIR/${BOOTSTRAP_FILE}.md5"
|
||||
local sha256file="$DATADIR/${BOOTSTRAP_FILE}.sha256"
|
||||
|
||||
info "Downloading bootstrap from $BOOTSTRAP_BASE_URL ..."
|
||||
info "This may take a while depending on your connection speed."
|
||||
|
||||
download_file "$BOOTSTRAP_BASE_URL/$BOOTSTRAP_FILE" "$outfile"
|
||||
info "Bootstrap download complete."
|
||||
|
||||
info "Downloading checksums..."
|
||||
download_file "$BOOTSTRAP_BASE_URL/${BOOTSTRAP_FILE}.md5" "$md5file"
|
||||
download_file "$BOOTSTRAP_BASE_URL/${BOOTSTRAP_FILE}.sha256" "$sha256file"
|
||||
|
||||
# Verify checksums
|
||||
info "Verifying checksums..."
|
||||
cd "$DATADIR"
|
||||
|
||||
if command -v md5sum &>/dev/null; then
|
||||
if md5sum -c "$md5file" >&2; then
|
||||
info "MD5 checksum verified."
|
||||
else
|
||||
error "MD5 checksum verification failed! The download may be corrupted."
|
||||
fi
|
||||
else
|
||||
warn "md5sum not found, skipping MD5 verification."
|
||||
fi
|
||||
|
||||
if command -v sha256sum &>/dev/null; then
|
||||
if sha256sum -c "$sha256file" >&2; then
|
||||
info "SHA256 checksum verified."
|
||||
else
|
||||
error "SHA256 checksum verification failed! The download may be corrupted."
|
||||
fi
|
||||
else
|
||||
warn "sha256sum not found, skipping SHA256 verification."
|
||||
fi
|
||||
|
||||
# Clean up checksum files
|
||||
rm -f "$md5file" "$sha256file"
|
||||
|
||||
echo "$outfile"
|
||||
}
|
||||
|
||||
# Extract the bootstrap
|
||||
extract_bootstrap() {
|
||||
local archive="$1"
|
||||
|
||||
info "Extracting bootstrap..."
|
||||
cd "$DATADIR"
|
||||
|
||||
# Extract zip, but never overwrite wallet.dat or config
|
||||
unzip -o "$archive" -x 'wallet.dat' '*.conf' || error "Extraction failed. Please install unzip and retry."
|
||||
|
||||
info "Bootstrap extracted successfully."
|
||||
|
||||
# Clean up the downloaded archive
|
||||
rm -f "$archive"
|
||||
info "Removed downloaded archive to save disk space."
|
||||
}
|
||||
|
||||
|
||||
|
||||
main() {
|
||||
echo "============================================"
|
||||
echo " DragonX Bootstrap Installer"
|
||||
echo "============================================"
|
||||
echo ""
|
||||
info "Data directory: $DATADIR"
|
||||
echo ""
|
||||
|
||||
# Step 1: Stop daemon
|
||||
stop_daemon
|
||||
|
||||
# Step 2: Clean old chain data
|
||||
clean_chain_data
|
||||
|
||||
# Step 3: Download bootstrap
|
||||
local archive
|
||||
archive=$(download_bootstrap)
|
||||
|
||||
# Step 4: Extract bootstrap
|
||||
extract_bootstrap "$archive"
|
||||
|
||||
echo ""
|
||||
info "Bootstrap installation complete!"
|
||||
info "You can now start DragonX with: dragonxd"
|
||||
echo ""
|
||||
}
|
||||
|
||||
main "$@"
|
||||
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2016-2024 The Hush developers
|
||||
# Copyright (c) 2024-2026 The DragonX developers
|
||||
# Distributed under the GPLv3 software license, see the accompanying
|
||||
# file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
export HOST=x86_64-w64-mingw32
|
||||
@@ -40,4 +41,4 @@ cd $WD
|
||||
|
||||
sed -i 's/-lboost_system-mt /-lboost_system-mt-s /' configure
|
||||
cd src/
|
||||
CC="${CC} -g " CXX="${CXX} -g " make V=1 hushd.exe hush-cli.exe hush-tx.exe
|
||||
CC="${CC} -g " CXX="${CXX} -g " make V=1 dragonxd.exe dragonx-cli.exe dragonx-tx.exe
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
# Copyright (c) 2016-2024 The Hush developers
|
||||
# Copyright (c) 2024-2026 The DragonX developers
|
||||
# Released under the GPLv3
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
#hardcode and uncomment if hushd is not running on this machine
|
||||
#VERSION=3.6.3
|
||||
VERSION=$(./src/hushd --version|grep version|cut -d' ' -f4|cut -d- -f1|sed 's/v//g')
|
||||
DIR="hush-$VERSION-linux-amd64"
|
||||
#hardcode and uncomment if dragonxd is not running on this machine
|
||||
#VERSION=1.0.0
|
||||
VERSION=$(./src/dragonxd --version|grep version|cut -d' ' -f4|cut -d- -f1|sed 's/v//g')
|
||||
DIR="dragonx-$VERSION-linux-amd64"
|
||||
FILE="$DIR.tar"
|
||||
TIME=$(perl -e 'print time')
|
||||
|
||||
@@ -23,12 +24,13 @@ mkdir $BUILD
|
||||
echo "Created new build dir $BUILD"
|
||||
cp contrib/asmap/asmap.dat $BUILD
|
||||
cp sapling*.params $BUILD
|
||||
cp util/bootstrap-dragonx.sh $BUILD
|
||||
cd src
|
||||
cp hushd hush-cli hush-tx hush-arrakis-chain ../$BUILD
|
||||
cp dragonxd dragonx-cli dragonx-tx ../$BUILD
|
||||
cd ../$BUILD
|
||||
strip hushd hush-cli hush-tx
|
||||
strip dragonxd dragonx-cli dragonx-tx
|
||||
cd ..
|
||||
tar -f $FILE -c hush-$VERSION-linux-amd64/*
|
||||
tar -f $FILE -c dragonx-$VERSION-linux-amd64/*
|
||||
gzip -9 $FILE
|
||||
sha256sum *.gz
|
||||
du -sh *.gz
|
||||
|
||||
Reference in New Issue
Block a user