Skip to content

Commit

Permalink
Merge pull request #95 from piratelinux/dev
Browse files Browse the repository at this point in the history
Revert forking changes and keep latest features
  • Loading branch information
dbkeys committed Nov 7, 2018
2 parents 7f87cb8 + ce8a163 commit 9540128
Show file tree
Hide file tree
Showing 18 changed files with 374 additions and 177 deletions.
34 changes: 2 additions & 32 deletions README.md
Expand Up @@ -35,37 +35,7 @@ Bitmark aims to be a relatively stable, user focused crypto currency, which refi

All Bitmark software releases are published through the github release process, you can download the [latest release](https://github.com/project-bitmark/bitmark/releases) from the releases tab above.

## Hard Fork #2 - (v0.9.8.0)
## CEM Increased Effectiveness & Authority - Equitable AuxPoW Block Subsidies

There are two major changes in Bitmark v0.9.8

1)
A more effective Coin Emission Modulation policy. Instead of ruling over only one-half the full epoch reward, CEM v0.2 now has reduction authority over 80% of the epoch reward.
A more forgiving Coin Emission policy. The time window, which remembers high hashrate peaks, is reduced from 1 year to 30 days.

2)
Block Rewards for Merge-Mined Blocks are now 20% of the CEM v0.2 modulated subsidy value. The rationale is that Merge-Mined blocks are much less expensive to mine.

Native rewards may range from 20% to 100% of the Epoch maximum (currently 15 MARKS) under CEM v0.2 : 3 --> 15 MARKS.
This is scaled in the range of 10% to 20% for merged mined blocks.
For example if a native reward is 9 MARKS, which is in the middle of the 3 - 15 MARKS range, it will be scaled for merge-mined blocks to 2.25 MARKS, which is in the middle of range from 1.5 to 3 MARKS

## CEM - Coin Emission Modulation, version 0.2

The Coin Emission Modulation algorithm looks at a past window of hashrate history, and chooses the hightest hashrate it finds as measure to compare the current hashrate against. When current hashrate is at or above this level, the epoch's full block reward subsidy will be given; but if the current hash rate is below, then the block reward gets proportionately reduced, down to a certain minimum. CEM tracks the hash rate for each PoW algo independently.

(Hard Fork #1, which introduced multiple proof-of-work algorithms (SCRYPT, SHA256D, YESCRYPT, ARGON2D, X17, LYRA2REv2, EQUIHASH, CRYPTONIGHT) under DGWv3 was adopted by the Bitmark community by supermajority consensus after block 450946. The first block where v0.9.7 rules are in effect is 450947.)
Fork #1 has been very succesful. The blockchain is flowing in a secure and steady way. Transactions are processed expediently, and CEM v0.1 has tempered coin emission with reduced subsidies when hashrate dips.

This fork, Hard Fork #2 will build on the success of CEM 0.1 by increasing the portion of the block reward over which the Coin Emission Modulation algorithm has reduction authority. This hard fork is to take effect on block 511,111. The Bitmark Foundation wishes that the blockchain retain a measure of independent and native mining.
We appreciate the extra hashrate and chain security brought by merge-miners and thank the Mining Pools which have added Bitmark to their mining operations. Because merge-mining costs are already established and mostly fixed when Bitmark (or any other AuxPoW chain) is added through an AuxPoW-enabled algo to an existing mining operation, the extra work to obtain Bitmarks is relatively small. AuxPoW block rewards should be equitable when compared with the work to mine blocks natively.
We seek to find middle ground between the security value to the Bitmark chain and the marginal cost of production to merge-miners.
Our goal is to foster native mining and to foster interest in the Bitmark project while still making it profitable and attractive for merge-miners of larger chains to contribute to Bitmark’s blockchain security. Any miner who wishes to receive the native CEM block subsidy may of course simply mine the chain natively.


## Hard Fork #1 (v0.9.7)
## Eight Algortihm multiple Proof-of-Work Algorithms - 8mPoW
## Eight Algortihm mPoW Hard Fork (v0.9.7)

The hard fork for multiple proof-of-work algorithms (SCRYPT, SHA256D, YESCRYPT, ARGON2D, X17, LYRA2REv2, EQUIHASH, CRYPTONIGHT) under DGWv3 was adopted by the Bitmark community by supermajority consensus after block 450946. The first block where v0.9.7 rules are in effect is 450947.

Expand All @@ -80,7 +50,7 @@ rpcpassword=YoUrSecreT-PaSsWoRd
listen=1


##Note: libsodium cryptographic library is required by Bitmark v0.9.7 and above
##Note: libsodium cryptographic library is required by Bitmark v0.9.7

Ubuntu 16 and higher may simply do:

Expand Down
4 changes: 2 additions & 2 deletions configure.ac
Expand Up @@ -2,9 +2,9 @@ dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 9)
define(_CLIENT_VERSION_REVISION, 8)
define(_CLIENT_VERSION_REVISION, 7)
define(_CLIENT_VERSION_BUILD, 3)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_COPYRIGHT_YEAR, 2018)
AC_INIT([Bitmark Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@bitmark.org],[bitmark])
AC_CONFIG_AUX_DIR([src/build-aux])
Expand Down
2 changes: 1 addition & 1 deletion doc/README.md
@@ -1,4 +1,4 @@
Bitmark 0.9.8.3.1 BETA
Bitmark 0.9.7.3 BETA
===========================================

