Skip to content

Commit

Permalink
Merge pull request #251 from carsenk/ipfs
Browse files Browse the repository at this point in the history
Jupiter Update v3.3.9.6
  • Loading branch information
metaspartan authored Nov 27, 2019
2 parents 889d9f9 + 75938c9 commit d13b3f9
Show file tree
Hide file tree
Showing 80 changed files with 35,489 additions and 4,005 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ dist
*.app
*.dmg
.idea
.vscode

5 changes: 0 additions & 5 deletions .vscode/settings.json

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ Technology
* New/First Tribus PoW Algorithm comprising of 3 NIST5 algorithms
* Tribus PoW/PoS Hybrid
* Full decentralization
* Jupiter - IPFS API Implementation with Anonymous Decentralized File Uploads (UI and RPC)

LINKS
==========================
Expand Down
39 changes: 32 additions & 7 deletions denarius-qt.pro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
TEMPLATE = app
TARGET = Denarius
VERSION = 3.3.9.4
VERSION = 3.3.9.6
INCLUDEPATH += src src/json src/qt src/qt/plugins/mrichtexteditor
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE CURL_STATICLIB
CONFIG += no_include_pwd
CONFIG += thread
CONFIG += static
Expand Down Expand Up @@ -39,6 +39,8 @@ QRENCODE_INCLUDE_PATH=C:/deps/qrencode-3.4.4
QRENCODE_LIB_PATH=C:/deps/qrencode-3.4.4/.libs
LIBEVENT_INCLUDE_PATH=C:/deps/libevent/include
LIBEVENT_LIB_PATH=C:/deps/libevent/.libs
LIBCURL_INCLUDE_PATH=C:/deps/libcurl/include
LIBCURL_LIB_PATH=C:/deps/libcurl/lib
}

# for boost 1.37, add -mt to the boost libraries
Expand Down Expand Up @@ -80,6 +82,25 @@ win32:QMAKE_LFLAGS *= -static
#win32:QMAKE_LFLAGS += -static-libgcc -static-libstdc++
lessThan(QT_MAJOR_VERSION, 5): win32: QMAKE_LFLAGS *= -static

# use: qmake "USE_IPFS=1" ( enabled by default; default)
# or: qmake "USE_IPFS=0" (disabled by default)
# or: qmake "USE_IPFS=-" (not supported)
# D E N A R I U S IPFS - USE_IPFS=- to not compile with the IPFS C Library located in src/ipfs
contains(USE_IPFS, -) {
message(Building without IPFS support)
} else {
message(Building with IPFS support)
count(USE_IPFS, 0) {
USE_IPFS=1
}
DEFINES += USE_IPFS=$$USE_IPFS
INCLUDEPATH += src/ipfs

###IPFS C Library native integration sources
SOURCES += src/ipfs.cc \
src/ipfscurl.cc
}


