Skip to content

Commit

Permalink
Merge pull request #235 from galpHub/UpdateMaster
Browse files Browse the repository at this point in the history
Update master
  • Loading branch information
galpHub committed Jul 6, 2023
2 parents 4d4e34a + 590edcd commit 9e2f76c
Show file tree
Hide file tree
Showing 474 changed files with 17,604 additions and 13,579 deletions.
10 changes: 10 additions & 0 deletions .cirrus.yml
@@ -0,0 +1,10 @@
continous_integration_task:
container:
dockerfile: divi/DockerfileForCI
test_script:
- pushd divi/qa/rpc-tests && split --numeric-suffixes --lines=60 test_list.txt test_list && rm test_list.txt && popd
- pushd divi/src/GMock && autoreconf -fvi && popd
- pushd divi/ && { make distclean || true ; } && ./autogen.sh && ./configure --without-gui NO_QT=1 && popd
- pushd divi/ && make && make -j check && popd
- pushd divi/qa/rpc-tests && ./test_runner.py --test_suite_file test_list00 --exclude proxy_test.py,rpcbind_test.py --jobs=1 --cli_timeout=60.0 && popd
- pushd divi/qa/rpc-tests && ./test_runner.py --test_suite_file test_list01 --exclude proxy_test.py,rpcbind_test.py --jobs=1 --cli_timeout=60.0 && popd
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,3 +6,4 @@ doxygen/*
developer_stuff
documents/*
doxygen/
*/divi_regtest/*
25 changes: 0 additions & 25 deletions DeploymentScripts/LastBuiltDevelopment
@@ -1,25 +0,0 @@
b064ff156dad8c5e60e5b836bbe79ad0094faf4a
e3f9a6592f18bded5b4355880707a8be9488f0ee
f7e41254d2357b23184367a0f4d305feb9709702
0e85c951d20c61298a295717ffed3795072435d2
fb7c7142cbeddc3a07b2182a40cd2ccdfcafd851
2d996d92af6f698c847daa2192876624afdc8108
c486ba3ced3f9840bb5b8b7906d6f7c73032eddf
13d3eb96e89e329e8f42d21cb9e3821af7266ad1
44bc2d0f1560fd3b44c2e24ba338a058744e642b
5b15ae43174cb2d884726ce7002557940298e01a
1a9c10df4119a56a5038d472fad79b1788883f8a
320f3c57f4ebf8485d6021db121631741c021eb6
06db2f697a30bc960402faee048c1fb3549285cc
0adb94a83698c9c4b787509ce2a3db91533221f3
1b424747ceeb744362ec18b6dc6a1ca829921d73
1b2613983a029fd7e332fdb57338050c71d338ab
515ee8b9d0ed7c2dc246def30882c31ac913ee60
119fe55587f5593bccac1f0573c8d22a4a9731bb
987d866a1573a29c3bc0314a7f3b38489674b325
d501f3dbb061306940b792454a5a6852d3e1428c
5eb5b40d08214af2545408eea1e7158ddb1368dc
8b10201f2f07e93ea4582e5b8c465beab764e6cb
ee1328d04749b0ca93b1bd8be79ea50679568410
23b4e8afb8771f51db9446b845f430545f78749a
f5cc2c1f383531571858270ccc78578382fdc254
36 changes: 18 additions & 18 deletions DeploymentScripts/README.txt
@@ -1,19 +1,19 @@
# This tool was designed to be used in an Ubuntu 18.04 environment
# It provides a quick way of building divi binaries without all the
# maneuvering that's otherwise required. A few dependencies like the MacOSX10.9 sdk
# as well as the raspberrypi-tools. These are downloaded as part of the tidy_build.sh
# but require care as these tools have not been thoroughly tested against careless
# usage.
# First time usage should be './continuous_build.sh clean'
# Later usages that wish to skip the download of the 3rd party dependencies
# can ommit the call to clean
# Note that these deployment scripts point to a specific remote repo and branch
# namely the development branch being managed by @galpHub. These should be updated
# whenever these change
Release Process Procedure (For Ubuntu 20.04 OS base machine - e.g. Digital Ocean)
* sudo apt-get update
* sudo apt-get -y upgrade
* sudo apt-get install -y ruby rename
* git clone --depth=1 <development-repo> Divi
* cp Divi/DeploymentScripts DeploymentScripts && cd DeploymentScripts
* ./install_docker_20-04.sh
* sudo chmod +x download_dependencies.sh continuous_build.sh tidy_build.sh build.sh
* ./download_dependencies.sh
If development binaries are desired:
* rm LastBuiltDevelopment && nohup ./continuous_build.sh dev > build_process.log 2>&1 &
If production binaries are desired:
* rm LastBuiltDevelopment && nohup ./continuous_build.sh > build_process.log 2>&1 &

## Pre-requisites to be run in ~/build_dependencies
# curl -L https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.9.sdk.tar.xz | tar -xJf - &&
# tar -cJf MacOSX10.9.sdk.tar.xz ./ &&
# rm -r MacOSX10.9.sdk &&
# git clone -q https://github.com/raspberrypi/tools.git && tar -czf raspberrypi-tools.tar.gz ./tools &&
# rm -rf ./tools
Additonal notes:
* Should have at least 4 ram and 2 cpus of hardware for building
* Built binaries are stored under /divi_binaries/
* LastBuiltDevelopment is a list of recently built commit hashes. The build process ignores the last commit hash in this file.
* It's important to run the build process in the background as it can slow down the reponsiveness of the shell on which it executes potentially cancelling the build in the event of disconnection
36 changes: 14 additions & 22 deletions DeploymentScripts/build.sh
Expand Up @@ -29,39 +29,31 @@ last_failed_build=""
if ! $MayBuild; then
echo "Cannot build current configuration"
fi
all_builds_succeeded=false
all_builds_succeeded=true
builds=(linux win osx rpi2)
if $MayBuild; then
echo "Working from commit: $1 -> $COMMIT & source: $2"
rm -rf /blddv/upload/ &&
mkdir -p /blddv/upload/ &&
mkdir -p /blddv/upload/ubuntu &&
mkdir -p /blddv/upload/windows &&
mkdir -p /blddv/upload/osx &&
mkdir -p /blddv/upload/rpi2
mkdir -p /blddv/upload/

cd /blddv/gitian-builder/ &&
mkdir -p /blddv/gitian-builder/inputs/ &&
cp /blddv/build_dependencies/* /blddv/gitian-builder/inputs/

[ -d "/blddv/gitian-builder/inputs/divi/" ] && rm -rf /blddv/gitian-builder/inputs/divi/

all_builds_succeeded=false &&
cd /blddv/gitian-builder/ &&
/blddv/gitian-builder/bin/make-base-vm --docker --suite trusty && wait &&
last_failed_build="ubuntu" &&
/blddv/gitian-builder/bin/gbuild --commit divi=$COMMIT --url divi=/blddv/Divi/ /blddv/Divi/divi/contrib/gitian-descriptors/gitian-linux.yml &&
cp -r /blddv/gitian-builder/build/out/* /blddv/upload/ubuntu/ &&
last_failed_build="windows" &&
/blddv/gitian-builder/bin/gbuild --commit divi=$COMMIT --url divi=/blddv/Divi/ /blddv/Divi/divi/contrib/gitian-descriptors/gitian-win.yml &&
cp -r /blddv/gitian-builder/build/out/* /blddv/upload/windows/ &&
last_failed_build="mac" &&
/blddv/gitian-builder/bin/gbuild --commit divi=$COMMIT --url divi=/blddv/Divi/ /blddv/Divi/divi/contrib/gitian-descriptors/gitian-osx.yml &&
cp -r /blddv/gitian-builder/build/out/* /blddv/upload/osx/ &&
last_failed_build="rpi" &&
/blddv/gitian-builder/bin/make-base-vm --docker --suite trusty && wait &&
/blddv/gitian-builder/bin/gbuild --commit divi=$COMMIT --url divi=/blddv/Divi/ /blddv/Divi/divi/contrib/gitian-descriptors/gitian-rpi2.yml &&
cp -r /blddv/gitian-builder/build/out/* /blddv/upload/rpi2/ &&
all_builds_succeeded=true
for build_id in ${builds[@]}
do
if [ "${last_failed_build}" = "${build_id}" ]; then all_builds_succeeded=false && break ; fi
last_failed_build="${build_id}" &&
/blddv/gitian-builder/bin/make-base-vm --docker --suite bionic && wait &&
/blddv/gitian-builder/bin/gbuild -j 1 --commit divi=$COMMIT --url divi=/blddv/Divi/ /blddv/Divi/divi/contrib/gitian-descriptors/gitian-${build_id}.yml &&
mkdir -p /blddv/upload/${build_id} &&
cp -r /blddv/gitian-builder/build/out/* /blddv/upload/${build_id}/ &&
last_failed_build="" &&
docker container stop $( docker ps -a -q )
done
fi

mkdir -p /divi_binaries/
Expand Down
24 changes: 20 additions & 4 deletions DeploymentScripts/continuous_build.sh
Expand Up @@ -7,8 +7,20 @@ oldHash=$(tac LastBuiltDevelopment | head -n 1)
remoteDevelopment="https://github.com/galpHub/Divi.git"
remoteMaster="https://github.com/DiviProject/Divi.git"

branch_name="Development"
remoteRepo=$remoteDevelopment
clean_mode=false
if [[ -z $1 ]] ; then
branch_name="master"
remoteRepo=$remoteMaster
echo "Building master..."
elif [[ ! -z $1 ]] && [[ $1 == "dev" ]] ; then
branch_name="Development"
remoteRepo=$remoteDevelopment
echo "Building Development..."
fi

if [[ ! -z $2 ]] ; then
clean_mode=true
fi

git clone --depth=1 $remoteRepo --branch $branch_name /tmp/Divi/
pushd /tmp/Divi/
Expand All @@ -17,7 +29,11 @@ popd
rm -r /tmp/Divi/
zero=0
if [[ $oldHash != $newestHash ]]; then
./tidy_build.sh $branch_name $remoteRepo $1
if $clean_mode ; then
./tidy_build.sh $branch_name $remoteRepo clean
else
./tidy_build.sh $branch_name $remoteRepo
fi
if [[ $? ]]; then
if [[ -d "/divi_binaries/$newestHash" ]]; then
echo "Build complete!"
Expand All @@ -37,4 +53,4 @@ else
fi

}
run $1
run $1 $2
8 changes: 0 additions & 8 deletions DeploymentScripts/derp_build.sh

This file was deleted.

4 changes: 2 additions & 2 deletions DeploymentScripts/download_dependencies.sh
Expand Up @@ -9,7 +9,7 @@ pushd MacOSX10.9.sdk &&
find . -type f ! -iname "sha256checksums" -print0 | sort -z | xargs -r0 sha256sum > sha256checksums &&
echo "5c4e5b294f196c7f88f755c35e8ecc688f80da5a33f00d8078ed4c6f9ff4d3d8 sha256checksums" | sha256sum -c &&
rm sha256checksums && popd &&
tar -cJf MacOSX10.9.sdk.tar.xz ./ &&
{ tar -cJf MacOSX10.9.sdk.tar.xz ./ || true ; } &&
rm -r MacOSX10.9.sdk &&
git clone -q https://github.com/raspberrypi/tools.git &&
tar -czf raspberrypi-tools.tar.gz ./tools &&
Expand All @@ -22,4 +22,4 @@ git config --global user.name "DevBot" &&
git commit -m "Remove proxy"
}

run
run
File renamed without changes.
8 changes: 8 additions & 0 deletions DeploymentScripts/install_docker_20-04.sh
@@ -0,0 +1,8 @@
apt-get update &&
apt-get -y install sudo &&
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common &&
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - &&
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" &&
apt-cache policy docker-ce &&
apt-cache search docker-ce &&
sudo apt install -y docker-ce
4 changes: 2 additions & 2 deletions DeploymentScripts/periodic_build.sh
@@ -1,13 +1,13 @@
case "$1" in
start)
/root/DeploymentScripts/derp_build.sh && wait && $0 stop &
/root/DeploymentScripts/continuous_build.sh && wait && $0 stop &
echo $!>/var/run/hit.pid

;;
stop)
kill `cat /var/run/hit.pid` &> /dev/null
rm /var/run/hit.pid
echo periodic_build.sh is stopping...
echo continuous_build.sh is stopping...
;;
restart)
$0 stop
Expand Down
2 changes: 1 addition & 1 deletion DeploymentScripts/tidy_build.sh
Expand Up @@ -6,7 +6,7 @@ readyToBuild=false
case "$3" in
clean)
pushd ~/DeploymentScripts/
./download_depencies &&
./download_dependencies &&
popd &&
readyToBuild=true

Expand Down
4 changes: 4 additions & 0 deletions divi/.gitignore
@@ -1,3 +1,7 @@
divi_testforknetdata
divi_testnetdata
divi_mainnetdata
prior_binaries
*.sublime-project
*.sublime-workspace
todo.txt
Expand Down
30 changes: 30 additions & 0 deletions divi/DockerfileForCI
@@ -0,0 +1,30 @@
FROM ubuntu:bionic

WORKDIR /app
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install apt-utils -y
RUN apt-get install bsdmainutils -y
RUN apt-get install software-properties-common -y
RUN add-apt-repository ppa:bitcoin/bitcoin -y
RUN apt-get update

RUN apt-get install make -y
RUN apt-get install gcc -y
RUN apt-get install g++ -y
RUN apt-get install pkg-config -y
RUN apt-get install autoconf -y
RUN apt-get install libtool -y
RUN apt-get install libboost-all-dev -y
RUN apt-get install libssl1.0-dev -y
RUN apt-get install libevent-dev -y
RUN apt-get install libdb4.8-dev libdb4.8++-dev -y
RUN apt-get install libzmq3-dev -y
RUN apt-get install python3.8 -y
RUN apt-get install python3-zmq -y
RUN apt-get install python3-pip -y
RUN pip3 install zmq
RUN apt-get update
RUN apt-get upgrade -y

CMD ["bash"]
32 changes: 32 additions & 0 deletions divi/DockerfileForDev
@@ -0,0 +1,32 @@
FROM ubuntu:bionic

RUN apt-get update
RUN apt-get install apt-utils -y
RUN apt-get install bsdmainutils -y
RUN apt-get install software-properties-common -y
RUN add-apt-repository ppa:bitcoin/bitcoin -y
RUN apt-get update

RUN apt-get install make -y
RUN apt-get install gcc -y
RUN apt-get install g++ -y
RUN apt-get install pkg-config -y
RUN apt-get install autoconf -y
RUN apt-get install libtool -y
RUN apt-get install libboost-all-dev -y
RUN apt-get install libssl1.0-dev -y
RUN apt-get install libevent-dev -y
RUN apt-get install libdb4.8-dev libdb4.8++-dev -y
RUN apt-get install libzmq3-dev -y
RUN apt-get install python3.8 -y
RUN apt-get install python3-zmq -y
RUN apt-get install python3-pip -y
RUN pip3 install zmq

RUN apt-get upgrade -y
RUN apt-get -y install sudo
RUN useradd -rm -d /home/ubuntu -s /bin/bash -g root -G sudo -u 1001 ubuntu
RUN echo "ubuntu:ubuntu" | chpasswd && adduser ubuntu sudo
USER ubuntu

CMD ["bash"]
8 changes: 4 additions & 4 deletions divi/configure.ac
@@ -1,11 +1,11 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 10)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_MAJOR, 3)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2017)
define(_COPYRIGHT_YEAR, 2023)
AC_INIT([Divi Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[www.diviproject.org],[divi])
AC_CONFIG_SRCDIR([src/main.cpp])
AC_CONFIG_HEADERS([src/config/divi-config.h])
Expand Down
8 changes: 2 additions & 6 deletions divi/contrib/bitrpc/bitrpc.py
Expand Up @@ -272,12 +272,8 @@

elif cmd == "setgenerate":
try:
gen= raw_input("Generate? (true/false): ")
cpus = raw_input("Max processors/cores (-1 for unlimited, optional):")
try:
print access.setgenerate(gen, cpus)
except:
print access.setgenerate(gen)
blocks = raw_input("Max number of blocks:")
print access.setgenerate( blocks)
except:
print "\n---An error occurred---\n"

Expand Down
2 changes: 1 addition & 1 deletion divi/contrib/divid.bash-completion
Expand Up @@ -81,7 +81,7 @@ _divid() {
fi

case "$prev" in
backupwallet|dumpwallet|importwallet)
backupwallet)
_filedir
return 0
;;
Expand Down
6 changes: 2 additions & 4 deletions divi/contrib/gitian-descriptors/gitian-aarch64.yml
Expand Up @@ -8,11 +8,9 @@ architectures:
packages:
- "curl"
- "g++-aarch64-linux-gnu"
- "g++-4.9-aarch64-linux-gnu"
- "gcc-4.9-aarch64-linux-gnu"
- "g++-9-aarch64-linux-gnu"
- "gcc-9-aarch64-linux-gnu"
- "binutils-aarch64-linux-gnu"
- "g++-4.9-multilib"
- "gcc-4.9-multilib"
- "binutils-gold"
- "git-core"
- "pkg-config"
Expand Down
4 changes: 1 addition & 3 deletions divi/contrib/gitian-descriptors/gitian-linux.yml
Expand Up @@ -2,14 +2,12 @@
name: "divi-linux-1.0"
enable_cache: true
suites:
- "trusty"
- "bionic"
architectures:
- "amd64"
packages:
- "curl"
- "g++-aarch64-linux-gnu"
- "g++-4.8-aarch64-linux-gnu"
- "gcc-4.8-aarch64-linux-gnu"
- "binutils-aarch64-linux-gnu"
- "g++-4.8-multilib"
- "gcc-4.8-multilib"
Expand Down
2 changes: 1 addition & 1 deletion divi/contrib/gitian-descriptors/gitian-osx.yml
Expand Up @@ -2,7 +2,7 @@
name: "divi-osx-3.0"
enable_cache: true
suites:
- "trusty"
- "bionic"
architectures:
- "amd64"
packages:
Expand Down
2 changes: 1 addition & 1 deletion divi/contrib/gitian-descriptors/gitian-rpi2.yml
Expand Up @@ -2,7 +2,7 @@
name: "divi-raspberry-0.1"
enable_cache: true
suites:
- "trusty"
- "bionic"
architectures:
- "amd64"
packages:
Expand Down

0 comments on commit 9e2f76c

Please sign in to comment.