Copyright (c) 2009-2018 Bitmark Developers
Expand Down
139 changes: 139 additions & 0 deletions doc/gitian-howto.md
@@ -0,0 +1,139 @@
This guide documents in detail how Gitian can be used on an Ubuntu 16.04 system using KVM to virtualize the build environments for Bitmark and produce verifiable binaries. Gitian can be used with other virtualization methods, and on other operating systems, but they're outside the scope of this guide.

## Gitian Overview

Gitian is a piece of software that makes it possible for many different people to create identical binary builds of a cryptocurrency. Since cyrptocurrency software is particularly at risk for poisoning for monetary gain, having a procedure to create a verifiably clean build is important. With Gitian, many different unaffiliated individuals can build a binary release and check to see that the same result was achieved, and therefore certify that the binary is likely safe, and has not been tampered with. All parties building the binary would have to collude to tamper, and this is less and less likely the more people have posted the result of their Gitian build.

## Instructions

First, install the pre-requisite packages and give yourself permission to KVM virtualization.
```
sudo apt-get install python-vm-builder git python-vm-builder ruby qemu-utils apt-cacher-ng
sudo adduser `id -un` kvm
sudo reboot
```

Next, check out the sourcecode for Gitian and Bitmark.
```
git clone https://github.com/devrandom/gitian-builder.git
git clone https://github.com/project-bitmark/bitmark
```

Inside Bitmark's source we see Gitian descriptors. Each file details a single build action, including source files to load, what type of machine images to use, and exactly what build commands to use. Looking inside them is pretty self explanatory, and can be useful for debugging if this guide becomes out of date.
```
$ ls -l contrib/gitian-descriptors
-rw-rw-r-- 1 icook icook 1749 Nov 5 21:12 boost-linux.yml
-rw-rw-r-- 1 icook icook 3900 Oct 18 23:22 boost-win.yml
-rw-rw-r-- 1 icook icook 3727 Nov 5 21:12 deps-linux.yml
-rw-rw-r-- 1 icook icook 4579 Oct 18 23:22 deps-win.yml
-rw-rw-r-- 1 icook icook 2896 Nov 5 21:12 gitian-linux.yml
-rw-rw-r-- 1 icook icook 2629 Oct 18 23:22 gitian-osx-bitmark.yml
-rw-rw-r-- 1 icook icook 6443 Oct 18 23:22 gitian-osx-depends.yml
-rw-rw-r-- 1 icook icook 6476 Oct 18 23:22 gitian-osx-native.yml
-rw-rw-r-- 1 icook icook 6293 Oct 18 23:22 gitian-osx-qt.yml
-rw-rw-r-- 1 icook icook 3834 Oct 18 23:22 gitian-win.yml
-rw-rw-r-- 1 icook icook 2006 Oct 18 23:22 protobuf-win.yml
-rw-rw-r-- 1 icook icook 8557 Nov 5 21:12 qt-linux.yml
-rw-rw-r-- 1 icook icook 4574 Oct 18 23:22 qt-win.yml
```

