diff --git a/DOCKER/Dockerfile b/DOCKER/Dockerfile index e030327fa2..063042c439 100644 --- a/DOCKER/Dockerfile +++ b/DOCKER/Dockerfile @@ -13,15 +13,14 @@ FROM golang:${GOLANG_VERSION}-alpine${ALIPNE_VERSION} AS base RUN apk update && \ apk upgrade && \ - apk --no-cache add bash git gmp-dev sudo cmake build-base python3-dev libpcap-dev leveldb-dev && \ + apk --no-cache add bash git gmp-dev sudo cmake build-base libpcap-dev leveldb-dev && \ rm -rf /var/cache/apk/* WORKDIR /src/bls # Install BLS library COPY third_party ./third_party -RUN ./third_party/bls-signatures/build.sh && \ - ./third_party/bls-signatures/install.sh +RUN ./third_party/bls-signatures/build.sh ##################################### # STAGE 2: install golang libraries # diff --git a/Makefile b/Makefile index 67c61379ae..8cf9474354 100644 --- a/Makefile +++ b/Makefile @@ -95,9 +95,10 @@ endif # allow users to pass additional flags via the conventional LDFLAGS variable LD_FLAGS += $(LDFLAGS) -all: build install +all: build build: build-bls build-binary .PHONY: build + install: install-bls .PHONY: all @@ -113,7 +114,7 @@ build-bls: .PHONY: build-bls install-bls: build-bls - @sudo third_party/bls-signatures/install.sh + @third_party/bls-signatures/install.sh .PHONY: install-bls ############################################################################### diff --git a/README.md b/README.md index b3b166f0f4..533c2d79ad 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ to notify you of vulnerabilities and fixes in Tendermint Core. You can subscribe | Requirement | Notes | |-------------|------------------| -| Go version | Go1.17 or higher | +| Go version | Go1.21 or higher | ### Install diff --git a/docs/introduction/install.md b/docs/introduction/install.md index 01b8464ae8..1d83811c6a 100644 --- a/docs/introduction/install.md +++ b/docs/introduction/install.md @@ -4,45 +4,62 @@ order: 3 # Install Tenderdash +## Using Dashmate (Recommended Method) + +Dashmate is a part of the Dash Platform and provides a comprehensive solution for installing the entire platform. We highly recommend using Dashmate for a seamless and straightforward installation process. + +For detailed instructions on how to set up a node using Dashmate, please refer to the official Dash documentation: [Set Up a Node](https://docs.dash.org/projects/platform/en/stable/docs/tutorials/setup-a-node.html). + ## From Binary To download pre-built binaries, see the [releases page](https://github.com/dashevo/tenderdash/releases). ## From Source -You'll need `go` [installed](https://golang.org/doc/install) and the required -environment variables set, which can be done with the following commands: +Install official go into the standard location with standard PATH updates: -```sh -echo export GOPATH=\"\$HOME/go\" >> ~/.bash_profile -echo export PATH=\"\$PATH:\$GOPATH/bin\" >> ~/.bash_profile -``` + ```bash + curl https://webinstall.dev/go | sh + source ~/.config/envman/PATH.env + ``` -Get the source code: +Install git, cmake, and build-essential (apt) or build-base (apk) and other libs. -```sh -git clone https://github.com/dashevo/tenderdash.git -cd tenderdash -``` +For Debian-based (eg. Ubuntu): + + ```bash + sudo apt update + sudo apt install -y git build-essential cmake libgmp-dev + ``` -Then run: +For Alpine Linux: -```sh -make install -``` + ```bash + apk add --no-cache git build-base cmake gmp-dev + ``` -to put the binary in `$GOPATH/bin` or use: +Get the source code: -```sh -make build -``` + ```bash + git clone https://github.com/dashpay/tenderdash.git + pushd ./tenderdash/ + git submodule init + git submodule update + ``` + +Build: + +to put the binary in `$GOPATH/bin`: + + ```sh + make install + ``` -to put the binary in `./build`. +to put the binary in `./build`: -_DISCLAIMER_ The binary of Tenderdash is build/installed without the DWARF -symbol table. If you would like to build/install Tenderdash with the DWARF -symbol and debug information, remove `-s -w` from `BUILD_FLAGS` in the make -file. + ```sh + make build + ``` The latest Tenderdash is now installed. You can verify the installation by running: diff --git a/test/e2e/docker/Dockerfile b/test/e2e/docker/Dockerfile index 170f69e989..686add6add 100644 --- a/test/e2e/docker/Dockerfile +++ b/test/e2e/docker/Dockerfile @@ -8,7 +8,7 @@ FROM golang:${GOLANG_VERSION}-alpine${ALIPNE_VERSION} AS base RUN apk update && \ apk upgrade && \ - apk --no-cache add bash git gmp-dev sudo cmake build-base python3-dev libpcap-dev leveldb-dev && \ + apk --no-cache add bash git gmp-dev sudo cmake build-base libpcap-dev leveldb-dev && \ rm -rf /var/cache/apk/* WORKDIR /src/bls diff --git a/third_party/bls-signatures/build.sh b/third_party/bls-signatures/build.sh index 269ac582aa..8a01299185 100755 --- a/third_party/bls-signatures/build.sh +++ b/third_party/bls-signatures/build.sh @@ -1,19 +1,22 @@ #!/bin/bash -SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +SCRIPT_PATH="$(realpath "$(dirname "$0")")" + SRC_PATH="${SCRIPT_PATH}/src" BUILD_PATH="${SCRIPT_PATH}/build" -BLS_SM_PATH="third_party/bls-signatures/src" +BLS_SM_PATH="${SRC_PATH}" BLS_GIT_REPO="https://github.com/dashpay/bls-signatures.git" BLS_GIT_BRANCH=${BLS_GIT_BRANCH:-"1.2.6"} set -e -if ! git submodule update --init "${BLS_SM_PATH}" ; then +pushd "${SCRIPT_PATH}" + +if ! git submodule update --init "${BLS_SM_PATH}"; then echo "It looks like this source code is not tracked by git." echo "As a fallback scenario we will fetch \"${BLS_GIT_BRANCH}\" branch \"${BLS_GIT_REPO}\" library." echo "We would recommend to clone of this project rather than using a release archive." - rm -r "${BLS_SM_PATH}" || true + rm -r "${BLS_SM_PATH}" || true git clone --single-branch --branch "${BLS_GIT_BRANCH}" "${BLS_GIT_REPO}" "${BLS_SM_PATH}" fi @@ -21,7 +24,11 @@ fi mkdir -p "${BUILD_PATH}" # Configurate the library build -cmake -B "${BUILD_PATH}" -S "${SRC_PATH}" +cmake \ + -D BUILD_BLS_PYTHON_BINDINGS=OFF \ + -D BUILD_BLS_TESTS=OFF \ + -D BUILD_BLS_BENCHMARKS=OFF \ + -B "${BUILD_PATH}" -S "${SRC_PATH}" # Build the library cmake --build "${BUILD_PATH}" -- -j 6 @@ -29,4 +36,6 @@ cmake --build "${BUILD_PATH}" -- -j 6 mkdir -p "${BUILD_PATH}/src/bls-dash" cp -r ${SRC_PATH}/src/* "${BUILD_PATH}/src/bls-dash" +popd + exit 0 diff --git a/third_party/bls-signatures/install.sh b/third_party/bls-signatures/install.sh index cc3d06c548..37b6fa60d5 100755 --- a/third_party/bls-signatures/install.sh +++ b/third_party/bls-signatures/install.sh @@ -2,15 +2,25 @@ set -e -SCRIPT_PATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" +SCRIPT_PATH="$(realpath "$(dirname "$0")")" BUILD_PATH="$SCRIPT_PATH/build" -if [ ! -d $BUILD_PATH ]; then +if [ "$UID" -eq "0" ]; then + DESTDIR=${DESTDIR:-"/usr/local"} +else + DESTDIR=${DESTDIR:-"${HOME}/.local"} +fi + +if [ ! -d "$BUILD_PATH" ]; then echo "$BUILD_PATH doesn't exist. Run \"make build-bls\" first." >/dev/stderr exit 1 fi +pushd "${SCRIPT_PATH}" + # Install the library -cmake -P $BUILD_PATH/cmake_install.cmake +cmake -D CMAKE_INSTALL_PREFIX="${DESTDIR}" -P "$BUILD_PATH/cmake_install.cmake" + +popd exit 0