Skip to content

Commit

Permalink
Merge pull request #95 from Divicoin/documentation
Browse files Browse the repository at this point in the history
Documentation
  • Loading branch information
99darwin authored Nov 26, 2018
2 parents 5a0f666 + 9ba6497 commit 706b9f6
Show file tree
Hide file tree
Showing 59 changed files with 983 additions and 205 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
.vs
.vscode/
*.creator.user
doxygen/*
developer_stuff
documents/*
doxygen/
developer_stuff/
68 changes: 52 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,62 @@
DIVI Core integration/staging repository
=====================================

We wish to make it as easy to participate in Divi development as possible. Open source software typically has very high but hidden barriers to entry to each project due to the massive and normally undocumented state space of potential operating systems, pre-loaded packages and other development environment details. Further, regression testing turns into a nightmare if developers have used even slightly different versions of the same operating system or one of the normally numerous packages – much less different packages or a different operating system. Life has gotten better with the Gitian builds used to ensure identical certified release packages to combat malware but setting up a Gitian build is still a dark art.
https://diviproject.org

The advent of lightweight, cross-platform containers make it, not just possible but, easy to develop and run the exact same software across all non-mobile platforms – including both major and minor cloud providers. DIVI is built and run inside a Docker container so *anyone* can install the free community version of Docker on their Windows, Mac or Linux machine and immediately build and run the DIVI software. Development for the iPhone and Android wallets is unfortunately far more difficult due to an ongoing lack of a unified standard – but that is something that we will look at in the future with the increasing availability and sophistication of environments like Ionic or Xamarin.
## What is Divi?
---

To build divi:
1. Ensure docker is installed on your machine (https://store.docker.com/search?type=edition&offering=community)
2. Create a directory and copy the divi/docker directory into it
3. docker build -t [your tag name] .
Divi is a next-generation blockchain protocol that enables any user to begin earning, sending, and spending cryptocurrency easily, without the need for advanced technical knowledge. Divi uses a state-of-the-art Proof of Stake consensus mechanism that offers opportunities for users to stake their coins or allocate their coins to Masternodes, which secure the network and verify transactions.

If you don't want to build divi
1. Ensure docker is installed on your machine (https://store.docker.com/search?type=edition&offering=community)
2. docker pull caldwellsw/divi:base
For more information, as well as an immediately usable version of the Divi Project software, visit our website's [download page](https://diviproject.org/downloads), or read our [whitepaper](https://wiki.diviproject.org/#whitepaper).

To run divi and connect to the testnet
1. docker run -it -p51472:51472 [your tag name or caldwellsw/divi:base]
2. divid -debug
3. divi-cli addnode dt01.westus.cloudapp.azure.com add
4. divi-cli addnode dt02.westus.cloudapp.azure.com add
5. divi-cli getpeerinfo
## License
---

* It may take some time before you see other nodes in the testnet.
Divi Core is released under the terms of the MIT license. See https://opensource.org/licenses/MIT for more information.

## Developing
---

The `master0` branch is regularly built and tested by Divi's core development team, and is typically the most stable version of the software, but this cannot be guaranteed at any given time.

## Building
---

To build from source on UNIX systems, follow these instructions.

### System requirements

C++ compilers are memory-hungry. It is recommended to have at least 1 GB of
memory available when compiling DIVI Core. With 512MB of memory or less
compilation will take much longer due to swap thrashing.

### Dependencies

These dependencies are required:

Library | Purpose | Description
------------|------------------|----------------------
libssl | SSL Support | Secure communications
libboost | Boost | C++ Library

Optional dependencies:

Library | Purpose | Description
------------|------------------|----------------------
miniupnpc | UPnP Support | Firewall-jumping support
libdb4.8 | Berkeley DB | Wallet storage (only needed when wallet enabled)
qt | GUI | GUI toolkit (only needed when GUI enabled)
protobuf | Payments in GUI | Data interchange format used for payment protocol (only needed when GUI enabled)
libqrencode | QR codes in GUI | Optional for generating QR codes (only needed when GUI enabled)

For the versions used in the release, see [release-process.md](./divi/doc/release-process.md) under *Fetch and build inputs*.

For additional information about dependencies see [build-unix.md](./divi/doc/build-unix.md)
```
./autogen.sh
./configure --disable-tests --without-gui
make
make install # optional
```

4 changes: 2 additions & 2 deletions divi/contrib/gitian-descriptors/gitian-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ packages:
- "python"
reference_datetime: "2018-03-20 00:00:00"
remotes:
- "url": "https://github.com/divicoin/divi.git"
- "url": "https://github.com/Divicoin/Divi.git"
"dir": "divi"
files: []
script: |
WRAP_DIR=$HOME/wrapped
HOSTS="x86_64-linux-gnu"
CONFIGFLAGS="--without-gui --disable-zerocoin --enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
CONFIGFLAGS="--without-gui --disable-tests --disable-zerocoin --enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
FAKETIME_HOST_PROGS=""
FAKETIME_PROGS="date ar ranlib nm"
HOST_CFLAGS="-O2 -g"
Expand Down
33 changes: 8 additions & 25 deletions divi/contrib/gitian-descriptors/gitian-osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ packages:
- "python-setuptools"
- "fonts-tuffy"
remotes:
- "url": "https://github.com/divicoin/divi.git"
- "url": "https://github.com/Divicoin/Divi.git"
"dir": "divi"
files:
- "MacOSX10.11.sdk.tar.gz"
- "MacOSX10.9.sdk.tar.xz"
script: |
WRAP_DIR=$HOME/wrapped
HOSTS="x86_64-apple-darwin11"
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage"
CONFIGFLAGS="--disable-tests --without-gui --enable-reduce-exports --disable-bench --disable-gui-tests GENISOIMAGE=$WRAP_DIR/genisoimage"
FAKETIME_HOST_PROGS=""
FAKETIME_PROGS="ar ranlib date dmg genisoimage"
Expand Down Expand Up @@ -83,11 +83,11 @@ script: |
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
export PATH=${WRAP_DIR}:${PATH}
cd divi
cd divi/divi
BASEPREFIX=`pwd`/depends
mkdir -p ${BASEPREFIX}/SDKs
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.11.sdk.tar.gz
tar -C ${BASEPREFIX}/SDKs -xf ${BUILD_DIR}/MacOSX10.9.sdk.tar.xz
# Build dependencies for each host
for i in $HOSTS; do
Expand Down Expand Up @@ -124,27 +124,10 @@ script: |
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf ../$SOURCEDIST
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
CONFIG_SITE=${BASEPREFIX}/${i}/share/config.site ./configure --prefix=/ --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS} CXXFLAGS="-g" CFLAGS="-g"
make ${MAKEOPTS}
make install-strip DESTDIR=${INSTALLPATH}
make osx_volname
make deploydir
OSX_VOLNAME="$(cat osx_volname)"
mkdir -p unsigned-app-${i}
cp osx_volname unsigned-app-${i}/
cp contrib/macdeploy/detached-sig-apply.sh unsigned-app-${i}
cp contrib/macdeploy/detached-sig-create.sh unsigned-app-${i}
cp ${BASEPREFIX}/${i}/native/bin/dmg ${BASEPREFIX}/${i}/native/bin/genisoimage unsigned-app-${i}
cp ${BASEPREFIX}/${i}/native/bin/${i}-codesign_allocate unsigned-app-${i}/codesign_allocate
cp ${BASEPREFIX}/${i}/native/bin/${i}-pagestuff unsigned-app-${i}/pagestuff
mv dist unsigned-app-${i}
pushd unsigned-app-${i}
find . | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-osx-unsigned.tar.gz
popd
make deploy
${WRAP_DIR}/dmg dmg "${OSX_VOLNAME}.dmg" ${OUTDIR}/${DISTNAME}-osx-unsigned.dmg
#make install-strip DESTDIR=${INSTALLPATH}
make install DESTDIR=${INSTALLPATH}
cd installed
find . -name "lib*.la" -delete
Expand Down
114 changes: 114 additions & 0 deletions divi/contrib/gitian-descriptors/gitian-rpi2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
---
name: "divi-raspberry-0.1"
enable_cache: true
suites:
- "precise"
architectures:
- "amd64"
packages:
- "g++-multilib"
- "git-core"
- "pkg-config"
- "autoconf2.13"
- "libtool"
- "automake"
- "faketime"
- "bsdmainutils"
- "binutils-gold"
reference_datetime: "2017-01-01 00:00:00"
remotes:
- "url": "https://github.com/Divicoin/Divi.git"
"dir": "divi"
files:
- "raspberrypi-tools.tar.gz"
script: |
WRAP_DIR=$HOME/wrapped
export BUILD_DIR=`pwd`
HOSTS="arm-linux-gnueabihf"
CONFIGFLAGS="--enable-upnp-default --without-gui --disable-tests --disable-zerocoin --enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
FAKETIME_HOST_PROGS=""
FAKETIME_PROGS="date ar ranlib nm strip"
mkdir -p ${BUILD_DIR}/toolchain
tar -C ${BUILD_DIR}/toolchain -xf ${BUILD_DIR}/raspberrypi-tools.tar.gz
export TOOLCHAIN_BIN=${BUILD_DIR}/toolchain/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
export PATH=$PATH:$TOOLCHAIN_BIN
export QT_RCC_TEST=1
export GZIP="-9n"
export TAR_OPTIONS="--mtime="$REFERENCE_DATE\\\ $REFERENCE_TIME""
export TZ="UTC"
export BUILD_DIR=`pwd`
mkdir -p ${WRAP_DIR}
if test -n "$GBUILD_CACHE_ENABLED"; then
export SOURCES_PATH=${GBUILD_COMMON_CACHE}
export BASE_CACHE=${GBUILD_PACKAGE_CACHE}
mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
fi
# Create global faketime wrappers
for prog in ${FAKETIME_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${prog}
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
chmod +x ${WRAP_DIR}/${prog}
done
# Create per-host faketime wrappers
for i in $HOSTS; do
for prog in ${FAKETIME_HOST_PROGS}; do
echo '#!/bin/bash' > ${WRAP_DIR}/${i}-${prog}
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
echo 'export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${i}-${prog}
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
chmod +x ${WRAP_DIR}/${i}-${prog}
done
done
export PATH=${WRAP_DIR}:${PATH}
cd divi/divi
BASEPREFIX=`pwd`/depends
# Build dependencies for each host
for i in $HOSTS; do
make ${MAKEOPTS} NO_QT=1 -C ${BASEPREFIX} HOST="${i}"
done
# Create the release tarball using (arbitrarily) the first host
./autogen.sh
./configure --prefix=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`
make NO_QT=1 dist
SOURCEDIST=`echo divi-*.tar.gz`
DISTNAME=`echo ${SOURCEDIST} | sed 's/.tar.*//'`
# Correct tar file order
mkdir -p temp
pushd temp
tar xf ../$SOURCEDIST
find divi-* | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ../$SOURCEDIST
popd
ORIGPATH="$PATH"
# Extract the release tarball into a dir for each host and build
for i in ${HOSTS}; do
export PATH=${BASEPREFIX}/${i}/native/bin:${ORIGPATH}
mkdir -p distsrc-${i}
cd distsrc-${i}
INSTALLPATH=`pwd`/installed/${DISTNAME}
mkdir -p ${INSTALLPATH}
tar --strip-components=1 -xf ../$SOURCEDIST
./configure --prefix=${BASEPREFIX}/${i} --bindir=${INSTALLPATH}/bin --includedir=${INSTALLPATH}/include --libdir=${INSTALLPATH}/lib --disable-ccache --disable-maintainer-mode --disable-dependency-tracking ${CONFIGFLAGS}
make ${MAKEOPTS} NO_QT=1
make NO_QT=1 install-strip
cd installed
find . -name "lib*.la" -delete
find . -name "lib*.a" -delete
rm -rf ${DISTNAME}/lib/pkgconfig
find ${DISTNAME} | sort | tar --no-recursion --mode='u+rw,go+r-w,a+X' --owner=0 --group=0 -c -T - | gzip -9n > ${OUTDIR}/${DISTNAME}-${i}.tar.gz
cd ../../
done
mkdir -p $OUTDIR/src
mv $SOURCEDIST $OUTDIR/src
mv ${OUTDIR}/${DISTNAME}-arm-*.tar.gz ${OUTDIR}/${DISTNAME}-RPi2.tar.gz
4 changes: 2 additions & 2 deletions divi/contrib/gitian-descriptors/gitian-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ packages:
- "ca-certificates"
- "python"
remotes:
- "url": "https://github.com/divicoin/divi.git"
- "url": "https://github.com/Divicoin/Divi.git"
"dir": "divi"
files: []
script: |
WRAP_DIR=$HOME/wrapped
HOSTS="i686-w64-mingw32 x86_64-w64-mingw32"
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests"
CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests --disable-tests --without-gui"
FAKETIME_HOST_PROGS="g++ ar ranlib nm windres strip objcopy"
FAKETIME_PROGS="date makensis zip"
HOST_CFLAGS="-O2 -g"
Expand Down
3 changes: 0 additions & 3 deletions divi/contrib/init/divid.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ Description=DIVI's distributed currency daemon
After=network.target
[Service]
User=divi
Group=divi
Type=forking
PIDFile=/var/lib/divid/divid.pid
Expand Down
8 changes: 5 additions & 3 deletions divi/doc/build-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ To Build

```bash
./autogen.sh
./configure
./configure --disable-tests --without-gui
make
make install # optional
```

This will build divi-qt as well if the dependencies are met.
If you are using Ubuntu 18 or newer, run `./configure --disable-tests --without-gui --with-unsupported-ssl` to build with system OpenSSL which is required for Ubuntu > 16.10

This will build divid, building divi-qt is deprecated and shouldn't be used.

Dependencies
---------------------
Expand Down Expand Up @@ -80,7 +82,7 @@ Optional:

sudo apt-get install libminiupnpc-dev (see --with-miniupnpc and --enable-upnp-default)

Dependencies for the GUI: Ubuntu & Debian
Dependencies for the GUI: Ubuntu & Debian (Deprecated)
-----------------------------------------

If you want to build DIVI-Qt, make sure that the required packages for Qt development
Expand Down
Loading

0 comments on commit 706b9f6

Please sign in to comment.