Now create the virtual machine templates that will be used to run our builds. These are the machines required by the Gitian build profiles that we were just discussing.
```
cd gitian-builder
./bin/make-base-vm --arch amd64 --suite precise
./bin/make-base-vm --arch i386 --suite precise
```

We must now obtain all the build dependencies for Bitmark. Execute the following commands to download all requisite dependencies with the exception of OSX libraries.
```
mkdir inputs
cd inputs
wget 'http://miniupnp.free.fr/files/download.php?file=miniupnpc-1.9.20140701.tar.gz' -O miniupnpc-1.9.20140701.tar.gz
wget 'https://www.openssl.org/source/openssl-1.0.1k.tar.gz'
wget 'http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz'
wget 'http://zlib.net/zlib-1.2.8.tar.gz'
wget 'ftp://ftp.simplesystems.org/pub/png/src/history/libpng16/libpng-1.6.8.tar.gz'
wget 'https://fukuchi.org/works/qrencode/qrencode-3.4.3.tar.bz2'
wget 'https://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.bz2'
wget 'https://svn.boost.org/trac/boost/raw-attachment/ticket/7262/boost-mingw.patch' -O boost-mingw-gas-cross-compile-2013-03-03.patch
wget 'https://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.tar.gz'
wget 'https://download.qt-project.org/archive/qt/4.8/4.8.6/qt-everywhere-opensource-src-4.8.6.tar.gz'
wget 'https://github.com/google/protobuf/releases/download/v2.5.0/protobuf-2.5.0.tar.bz2'
wget 'https://github.com/mingwandroid/toolchain4/archive/10cc648683617cca8bcbeae507888099b41b530c.tar.gz'
wget 'http://www.opensource.apple.com/tarballs/cctools/cctools-809.tar.gz'
wget 'http://www.opensource.apple.com/tarballs/dyld/dyld-195.5.tar.gz'
wget 'http://www.opensource.apple.com/tarballs/ld64/ld64-127.2.tar.gz'
wget 'http://pkgs.fedoraproject.org/repo/pkgs/cdrkit/cdrkit-1.1.11.tar.gz/efe08e2f3ca478486037b053acd512e9/cdrkit-1.1.11.tar.gz'
wget 'https://github.com/theuni/libdmg-hfsplus/archive/libdmg-hfsplus-v0.1.tar.gz'
wget 'http://llvm.org/releases/3.2/clang+llvm-3.2-x86-linux-ubuntu-12.04.tar.gz' -O clang-llvm-3.2-x86-linux-ubuntu-12.04.tar.gz
wget 'https://raw.githubusercontent.com/theuni/osx-cross-depends/master/patches/cdrtools/genisoimage.diff' -O cdrkit-deterministic.patch
```

OSX Libraries are a bit of a pain, so you can skip this is you're not building OSX for some reason. On an OSX machine, visit [Apple Developer Downloads](
https://developer.apple.com/download/more/?path=xcode%204.6.3), sign in with a Apple Developer account, and search for "xcode 4.6.3". You now need to download the `.dmg` image. Mount that image, and then extract a small chunk of the image to an archive. Transfer that archive to the inputs folder on your original Ubuntu machine.

```
tar -C /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/ -czf MacOSX10.7.sdk.tar.gz MacOSX10.7.sdk
```

Now we must build intermediate builds. These are collections of built dependencies that will be used to build the final binaries.

**Linux Dependencies**
```
./bin/gbuild ../bitmark/contrib/gitian-descriptors/boost-linux.yml
mv build/out/boost-*.zip inputs/
./bin/gbuild ../bitmark/contrib/gitian-descriptors/deps-linux.yml
mv build/out/bitmark-deps-*.zip inputs/
./bin/gbuild ../bitmark/contrib/gitian-descriptors/qt-linux.yml
mv build/out/qt-*.tar.gz inputs/
```

