Skip to content

Commit

Permalink
fixed to work with modern libs (QT5, libssl, ...)
Browse files Browse the repository at this point in the history
  • Loading branch information
epsylon committed Apr 19, 2024
1 parent d1cacfb commit f9be9e7
Show file tree
Hide file tree
Showing 40 changed files with 26,598 additions and 13,395 deletions.
18 changes: 11 additions & 7 deletions README.md
Expand Up @@ -7,12 +7,6 @@

+ https://ecoin.03c8.net

#### Blockchain Explorer:

+ The [blockchain](https://en.wikipedia.org/wiki/Blockchain) with the transactions is publicly accessible from the url: [https://ecoin.03c8.net/blockexplorer](https://ecoin.03c8.net/blockexplorer)

![c](https://ecoin.03c8.net/ecoin/ecoin-blockexplorer.png)

----------

#### Description:
Expand All @@ -23,7 +17,7 @@

+ [Proof-Of-Work](https://en.wikipedia.org/wiki/Proof_of_work)
+ [Proof-Of-Stake](https://en.wikipedia.org/wiki/Proof_of_stake)
+ [Proof-Of-Transaction](https://cryptoticker.io/en/proof-transaction/)
+ [Proof-Of-Transaction](https://cryptoticker.io/en/proof-transaction)

There is no maximum number of coins, through the estimated coinbase size will be roughly [225 million ECO].

Expand All @@ -42,6 +36,12 @@

----------

#### Blockchain Explorer:

+ The [blockchain](https://en.wikipedia.org/wiki/Blockchain) with the transactions is publicly accessible from the url: [https://ecoin.03c8.net/blockexplorer](https://ecoin.03c8.net/blockexplorer)

----------

#### Building:

This tool runs on many platforms (GNU-Linux/Win32/MacosOSX). See [INSTALL](./ecoin/INSTALL) for your system.
Expand Down Expand Up @@ -89,3 +89,7 @@ Mining:

![c](https://ecoin.03c8.net/ecoin/ecoin_mining_zoom.png)

BlockExplorer:

![c](https://ecoin.03c8.net/ecoin/ecoin-blockexplorer.png)

12 changes: 6 additions & 6 deletions ecoin/INSTALL
@@ -1,5 +1,5 @@

ECOin - Copyright (c) - 2014/2022 - GPLv3 - epsylon@riseup.net (https://03c8.net)
ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

===================================================
# BUILDS - ECOlogical P2P Crypto-Currency (ECOin) #
Expand All @@ -13,7 +13,7 @@ cd ecoin/

+ GNU/Linux:

/usr/lib/x86_64-linux-gnu/qt4/bin/qmake USE_UPNP=0 USE_IPV6=0 -o Makefile ecoin-qt.pro
/usr/lib/x86_64-linux-gnu/qt5/bin/qmake USE_UPNP=- USE_IPV6=- -o Makefile ecoin-qt.pro

================
+ Build leveldb:
Expand Down Expand Up @@ -43,8 +43,7 @@ See doc/build-*.txt for detailed instructions on building /ecoin-qt/ on differen

+ GNU/Linux:

cd ..
qmake USE_UPNP=- (or USE_UPNP=0)
qmake USE_UPNP=-
make

./ecoin-qt
Expand All @@ -58,7 +57,7 @@ See doc/build-*.txt for detailed instructions on building /ecoind/ on different
+ GNU/Linux:

cd src/
make -f makefile.linux USE_UPNP=- (or USE_UPNP=0)
make -f makefile.linux USE_UPNP=-
strip ecoind

./ecoind
Expand All @@ -72,8 +71,9 @@ See doc/build-*.txt for detailed instructions on building /ecoind/ on different
- File: /home/$USER/.ecoin/ecoin.conf # chmod 600 ecoin.conf

rpcuser=ecoinrpc
rpcpassword=YourPassWord2021 # use lowercase, upper case and numbers
rpcpassword=<YourPassWord2024> # use lowercase, upper case and numbers
rpcallowip=127.0.0.1
rpcallowip=<YourPrivateIP> # ex: 10.0.0.5
noirc=1
listen=1
server=1
Expand Down
12 changes: 12 additions & 0 deletions ecoin/doc/IMPLEMENTATIONS.txt
@@ -0,0 +1,12 @@

ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

=========================================================
# IMPLEMENTATIONS - ECOlogical P2P Crypto-Currency (ECOin) #
=========================================================

This code is part of the project:

https://solarnethub.com/

=========================================================
8 changes: 4 additions & 4 deletions ecoin/doc/build-linux.txt
@@ -1,5 +1,5 @@

ECOin - Copyright (c) - 2014/2022 - GPLv3 - epsylon@riseup.net (https://03c8.net)
ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

======================================
# SOURCES for ECOin (Unix/GNU-Linux) #
Expand Down Expand Up @@ -55,12 +55,12 @@ All of the commands should be executed in a shell.
------------------------------

======================================
# Qt4 GUI for ECOin (Unix/GNU-Linux) #
# Qt5 GUI for ECOin (Unix/GNU-Linux) #
======================================

(1.) First, make sure that the required packages for Qt4 development of your distribution are installed, for Debian and Ubuntu these are:
(1.) First, make sure that the required packages for Qt5 development of your distribution are installed, for Debian and Ubuntu these are:

sudo apt-get install qt4-qmake libqt4-dev build-essential libboost-dev libboost-system-dev miniupnpc libminiupnpc-dev \
sudo apt-get install qt5-qmake qtbase5-dev build-essential libboost-dev libboost-system-dev miniupnpc libminiupnpc-dev \
libboost-filesystem-dev libboost-program-options-dev libboost-thread-dev libssl-dev libssl1.1 libdb5.3++-dev

(2.) Then execute the following:
Expand Down
6 changes: 3 additions & 3 deletions ecoin/doc/build-osx.txt
@@ -1,5 +1,5 @@

ECOin - Copyright (c) - 2014/2021 - GPLv3 - epsylon@riseup.net (https://03c8.net)
ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

===============================
# SOURCES for ECOin (MacOS X) #
Expand Down Expand Up @@ -53,15 +53,15 @@ All of the commands should be executed in Terminal.app
An executable named 'ecoind' will be built.

===============================
# Qt4 GUI for ECOin (MacOS X) #
# Qt5 GUI for ECOin (MacOS X) #
===============================

(1.) Download and install MacPorts from: http://www.macports.org/

(2.) Execute the following commands in a terminal to get the dependencies:

sudo port selfupdate
sudo port install qt4-mac qt4-creator-mac boost db53 miniupnpc
sudo port install qt5-mac qt5-creator-mac boost db53 miniupnpc

(3.) Open the .pro file in Qt Creator (with Desktop kit) and build as normal (cmd-B)

Expand Down
2 changes: 1 addition & 1 deletion ecoin/doc/build-win32.txt
@@ -1,5 +1,5 @@

ECOin - Copyright (c) - 2014/2021 - GPLv3 - epsylon@riseup.net (https://03c8.net)
ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

=============================
# SOURCES for ECOin (Win32) #
Expand Down
18 changes: 13 additions & 5 deletions ecoin/ecoin-qt.pro
@@ -1,16 +1,26 @@

# ECOin - Copyright (c) - 2014/2022 - GPLv3 - epsylon@riseup.net (https://03c8.net)
# ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

TEMPLATE = app
TARGET = ecoin-qt
VERSION = 0.0.3
VERSION = 0.0.4
INCLUDEPATH += src src/json src/qt
DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
CONFIG += no_include_pwd
CONFIG += thread
OBJECTS_DIR = build
MOC_DIR = build
UI_DIR = build
QT += core gui widgets
QT_NO_DEFAULT_CODEC = 1

QMAKE_CXXFLAGS_WARN_ON = -Wno-unused-parameter -Wno-deprecated-declarations -Wno-stringop-overread -Wno-return-type

# Disable stack-protector warnings
QMAKE_CXXFLAGS += -Wno-stack-protector

# Extra security measures for Windows
win32:QMAKE_LFLAGS += -Wl,--dynamicbase -Wl,--nxcompat
win32:QMAKE_LFLAGS += -static-libgcc -static-libstdc++

# use: qmake "RELEASE=1"
contains(RELEASE, 1) {
Expand Down Expand Up @@ -129,8 +139,6 @@ contains(USE_O3, 1) {
QMAKE_CFLAGS += -msse2
}

QMAKE_CXXFLAGS_WARN_ON = -fdiagnostics-show-option -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector

# Input
DEPENDPATH += src src/json src/qt
HEADERS += src/qt/ecoingui.h \
Expand Down
10 changes: 5 additions & 5 deletions ecoin/share/setup.nsi
@@ -1,5 +1,5 @@

# ECOin - Copyright (c) - 2014/2021 - GPLv3 - epsylon@riseup.net (https://03c8.net)
# ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

Name Ecoin

Expand All @@ -8,9 +8,9 @@ SetCompressor /SOLID lzma

# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"
!define VERSION 0.0.2
!define VERSION 0.0.3
!define COMPANY "Ecoin project"
!define URL https://03c8.net
!define URL https://ecoin.03c8.net

# MUI Symbol Definitions
!define MUI_ICON "../share/pixmaps/ecoin.ico"
Expand Down Expand Up @@ -48,13 +48,13 @@ Var StartMenuGroup
!insertmacro MUI_LANGUAGE English

# Installer attributes
OutFile ecoin-0.0.2-win32-setup.exe
OutFile ecoin-0.0.3-win32-setup.exe
InstallDir $PROGRAMFILES\Ecoin
CRCCheck on
XPStyle on
BrandingText " "
ShowInstDetails show
VIProductVersion 0.0.2.1
VIProductVersion 0.0.3.1
VIAddVersionKey ProductName Ecoin
VIAddVersionKey ProductVersion "${VERSION}"
VIAddVersionKey CompanyName "${COMPANY}"
Expand Down
10 changes: 5 additions & 5 deletions ecoin/src/db.cpp
@@ -1,4 +1,4 @@
// ECOin - Copyright (c) - 2014/2022 - GPLv3 - epsylon@riseup.net (https://03c8.net)
// ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

#include "db.h"
#include "net.h"
Expand Down Expand Up @@ -57,11 +57,11 @@ bool CDBEnv::Open(boost::filesystem::path pathEnv_)
return false;

pathEnv = pathEnv_;
filesystem::path pathDataDir = pathEnv;
boost::filesystem::path pathDataDir = pathEnv;
strPath = pathDataDir.string();
filesystem::path pathLogDir = pathDataDir / "database";
filesystem::create_directory(pathLogDir);
filesystem::path pathErrorFile = pathDataDir / "db.log";
boost::filesystem::path pathLogDir = pathDataDir / "database";
boost::filesystem::create_directory(pathLogDir);
boost::filesystem::path pathErrorFile = pathDataDir / "db.log";
printf("dbenv.open LogDir=%s ErrorFile=%s\n", pathLogDir.string().c_str(), pathErrorFile.string().c_str());

unsigned int nEnvFlags = 0;
Expand Down
23 changes: 13 additions & 10 deletions ecoin/src/ecoinrpc.cpp
@@ -1,4 +1,4 @@
// ECOin - Copyright (c) - 2014/2022 - GPLv3 - epsylon@riseup.net (https://03c8.net)
// ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

#include "init.h"
#include "util.h"
Expand All @@ -11,7 +11,9 @@
#undef printf
#include <boost/asio.hpp>
#include <boost/asio/ip/v6_only.hpp>
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
using namespace boost::placeholders;

#include <boost/filesystem.hpp>
#include <boost/foreach.hpp>
#include <boost/iostreams/concepts.hpp>
Expand Down Expand Up @@ -547,7 +549,7 @@ class SSLIOStreamDevice : public iostreams::device<iostreams::bidirectional> {
}
bool connect(const std::string& server, const std::string& port)
{
ip::tcp::resolver resolver(stream.get_io_service());
ip::tcp::resolver resolver(GetIOService(stream));
ip::tcp::resolver::query query(server.c_str(), port.c_str());
ip::tcp::resolver::iterator endpoint_iterator = resolver.resolve(query);
ip::tcp::resolver::iterator end;
Expand Down Expand Up @@ -647,7 +649,7 @@ static void RPCListen(boost::shared_ptr< basic_socket_acceptor<Protocol, SocketA
ssl::context& context,
const bool fUseSSL)
{
AcceptedConnectionImpl<Protocol>* conn = new AcceptedConnectionImpl<Protocol>(acceptor->get_io_service(), context, fUseSSL);
AcceptedConnectionImpl<Protocol>* conn = new AcceptedConnectionImpl<Protocol>(GetIOService(*acceptor), context, fUseSSL);

acceptor->async_accept(
conn->sslStream.lowest_layer(),
Expand Down Expand Up @@ -736,14 +738,14 @@ void ThreadRPCServer2(void* parg)
{
context.set_options(ssl::context::no_sslv2);

filesystem::path pathCertFile(GetArg("-rpcsslcertificatechainfile", "server.cert"));
if (!pathCertFile.is_complete()) pathCertFile = filesystem::path(GetDataDir()) / pathCertFile;
if (filesystem::exists(pathCertFile)) context.use_certificate_chain_file(pathCertFile.string());
boost::filesystem::path pathCertFile(GetArg("-rpcsslcertificatechainfile", "server.cert"));
if (!pathCertFile.is_complete()) pathCertFile = boost::filesystem::path(GetDataDir()) / pathCertFile;
if (boost::filesystem::exists(pathCertFile)) context.use_certificate_chain_file(pathCertFile.string());
else printf("ThreadRPCServer ERROR: missing server certificate file %s\n", pathCertFile.string().c_str());

filesystem::path pathPKFile(GetArg("-rpcsslprivatekeyfile", "server.pem"));
if (!pathPKFile.is_complete()) pathPKFile = filesystem::path(GetDataDir()) / pathPKFile;
if (filesystem::exists(pathPKFile)) context.use_private_key_file(pathPKFile.string(), ssl::context::pem);
boost::filesystem::path pathPKFile(GetArg("-rpcsslprivatekeyfile", "server.pem"));
if (!pathPKFile.is_complete()) pathPKFile = boost::filesystem::path(GetDataDir()) / pathPKFile;
if (boost::filesystem::exists(pathPKFile)) context.use_private_key_file(pathPKFile.string(), ssl::context::pem);
else printf("ThreadRPCServer ERROR: missing server private key file %s\n", pathPKFile.string().c_str());

string strCiphers = GetArg("-rpcsslciphers", "TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH");
Expand Down Expand Up @@ -1223,3 +1225,4 @@ int main(int argc, char *argv[])
#endif

const CRPCTable tableRPC;

14 changes: 9 additions & 5 deletions ecoin/src/init.cpp
@@ -1,4 +1,4 @@
// ECOin - Copyright (c) - 2014/2022 - GPLv3 - epsylon@riseup.net (https://03c8.net)
// ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

#include "txdb.h"
#include "walletdb.h"
Expand All @@ -16,13 +16,17 @@
#include <boost/algorithm/string/predicate.hpp>
#include <openssl/crypto.h>

#include <boost/bind/bind.hpp>
using namespace boost::placeholders;

#ifndef WIN32
#include <signal.h>
#endif

using namespace std;
using namespace boost;


CWallet* pwalletMain;
CClientUIInterface uiInterface;
std::string strWalletFileName;
Expand Down Expand Up @@ -489,7 +493,7 @@ bool AppInit2()
return false;
}

if (filesystem::exists(GetDataDir() / strWalletFileName))
if (boost::filesystem::exists(GetDataDir() / strWalletFileName))
{
CDBEnv::VerifyResult r = bitdb.Verify(strWalletFileName, CWalletDB::Recover);
if (r == CDBEnv::RECOVER_OK)
Expand Down Expand Up @@ -779,13 +783,13 @@ bool AppInit2()
exit(0);
}

filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat";
if (filesystem::exists(pathBootstrap)) {
boost::filesystem::path pathBootstrap = GetDataDir() / "bootstrap.dat";
if (boost::filesystem::exists(pathBootstrap)) {
uiInterface.InitMessage(_("Importing bootstrap blockchain data file."));

FILE *file = fopen(pathBootstrap.string().c_str(), "rb");
if (file) {
filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old";
boost::filesystem::path pathBootstrapOld = GetDataDir() / "bootstrap.dat.old";
LoadExternalBlockFile(file);
RenameOver(pathBootstrap, pathBootstrapOld);
}
Expand Down
7 changes: 5 additions & 2 deletions ecoin/src/json/json_spirit_reader_template.h
@@ -1,10 +1,13 @@
// ECOin - Copyright (c) - 2014/2021 - GPLv3 - epsylon@riseup.net (https://03c8.net)
// ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

#ifndef JSON_SPIRIT_READER_TEMPLATE
#define JSON_SPIRIT_READER_TEMPLATE

#include "json_spirit_value.h"
#include "json_spirit_error_position.h"
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
using namespace boost::placeholders;

#include <boost/function.hpp>
#include <boost/version.hpp>

Expand Down
4 changes: 2 additions & 2 deletions ecoin/src/key.cpp
@@ -1,4 +1,4 @@
// ECOin - Copyright (c) - 2014/2022 - GPLv3 - epsylon@riseup.net (https://03c8.net)
// ECOin - Copyright (c) - 2014/2024 - GPLv3 - epsylon@riseup.net (https://03c8.net)

#include <map>

Expand Down Expand Up @@ -96,7 +96,7 @@ int ECDSA_SIG_recover_key_GFp(EC_KEY *eckey, ECDSA_SIG *ecsig, const unsigned ch
if (!BN_bin2bn(msg, msglen, e)) { ret=-1; goto err; }
if (8*msglen > n) BN_rshift(e, e, 8-(n & 7));
zero = BN_CTX_get(ctx);
if (!BN_zero(zero)) { ret=-1; goto err; }
BN_zero(zero); // Set the value of 'zero' to zero
if (!BN_mod_sub(e, zero, e, order, ctx)) { ret=-1; goto err; }
rr = BN_CTX_get(ctx);
ECDSA_SIG_get0(ecsig, (const BIGNUM **)&s, 0);
Expand Down

0 comments on commit f9be9e7

Please sign in to comment.