Skip to content

Commit

Permalink
Merge pull request #2915 from Taraxa-project/release/v1.12.1
Browse files Browse the repository at this point in the history
Release/v1.12.1
  • Loading branch information
MatusKysel authored Dec 20, 2024
2 parents 6b763a2 + 1bdb67d commit 6819fd8
Show file tree
Hide file tree
Showing 322 changed files with 7,327 additions and 3,605 deletions.
12 changes: 5 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ cmake_minimum_required(VERSION 3.20)

# Set current version of the project
set(TARAXA_MAJOR_VERSION 1)
set(TARAXA_MINOR_VERSION 11)
set(TARAXA_PATCH_VERSION 4)
set(TARAXA_MINOR_VERSION 12)
set(TARAXA_PATCH_VERSION 1)
set(TARAXA_VERSION ${TARAXA_MAJOR_VERSION}.${TARAXA_MINOR_VERSION}.${TARAXA_PATCH_VERSION})

# Any time a change in the network protocol is introduced this version should be increased
set(TARAXA_NET_VERSION 3)
set(TARAXA_NET_VERSION 4)
# Major version is modified when DAG blocks, pbft blocks and any basic building blocks of our blockchain is modified
# in the db
set(TARAXA_DB_MAJOR_VERSION 1)
Expand All @@ -32,7 +32,8 @@ add_compile_options(-Wall
-Wextra-semi
-Wnull-dereference
-Wno-unknown-pragmas
-Wno-overlength-strings)
-Wno-overlength-strings
-Wno-switch)
# Set the position independent code property on all targets
set(CMAKE_POSITION_INDEPENDENT_CODE ON)

Expand Down Expand Up @@ -217,9 +218,6 @@ find_package(MPFR)
set(JSONCPP_INCLUDE_DIR ${CONAN_INCLUDE_DIRS_JSONCPP})
include(ProjectJSONRPCCPP)

# rocksdb build
include(${PROJECT_SOURCE_DIR}/CMakeModules/rocksdb.cmake)

# Add sub-directories cmakes
add_subdirectory(submodules)
add_subdirectory(libraries)
Expand Down
2 changes: 1 addition & 1 deletion CMakeModules/cpp_graphql_gen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set(Boost_NO_WARN_NEW_VERSIONS 1)
FetchContent_Declare(
cppgraphqlgen
GIT_REPOSITORY https://github.com/microsoft/cppgraphqlgen.git
GIT_TAG v4.5.6
GIT_TAG v4.5.8
GIT_SHALLOW TRUE
)
set(GRAPHQL_BUILD_TESTS OFF)
Expand Down
10 changes: 9 additions & 1 deletion CMakeModules/cppcheck.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ else ()
COMMAND ${CPP_CHECK_EXE}
--error-exitcode=1
--enable=all
--check-level=exhaustive
--suppress=missingInclude
--suppress=missingIncludeSystem
# find_if - useless here
Expand All @@ -19,14 +20,20 @@ else ()
# false positive
--suppress=uninitMemberVar:${PROJECT_SOURCE_DIR}/*/UPnP.cpp
# This is only enabled because of test functions and false positives
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/Eth.cpp
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/Common.cpp
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/Base64.cpp
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/util.cpp
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/vrf_wrapper.cpp
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/UPnP.cpp
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/logger.cpp
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/state_api.cpp
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/watches.hpp
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/vector_ref.h
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/RLP.h
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/FixedHash.h
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/CommonData.h
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/Common.h
--suppress=unusedFunction:${PROJECT_SOURCE_DIR}/*/Log.h
# TODO remove this when we solve correct exit of programs
--suppress=localMutex:${PROJECT_SOURCE_DIR}/*/main.cpp
# Just style warning
Expand All @@ -38,6 +45,7 @@ else ()
--suppress=unmatchedSuppression:${PROJECT_SOURCE_DIR}/*/Common.h
--suppress=cstyleCast:${PROJECT_SOURCE_DIR}/*/vector_ref.h
--suppress=cstyleCast:${PROJECT_SOURCE_DIR}/*/Common.h
--suppress=cstyleCast:${PROJECT_SOURCE_DIR}/*/transaction.cpp
# not an issue here
--suppress=virtualCallInConstructor:${PROJECT_SOURCE_DIR}/*/final_chain.cpp
# just a warning
Expand Down
32 changes: 0 additions & 32 deletions CMakeModules/rocksdb.cmake

This file was deleted.

15 changes: 9 additions & 6 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@ class TaraxaConan(ConanFile):
generators = "cmake"

