Permalink
Browse files

Initial commit

  • Loading branch information...
nathanhourt committed Apr 5, 2017
0 parents commit e03269e8ed2a2544f85573f0a8028724b8a57e4c
Showing with 77,325 additions and 0 deletions.
  1. +46 −0 .gitignore
  2. +10 −0 .gitmodules
  3. +203 −0 CMakeLists.txt
  4. +51 −0 CMakeModules/FindGperftools.cmake
  5. +4,008 −0 CMakeModules/cotire.cmake
  6. +2,362 −0 Doxyfile
  7. +23 −0 HEADER
  8. +21 −0 LICENSE.txt
  9. +96 −0 genesis.json
  10. +10 −0 libraries/CMakeLists.txt
  11. +29 −0 libraries/app/CMakeLists.txt
  12. +214 −0 libraries/app/api.cpp
  13. +1,081 −0 libraries/app/application.cpp
  14. +231 −0 libraries/app/include/eos/app/api.hpp
  15. +56 −0 libraries/app/include/eos/app/api_access.hpp
  16. +99 −0 libraries/app/include/eos/app/application.hpp
  17. +137 −0 libraries/app/include/eos/app/plugin.hpp
  18. +74 −0 libraries/app/plugin.cpp
  19. +62 −0 libraries/chain/CMakeLists.txt
  20. +281 −0 libraries/chain/block_database.cpp
  21. +32 −0 libraries/chain/database.cpp
  22. +604 −0 libraries/chain/db_block.cpp
  23. +51 −0 libraries/chain/db_debug.cpp
  24. +85 −0 libraries/chain/db_getter.cpp
  25. +140 −0 libraries/chain/db_init.cpp
  26. +88 −0 libraries/chain/db_maint.cpp
  27. +186 −0 libraries/chain/db_management.cpp
  28. +89 −0 libraries/chain/db_producer_schedule.cpp
  29. +163 −0 libraries/chain/db_update.cpp
  30. +42 −0 libraries/chain/evaluator.cpp
  31. +252 −0 libraries/chain/fork_database.cpp
  32. +37 −0 libraries/chain/genesis_state.cpp
  33. +61 −0 libraries/chain/get_config.cpp
  34. +64 −0 libraries/chain/include/eos/chain/account_object.hpp
  35. +50 −0 libraries/chain/include/eos/chain/block_database.hpp
  36. +60 −0 libraries/chain/include/eos/chain/block_summary_object.hpp
  37. +56 −0 libraries/chain/include/eos/chain/chain_property_object.hpp
  38. +85 −0 libraries/chain/include/eos/chain/config.hpp
  39. +346 −0 libraries/chain/include/eos/chain/database.hpp
  40. +138 −0 libraries/chain/include/eos/chain/db_with.hpp
  41. +97 −0 libraries/chain/include/eos/chain/evaluator.hpp
  42. +190 −0 libraries/chain/include/eos/chain/exceptions.hpp
  43. +124 −0 libraries/chain/include/eos/chain/fork_database.hpp
  44. +90 −0 libraries/chain/include/eos/chain/genesis_state.hpp
  45. +32 −0 libraries/chain/include/eos/chain/get_config.hpp
  46. +164 −0 libraries/chain/include/eos/chain/global_property_object.hpp
  47. +43 −0 libraries/chain/include/eos/chain/immutable_chain_parameters.hpp
  48. +44 −0 libraries/chain/include/eos/chain/internal_exceptions.hpp
  49. +39 −0 libraries/chain/include/eos/chain/multi_index_includes.hpp
  50. +48 −0 libraries/chain/include/eos/chain/node_property_object.hpp
  51. +65 −0 libraries/chain/include/eos/chain/operation_history_object.hpp
  52. +69 −0 libraries/chain/include/eos/chain/producer_object.hpp
  53. +10 −0 libraries/chain/include/eos/chain/protocol/README.md
  54. +88 −0 libraries/chain/include/eos/chain/protocol/base.hpp
  55. +61 −0 libraries/chain/include/eos/chain/protocol/block.hpp
  56. +56 −0 libraries/chain/include/eos/chain/protocol/chain_parameters.hpp
  57. +25 −0 libraries/chain/include/eos/chain/protocol/config.hpp
  58. +212 −0 libraries/chain/include/eos/chain/protocol/ext.hpp
  59. +44 −0 libraries/chain/include/eos/chain/protocol/operations.hpp
  60. +25 −0 libraries/chain/include/eos/chain/protocol/protocol.hpp
  61. +127 −0 libraries/chain/include/eos/chain/protocol/transaction.hpp
  62. +227 −0 libraries/chain/include/eos/chain/protocol/types.hpp
  63. +48 −0 libraries/chain/include/eos/chain/transaction_evaluation_state.hpp
  64. +70 −0 libraries/chain/include/eos/chain/transaction_object.hpp
  65. +92 −0 libraries/chain/protocol/block.cpp
  66. +43 −0 libraries/chain/protocol/operations.cpp
  67. +109 −0 libraries/chain/protocol/transaction.cpp
  68. +262 −0 libraries/chain/protocol/types.cpp
  69. +1 −0 libraries/chainbase
  70. +28 −0 libraries/deterministic_openssl_rand/CMakeLists.txt
  71. +104 −0 libraries/deterministic_openssl_rand/deterministic_openssl_rand.cpp
  72. +31 −0 libraries/deterministic_openssl_rand/include/eos/utilities/deterministic_openssl_rand.hpp
  73. +59 −0 libraries/egenesis/CMakeLists.txt
  74. +42 −0 libraries/egenesis/egenesis_brief.cpp.tmpl
  75. +54 −0 libraries/egenesis/egenesis_full.cpp.tmpl
  76. +46 −0 libraries/egenesis/egenesis_none.cpp
  77. +287 −0 libraries/egenesis/embed_genesis.cpp
  78. +51 −0 libraries/egenesis/include/eos/egenesis/egenesis.hpp
  79. +1 −0 libraries/fc
  80. +35 −0 libraries/net/CMakeLists.txt
  81. +50 −0 libraries/net/core_messages.cpp
  82. +105 −0 libraries/net/include/eos/net/config.hpp
  83. +525 −0 libraries/net/include/eos/net/core_messages.hpp
  84. +38 −0 libraries/net/include/eos/net/exceptions.hpp
  85. +117 −0 libraries/net/include/eos/net/message.hpp
  86. +69 −0 libraries/net/include/eos/net/message_oriented_connection.hpp
  87. +328 −0 libraries/net/include/eos/net/node.hpp
  88. +342 −0 libraries/net/include/eos/net/peer_connection.hpp
  89. +122 −0 libraries/net/include/eos/net/peer_database.hpp
  90. +79 −0 libraries/net/include/eos/net/stcp_socket.hpp
  91. +412 −0 libraries/net/message_oriented_connection.cpp
  92. +5,474 −0 libraries/net/node.cpp
  93. +516 −0 libraries/net/peer_connection.cpp
  94. +278 −0 libraries/net/peer_database.cpp
  95. +187 −0 libraries/net/stcp_socket.cpp
  96. +2 −0 libraries/plugins/CMakeLists.txt
  97. +18 −0 libraries/plugins/debug_producer/CMakeLists.txt
  98. +158 −0 libraries/plugins/debug_producer/debug_api.cpp
  99. +137 −0 libraries/plugins/debug_producer/debug_producer.cpp
  100. +96 −0 libraries/plugins/debug_producer/include/eos/debug_producer/debug_api.hpp
  101. +67 −0 libraries/plugins/debug_producer/include/eos/debug_producer/debug_producer.hpp
  102. +17 −0 libraries/plugins/producer/CMakeLists.txt
  103. +91 −0 libraries/plugins/producer/include/eos/producer/producer.hpp
  104. +290 −0 libraries/plugins/producer/producer.cpp
  105. +40 −0 libraries/utilities/CMakeLists.txt
  106. +14 −0 libraries/utilities/git_revision.cpp.in
  107. +33 −0 libraries/utilities/include/eos/utilities/git_revision.hpp
  108. +36 −0 libraries/utilities/include/eos/utilities/key_conversion.hpp
  109. +58 −0 libraries/utilities/include/eos/utilities/padding_ostream.hpp
  110. +32 −0 libraries/utilities/include/eos/utilities/string_escape.hpp
  111. +34 −0 libraries/utilities/include/eos/utilities/tempdir.hpp
  112. +32 −0 libraries/utilities/include/eos/utilities/words.hpp
  113. +72 −0 libraries/utilities/key_conversion.cpp
  114. +73 −0 libraries/utilities/string_escape.cpp
  115. +39 −0 libraries/utilities/tempdir.cpp
  116. +49,783 −0 libraries/utilities/words.cpp
  117. +1 −0 libraries/wren
  118. +12 −0 libraries/wrenbase/CMakeLists.txt
  119. +67 −0 libraries/wrenbase/Int.cpp
  120. +63 −0 libraries/wrenbase/include/wrenbase/Int.hpp
  121. +4 −0 programs/CMakeLists.txt
  122. +17 −0 programs/build_helpers/CMakeLists.txt
  123. +78 −0 programs/build_helpers/cat-parts.cpp
  124. +134 −0 programs/build_helpers/check_reflect.py
  125. +207 −0 programs/build_helpers/member_enumerator.cpp
  126. +21 −0 programs/debug_node/CMakeLists.txt
  127. +104 −0 programs/debug_node/README.md
  128. +303 −0 programs/debug_node/main.cpp
  129. +22 −0 programs/producer_node/CMakeLists.txt
  130. +303 −0 programs/producer_node/main.cpp
  131. +23 −0 programs/producer_node/saltpass.py
  132. +15 −0 programs/size_checker/CMakeLists.txt
  133. +114 −0 programs/size_checker/main.cpp
  134. +11 −0 tests/CMakeLists.txt
  135. +186 −0 tests/common/database_fixture.cpp
  136. +335 −0 tests/common/database_fixture.hpp
  137. +475 −0 tests/tests/block_tests.cpp
  138. +60 −0 tests/tests/database_tests.cpp
  139. +40 −0 tests/tests/main.cpp