# use: qmake "USE_NATIVETOR=1" ( enabled by default; default)
# or: qmake "USE_NATIVETOR=0" (disabled by default)
Expand Down Expand Up @@ -325,7 +346,6 @@ contains(USE_LEVELDB, -) {
message(Building with Berkeley DB transaction index)

SOURCES += src/txdb-bdb.cpp \
src/bloom.cpp \
src/hash.cpp \
src/aes_helper.c \
src/echo.c \
Expand All @@ -343,7 +363,6 @@ contains(USE_LEVELDB, -) {
INCLUDEPATH += src/leveldb/include src/leveldb/helpers
LIBS += $$PWD/src/leveldb/libleveldb.a $$PWD/src/leveldb/libmemenv.a
SOURCES += src/txdb-leveldb.cpp \
src/bloom.cpp \
src/hash.cpp \
src/aes_helper.c \
src/echo.c \
Expand Down Expand Up @@ -418,6 +437,7 @@ HEADERS += src/qt/bitcoingui.h \
src/qt/mintingtablemodel.h \
src/qt/mintingview.h \
src/qt/proofofimage.h \
src/qt/jupiter.h \
src/qt/multisigaddressentry.h \
src/qt/multisiginputentry.h \
src/qt/multisigdialog.h \
Expand All @@ -440,6 +460,7 @@ HEADERS += src/qt/bitcoingui.h \
src/smessage.h \
src/main.h \
src/core.h \
src/state.h \
src/ringsig.h \
src/miner.h \
src/net.h \
Expand Down Expand Up @@ -547,6 +568,7 @@ SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
src/qt/multisiginputentry.cpp \
src/qt/multisigdialog.cpp \
src/qt/proofofimage.cpp \
src/qt/jupiter.cpp \
src/qt/termsofuse.cpp \
src/alert.cpp \
src/stun.cpp \
Expand All @@ -560,6 +582,8 @@ SOURCES += src/qt/bitcoin.cpp src/qt/bitcoingui.cpp \
src/script.cpp \
src/main.cpp \
src/core.cpp \
src/bloom.cpp \
src/state.cpp \
src/ringsig.cpp \
src/miner.cpp \
src/init.cpp \
Expand Down Expand Up @@ -654,6 +678,7 @@ FORMS += \
src/qt/forms/blockbrowser.ui \
src/qt/forms/marketbrowser.ui \
src/qt/forms/proofofimage.ui \
src/qt/forms/jupiter.ui \
src/qt/forms/termsofuse.ui \
src/qt/forms/fortunastakemanager.ui \
src/qt/forms/addeditadrenalinenode.ui \
Expand Down Expand Up @@ -759,9 +784,9 @@ macx:QMAKE_CXXFLAGS += -stdlib=libc++


# Set libraries and includes at end, to use platform-defined defaults if not overridden
INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH $$LIBEVENT_INCLUDE_PATH
LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,) $$join(LIBEVENT_LIB_PATH,,-L,)
LIBS += -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
INCLUDEPATH += $$BOOST_INCLUDE_PATH $$BDB_INCLUDE_PATH $$OPENSSL_INCLUDE_PATH $$QRENCODE_INCLUDE_PATH $$LIBEVENT_INCLUDE_PATH $$LIBCURL_INCLUDE_PATH
LIBS += $$join(BOOST_LIB_PATH,,-L,) $$join(BDB_LIB_PATH,,-L,) $$join(OPENSSL_LIB_PATH,,-L,) $$join(QRENCODE_LIB_PATH,,-L,) $$join(LIBEVENT_LIB_PATH,,-L,) $$join(LIBCURL_LIB_PATH,,-L,)
LIBS += -lcurl -lssl -lcrypto -ldb_cxx$$BDB_LIB_SUFFIX
LIBS += -lz -levent

# -lgdi32 has to happen after -lcrypto (see #681)
Expand Down
4 changes: 2 additions & 2 deletions denariusqtubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ case $choice in
echo "Updating linux packages"
sudo apt-get update -y && sudo apt-get upgrade -y

sudo apt-get install -y git unzip build-essential libssl-dev libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev libevent-dev autogen automake libtool libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qt5-default
sudo apt-get install -y git unzip build-essential libssl-dev libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev libevent-dev autogen automake libtool libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qt5-default libcurl4-openssl-dev

echo "Installing Denarius Wallet"
git clone https://github.com/carsenk/denarius
Expand Down Expand Up @@ -55,7 +55,7 @@ cd ~/denarius
echo "Updating linux packages"
sudo apt-get update -y && sudo apt-get upgrade -y

sudo apt-get install -y git unzip build-essential libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev libevent-dev autogen automake libtool libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qt5-default
sudo apt-get install -y git unzip build-essential libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev libevent-dev autogen automake libtool libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools qt5-default libcurl4-openssl-dev

echo "Downgrade libssl-dev"
sudo apt-get install make
Expand Down
7 changes: 7 additions & 0 deletions doc/build-unix.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Dependencies
libssl SSL Support Secure communications
libdb Berkeley DB Blockchain & wallet storage
libboost Boost C++ Library
libcurl IPFS API Support C Library
miniupnpc UPnP Support Optional firewall-jumping support
libqrencode QRCode generation Optional QRCode generation
libevent-dev Libevent Support Optional Libevent Library required for building with USE_NATIVETOR=1
Expand Down Expand Up @@ -68,6 +69,7 @@ Versions used in this release:
miniupnpc 1.9.20140401
libevent 2.1.8 Stable
obfs4proxy 0.0.6-2
libcurl latest

Dependency Build Instructions: Ubuntu & Debian
----------------------------------------------
Expand All @@ -79,6 +81,11 @@ sudo apt-get install libminiupnpc-dev
sudo apt-get install libqrencode-dev
sudo apt-get install libevent-dev
sudo apt-get install obfs4proxy
sudo apt-get install libcurl4-openssl-dev

Libcurl is only required if you are building with IPFS API Support
----------------------------------------------
sudo apt-get install libcurl4-openssl-dev


Libevent-dev and obfs4proxy is only required if you are building with USE_NATIVETOR=1 support
Expand Down
4 changes: 2 additions & 2 deletions installd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ case $choice in
echo "Updating linux packages"
sudo apt-get update -y && sudo apt-get upgrade -y

sudo apt-get --assume-yes install git unzip build-essential libssl-dev libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev libevent-dev obfs4proxy
sudo apt-get --assume-yes install git unzip build-essential libssl-dev libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev libevent-dev obfs4proxy libcurl4-openssl-dev

echo "Installing Denarius Wallet"
git clone https://github.com/carsenk/denarius
Expand Down Expand Up @@ -56,7 +56,7 @@ cd ~/denarius/src
echo "Updating linux packages"
sudo apt-get update -y && sudo apt-get upgrade -y

sudo apt-get --assume-yes install git unzip build-essential libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev libevent-dev obfs4proxy libssl-dev
sudo apt-get --assume-yes install git unzip build-essential libdb++-dev libboost-all-dev libqrencode-dev libminiupnpc-dev libevent-dev obfs4proxy libssl-dev libcurl4-openssl-dev

echo "Downgrade libssl-dev"
sudo apt-get install make
Expand Down
6 changes: 5 additions & 1 deletion snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# https://github.com/carsenk/denarius
# By Carsen Klock
name: denarius
version: '3.3.9.4'
version: '3.3.9.6'
summary: Denarius
description: |
An open source hybrid cryptocurrency called Denarius, which features Fortuna Stakes (Masternodes), Staking, Mining, Multisig, and much more!
Expand Down Expand Up @@ -87,6 +87,7 @@ parts:
- libqrencode-dev
- libminiupnpc-dev
- libevent-dev
- libcurl4-openssl-dev
- libssl-dev
- libtool
stage-packages:
Expand All @@ -103,6 +104,7 @@ parts:
- libqrencode-dev
- libminiupnpc-dev
- libevent-dev
- libcurl4-openssl-dev
- libssl-dev
- libtool
override-build: |
Expand Down Expand Up @@ -153,6 +155,7 @@ parts:
- libqrencode-dev
- libminiupnpc-dev
- libevent-dev
- libcurl4-openssl-dev
- libssl-dev
- libtool
- libqt5gui5
Expand All @@ -176,6 +179,7 @@ parts:
- libqrencode-dev
- libminiupnpc-dev
- libevent-dev
- libcurl4-openssl-dev
- libssl-dev
- libtool
- libqt5gui5
Expand Down
1 change: 1 addition & 0 deletions src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "bignum.h"
#include "key.h"
#include "script.h"
#include "state.h"
/**
* Encode a byte sequence as a base58-encoded string.
* pbegin and pend cannot be NULL, unless both are.
Expand Down
44 changes: 34 additions & 10 deletions src/bloom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ bool CBloomFilter::IsWithinSizeConstraints() const
return vData.size() <= MAX_BLOOM_FILTER_SIZE && nHashFuncs <= MAX_HASH_FUNCS;
}

bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx, const uint256& hash)
bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx)
{
bool fFound = false;
// Match if the filter contains the hash of tx
Expand All @@ -108,8 +108,17 @@ bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx, const uint256& ha
return true;
if (isEmpty)
return false;
if (contains(hash))

const uint256& hash = tx.GetHash();


if (((nFlags & BLOOM_ACCEPT_STEALTH) && tx.HasStealthOutput())
|| contains(hash))
{
fFound = true;
// -- don't return here!
};


for (unsigned int i = 0; i < tx.vout.size(); i++)
{
Expand All @@ -125,23 +134,38 @@ bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx, const uint256& ha
opcodetype opcode;
if (!txout.scriptPubKey.GetOp(pc, opcode, data))
break;
if (data.size() != 0 && contains(data))

if (data.size() == 33) // coinstake
{
uint160 pkHash = Hash160(data);
vector<unsigned char> dataHash160(pkHash.begin(), pkHash.end());

if (dataHash160.size() != 0 && contains(dataHash160))
fFound = true;
};

if (!fFound
&& data.size() != 0 && contains(data))
fFound = true;

if (fFound)
{
if ((nFlags & BLOOM_UPDATE_MASK) == BLOOM_UPDATE_ALL)
{
insert(COutPoint(hash, i));
else if ((nFlags & BLOOM_UPDATE_MASK) == BLOOM_UPDATE_P2PUBKEY_ONLY)
} else
if ((nFlags & BLOOM_UPDATE_MASK) == BLOOM_UPDATE_P2PUBKEY_ONLY)
{
txnouttype type;
vector<vector<unsigned char> > vSolutions;
if (Solver(txout.scriptPubKey, type, vSolutions) &&
(type == TX_PUBKEY || type == TX_MULTISIG))
insert(COutPoint(hash, i));
}
};
break;
}
}
}
};
};
};

if (fFound)
return true;
Expand All @@ -162,8 +186,8 @@ bool CBloomFilter::IsRelevantAndUpdate(const CTransaction& tx, const uint256& ha
break;
if (data.size() != 0 && contains(data))
return true;
}
}
};
};

return false;
}
Expand Down
9 changes: 5 additions & 4 deletions src/bloom.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ enum bloomflags
*/
class CBloomFilter
{
private:
public:
std::vector<unsigned char> vData;
bool isFull;
bool isEmpty;
Expand All @@ -53,8 +53,6 @@ class CBloomFilter
unsigned char nFlags;

unsigned int Hash(unsigned int nHashNum, const std::vector<unsigned char>& vDataToHash) const;

public:
// Creates a new bloom filter which will provide the given fp rate when filled with the given number of elements
// Note that if the given parameters will result in a filter outside the bounds of the protocol limits,
// the filter created will be as close to the given parameters as possible within the protocol limits.
Expand All @@ -73,6 +71,9 @@ class CBloomFilter
READWRITE(nFlags);
)

bool IsFull() {return isFull;};
unsigned int GetSize() {return vData.size();};

void insert(const std::vector<unsigned char>& vKey);
void insert(const COutPoint& outpoint);
void insert(const uint256& hash);
Expand All @@ -86,7 +87,7 @@ class CBloomFilter
bool IsWithinSizeConstraints() const;

// Also adds any outputs which match the filter to the filter (to match their spending txes)
bool IsRelevantAndUpdate(const CTransaction& tx, const uint256& hash);
bool IsRelevantAndUpdate(const CTransaction& tx);

// Checks for empty and full filters to avoid wasting cpu
void UpdateEmptyFull();
Expand Down
Loading

0 comments on commit d13b3f9

Please sign in to comment.