def requirements(self):
self.requires("boost/1.85.0")
self.requires("cppcheck/2.12") #TODO(2.14.1)
self.requires("openssl/3.2.1")
self.requires("boost/1.86.0")
self.requires("cppcheck/2.15.0")
self.requires("openssl/3.3.2")
self.requires("cryptopp/8.9.0")
self.requires("gtest/1.14.0")
self.requires("lz4/1.9.4")
self.requires("prometheus-cpp/1.1.0")
self.requires("gtest/1.15.0")
self.requires("lz4/1.10.0")
self.requires("rocksdb/9.2.1")
self.requires("prometheus-cpp/1.2.4")
self.requires("jsoncpp/1.9.5")

def _configure_boost_libs(self):
Expand Down Expand Up @@ -60,6 +61,8 @@ def configure(self):
self.options["gtest"].build_gmock = False
# this links cppcheck to prce library
self.options["cppcheck"].have_rules = False
self.options["rocksdb"].use_rtti = True
self.options["rocksdb"].with_lz4 = True
# mpir is required by cppcheck and it causing gmp confict
self.options["mpir"].enable_gmpcompat = False

Expand Down
174 changes: 10 additions & 164 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ will build out of the box without further effort:
autoconf \
ccache \
cmake \
clang \
clang-format-17 \
clang-tidy-17 \
llvm-17 \
golang-go \
python3-full \
# this libs are required for arm build by go part. you can skip it for amd64 build
libzstd-dev \
libsnappy-dev \
rapidjson-dev \
Expand All @@ -47,7 +47,7 @@ will build out of the box without further effort:

### Clone the Repository

git clone https://github.com/Taraxa-project/taraxa-node.git --branch testnet
git clone https://github.com/Taraxa-project/taraxa-node.git
cd taraxa-node
git submodule update --init --recursive

Expand All @@ -62,180 +62,26 @@ will build out of the box without further effort:
&& conan profile update settings.compiler.libcxx=libstdc++11 clang \
&& conan profile update settings.build_type=RelWithDebInfo clang \
&& conan profile update env.CC=clang-17 clang \
&& conan profile update env.CXX=clang++-17 clang \
&& conan install --build missing -pr=clang .
&& conan profile update env.CXX=clang++-17 clang

# Compile project using cmake
mkdir cmake-build
cd cmake-build
cmake -DCONAN_PROFILE=clang -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTARAXA_ENABLE_LTO=OFF -DTARAXA_STATIC_BUILD=OFF ../
make -j$(nproc)

## Building on Ubuntu 22.04
For Ubuntu 22.04 users, after installing the right packages with `apt` taraxa-node
will build out of the box without further effort:

### Install taraxa-node dependencies:

# Required packages
sudo apt-get install -y \
libtool \
autoconf \
ccache \
cmake \
clang-format-14 \
clang-tidy-14 \
golang-go \
python3-pip \
# this libs are required for arm build by go part. you can skip it for amd64 build
libzstd-dev \
libsnappy-dev \
rapidjson-dev \
libgmp-dev \
libmpfr-dev \
libmicrohttpd-dev

# Optional. Needed to run py_test. This won't install on arm64 OS because package is missing in apt
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt install solc

# Install conan package manager
sudo python3 -m pip install conan==1.64.1

# Setup clang as default compiler either in your IDE or by env. variables"
export CC="clang-14"
export CXX="clang++-14"

### Clone the Repository

git clone https://github.com/Taraxa-project/taraxa-node.git --branch testnet
cd taraxa-node
git submodule update --init --recursive

### Compile

# Optional - one time action
# Create clang profile
# It is recommended to use clang because on other compilers you could face some errors
conan profile new clang --detect && \
conan profile update settings.compiler=clang clang && \
conan profile update settings.compiler.version=14 clang && \
conan profile update settings.compiler.libcxx=libstdc++11 clang && \
conan profile update env.CC=clang-14 clang && \
conan profile update env.CXX=clang++-14 clang

# Export needed var for conan
export CONAN_REVISIONS_ENABLED=1

# Compile project using cmake
mkdir cmake-build
cd cmake-build
cmake -DCONAN_PROFILE=clang -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTARAXA_ENABLE_LTO=OFF -DTARAXA_STATIC_BUILD=OFF ../
make -j$(nproc)

## Building on Ubuntu 20.04
For Ubuntu 20.04 users, after installing the right packages with `apt` taraxa-node
will build out of the box without further effort:

### Install taraxa-node dependencies:

# Required packages
sudo apt-get install -y \
libtool \
autoconf \
ccache cmake gcc g++ clang-format clang-tidy cppcheck \
libgflags-dev\
libjsoncpp-dev \
libjsonrpccpp-dev \
python3-pip \
rapidjson-dev \
libgmp-dev \
libmpfr-dev \
libmicrohttpd-dev


# Install conan package manager
# >= 1.36.0 version is required to work properly with clang-14
sudo python3 -m pip install conan==1.60.0

