Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This guide will help you build `zclassicd` (ZClassic daemon) from source code.

## System Requirements

- **Operating System**: Ubuntu 20.04+, Debian 11+, or compatible Linux distribution
- **Operating System**: Ubuntu 20.04+, Debian 11+, Arch Linux, Manjaro, or compatible Linux distribution
- **Memory**: At least 4 GB RAM recommended
- **Disk Space**: 20 GB free space (for build files and blockchain data)
- **Compiler**: GCC 9+ or Clang 10+
Expand Down Expand Up @@ -42,6 +42,15 @@ sudo apt-get install -y \
zlib1g-dev libssl-dev libevent-dev
```

#### Arch Linux / Manjaro

```bash
sudo pacman -S --needed \
base-devel autoconf automake libtool pkgconf \
gmp db libsodium curl \
git python wget openssl libevent
```

#### Other Distributions

Install equivalent packages for your distribution. The key dependencies are:
Expand Down Expand Up @@ -139,11 +148,15 @@ If Arweave downloads fail during first run:

```bash
# Build only the dependencies
make -C depends -j$(nproc)
make -C depends -j$(nproc) NO_PROTON=1

# Then configure with the dependencies
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-unknown-linux-gnu/share/config.site ./configure
DEPS_DIR=$PWD/depends/x86_64-unknown-linux-gnu
CONFIG_SITE=$DEPS_DIR/share/config.site ./configure \
--with-boost=$DEPS_DIR \
CPPFLAGS="-I$DEPS_DIR/include" \
LDFLAGS="-L$DEPS_DIR/lib"
make -j$(nproc)
```

Expand Down
4 changes: 2 additions & 2 deletions depends/hosts/linux.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
linux_CFLAGS=-pipe
linux_CXXFLAGS=$(linux_CFLAGS)
linux_CFLAGS=-pipe -std=gnu17
linux_CXXFLAGS=-pipe -std=gnu++17

linux_release_CFLAGS=-O1
linux_release_CXXFLAGS=$(linux_release_CFLAGS)
Expand Down
8 changes: 5 additions & 3 deletions src/zcbenchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ double benchmark_increment_sapling_note_witnesses(size_t nTxs)
// CCoinsViewDB, but the rest are either mocks and/or don't really do anything.
class FakeCoinsViewDB : public CCoinsView {
// The following constant is a duplicate of the one found in txdb.cpp
static const char DB_COINS = 'c';
static constexpr char DB_COINS = 'c';

CDBWrapper db;

Expand Down Expand Up @@ -488,11 +488,13 @@ class FakeCoinsViewDB : public CCoinsView {
}

bool GetCoins(const uint256 &txid, CCoins &coins) const {
return db.Read(std::make_pair(DB_COINS, txid), coins);
char key = DB_COINS;
return db.Read(std::make_pair(key, txid), coins);
}

bool HaveCoins(const uint256 &txid) const {
return db.Exists(std::make_pair(DB_COINS, txid));
char key = DB_COINS;
return db.Exists(std::make_pair(key, txid));
}

uint256 GetBestBlock() const {
Expand Down
11 changes: 10 additions & 1 deletion zcutil/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,14 @@ ld -v

HOST="$HOST" BUILD="$BUILD" NO_PROTON="$PROTON_ARG" "$MAKE" "$@" -C ./depends/ V=1
./autogen.sh
CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" "$PROTON_ARG" $CONFIGURE_FLAGS CXXFLAGS='-g'

DEPS_DIR="$PWD/depends/$HOST"
CONFIG_SITE="$DEPS_DIR/share/config.site" ./configure \
"$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" "$PROTON_ARG" \
--with-boost="$DEPS_DIR" \
$CONFIGURE_FLAGS \
CXXFLAGS='-g' \
CPPFLAGS="-I$DEPS_DIR/include" \
LDFLAGS="-L$DEPS_DIR/lib"

"$MAKE" "$@" V=1
37 changes: 35 additions & 2 deletions zcutil/install-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ if [ -f /etc/os-release ]; then
. /etc/os-release
OS=$ID
else
echo "Cannot detect OS. This script supports Ubuntu/Debian."
echo "Cannot detect OS. This script supports Ubuntu/Debian and Arch-based distributions."
exit 1
fi

Expand Down Expand Up @@ -79,13 +79,46 @@ install_ubuntu_debian() {
echo "✓ All dependencies installed successfully!"
}

install_arch() {
echo "Installing dependencies for Arch/Manjaro..."
echo ""

PACKAGES=(
base-devel
autoconf
automake
libtool
pkgconf
gmp
db
libsodium
curl
git
python
wget
openssl
libevent
)

echo "Installing packages: ${PACKAGES[*]}"
echo ""

$SUDO pacman -S --needed --noconfirm "${PACKAGES[@]}"

echo ""
echo "All dependencies installed successfully!"
}

case "$OS" in
ubuntu|debian|linuxmint|pop)
install_ubuntu_debian
;;
arch|manjaro|endeavouros|garuda)
install_arch
;;
*)
echo "Unsupported OS: $OS"
echo "This script currently supports Ubuntu and Debian-based distributions."
echo "This script supports Ubuntu/Debian and Arch-based distributions."
echo ""
echo "Required packages:"
echo " - build-essential, autoconf, libtool, automake"
Expand Down
Loading