**Windows Dependencies**
```
./bin/gbuild ../bitmark/contrib/gitian-descriptors/boost-win.yml
mv build/out/boost-*.zip inputs/
./bin/gbuild ../bitmark/contrib/gitian-descriptors/deps-win.yml
mv build/out/bitmark-deps-*.zip inputs/
./bin/gbuild ../bitmark/contrib/gitian-descriptors/qt-win.yml
mv build/out/qt-*.zip inputs/
./bin/gbuild ../bitmark/contrib/gitian-descriptors/protobuf-win.yml
mv build/out/protobuf-*.zip inputs/
```

**OSX Dependencies**
```
./bin/gbuild ../bitmark/contrib/gitian-descriptors/gitian-osx-native.yml
mv build/out/osx-*.tar.gz inputs/
./bin/gbuild ../bitmark/contrib/gitian-descriptors/gitian-osx-depends.yml
mv build/out/osx-*.tar.gz inputs/
./bin/gbuild ../bitmark/contrib/gitian-descriptors/gitian-osx-qt.yml
mv build/out/osx-*.tar.gz inputs/
```

Before the final builds we set some variables that will be used a lot in the final build commands. Also we make a folder to hold our Gitian signatures.
```
export SIGNER=(your gitian key, ie bluematt, sipa, etc)
export VERSION=(new version, e.g. 0.8.0)
mkdir ../gitian.sigs
```
**Build Linux**
```
./bin/gbuild --commit bitmark=v${VERSION} ../bitmark/contrib/gitian-descriptors/gitian-linux.yml
./bin/gsign --signer $SIGNER --release ${VERSION} --destination ../gitian.sigs/ ../bitmark/contrib/gitian-descriptors/gitian-linux.yml
zip -rj bitmark-${VERSION}-linux-gitian.zip build/out/*
mv bitmark-${VERSION}-linux-gitian.zip ..
```
**Build Windows**
```
./bin/gbuild --commit bitmark=v${VERSION} ../bitmark/contrib/gitian-descriptors/gitian-win.yml
./bin/gsign --signer $SIGNER --release ${VERSION}-win --destination ../gitian.sigs/ ../bitmark/contrib/gitian-descriptors/gitian-win.yml
zip -rj bitmark-${VERSION}-win-gitian.zip build/out/*
mv bitmark-${VERSION}-win-gitian.zip ..
```
**Build OSX**
```
./bin/gbuild --commit bitmark=v${VERSION} ../bitmark/contrib/gitian-descriptors/gitian-osx-bitmark.yml
./bin/gsign --signer $SIGNER --release ${VERSION}-osx --destination ../gitian.sigs/ ../bitmark/contrib/gitian-descriptors/gitian-osx-bitmark.yml
mv build/out/Bitmark-Qt.dmg ..
```
We now have built binaries and our associated signatures.
4 changes: 1 addition & 3 deletions src/bitmarkd.cpp
Expand Up @@ -55,7 +55,6 @@ void DetectShutdownThread(boost::thread_group* threadGroup)
//
bool AppInit(int argc, char* argv[])
{
//printf("appinit\n");
boost::thread_group threadGroup;
boost::thread* detectShutdownThread = NULL;

Expand Down Expand Up @@ -110,7 +109,7 @@ bool AppInit(int argc, char* argv[])
std::string strUsage = _("Bitmark Core Daemon") + " " + _("version") + " " + FormatFullVersion() + "\n";
fprintf(stdout, "%s", strUsage.c_str());
return false;
}
}

// Command-line RPC
bool fCommandLine = false;
Expand Down Expand Up @@ -183,7 +182,6 @@ bool AppInit(int argc, char* argv[])

int main(int argc, char* argv[])
{
//printf("main");
SetupEnvironment();

bool fRet = false;
Expand Down

0 comments on commit 9540128

Please sign in to comment.