# Install cmake
# >= 3.20 version is required for JSON subcommand
# Setup your IDE accordingly to use this version
sudo python3 -m pip install cmake

# Go (required)
curl -LO https://go.dev/dl/go1.22.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.22.2.linux-amd64.tar.gz
rm -rf go1.22.2.linux-amd64.tar.gz

# Add go to PATH
# Add these env. variables to the ~/.profile to persist go settings even after restart
export GOROOT=/usr/local/go
export GOPATH=$HOME/.go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

# Optional
# We are using clang from llvm toolchain as default compiler as well as clang-format and clang-tidy
# It is possible to build taraxa-node also with other C++ compilers but to contribute to the official repo,
# changes must pass clang-format/clang-tidy checks for which we internally use llvm version=13
# To install llvm:
sudo su

curl -SL -o llvm.sh https://apt.llvm.org/llvm.sh && \
chmod +x llvm.sh && \
./llvm.sh 14 && \
apt-get install -y clang-format-14 clang-tidy-14 && \
rm -f llvm.sh

# Setup clang as default compiler either in your IDE or by env. variables"
export CC="clang-14"
export CXX="clang++-14"

### Clone the Repository

git clone https://github.com/Taraxa-project/taraxa-node.git --branch testnet
cd taraxa-node
git submodule update --init --recursive

### Compile

# Optional - one time action
# Create clang profile
# It is recommended to use clang because on other compilers you could face some errors
conan profile new clang --detect && \
conan profile update settings.compiler=clang clang && \
conan profile update settings.compiler.version=14 clang && \
conan profile update settings.compiler.libcxx=libstdc++11 clang && \
conan profile update env.CC=clang-14 clang && \
conan profile update env.CXX=clang++-14 clang

# Export needed var for conan
export CONAN_REVISIONS_ENABLED=1

# Compile project using cmake
mkdir cmake-build
cd cmake-build
cmake -DCONAN_PROFILE=clang -DCMAKE_BUILD_TYPE=RelWithDebInfo -DTARAXA_ENABLE_LTO=OFF -DTARAXA_STATIC_BUILD=OFF ../
make -j$(nproc)

And optional:

# optional
make install # defaults to /usr/local

## Building on MacOS

### Install taraxa-node dependencies:

First you need to get (Brew)[https://brew.sh/] package manager. After that you need tot install dependencies with it. Clang-14 is used for compilation.
First you need to get (Brew)[https://brew.sh/] package manager. After that you need tot install dependencies with it. Clang-17 is used for compilation.

brew update
brew install coreutils go autoconf automake gflags git libtool llvm@14 make pkg-config cmake conan snappy zstd rapidjson gmp mpfr libmicrohttpd
brew install coreutils go autoconf automake gflags git libtool llvm@17 make pkg-config cmake conan snappy zstd rapidjson gmp mpfr libmicrohttpd

### Clone the Repository

git clone https://github.com/Taraxa-project/taraxa-node.git --branch testnet
git clone https://github.com/Taraxa-project/taraxa-node.git
cd taraxa-node
git submodule update --init --recursive

Expand All @@ -245,8 +91,8 @@ First you need to get (Brew)[https://brew.sh/] package manager. After that you n
# It is recommended to use clang because on other compilers you could face some errors
conan profile new clang --detect && \
conan profile update settings.compiler=clang clang && \
conan profile update settings.compiler.version=14 clang && \
conan profile update settings.compiler.compiler.cppstd=14
conan profile update settings.compiler.version=17 clang && \
conan profile update settings.compiler.compiler.cppstd=17
conan profile update settings.compiler.libcxx=libc++ clang && \
conan profile update env.CC=clang clang && \
conan profile update env.CXX=clang++ clang
Expand Down Expand Up @@ -304,7 +150,7 @@ You should be able to build project following default MacOS building process. Bu

### Clone the Repository

git clone https://github.com/Taraxa-project/taraxa-node.git --branch testnet
git clone https://github.com/Taraxa-project/taraxa-node.git
cd taraxa-node
git submodule update --init --recursive

Expand All @@ -316,7 +162,7 @@ You should be able to build project following default MacOS building process. Bu
# It output should be equal to `i386`
conan profile new clang --detect && \
conan profile update settings.compiler=clang clang && \
conan profile update settings.compiler.version=14 clang && \
conan profile update settings.compiler.version=17 clang && \
conan profile update settings.compiler.libcxx=libc++ clang && \
conan profile update env.CC=/usr/local/opt/llvm/bin/clang clang && \
conan profile update env.CXX=/usr/local/opt/llvm/bin/clang++ clang
Expand Down
Loading

0 comments on commit 6819fd8

Please sign in to comment.