Skip to content

Commit

Permalink
Clean code and update libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
harrywong committed Dec 6, 2018
1 parent 950732e commit da72d59
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 41 deletions.
72 changes: 36 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ option(ENABLE_FULL_STATIC_BUILD "Enable full static build" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/CMakeModules")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

include( GNUInstallDirs )
include( VersionMacros )
include( SetupTargetMacros )
include( InstallDirectoryPermissions )
include(GNUInstallDirs)
include(VersionMacros)
include(SetupTargetMacros)
include(InstallDirectoryPermissions)

set(BLOCKCHAIN_NAME "EVT")

Expand Down Expand Up @@ -77,43 +77,43 @@ endif()

# add defaults for openssl
if("${OPENSSL_ROOT_DIR}" STREQUAL "")
if(NOT "$ENV{OPENSSL_ROOT_DIR}" STREQUAL "")
set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT_DIR})
set(OPENSSL_INCLUDE_DIR ${OPENSSL_ROOT_DIR}/include)
elseif (APPLE)
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
set(OPENSSL_INCLUDE_DIR "/usr/local/opt/openssl/include")
elseif(UNIX AND NOT APPLE)
set(OPENSSL_ROOT_DIR "/usr/include/openssl")
set(OPENSSL_INCLUDE_DIR "/usr/include/openssl/include")
else()
message(FATAL_ERROR "openssl not found and don't know where to look, please specify OPENSSL_ROOT_DIR")
endif()
if(NOT "$ENV{OPENSSL_ROOT_DIR}" STREQUAL "")
set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT_DIR})
set(OPENSSL_INCLUDE_DIR ${OPENSSL_ROOT_DIR}/include)
elseif (APPLE)
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
set(OPENSSL_INCLUDE_DIR "/usr/local/opt/openssl/include")
elseif(UNIX AND NOT APPLE)
set(OPENSSL_ROOT_DIR "/usr/include/openssl")
set(OPENSSL_INCLUDE_DIR "/usr/include/openssl/include")
else()
message(FATAL_ERROR "openssl not found and don't know where to look, please specify OPENSSL_ROOT_DIR")
endif()
endif()

if("${OPENSSL_LIBRARIES}" STREQUAL "")
if (NOT "$ENV{OPENSSL_LIBRARIES}" STREQUAL "")
set(OPENSSL_LIBRARIES $ENV{OPENSSL_LIBRARIES})
elseif (APPLE)
set(OPENSSL_LIBRARIES "/usr/local/opt/openssl/lib")
elseif(UNIX AND NOT APPLE)
set(OPENSSL_LIBRARIES "/usr/include/openssl")
else()
message(FATAL_ERROR "openssl libs not found and don't know where to look, please specify OPENSSL_LIBRARIES")
endif()
if(NOT "$ENV{OPENSSL_LIBRARIES}" STREQUAL "")
set(OPENSSL_LIBRARIES $ENV{OPENSSL_LIBRARIES})
elseif (APPLE)
set(OPENSSL_LIBRARIES "/usr/local/opt/openssl/lib")
elseif(UNIX AND NOT APPLE)
set(OPENSSL_LIBRARIES "/usr/include/openssl")
else()
message(FATAL_ERROR "openssl libs not found and don't know where to look, please specify OPENSSL_LIBRARIES")
endif()
endif()

if(UNIX)
if(APPLE)
set(whole_archive_flag "-force_load")
set(no_whole_archive_flag "")
else()
if(APPLE)
set(whole_archive_flag "-force_load")
set(no_whole_archive_flag "")
else()
set(whole_archive_flag "--whole-archive")
set(no_whole_archive_flag "--no-whole-archive")
endif()
else()
set(whole_archive_flag "--whole-archive")
set(no_whole_archive_flag "--no-whole-archive")
endif()
else()
set(whole_archive_flag "--whole-archive")
set(no_whole_archive_flag "--no-whole-archive")
endif()

if(ENABLE_FULL_STATIC_BUILD)
Expand Down Expand Up @@ -203,9 +203,9 @@ if(ENABLE_TESTING)
enable_testing()
endif()

add_subdirectory( libraries )
add_subdirectory( plugins )
add_subdirectory( programs )
add_subdirectory(libraries)
add_subdirectory(plugins)
add_subdirectory(programs)

if(ENABLE_BIND_LIBRARIES)
add_subdirectory(bind)
Expand Down
3 changes: 2 additions & 1 deletion Docker/mainnet/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ RUN git clone -b $branch https://github.com/everitoken/evt.git --recursive \
&& cd evt && echo "$branch:$(git rev-parse HEAD)" > /etc/evt-version \
&& cmake -H. -B"/tmp/build" -G"Ninja" -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/tmp/build -DSecp256k1_ROOT_DIR=/usr/local -DENABLE_MONGODB_SUPPORT=OFF \
-DENABLE_POSTGRES_SUPPORT=ON -DENABLE_BREAKPAD_SUPPORT=ON -DENABLE_MAINNET_BUILD=ON -DEVT_ROOT_KEY=$rootkey
-DENABLE_POSTGRES_SUPPORT=ON -DENABLE_BREAKPAD_SUPPORT=ON -DENABLE_MAINNET_BUILD=ON \
-DENABLE_BUILD_LTO=ON -DEVT_ROOT_KEY=$rootkey
RUN ninja -C /tmp/build -j $bjobs evtd evtwd evtc && ninja -C /tmp/build install

RUN echo 'APT::Install-Recommends 0;' >> /etc/apt/apt.conf.d/01norecommends \
Expand Down
2 changes: 1 addition & 1 deletion libraries/chainbase
2 changes: 1 addition & 1 deletion libraries/rocksdb
Submodule rocksdb updated 532 files
5 changes: 3 additions & 2 deletions plugins/postgres_plugin/postgres_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ using boost::condition_variable_any;
#include <fc/io/json.hpp>
#include <fc/variant.hpp>
#include <fc/time.hpp>
#include <fmt/format.h>

#include <evt/chain/config.hpp>
#include <evt/chain/exceptions.hpp>
Expand Down Expand Up @@ -178,10 +179,10 @@ postgres_plugin_impl::consume_queues() {

// warn if queue size greater than 75%
if(bqueue.size() > (queue_size_ * 0.75)) {
wlog("queue size: ${q}, head block num: ${b}", ("q", bqueue.size())("b",std::get<BlockPtr>(bqueue.front())->block_num));
wlog("queue size: ${q}, head block num: ${b}", ("q", fmt::format("{:n}",bqueue.size()))("b",fmt::format("{:n}",std::get<BlockPtr>(bqueue.front())->block_num)));
}
else if(done_) {
ilog("draining queue, size: ${q}", ("q", bqueue.size()));
ilog("draining queue, size: ${q}", ("q", fmt::format("{:n}",bqueue.size())));
break;
}

Expand Down

0 comments on commit da72d59

Please sign in to comment.