@@ -0,0 +1,46 @@
*.a
*.sw*
*.cmake
CMakeCache.txt
CMakeFiles
Makefile
compile_commands.json
moc_*
*.moc
genesis.json
hardfork.hpp
libraries/utilities/git_revision.cpp
libraries/wallet/Doxyfile
libraries/wallet/api_documentation.cpp
libraries/wallet/doxygen
programs/cli_wallet/cli_wallet
programs/js_operation_serializer/js_operation_serializer
programs/witness_node/witness_node
tests/app_test
tests/chain_bench
tests/chain_test
tests/intense_test
tests/performance_test
doxygen
wallet.json
witness_node_data_dir
*.wallet
programs/witness_node/object_database/*
object_database/*
*.pyc
*.pyo
build/*
build-debug/*
@@ -0,0 +1,10 @@
[submodule "libraries/fc"]
path = libraries/fc
url = https://github.com/bitshares/bitshares-fc.git
ignore = dirty
[submodule "libraries/chainbase"]
path = libraries/chainbase
url = https://github.com/bytemaster/chainbase
[submodule "libraries/wren"]
path = libraries/wren
url = https://github.com/bytemaster/wren.git
@@ -0,0 +1,203 @@
# Defines Eos library target.
project( Eos )
cmake_minimum_required( VERSION 2.8.12 )
set( BLOCKCHAIN_NAME "BitShares" )
set( CLI_CLIENT_EXECUTABLE_NAME eos_client )
set( GUI_CLIENT_EXECUTABLE_NAME eos )
set( CUSTOM_URL_SCHEME "gcs" )
set( INSTALLER_APP_ID "68ad7005-8eee-49c9-95ce-9eed97e5b347" )
# http://stackoverflow.com/a/18369825
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "GCC version must be at least 4.8!")
endif()
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.3)
message(FATAL_ERROR "Clang version must be at least 3.3!")
endif()
endif()
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules" )
set(CMAKE_EXPORT_COMPILE_COMMANDS "ON")
set(EOS_EGENESIS_JSON "${CMAKE_CURRENT_SOURCE_DIR}/genesis.json" )
#set (ENABLE_INSTALLER 1)
#set (USE_PCH 1)
if (USE_PCH)
include (cotire)
endif(USE_PCH)
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/CMakeModules" )
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/libraries/fc/GitVersionGen" )
include( GetGitRevisionDescription )
get_git_head_revision( GIT_REFSPEC GIT_SHA2 )
SET(BOOST_COMPONENTS)
LIST(APPEND BOOST_COMPONENTS thread
date_time
system
filesystem
program_options
signals
serialization
chrono
unit_test_framework
context
locale)
SET( Boost_USE_STATIC_LIBS ON CACHE STRING "ON or OFF" )
IF( WIN32 )
SET(BOOST_ROOT $ENV{BOOST_ROOT})
set(Boost_USE_MULTITHREADED ON)
set(BOOST_ALL_DYN_LINK OFF) # force dynamic linking for all libraries
ENDIF(WIN32)
FIND_PACKAGE(Boost 1.57 REQUIRED COMPONENTS ${BOOST_COMPONENTS})
# For Boost 1.53 on windows, coroutine was not in BOOST_LIBRARYDIR and do not need it to build, but if boost versin >= 1.54, find coroutine otherwise will cause link errors
IF(NOT "${Boost_VERSION}" MATCHES "1.53(.*)")
SET(BOOST_LIBRARIES_TEMP ${Boost_LIBRARIES})
FIND_PACKAGE(Boost 1.54 REQUIRED COMPONENTS coroutine)
LIST(APPEND BOOST_COMPONENTS coroutine)
SET(Boost_LIBRARIES ${BOOST_LIBRARIES_TEMP} ${Boost_LIBRARIES})
ENDIF()
if( WIN32 )
message( STATUS "Configuring BitShares on WIN32")
set( DB_VERSION 60 )
set( BDB_STATIC_LIBS 1 )
set( ZLIB_LIBRARIES "" )
SET( DEFAULT_EXECUTABLE_INSTALL_DIR bin/ )
set(CRYPTO_LIB)
#looks like this flag can have different default on some machines.
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
# Probably cmake has a bug and vcxproj generated for executable in Debug conf. has disabled debug info
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /DEBUG")
# On windows tcl should be installed to the directory pointed by setenv.bat script
SET(TCL_INCLUDE_PATH $ENV{TCL_ROOT}/include)
MESSAGE(STATUS "tcl INCLUDE PATH: ${TCL_INCLUDE_PATH}")
FIND_PACKAGE(TCL)
MESSAGE(STATUS "tcl_library: ${TCL_LIBRARY}")
SET(TCL_LIBS "optimized;${TCL_LIBRARY};debug;")
get_filename_component(TCL_LIB_PATH "${TCL_LIBRARY}" PATH)
get_filename_component(TCL_LIB_NAME "${TCL_LIBRARY}" NAME_WE)
get_filename_component(TCL_LIB_EXT "${TCL_LIBRARY}" EXT)
SET(TCL_LIBS "${TCL_LIBS}${TCL_LIB_PATH}/${TCL_LIB_NAME}g${TCL_LIB_EXT}")
SET(TCL_LIBRARY ${TCL_LIBS})
else( WIN32 ) # Apple AND Linux
find_library(READLINE_LIBRARIES NAMES readline)
find_path(READLINE_INCLUDE_DIR readline/readline.h)
#if(NOT READLINE_INCLUDE_DIR OR NOT READLINE_LIBRARIES)
# MESSAGE(FATAL_ERROR "Could not find lib readline.")
#endif()
if( APPLE )
# Apple Specific Options Here
message( STATUS "Configuring BitShares on OS X" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -stdlib=libc++ -Wall" )
else( APPLE )
# Linux Specific Options Here
message( STATUS "Configuring BitShares on Linux" )
set( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -Wall" )
set( rt_library rt )
set( pthread_library pthread)
if ( NOT DEFINED crypto_library )
# I'm not sure why this is here, I guess someone has openssl and can't detect it with find_package()?
# if you have a normal install, you can define crypto_library to the empty string to avoid a build error
set( crypto_library crypto)
endif ()
if ( FULL_STATIC_BUILD )
set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc")
endif ( FULL_STATIC_BUILD )
endif( APPLE )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-builtin-memcmp" )
endif()
if( "${CMAKE_GENERATOR}" STREQUAL "Ninja" )
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics" )
endif()
endif()
# based on http://www.delorie.com/gnu/docs/gdb/gdb_70.html
# uncomment this line to tell GDB about macros (slows compile times)
# set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -gdwarf-2 -g3" )
endif( WIN32 )
set(ENABLE_COVERAGE_TESTING FALSE CACHE BOOL "Build BitShares for code coverage analysis")
if(ENABLE_COVERAGE_TESTING)
SET(CMAKE_CXX_FLAGS "--coverage ${CMAKE_CXX_FLAGS}")
endif()
add_subdirectory( libraries )
add_subdirectory( programs )
add_subdirectory( tests )
if (ENABLE_INSTALLER)
set(VERSION_MAJOR 0)
set(VERSION_MINOR 1)
set(VERSION_PATCH 0)
include(InstallRequiredSystemLibraries)
set(CPACK_OUTPUT_FILE_PREFIX ${CMAKE_BINARY_DIR}/packages)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/install)
SET(CPACK_PACKAGE_DIRECTORY "${CMAKE_INSTALL_PREFIX}")
set(CPACK_PACKAGE_NAME "eos")
set(CPACK_PACKAGE_VENDOR "EOSIO")
set(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
set(CPACK_PACKAGE_DESCRIPTION "A client for the BitShares network")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A client for the BitShares network")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.md")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "BitShares ${CPACK_PACKAGE_VERSION}")
if(WIN32)
SET(CPACK_GENERATOR "ZIP;NSIS")
set(CPACK_PACKAGE_NAME "BitShares") # override above
set(CPACK_NSIS_EXECUTABLES_DIRECTORY .)
set(CPACK_NSIS_PACKAGE_NAME "BitShares v${CPACK_PACKAGE_VERSION}")
set(CPACK_NSIS_DISPLAY_NAME "${CPACK_NSIS_PACKAGE_NAME}")
set(CPACK_NSIS_DEFINES " !define MUI_STARTMENUPAGE_DEFAULTFOLDER \\\"BitShares\\\"")
# it seems like windows zip files usually don't have a single directory inside them, unix tgz frequently do
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0)
endif(WIN32)
if(APPLE)
set(CPACK_GENERATOR "DragNDrop")
endif()
if(LINUX)
# Linux gets a .tgz
SET(CPACK_GENERATOR "TGZ")
SET(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 1)
endif(LINUX)
include(CPack)
endif(ENABLE_INSTALLER)
@@ -0,0 +1,51 @@
# Tries to find Gperftools.
#
# Usage of this module as follows:
#
# find_package(Gperftools)
#
# Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package:
#
# Gperftools_ROOT_DIR Set this variable to the root installation of
# Gperftools if the module has problems finding
# the proper installation path.
#
# Variables defined by this module:
#
# GPERFTOOLS_FOUND System has Gperftools libs/headers
# GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler)
# GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers
find_library(GPERFTOOLS_TCMALLOC
NAMES tcmalloc
HINTS ${Gperftools_ROOT_DIR}/lib)
find_library(GPERFTOOLS_PROFILER
NAMES profiler
HINTS ${Gperftools_ROOT_DIR}/lib)
find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER
NAMES tcmalloc_and_profiler
HINTS ${Gperftools_ROOT_DIR}/lib)
find_path(GPERFTOOLS_INCLUDE_DIR
NAMES gperftools/heap-profiler.h
HINTS ${Gperftools_ROOT_DIR}/include)
set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Gperftools
DEFAULT_MSG
GPERFTOOLS_LIBRARIES
GPERFTOOLS_INCLUDE_DIR)
mark_as_advanced(
Gperftools_ROOT_DIR
GPERFTOOLS_TCMALLOC
GPERFTOOLS_PROFILER
GPERFTOOLS_TCMALLOC_AND_PROFILER
GPERFTOOLS_LIBRARIES
GPERFTOOLS_INCLUDE_DIR)
Oops, something went wrong.

0 comments on commit e03269e

Please sign in to comment.