Gav Wood
10 years ago
216 changed files with 2454 additions and 22433 deletions
@ -1,101 +1,53 @@ |
|||||
|
cmake_policy(SET CMP0015 NEW) |
||||
|
# let cmake autolink dependencies on windows |
||||
|
cmake_policy(SET CMP0020 NEW) |
||||
|
# this policy was introduced in cmake 3.0 |
||||
|
# remove if, once 3.0 will be used on unix |
||||
|
if (${CMAKE_MAJOR_VERSION} GREATER 2) |
||||
|
cmake_policy(SET CMP0043 OLD) |
||||
|
endif() |
||||
|
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
||||
aux_source_directory(. SRC_LIST) |
aux_source_directory(. SRC_LIST) |
||||
include_directories(..) |
|
||||
|
|
||||
if (APPLE) |
|
||||
# Add homebrew path for qt5 |
|
||||
set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) |
|
||||
include_directories(/usr/local/opt/qt5/include /usr/local/include) |
|
||||
elseif ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) |
|
||||
include_directories(/usr/x86_64-w64-mingw32/include /usr/x86_64-w64-mingw32/include/QtCore /usr/x86_64-w64-mingw32/include/QtGui /usr/x86_64-w64-mingw32/include/QtQuick /usr/x86_64-w64-mingw32/include/QtQml /usr/x86_64-w64-mingw32/include/QtNetwork /usr/x86_64-w64-mingw32/include/QtWidgets /usr/x86_64-w64-mingw32/include/QtWebKit /usr/x86_64-w64-mingw32/include/QtWebKitWidgets) |
|
||||
elseif (UNIX) |
|
||||
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") |
|
||||
endif () |
|
||||
|
|
||||
find_package(Qt5Core REQUIRED) |
include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) |
||||
find_package(Qt5Gui REQUIRED) |
include_directories(..) |
||||
find_package(Qt5Quick REQUIRED) |
|
||||
find_package(Qt5Qml REQUIRED) |
|
||||
find_package(Qt5Network REQUIRED) |
|
||||
find_package(Qt5Widgets REQUIRED) |
|
||||
find_package(Qt5WebKit REQUIRED) |
|
||||
find_package(Qt5WebKitWidgets REQUIRED) |
|
||||
|
|
||||
qt5_wrap_ui(ui_Main.h Main.ui) |
qt5_wrap_ui(ui_Main.h Main.ui) |
||||
|
|
||||
# Set name of binary and add_executable() |
|
||||
file(GLOB HEADERS "*.h") |
file(GLOB HEADERS "*.h") |
||||
if (APPLE) |
|
||||
set(EXECUTEABLE AlethZero) |
|
||||
set(BIN_INSTALL_DIR ".") |
|
||||
set(DOC_INSTALL_DIR ".") |
|
||||
|
|
||||
set(PROJECT_VERSION "${ETH_VERSION}") |
|
||||
set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") |
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") |
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTEABLE}) |
|
||||
set(MACOSX_BUNDLE_ICON_FILE alethzero) |
|
||||
include(BundleUtilities) |
|
||||
|
|
||||
add_executable(${EXECUTEABLE} MACOSX_BUNDLE alethzero.icns Main.ui ${SRC_LIST} ${HEADERS}) |
|
||||
set_target_properties(${EXECUTEABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") |
|
||||
SET_SOURCE_FILES_PROPERTIES(${EXECUTEABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) |
|
||||
SET_SOURCE_FILES_PROPERTIES(${MACOSX_BUNDLE_ICON_FILE}.icns PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") |
|
||||
|
|
||||
else () |
|
||||
set(EXECUTEABLE alethzero) |
|
||||
add_executable(${EXECUTEABLE} Main.ui ${SRC_LIST} ${HEADERS}) |
|
||||
endif () |
|
||||
|
|
||||
qt5_use_modules(${EXECUTEABLE} Core)# Gui Widgets Network WebKit WebKitWidgets) |
|
||||
target_link_libraries(${EXECUTEABLE} webthree qethereum ethereum evm ethcore devcrypto secp256k1 gmp ${CRYPTOPP_LS} serpent lll solidity evmcore devcore web3jsonrpc jsqrc) |
|
||||
|
|
||||
if (APPLE) |
if (APPLE) |
||||
# First have qt5 install plugins and frameworks |
set(EXECUTABLE AlethZero) |
||||
add_custom_command(TARGET ${EXECUTEABLE} POST_BUILD |
|
||||
COMMAND /usr/local/opt/qt5/bin/macdeployqt ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTEABLE}.app |
|
||||
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) |
|
||||
|
|
||||
# This tool and next will inspect linked libraries in order to determine which dependencies are required |
|
||||
if (${CMAKE_CFG_INTDIR} STREQUAL ".") |
|
||||
set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTEABLE}.app") |
|
||||
else () |
else () |
||||
set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTEABLE}.app") |
set(EXECUTABLE alethzero) |
||||
endif () |
|
||||
install(CODE " |
|
||||
include(BundleUtilities) |
|
||||
set(BU_CHMOD_BUNDLE_ITEMS 1) |
|
||||
fixup_bundle(\"${APP_BUNDLE_PATH}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\") |
|
||||
" COMPONENT RUNTIME ) |
|
||||
# Cleanup duplicate libs from macdeployqt |
|
||||
install(CODE " |
|
||||
file(GLOB LINGER_RM \"${APP_BUNDLE_PATH}/Contents/Frameworks/*.dylib\") |
|
||||
if (LINGER_RM) |
|
||||
file(REMOVE \${LINGER_RM}) |
|
||||
endif () |
|
||||
") |
|
||||
elseif ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport -static-libgcc -static-libstdc++ -static") |
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s -Wl,-subsystem,windows -mthreads -L/usr/x86_64-w64-mingw32/plugins/platforms") |
|
||||
target_link_libraries(${EXECUTEABLE} gcc) |
|
||||
target_link_libraries(${EXECUTEABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport opengl32 gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32) |
|
||||
target_link_libraries(${EXECUTEABLE} boost_system-mt-s) |
|
||||
target_link_libraries(${EXECUTEABLE} boost_filesystem-mt-s) |
|
||||
target_link_libraries(${EXECUTEABLE} boost_thread_win32-mt-s) |
|
||||
target_link_libraries(${EXECUTEABLE} crypt32) |
|
||||
target_link_libraries(${EXECUTEABLE} Qt5PlatformSupport) |
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) |
|
||||
elseif (UNIX) |
|
||||
else () |
|
||||
target_link_libraries(${EXECUTEABLE} boost_system) |
|
||||
target_link_libraries(${EXECUTEABLE} boost_filesystem) |
|
||||
find_package(Threads REQUIRED) |
|
||||
target_link_libraries(${EXECUTEABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
install( TARGETS ${EXECUTEABLE} RUNTIME DESTINATION bin ) |
|
||||
endif () |
endif () |
||||
|
|
||||
|
# eth_add_executable is defined in cmake/EthExecutableHelper.cmake |
||||
|
eth_add_executable(${EXECUTABLE} |
||||
|
ICON alethzero |
||||
|
UI_RESOURCES alethzero.icns Main.ui |
||||
|
) |
||||
|
|
||||
|
add_dependencies(${EXECUTABLE} BuildInfo.h) |
||||
|
|
||||
|
target_link_libraries(${EXECUTABLE} Qt5::Core) |
||||
|
target_link_libraries(${EXECUTABLE} ${JSONCPP_LIBRARIES}) |
||||
|
target_link_libraries(${EXECUTABLE} webthree) |
||||
|
target_link_libraries(${EXECUTABLE} qethereum) |
||||
|
target_link_libraries(${EXECUTABLE} ethereum) |
||||
|
target_link_libraries(${EXECUTABLE} evm) |
||||
|
target_link_libraries(${EXECUTABLE} ethcore) |
||||
|
target_link_libraries(${EXECUTABLE} devcrypto) |
||||
|
target_link_libraries(${EXECUTABLE} secp256k1) |
||||
|
target_link_libraries(${EXECUTABLE} serpent) |
||||
|
target_link_libraries(${EXECUTABLE} lll) |
||||
|
target_link_libraries(${EXECUTABLE} solidity) |
||||
|
target_link_libraries(${EXECUTABLE} evmcore) |
||||
|
target_link_libraries(${EXECUTABLE} devcore) |
||||
|
target_link_libraries(${EXECUTABLE} web3jsonrpc) |
||||
|
target_link_libraries(${EXECUTABLE} jsqrc) |
||||
|
|
||||
|
# eth_install_executable is defined in cmake/EthExecutableHelper.cmake |
||||
|
eth_install_executable(${EXECUTABLE}) |
||||
|
|
||||
|
@ -0,0 +1,27 @@ |
|||||
|
#!/usr/bin/python |
||||
|
# cpp-ethereum build script |
||||
|
# to be used from CI server, or to build locally |
||||
|
# uses python instead of bash script for better cross-platform support |
||||
|
|
||||
|
# TODO Initial version. Needs much more improvements |
||||
|
|
||||
|
import argparse |
||||
|
import os |
||||
|
import subprocess |
||||
|
|
||||
|
def build_dependencies(): |
||||
|
if os.path.exists("extdep"): |
||||
|
os.chdir("extdep") |
||||
|
if not os.path.exists("build"): |
||||
|
os.makedirs("build") |
||||
|
os.chdir("build") |
||||
|
subprocess.check_call(["cmake", ".."]) |
||||
|
subprocess.check_call("make") |
||||
|
|
||||
|
parser = argparse.ArgumentParser() |
||||
|
parser.add_argument("cmd", help="what to build") |
||||
|
|
||||
|
args = parser.parse_args() |
||||
|
if args.cmd == "dep": |
||||
|
build_dependencies() |
||||
|
|
@ -0,0 +1,137 @@ |
|||||
|
# all dependencies that are not directly included in the cpp-ethereum distribution are defined here |
||||
|
# for this to work, download the dependency via the cmake script in extdep or install them manually! |
||||
|
|
||||
|
# by defining this variable, cmake will look for dependencies first in our own repository before looking in system paths like /usr/local/ ... |
||||
|
# this must be set to point to the same directory as $ETH_DEPENDENCY_INSTALL_DIR in /extdep directory |
||||
|
string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name) |
||||
|
set (ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extdep/install/${_system_name}") |
||||
|
set (CMAKE_PREFIX_PATH ${ETH_DEPENDENCY_INSTALL_DIR}) |
||||
|
|
||||
|
# Qt5 requires opengl |
||||
|
# TODO use proper version of windows SDK (32 vs 64) |
||||
|
# TODO make it possible to use older versions of windows SDK (7.0+ should also work) |
||||
|
# TODO it windows SDK is NOT FOUND, throw ERROR |
||||
|
if (WIN32) |
||||
|
set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "C:/Program Files/Windows Kits/8.1/Lib/winv6.3/um/x86") |
||||
|
message(" - Found windows 8.1 SDK") |
||||
|
#set (CMAKE_PREFIX_PATH "C:/Program Files/Windows Kits/8.1/Lib/winv6.3/um/x64") |
||||
|
endif() |
||||
|
|
||||
|
# Dependencies must have a version number, to ensure reproducible build. The version provided here is the one that is in the extdep repository. If you use system libraries, version numbers may be different. |
||||
|
|
||||
|
find_package (CryptoPP 5.6.2 EXACT REQUIRED) |
||||
|
message(" - CryptoPP header: ${CRYPTOPP_INCLUDE_DIRS}") |
||||
|
message(" - CryptoPP lib : ${CRYPTOPP_LIBRARIES}") |
||||
|
|
||||
|
find_package (LevelDB REQUIRED) |
||||
|
message(" - LevelDB header: ${LEVELDB_INCLUDE_DIRS}") |
||||
|
message(" - LevelDB lib: ${LEVELDB_LIBRARIES}") |
||||
|
|
||||
|
# TODO the Jsoncpp package does not yet check for correct version number |
||||
|
find_package (Jsoncpp 0.60 REQUIRED) |
||||
|
message(" - Jsoncpp header: ${JSONCPP_INCLUDE_DIRS}") |
||||
|
message(" - Jsoncpp lib : ${JSONCPP_LIBRARIES}") |
||||
|
|
||||
|
# TODO the JsonRpcCpp package does not yet check for correct version number |
||||
|
# json-rpc-cpp support is currently not mandatory |
||||
|
# TODO make headless client optional |
||||
|
# TODO get rid of -DETH_JSONRPC |
||||
|
if (JSONRPC) |
||||
|
|
||||
|
find_package (JsonRpcCpp 0.3.2) |
||||
|
if (NOT JSON_RPC_CPP_FOUND) |
||||
|
message (FATAL_ERROR "JSONRPC 0.3.2. not found") |
||||
|
endif() |
||||
|
message (" - json-rpc-cpp header: ${JSON_RPC_CPP_INCLUDE_DIRS}") |
||||
|
message (" - json-rpc-cpp lib : ${JSON_RPC_CPP_LIBRARIES}") |
||||
|
add_definitions(-DETH_JSONRPC) |
||||
|
|
||||
|
endif() #JSONRPC |
||||
|
|
||||
|
# TODO readline package does not yet check for correct version number |
||||
|
# TODO make readline package dependent on cmake options |
||||
|
# TODO get rid of -DETH_READLINE |
||||
|
find_package (Readline 6.3.8) |
||||
|
if (READLINE_FOUND) |
||||
|
message (" - readline header: ${READLINE_INCLUDE_DIRS}") |
||||
|
message (" - readline lib : ${READLINE_LIBRARIES}") |
||||
|
add_definitions(-DETH_READLINE) |
||||
|
endif () |
||||
|
|
||||
|
# TODO miniupnpc package does not yet check for correct version number |
||||
|
# TODO make miniupnpc package dependent on cmake options |
||||
|
# TODO get rid of -DMINIUPNPC |
||||
|
find_package (Miniupnpc 1.8.2013) |
||||
|
if (MINIUPNPC_FOUND) |
||||
|
message (" - miniupnpc header: ${MINIUPNPC_INCLUDE_DIRS}") |
||||
|
message (" - miniupnpc lib : ${MINIUPNPC_LIBRARIES}") |
||||
|
add_definitions(-DETH_MINIUPNPC) |
||||
|
endif() |
||||
|
|
||||
|
# TODO gmp package does not yet check for correct version number |
||||
|
# TODO it is also not required in msvc build |
||||
|
find_package (Gmp 6.0.0) |
||||
|
if (GMP_FOUND) |
||||
|
message(" - gmp Header: ${GMP_INCLUDE_DIRS}") |
||||
|
message(" - gmp lib : ${GMP_LIBRARIES}") |
||||
|
endif() |
||||
|
|
||||
|
# curl is only requried for tests |
||||
|
# TODO specify min curl version, on windows we are currenly using 7.29 |
||||
|
find_package (CURL) |
||||
|
message(" - curl header: ${CURL_INCLUDE_DIRS}") |
||||
|
message(" - curl lib : ${CURL_LIBRARIES}") |
||||
|
|
||||
|
# do not compile GUI |
||||
|
if (NOT HEADLESS) |
||||
|
|
||||
|
# we need json rpc to build alethzero |
||||
|
if (NOT JSON_RPC_CPP_FOUND) |
||||
|
message (FATAL_ERROR "JSONRPC is required for GUI client") |
||||
|
endif() |
||||
|
|
||||
|
# find all of the Qt packages |
||||
|
# remember to use 'Qt' instead of 'QT', cause unix is case sensitive |
||||
|
# TODO make headless client optional |
||||
|
find_package (Qt5Core REQUIRED) |
||||
|
find_package (Qt5Gui REQUIRED) |
||||
|
find_package (Qt5Quick REQUIRED) |
||||
|
find_package (Qt5Qml REQUIRED) |
||||
|
find_package (Qt5Network REQUIRED) |
||||
|
find_package (Qt5Widgets REQUIRED) |
||||
|
find_package (Qt5WebKit REQUIRED) |
||||
|
find_package (Qt5WebKitWidgets REQUIRED) |
||||
|
|
||||
|
endif() #HEADLESS |
||||
|
|
||||
|
# use multithreaded boost libraries, with -mt suffix |
||||
|
set(Boost_USE_MULTITHREADED ON) |
||||
|
|
||||
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") |
||||
|
|
||||
|
# TODO hanlde other msvc versions or it will fail find them |
||||
|
set(Boost_COMPILER -vc120) |
||||
|
# use static boost libraries *.lib |
||||
|
set(Boost_USE_STATIC_LIBS ON) |
||||
|
|
||||
|
elseif (APPLE) |
||||
|
|
||||
|
# use static boost libraries *.a |
||||
|
set(Boost_USE_STATIC_LIBS ON) |
||||
|
|
||||
|
elseif (UNIX) |
||||
|
# use dynamic boost libraries .dll |
||||
|
set(Boost_USE_STATIC_LIBS OFF) |
||||
|
|
||||
|
endif() |
||||
|
|
||||
|
find_package(Boost 1.54.0 REQUIRED COMPONENTS thread date_time system regex chrono filesystem unit_test_framework program_options) |
||||
|
|
||||
|
message(" - boost header: ${Boost_INCLUDE_DIRS}") |
||||
|
message(" - boost lib : ${Boost_LIBRARIES}") |
||||
|
|
||||
|
if (APPLE) |
||||
|
link_directories(/usr/local/lib) |
||||
|
include_directories(/usr/local/include) |
||||
|
endif() |
||||
|
|
@ -1,210 +0,0 @@ |
|||||
# search for and configure dependencies |
|
||||
|
|
||||
# deprecated. TODO will rewrite to proper CMake packages |
|
||||
|
|
||||
|
|
||||
|
|
||||
if("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
# set(MINIUPNPC_LS /usr/x86_64-w64-mingw32/lib/libminiupnpc.a) |
|
||||
set(LEVELDB_LS leveldb) |
|
||||
set(CRYPTOPP_LS cryptopp) |
|
||||
set(CRYPTOPP_ID /usr/x86_64-w64-mingw32/include/cryptopp) |
|
||||
else() |
|
||||
# Look for available Crypto++ version and if it is >= 5.6.2 |
|
||||
find_path(ID cryptlib.h |
|
||||
../cryptopp/src |
|
||||
../../cryptopp/src |
|
||||
/usr/include/cryptopp |
|
||||
/usr/include/crypto++ |
|
||||
/usr/local/include/cryptopp |
|
||||
/usr/local/include/crypto++ |
|
||||
/opt/local/include/cryptopp |
|
||||
/opt/local/include/crypto++ |
|
||||
) |
|
||||
find_library(LS NAMES cryptoppeth cryptopp |
|
||||
../cryptopp/src/../target/build/release |
|
||||
../../cryptopp/src/../target/build/release |
|
||||
PATHS |
|
||||
/usr/lib |
|
||||
/usr/local/lib |
|
||||
/opt/local/lib |
|
||||
) |
|
||||
|
|
||||
if (ID AND LS) |
|
||||
message(STATUS "Found Crypto++: ${ID}, ${LS}") |
|
||||
set(_CRYPTOPP_VERSION_HEADER ${ID}/config.h) |
|
||||
if(EXISTS ${_CRYPTOPP_VERSION_HEADER}) |
|
||||
file(STRINGS ${_CRYPTOPP_VERSION_HEADER} _CRYPTOPP_VERSION REGEX "^#define CRYPTOPP_VERSION[ \t]+[0-9]+$") |
|
||||
string(REGEX REPLACE "^#define CRYPTOPP_VERSION[ \t]+([0-9]+)" "\\1" _CRYPTOPP_VERSION ${_CRYPTOPP_VERSION}) |
|
||||
if(${_CRYPTOPP_VERSION} LESS 562) |
|
||||
message(FATAL_ERROR "Crypto++ version found is smaller than 5.6.2.") |
|
||||
else() |
|
||||
set(CRYPTOPP_ID ${ID} CACHE FILEPATH "") |
|
||||
set(CRYPTOPP_LS ${LS} CACHE FILEPATH "") |
|
||||
message(STATUS "Crypto++ found and version greater or equal to 5.6.2") |
|
||||
endif() |
|
||||
endif() |
|
||||
else() |
|
||||
message(STATUS "Crypto++ Not Found: ${CRYPTOPP_ID}, ${CRYPTOPP_LS}") |
|
||||
endif() |
|
||||
|
|
||||
find_path( LEVELDB_ID leveldb/db.h |
|
||||
/usr/include |
|
||||
/usr/local/include |
|
||||
) |
|
||||
if ( LEVELDB_ID STREQUAL "LEVELDB_ID-NOTFOUND" ) |
|
||||
message(FATAL_ERROR "Failed to find the LevelDB headers") |
|
||||
else () |
|
||||
message(STATUS "Found LevelDB Headers") |
|
||||
|
|
||||
# Check for accessory dev libraries leveldb and miniupnpc |
|
||||
find_library( LEVELDB_LS NAMES leveldb |
|
||||
PATHS |
|
||||
/usr/lib |
|
||||
/usr/local/lib |
|
||||
/opt/local/lib |
|
||||
/usr/lib/*/ |
|
||||
) |
|
||||
if ( LEVELDB_LS STREQUAL "LEVELDB_LS-NOTFOUND" ) |
|
||||
message(FATAL_ERROR "Failed to find the LevelDB Library!") |
|
||||
else () |
|
||||
message(STATUS "Found LevelDB Library: ${LEVELDB_LS}") |
|
||||
add_definitions(-DETH_LEVELDB) |
|
||||
endif () |
|
||||
endif () |
|
||||
|
|
||||
find_path( PYTHON_ID pyconfig.h |
|
||||
${PYTHON_INCLUDE_DIR} |
|
||||
/usr/include/python2.7 |
|
||||
/usr/local/include/python2.7 |
|
||||
) |
|
||||
if ( PYTHON_ID STREQUAL "PYTHON_ID-NOTFOUND" ) |
|
||||
message(STATUS "Failed to find the Python-2.7 headers") |
|
||||
else () |
|
||||
message(STATUS "Found Python-2.7 Headers: ${PYTHON_ID}") |
|
||||
|
|
||||
# Check for accessory dev libraries leveldb and miniupnpc |
|
||||
find_library( PYTHON_LS NAMES python2.7 |
|
||||
PATHS |
|
||||
/usr/lib |
|
||||
/usr/local/lib |
|
||||
/opt/local/lib |
|
||||
/usr/lib/*/ |
|
||||
) |
|
||||
if ( PYTHON_LS STREQUAL "PYTHON_LS-NOTFOUND" ) |
|
||||
message(STATUS "Failed to find the Python-2.7 Library!") |
|
||||
set(PYTHON_ID) |
|
||||
set(PYTHON_LS) |
|
||||
else () |
|
||||
message(STATUS "Found Python-2.7 Library: ${PYTHON_LS}") |
|
||||
add_definitions(-DETH_PYTHON) |
|
||||
endif () |
|
||||
endif () |
|
||||
|
|
||||
find_path( MINIUPNPC_ID miniupnpc/miniwget.h |
|
||||
/usr/include |
|
||||
/usr/local/include |
|
||||
) |
|
||||
if ( MINIUPNPC_ID ) |
|
||||
message(STATUS "Found miniupnpc headers") |
|
||||
|
|
||||
find_library( MINIUPNPC_LS NAMES miniupnpc |
|
||||
PATHS |
|
||||
/usr/lib |
|
||||
/usr/local/lib |
|
||||
/opt/local/lib |
|
||||
/usr/lib/*/ |
|
||||
) |
|
||||
if ( MINIUPNPC_LS ) |
|
||||
message(STATUS "Found miniupnpc library: ${MINIUPNPC_LS}") |
|
||||
add_definitions(-DETH_MINIUPNPC) |
|
||||
else () |
|
||||
message(STATUS "Failed to find the miniupnpc library!") |
|
||||
endif () |
|
||||
else () |
|
||||
message(STATUS "Failed to find the miniupnpc headers!") |
|
||||
endif () |
|
||||
|
|
||||
find_path( JSONRPC_ID jsonrpc/rpc.h |
|
||||
/usr/include |
|
||||
/usr/local/include |
|
||||
../libjson-rpc-cpp/src |
|
||||
) |
|
||||
if ( JSONRPC_ID ) |
|
||||
message(STATUS "Found jsonrpc headers") |
|
||||
find_library( JSONRPC_LS NAMES jsonrpc |
|
||||
PATHS |
|
||||
/usr/lib |
|
||||
/usr/local/lib |
|
||||
/opt/local/lib |
|
||||
/usr/lib/*/ |
|
||||
../libjson-rpc-cpp/build/out |
|
||||
) |
|
||||
if ( JSONRPC_LS ) |
|
||||
message(STATUS "Found jsonrpc library: ${JSONRPC_LS}") |
|
||||
add_definitions(-DETH_JSONRPC) |
|
||||
else () |
|
||||
message(STATUS "Failed to find the jsonrpc library!") |
|
||||
endif () |
|
||||
else () |
|
||||
message(STATUS "Failed to find the jsonrpc headers!") |
|
||||
endif () |
|
||||
|
|
||||
find_path( READLINE_ID readline/readline.h |
|
||||
/usr/include |
|
||||
/usr/local/include |
|
||||
) |
|
||||
if ( READLINE_ID ) |
|
||||
message(STATUS "Found readline headers") |
|
||||
find_library( READLINE_LS NAMES readline |
|
||||
PATHS |
|
||||
/usr/lib |
|
||||
/usr/local/lib |
|
||||
/opt/local/lib |
|
||||
/usr/lib/*/ |
|
||||
) |
|
||||
if ( READLINE_LS ) |
|
||||
message(STATUS "Found readline library: ${READLINE_LS}") |
|
||||
add_definitions(-DETH_READLINE) |
|
||||
else () |
|
||||
message(STATUS "Failed to find the readline library!") |
|
||||
endif () |
|
||||
else () |
|
||||
message(STATUS "Failed to find the readline headers!") |
|
||||
endif () |
|
||||
|
|
||||
if (LANGUAGES) |
|
||||
find_package(Boost 1.53 REQUIRED COMPONENTS thread date_time) |
|
||||
else() |
|
||||
find_package(Boost 1.53 REQUIRED COMPONENTS thread date_time system regex) |
|
||||
endif() |
|
||||
|
|
||||
set(QTQML 1) |
|
||||
endif() |
|
||||
|
|
||||
if(CRYPTOPP_ID) |
|
||||
include_directories(${CRYPTOPP_ID}) |
|
||||
endif() |
|
||||
if(PYTHON_ID) |
|
||||
include_directories(${PYTHON_ID}) |
|
||||
endif() |
|
||||
if(MINIUPNPC_ID) |
|
||||
include_directories(${MINIUPNPC_ID}) |
|
||||
endif() |
|
||||
if(LEVELDB_ID) |
|
||||
include_directories(${LEVELDB_ID}) |
|
||||
endif() |
|
||||
if(READLINE_ID) |
|
||||
include_directories(${READLINE_ID}) |
|
||||
endif() |
|
||||
if(JSONRPC_ID) |
|
||||
include_directories(${JSONRPC_ID}) |
|
||||
endif() |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") |
|
||||
link_directories(/usr/local/lib) |
|
||||
include_directories(/usr/local/include) |
|
||||
endif() |
|
@ -0,0 +1,118 @@ |
|||||
|
# |
||||
|
# this function requires the following variables to be specified: |
||||
|
# ETH_VERSION |
||||
|
# PROJECT_NAME |
||||
|
# PROJECT_VERSION |
||||
|
# PROJECT_COPYRIGHT_YEAR |
||||
|
# PROJECT_VENDOR |
||||
|
# PROJECT_DOMAIN_SECOND |
||||
|
# PROJECT_DOMAIN_FIRST |
||||
|
# SRC_LIST |
||||
|
# HEADERS |
||||
|
# |
||||
|
# params: |
||||
|
# ICON |
||||
|
# |
||||
|
|
||||
|
macro(eth_add_executable EXECUTABLE) |
||||
|
set (extra_macro_args ${ARGN}) |
||||
|
set (options) |
||||
|
set (one_value_args ICON) |
||||
|
set (multi_value_args UI_RESOURCES) |
||||
|
cmake_parse_arguments (ETH_ADD_EXECUTABLE "${options}" "${one_value_args}" "${multi_value_args}" "${extra_macro_args}") |
||||
|
|
||||
|
if (APPLE) |
||||
|
|
||||
|
add_executable(${EXECUTABLE} MACOSX_BUNDLE ${SRC_LIST} ${HEADERS} ${ETH_ADD_EXECUTABLE_UI_RESOURCES}) |
||||
|
set(PROJECT_VERSION "${ETH_VERSION}") |
||||
|
set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") |
||||
|
set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") |
||||
|
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") |
||||
|
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") |
||||
|
set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") |
||||
|
set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") |
||||
|
set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTABLE}) |
||||
|
set(MACOSX_BUNDLE_ICON_FILE ${ETH_ADD_EXECUTABLE_ICON}) |
||||
|
set_target_properties(${EXECUTABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") |
||||
|
set_source_files_properties(${EXECUTABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) |
||||
|
set_source_files_properties(${MACOSX_BUNDLE_ICON_FILE}.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources) |
||||
|
|
||||
|
else () |
||||
|
add_executable(${EXECUTABLE} ${ETH_ADD_EXECUTABLE_UI_RESOURCES} ${SRC_LIST} ${HEADERS}) |
||||
|
endif() |
||||
|
|
||||
|
endmacro() |
||||
|
|
||||
|
# |
||||
|
# this function requires the following variables to be specified: |
||||
|
# ETH_DEPENDENCY_INSTALL_DIR |
||||
|
# |
||||
|
# params: |
||||
|
# QMLDIR |
||||
|
# |
||||
|
|
||||
|
macro(eth_install_executable EXECUTABLE) |
||||
|
|
||||
|
set (extra_macro_args ${ARGN}) |
||||
|
set (options) |
||||
|
set (one_value_args QMLDIR) |
||||
|
set (multi_value_args) |
||||
|
cmake_parse_arguments (ETH_INSTALL_EXECUTABLE "${options}" "${one_value_args}" "${multi_value_args}" "${extra_macro_args}") |
||||
|
|
||||
|
if (ETH_INSTALL_EXECUTABLE_QMLDIR) |
||||
|
set(eth_qml_dir "-qmldir=${ETH_INSTALL_EXECUTABLE_QMLDIR}") |
||||
|
endif() |
||||
|
|
||||
|
if (APPLE) |
||||
|
# First have qt5 install plugins and frameworks |
||||
|
add_custom_command(TARGET ${EXECUTABLE} POST_BUILD |
||||
|
COMMAND ${ETH_DEPENDENCY_INSTALL_DIR}/bin/macdeployqt ${eth_qml_dir} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app |
||||
|
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) |
||||
|
|
||||
|
# This tool and next will inspect linked libraries in order to determine which dependencies are required |
||||
|
if (${CMAKE_CFG_INTDIR} STREQUAL ".") |
||||
|
set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}.app") |
||||
|
else () |
||||
|
set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTABLE}.app") |
||||
|
endif () |
||||
|
|
||||
|
# TODO check, how fixup_bundle works and if it is required |
||||
|
install(CODE " |
||||
|
include(BundleUtilities) |
||||
|
set(BU_CHMOD_BUNDLE_ITEMS 1) |
||||
|
fixup_bundle(\"${APP_BUNDLE_PATH}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\") |
||||
|
" COMPONENT RUNTIME ) |
||||
|
# Cleanup duplicate libs from macdeployqt |
||||
|
install(CODE " |
||||
|
file(GLOB LINGER_RM \"${APP_BUNDLE_PATH}/Contents/Frameworks/*.dylib\") |
||||
|
if (LINGER_RM) |
||||
|
file(REMOVE \${LINGER_RM}) |
||||
|
endif () |
||||
|
") |
||||
|
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") |
||||
|
|
||||
|
# copy all dlls to executable directory |
||||
|
# TODO improve that by copying only required dlls |
||||
|
file (GLOB DLLS ${ETH_DEPENDENCY_INSTALL_DIR}/bin/*.dll) |
||||
|
|
||||
|
foreach(DLL ${DLLS}) |
||||
|
add_custom_command(TARGET ${EXECUTABLE} POST_BUILD |
||||
|
COMMAND cmake -E copy "${DLL}" "$<TARGET_FILE_DIR:${EXECUTABLE}>" |
||||
|
) |
||||
|
endforeach() |
||||
|
|
||||
|
add_custom_command(TARGET ${EXECUTABLE} POST_BUILD |
||||
|
COMMAND cmake -E copy_directory |
||||
|
"${ETH_DEPENDENCY_INSTALL_DIR}/plugins/platforms" |
||||
|
$<TARGET_FILE_DIR:${EXECUTABLE}>/platforms |
||||
|
) |
||||
|
|
||||
|
install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin) |
||||
|
|
||||
|
else() |
||||
|
install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin) |
||||
|
endif () |
||||
|
|
||||
|
endmacro() |
||||
|
|
||||
|
|
@ -0,0 +1,108 @@ |
|||||
|
# Module for locating the Crypto++ encryption library. |
||||
|
# |
||||
|
# Customizable variables: |
||||
|
# CRYPTOPP_ROOT_DIR |
||||
|
# This variable points to the CryptoPP root directory. On Windows the |
||||
|
# library location typically will have to be provided explicitly using the |
||||
|
# -D command-line option. The directory should include the include/cryptopp, |
||||
|
# lib and/or bin sub-directories. |
||||
|
# |
||||
|
# Read-only variables: |
||||
|
# CRYPTOPP_FOUND |
||||
|
# Indicates whether the library has been found. |
||||
|
# |
||||
|
# CRYPTOPP_INCLUDE_DIRS |
||||
|
# Points to the CryptoPP include directory. |
||||
|
# |
||||
|
# CRYPTOPP_LIBRARIES |
||||
|
# Points to the CryptoPP libraries that should be passed to |
||||
|
# target_link_libararies. |
||||
|
# |
||||
|
# |
||||
|
# Copyright (c) 2012 Sergiu Dotenco |
||||
|
# |
||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
|
# of this software and associated documentation files (the "Software"), to deal |
||||
|
# in the Software without restriction, including without limitation the rights |
||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
|
# copies of the Software, and to permit persons to whom the Software is |
||||
|
# furnished to do so, subject to the following conditions: |
||||
|
# |
||||
|
# The above copyright notice and this permission notice shall be included in all |
||||
|
# copies or substantial portions of the Software. |
||||
|
# |
||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||||
|
# SOFTWARE. |
||||
|
|
||||
|
INCLUDE (FindPackageHandleStandardArgs) |
||||
|
|
||||
|
FIND_PATH (CRYPTOPP_ROOT_DIR |
||||
|
NAMES cryptopp/cryptlib.h include/cryptopp/cryptlib.h |
||||
|
PATHS ENV CRYPTOPPROOT |
||||
|
DOC "CryptoPP root directory") |
||||
|
|
||||
|
# Re-use the previous path: |
||||
|
FIND_PATH (CRYPTOPP_INCLUDE_DIR |
||||
|
NAMES cryptopp/cryptlib.h |
||||
|
HINTS ${CRYPTOPP_ROOT_DIR} |
||||
|
PATH_SUFFIXES include |
||||
|
DOC "CryptoPP include directory") |
||||
|
|
||||
|
FIND_LIBRARY (CRYPTOPP_LIBRARY_DEBUG |
||||
|
NAMES cryptlibd cryptoppd |
||||
|
HINTS ${CRYPTOPP_ROOT_DIR} |
||||
|
PATH_SUFFIXES lib |
||||
|
DOC "CryptoPP debug library") |
||||
|
|
||||
|
FIND_LIBRARY (CRYPTOPP_LIBRARY_RELEASE |
||||
|
NAMES cryptlib cryptopp |
||||
|
HINTS ${CRYPTOPP_ROOT_DIR} |
||||
|
PATH_SUFFIXES lib |
||||
|
DOC "CryptoPP release library") |
||||
|
|
||||
|
IF (CRYPTOPP_LIBRARY_DEBUG AND CRYPTOPP_LIBRARY_RELEASE) |
||||
|
SET (CRYPTOPP_LIBRARY |
||||
|
optimized ${CRYPTOPP_LIBRARY_RELEASE} |
||||
|
debug ${CRYPTOPP_LIBRARY_DEBUG} CACHE DOC "CryptoPP library") |
||||
|
ELSEIF (CRYPTOPP_LIBRARY_RELEASE) |
||||
|
SET (CRYPTOPP_LIBRARY ${CRYPTOPP_LIBRARY_RELEASE} CACHE DOC |
||||
|
"CryptoPP library") |
||||
|
ENDIF (CRYPTOPP_LIBRARY_DEBUG AND CRYPTOPP_LIBRARY_RELEASE) |
||||
|
|
||||
|
IF (CRYPTOPP_INCLUDE_DIR) |
||||
|
SET (_CRYPTOPP_VERSION_HEADER ${CRYPTOPP_INCLUDE_DIR}/cryptopp/config.h) |
||||
|
|
||||
|
IF (EXISTS ${_CRYPTOPP_VERSION_HEADER}) |
||||
|
FILE (STRINGS ${_CRYPTOPP_VERSION_HEADER} _CRYPTOPP_VERSION_TMP REGEX |
||||
|
"^#define CRYPTOPP_VERSION[ \t]+[0-9]+$") |
||||
|
|
||||
|
STRING (REGEX REPLACE |
||||
|
"^#define CRYPTOPP_VERSION[ \t]+([0-9]+)" "\\1" _CRYPTOPP_VERSION_TMP |
||||
|
${_CRYPTOPP_VERSION_TMP}) |
||||
|
|
||||
|
STRING (REGEX REPLACE "([0-9]+)[0-9][0-9]" "\\1" CRYPTOPP_VERSION_MAJOR |
||||
|
${_CRYPTOPP_VERSION_TMP}) |
||||
|
STRING (REGEX REPLACE "[0-9]([0-9])[0-9]" "\\1" CRYPTOPP_VERSION_MINOR |
||||
|
${_CRYPTOPP_VERSION_TMP}) |
||||
|
STRING (REGEX REPLACE "[0-9][0-9]([0-9])" "\\1" CRYPTOPP_VERSION_PATCH |
||||
|
${_CRYPTOPP_VERSION_TMP}) |
||||
|
|
||||
|
SET (CRYPTOPP_VERSION_COUNT 3) |
||||
|
SET (CRYPTOPP_VERSION |
||||
|
${CRYPTOPP_VERSION_MAJOR}.${CRYPTOPP_VERSION_MINOR}.${CRYPTOPP_VERSION_PATCH}) |
||||
|
ENDIF (EXISTS ${_CRYPTOPP_VERSION_HEADER}) |
||||
|
ENDIF (CRYPTOPP_INCLUDE_DIR) |
||||
|
|
||||
|
SET (CRYPTOPP_INCLUDE_DIRS ${CRYPTOPP_INCLUDE_DIR}) |
||||
|
SET (CRYPTOPP_LIBRARIES ${CRYPTOPP_LIBRARY}) |
||||
|
|
||||
|
MARK_AS_ADVANCED (CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARY CRYPTOPP_LIBRARY_DEBUG |
||||
|
CRYPTOPP_LIBRARY_RELEASE) |
||||
|
|
||||
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS (CryptoPP REQUIRED_VARS |
||||
|
CRYPTOPP_INCLUDE_DIR CRYPTOPP_LIBRARY VERSION_VAR CRYPTOPP_VERSION) |
@ -0,0 +1,34 @@ |
|||||
|
# Find gmp |
||||
|
# |
||||
|
# Find the gmp includes and library |
||||
|
# |
||||
|
# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH |
||||
|
# |
||||
|
# This module defines |
||||
|
# GMP_INCLUDE_DIRS, where to find header, etc. |
||||
|
# GMP_LIBRARIES, the libraries needed to use gmp. |
||||
|
# GMP_FOUND, If false, do not try to use gmp. |
||||
|
|
||||
|
# only look in default directories |
||||
|
find_path( |
||||
|
GMP_INCLUDE_DIR |
||||
|
NAMES gmp.h |
||||
|
DOC "gmp include dir" |
||||
|
) |
||||
|
|
||||
|
find_library( |
||||
|
GMP_LIBRARY |
||||
|
NAMES gmp |
||||
|
DOC "gmp library" |
||||
|
) |
||||
|
|
||||
|
set(GMP_INCLUDE_DIRS ${GMP_INCLUDE_DIR}) |
||||
|
set(GMP_LIBRARIES ${GMP_LIBRARY}) |
||||
|
|
||||
|
# handle the QUIETLY and REQUIRED arguments and set GMP_FOUND to TRUE |
||||
|
# if all listed variables are TRUE, hide their existence from configuration view |
||||
|
include(FindPackageHandleStandardArgs) |
||||
|
find_package_handle_standard_args(gmp DEFAULT_MSG |
||||
|
GMP_INCLUDE_DIR GMP_LIBRARY) |
||||
|
mark_as_advanced (GMP_INCLUDE_DIR GMP_LIBRARY) |
||||
|
|
@ -0,0 +1,52 @@ |
|||||
|
# Find json-rcp-cpp |
||||
|
# |
||||
|
# Find the json-rpc-cpp includes and library |
||||
|
# |
||||
|
# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH |
||||
|
# |
||||
|
# This module defines |
||||
|
# JSON_RCP_CPP_INCLUDE_DIRS, where to find header, etc. |
||||
|
# JSON_RCP_CPP_LIBRARIES, the libraries needed to use json-rpc-cpp. |
||||
|
# JSON_RPC_CPP_SERVER_LIBRARIES, the libraries needed to use json-rpc-cpp-server |
||||
|
# JSON_RPC_CPP_CLIENT_LIBRARIES, the libraries needed to use json-rpc-cpp-client |
||||
|
# JSON_RCP_CPP_FOUND, If false, do not try to use json-rpc-cpp. |
||||
|
|
||||
|
# only look in default directories |
||||
|
find_path( |
||||
|
JSON_RPC_CPP_INCLUDE_DIR |
||||
|
NAMES jsonrpccpp/server.h |
||||
|
PATH_SUFFIXES jsonrpc |
||||
|
DOC "json-rpc-cpp include dir" |
||||
|
) |
||||
|
|
||||
|
find_library( |
||||
|
JSON_RPC_CPP_COMMON_LIBRARY |
||||
|
NAMES jsonrpccpp-common |
||||
|
DOC "json-rpc-cpp common library" |
||||
|
) |
||||
|
|
||||
|
find_library( |
||||
|
JSON_RPC_CPP_SERVER_LIBRARY |
||||
|
NAMES jsonrpccpp-server |
||||
|
DOC "json-rpc-cpp server library" |
||||
|
) |
||||
|
|
||||
|
find_library( |
||||
|
JSON_RPC_CPP_CLIENT_LIBRARY |
||||
|
NAMES jsonrpccpp-client |
||||
|
DOC "json-rpc-cpp client library" |
||||
|
) |
||||
|
|
||||
|
# these are the variables to be uses by the calling script |
||||
|
set (JSON_RPC_CPP_INCLUDE_DIRS ${JSON_RPC_CPP_INCLUDE_DIR}) |
||||
|
set (JSON_RPC_CPP_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP_SERVER_LIBRARY} ${JSON_RPC_CPP_CLIENT_LIBRARY}) |
||||
|
set (JSON_RPC_CPP_SERVER_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP_SERVER_LIBRARY}) |
||||
|
set (JSON_RPC_CPP_CLIENT_LIBRARIES ${JSON_RPC_CPP_COMMON_LIBRARY} ${JSON_RPC_CPP_CLIENT_LIBRARY}) |
||||
|
|
||||
|
# handle the QUIETLY and REQUIRED arguments and set JSON_RPC_CPP_FOUND to TRUE |
||||
|
# if all listed variables are TRUE, hide their existence from configuration view |
||||
|
include(FindPackageHandleStandardArgs) |
||||
|
find_package_handle_standard_args(json_rpc_cpp DEFAULT_MSG |
||||
|
JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY JSON_RPC_CPP_INCLUDE_DIR) |
||||
|
mark_as_advanced (JSON_RPC_CPP_COMMON_LIBRARY JSON_RPC_CPP_SERVER_LIBRARY JSON_RPC_CPP_CLIENT_LIBRARY JSON_RPC_CPP_INCLUDE_DIR) |
||||
|
|
@ -0,0 +1,103 @@ |
|||||
|
# - try to find JSONCPP library |
||||
|
# |
||||
|
# Cache Variables: (probably not for direct use in your scripts) |
||||
|
# JSONCPP_INCLUDE_DIR |
||||
|
# JSONCPP_LIBRARY |
||||
|
# |
||||
|
# Non-cache variables you might use in your CMakeLists.txt: |
||||
|
# JSONCPP_FOUND |
||||
|
# JSONCPP_INCLUDE_DIRS |
||||
|
# JSONCPP_LIBRARIES |
||||
|
# |
||||
|
# Requires these CMake modules: |
||||
|
# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) |
||||
|
# |
||||
|
# Author: |
||||
|
# 2011 Philippe Crassous (ENSAM ParisTech / Institut Image) p.crassous _at_ free.fr |
||||
|
# |
||||
|
# Adapted from the Virtual Reality Peripheral Network library. |
||||
|
# https://github.com/rpavlik/vrpn/blob/master/README.Legal |
||||
|
# |
||||
|
|
||||
|
set(JSONCPP_ROOT_DIR |
||||
|
"${JSONCPP_ROOT_DIR}" |
||||
|
CACHE |
||||
|
PATH |
||||
|
"Directory to search for JSONCPP") |
||||
|
set(_jsoncppnames) |
||||
|
set(_pathsuffixes |
||||
|
suncc |
||||
|
vacpp |
||||
|
mingw |
||||
|
msvc6 |
||||
|
msvc7 |
||||
|
msvc71 |
||||
|
msvc80 |
||||
|
msvc90 |
||||
|
linux-gcc) |
||||
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") |
||||
|
execute_process(COMMAND |
||||
|
${CMAKE_CXX_COMPILER} |
||||
|
-dumpversion |
||||
|
OUTPUT_VARIABLE |
||||
|
_gnucxx_ver |
||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE) |
||||
|
list(APPEND |
||||
|
_jsoncppnames |
||||
|
json_linux-gcc-${_gnucxx_ver}_libmt |
||||
|
json_linux-gcc_libmt) |
||||
|
list(APPEND _pathsuffixes linux-gcc-${_gnucxx_ver}) |
||||
|
elseif(MSVC) |
||||
|
if(MSVC_VERSION EQUAL 1200) |
||||
|
list(APPEND _jsoncppnames json_vc6_libmt) |
||||
|
elseif(MSVC_VERSION EQUAL 1300) |
||||
|
list(APPEND _jsoncppnames json_vc7_libmt) |
||||
|
elseif(MSVC_VERSION EQUAL 1310) |
||||
|
list(APPEND _jsoncppnames json_vc71_libmt) |
||||
|
elseif(MSVC_VERSION EQUAL 1400) |
||||
|
list(APPEND _jsoncppnames json_vc8_libmt) |
||||
|
elseif(MSVC_VERSION EQUAL 1500) |
||||
|
list(APPEND _jsoncppnames json_vc9_libmt) |
||||
|
elseif(MSVC_VERSION EQUAL 1600) |
||||
|
list(APPEND _jsoncppnames json_vc10_libmt) |
||||
|
endif() |
||||
|
else() |
||||
|
list(APPEND _jsoncppnames |
||||
|
json_suncc_libmt |
||||
|
json_vacpp_libmt) |
||||
|
endif() |
||||
|
|
||||
|
list(APPEND _jsoncppnames |
||||
|
json_mingw_libmt |
||||
|
jsoncpp) |
||||
|
|
||||
|
find_library(JSONCPP_LIBRARY |
||||
|
NAMES |
||||
|
${_jsoncppnames} |
||||
|
PATHS |
||||
|
"${JSONCPP_ROOT_DIR}/libs" |
||||
|
PATH_SUFFIXES |
||||
|
${_pathsuffixes}) |
||||
|
|
||||
|
find_path(JSONCPP_INCLUDE_DIR |
||||
|
NAMES |
||||
|
json/json.h |
||||
|
PATHS |
||||
|
"${JSONCPP_ROOT_DIR}" |
||||
|
PATH_SUFFIXES jsoncpp |
||||
|
include) |
||||
|
|
||||
|
include(FindPackageHandleStandardArgs) |
||||
|
find_package_handle_standard_args(JSONCPP |
||||
|
DEFAULT_MSG |
||||
|
JSONCPP_LIBRARY |
||||
|
JSONCPP_INCLUDE_DIR) |
||||
|
|
||||
|
if(JSONCPP_FOUND) |
||||
|
set(JSONCPP_LIBRARIES "${JSONCPP_LIBRARY}") |
||||
|
set(JSONCPP_INCLUDE_DIRS "${JSONCPP_INCLUDE_DIR}") |
||||
|
mark_as_advanced(JSONCPP_ROOT_DIR) |
||||
|
endif() |
||||
|
|
||||
|
mark_as_advanced(JSONCPP_INCLUDE_DIR JSONCPP_LIBRARY) |
||||
|
|
@ -0,0 +1,34 @@ |
|||||
|
# Find leveldb |
||||
|
# |
||||
|
# Find the leveldb includes and library |
||||
|
# |
||||
|
# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH |
||||
|
# |
||||
|
# This module defines |
||||
|
# LEVELDB_INCLUDE_DIRS, where to find header, etc. |
||||
|
# LEVELDB_LIBRARIES, the libraries needed to use leveldb. |
||||
|
# LEVELDB_FOUND, If false, do not try to use leveldb. |
||||
|
|
||||
|
# only look in default directories |
||||
|
find_path( |
||||
|
LEVELDB_INCLUDE_DIR |
||||
|
NAMES leveldb/db.h |
||||
|
DOC "leveldb include dir" |
||||
|
) |
||||
|
|
||||
|
find_library( |
||||
|
LEVELDB_LIBRARY |
||||
|
NAMES leveldb |
||||
|
DOC "leveldb library" |
||||
|
) |
||||
|
|
||||
|
set(LEVELDB_INCLUDE_DIRS ${LEVELDB_INCLUDE_DIR}) |
||||
|
set(LEVELDB_LIBRARIES ${LEVELDB_LIBRARY}) |
||||
|
|
||||
|
# handle the QUIETLY and REQUIRED arguments and set LEVELDB_FOUND to TRUE |
||||
|
# if all listed variables are TRUE, hide their existence from configuration view |
||||
|
include(FindPackageHandleStandardArgs) |
||||
|
find_package_handle_standard_args(leveldb DEFAULT_MSG |
||||
|
LEVELDB_INCLUDE_DIR LEVELDB_LIBRARY) |
||||
|
mark_as_advanced (LEVELDB_INCLUDE_DIR LEVELDB_LIBRARY) |
||||
|
|
@ -0,0 +1,34 @@ |
|||||
|
# Find miniupnpc |
||||
|
# |
||||
|
# Find the miniupnpc includes and library |
||||
|
# |
||||
|
# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH |
||||
|
# |
||||
|
# This module defines |
||||
|
# MINIUPNPC_INCLUDE_DIRS, where to find header, etc. |
||||
|
# MINIUPNPC_LIBRARIES, the libraries needed to use gmp. |
||||
|
# MINIUPNPC_FOUND, If false, do not try to use gmp. |
||||
|
|
||||
|
# only look in default directories |
||||
|
find_path( |
||||
|
MINIUPNPC_INCLUDE_DIR |
||||
|
NAMES miniupnpc/miniupnpc.h |
||||
|
DOC "miniupnpc include dir" |
||||
|
) |
||||
|
|
||||
|
find_library( |
||||
|
MINIUPNPC_LIBRARY |
||||
|
NAMES miniupnpc |
||||
|
DOC "miniupnpc library" |
||||
|
) |
||||
|
|
||||
|
set(MINIUPNPC_INCLUDE_DIRS ${MINIUPNPC_INCLUDE_DIR}) |
||||
|
set(MINIUPNPC_LIBRARIES ${MINIUPNPC_LIBRARY}) |
||||
|
|
||||
|
# handle the QUIETLY and REQUIRED arguments and set MINIUPNPC_FOUND to TRUE |
||||
|
# if all listed variables are TRUE, hide their existence from configuration view |
||||
|
include(FindPackageHandleStandardArgs) |
||||
|
find_package_handle_standard_args(miniupnpc DEFAULT_MSG |
||||
|
MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY) |
||||
|
mark_as_advanced (MINIUPNPC_INCLUDE_DIR MINIUPNPC_LIBRARY) |
||||
|
|
@ -0,0 +1,34 @@ |
|||||
|
# Find readline |
||||
|
# |
||||
|
# Find the readline includes and library |
||||
|
# |
||||
|
# if you nee to add a custom library search path, do it via via CMAKE_FIND_ROOT_PATH |
||||
|
# |
||||
|
# This module defines |
||||
|
# READLINE_INCLUDE_DIRS, where to find header, etc. |
||||
|
# READLINE_LIBRARIES, the libraries needed to use readline. |
||||
|
# READLINE_FOUND, If false, do not try to use readline. |
||||
|
|
||||
|
# only look in default directories |
||||
|
find_path( |
||||
|
READLINE_INCLUDE_DIR |
||||
|
NAMES readline/readline.h |
||||
|
DOC "readling include dir" |
||||
|
) |
||||
|
|
||||
|
find_library( |
||||
|
READLINE_LIBRARY |
||||
|
NAMES readline |
||||
|
DOC "readline library" |
||||
|
) |
||||
|
|
||||
|
set(READLINE_INCLUDE_DIRS ${READLINE_INCLUDE_DIR}) |
||||
|
set(READLINE_LIBRARIES ${READLINE_LIBRARY}) |
||||
|
|
||||
|
# handle the QUIETLY and REQUIRED arguments and set READLINE_FOUND to TRUE |
||||
|
# if all listed variables are TRUE, hide their existence from configuration view |
||||
|
include(FindPackageHandleStandardArgs) |
||||
|
find_package_handle_standard_args(readline DEFAULT_MSG |
||||
|
READLINE_INCLUDE_DIR READLINE_LIBRARY) |
||||
|
mark_as_advanced (READLINE_INCLUDE_DIR READLINE_LIBRARY) |
||||
|
|
@ -1,48 +1,32 @@ |
|||||
cmake_policy(SET CMP0015 NEW) |
cmake_policy(SET CMP0015 NEW) |
||||
|
set(CMAKE_AUTOMOC OFF) |
||||
|
|
||||
aux_source_directory(. SRC_LIST) |
aux_source_directory(. SRC_LIST) |
||||
|
|
||||
|
include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) |
||||
include_directories(..) |
include_directories(..) |
||||
|
|
||||
set(EXECUTABLE eth) |
set(EXECUTABLE eth) |
||||
|
|
||||
file(GLOB HEADERS "*.h") |
file(GLOB HEADERS "*.h") |
||||
|
|
||||
add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) |
add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) |
||||
|
|
||||
target_link_libraries(${EXECUTABLE} webthree) |
add_dependencies(${EXECUTABLE} BuildInfo.h) |
||||
target_link_libraries(${EXECUTABLE} secp256k1) |
|
||||
target_link_libraries(${EXECUTABLE} gmp) |
target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARY_RELEASE}) |
||||
if(MINIUPNPC_LS) |
target_link_libraries(${EXECUTABLE} ${Boost_DATE_TIME_LIBRARY_RELEASE}) |
||||
target_link_libraries(${EXECUTABLE} ${MINIUPNPC_LS}) |
|
||||
|
if (READLINE_FOUND) |
||||
|
target_link_libraries(${EXECUTABLE} ${READLINE_LIBRARIES}) |
||||
endif() |
endif() |
||||
target_link_libraries(${EXECUTABLE} ${LEVELDB_LS}) |
|
||||
target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LS}) |
if (JSONRPC) |
||||
if(JSONRPC_LS) |
|
||||
target_link_libraries(${EXECUTABLE} web3jsonrpc) |
target_link_libraries(${EXECUTABLE} web3jsonrpc) |
||||
endif() |
endif() |
||||
if(READLINE_LS) |
|
||||
target_link_libraries(${EXECUTABLE} ${READLINE_LS}) |
|
||||
endif() |
|
||||
|
|
||||
if ("${TARGET_PLATFORM}" STREQUAL "w64") |
target_link_libraries(${EXECUTABLE} webthree) |
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++") |
target_link_libraries(${EXECUTABLE} secp256k1) |
||||
target_link_libraries(${EXECUTABLE} boost_system-mt-s) |
|
||||
target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) |
|
||||
target_link_libraries(${EXECUTABLE} gcc) |
|
||||
target_link_libraries(${EXECUTABLE} gdi32) |
|
||||
target_link_libraries(${EXECUTABLE} ws2_32) |
|
||||
target_link_libraries(${EXECUTABLE} mswsock) |
|
||||
target_link_libraries(${EXECUTABLE} shlwapi) |
|
||||
target_link_libraries(${EXECUTABLE} iphlpapi) |
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) |
|
||||
elseif (UNIX) |
|
||||
else () |
|
||||
target_link_libraries(${EXECUTABLE} boost_system) |
|
||||
target_link_libraries(${EXECUTABLE} boost_filesystem) |
|
||||
find_package(Threads REQUIRED) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
endif () |
|
||||
|
|
||||
install( TARGETS ${EXECUTABLE} DESTINATION bin ) |
install( TARGETS ${EXECUTABLE} DESTINATION bin ) |
||||
|
|
||||
|
@ -0,0 +1,55 @@ |
|||||
|
cmake_minimum_required(VERSION 2.8.12) |
||||
|
|
||||
|
include(ExternalProject) |
||||
|
include(CMakeParseArguments) |
||||
|
include(eth_download.cmake) |
||||
|
|
||||
|
# all dependencies will be installed into this directory, separated by platform |
||||
|
string(TOLOWER ${CMAKE_SYSTEM_NAME} _system_name) |
||||
|
set(ETH_DEPENDENCY_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/install/${_system_name}") |
||||
|
set(ETH_DEPENDENCY_SERVER "http://poc-7.ethdev.com/precompiled/${_system_name}") |
||||
|
file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/lib) |
||||
|
file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include) |
||||
|
file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/bin) |
||||
|
|
||||
|
if (ETH_COMPILE) |
||||
|
# json-rpc-cpp and its dependencies |
||||
|
include(compile/jsoncpp.cmake) |
||||
|
include(compile/argtable2.cmake) |
||||
|
include(compile/curl.cmake) |
||||
|
include(compile/json-rpc-cpp.cmake) |
||||
|
|
||||
|
# qt and its dependencies |
||||
|
include(compile/icu.cmake) |
||||
|
include(compile/jom.cmake) |
||||
|
include(compile/qt.cmake) |
||||
|
|
||||
|
# leveldb and its dependencies |
||||
|
include(compile/snappy.cmake) |
||||
|
include(compile/leveldb.cmake) |
||||
|
|
||||
|
# cryptopp |
||||
|
include(compile/cryptopp.cmake) |
||||
|
|
||||
|
# boost |
||||
|
include(compile/boost.cmake) |
||||
|
else() |
||||
|
eth_download(jsoncpp) |
||||
|
eth_download(json-rpc-cpp OSX_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/json-rpc-cpp_osx.sh) |
||||
|
|
||||
|
if (APPLE) |
||||
|
eth_download(snappy OSX_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/snappy_osx.sh) |
||||
|
endif() |
||||
|
|
||||
|
eth_download(leveldb OSX_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/leveldb_osx.sh) |
||||
|
eth_download(qt) |
||||
|
eth_download(cryptopp) |
||||
|
eth_download(boost) |
||||
|
eth_download(curl) |
||||
|
|
||||
|
endif() |
||||
|
|
||||
|
# will be re-eanbled later |
||||
|
# include(miniupnpc.cmake) |
||||
|
# if install phase of extep fails, even if libs are already created, the ethereum install will fail |
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
# cpp-ethereum external dependencies |
||||
|
|
||||
|
**This is Work-in-Progress!** |
||||
|
|
||||
|
This directory hosts the external libraries that are needed to build cpp-ethereum. |
||||
|
|
||||
|
To automatically download, build, and link libraries, do |
||||
|
``` |
||||
|
cd extdep; mkdir build; cd build; cmake ..; make |
||||
|
``` |
||||
|
this will take some time. |
||||
|
|
||||
|
|
||||
|
To check which libraries are already included, check `CMakeLists.txt`. Other libraries still need to be fetched via the system's package manager. |
||||
|
|
||||
|
Libraries will be installed in `cpp-ethereum/extdep/install/<platform-name>` |
@ -0,0 +1,9 @@ |
|||||
|
# hacky way to resolve nested dependencies - needed for json-rpc-cpp |
||||
|
find_library(CURL_LIBRARY NAMES curl |
||||
|
PATHS |
||||
|
${ETH_DEPENDENCY_INSTALL_DIR}/lib |
||||
|
) |
||||
|
|
||||
|
set(CURL_LIBRARIES ${CURL_LIBRARY}) |
||||
|
set(CURL_INCLUDE_DIRS ${ETH_DEPENDENCY_INSTALL_DIR}/include) |
||||
|
|
@ -0,0 +1,13 @@ |
|||||
|
if (APPLE) |
||||
|
|
||||
|
elseif (WIN32) |
||||
|
ExternalProject_Add(argtable2 |
||||
|
GIT_REPOSITORY https://github.com/debris/argtable.git |
||||
|
GIT_TAG master |
||||
|
BINARY_DIR argtable2-prefix/src/argtable2 |
||||
|
CONFIGURE_COMMAND cmake . |
||||
|
BUILD_COMMAND devenv argtable2.sln /build release |
||||
|
INSTALL_COMMAND cmd /c cp src/Release/argtable2.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp src/argtable2.h ${ETH_DEPENDENCY_INSTALL_DIR}/include |
||||
|
) |
||||
|
else() |
||||
|
endif() |
@ -0,0 +1,19 @@ |
|||||
|
if (APPLE) |
||||
|
|
||||
|
elseif (WIN32) |
||||
|
set(boost_address_model) |
||||
|
# on windows 64: |
||||
|
# set(boost_address_model address-model=64) |
||||
|
|
||||
|
set(boost_targets --with-filesystem --with-system --with-thread --with-date_time --with-regex --with-test --with-chrono --with-program_options) |
||||
|
ExternalProject_Add(boost |
||||
|
URL http://downloads.sourceforge.net/project/boost/boost/1.55.0/boost_1_55_0.tar.gz |
||||
|
BINARY_DIR boost-prefix/src/boost |
||||
|
CONFIGURE_COMMAND ./bootstrap.bat |
||||
|
BUILD_COMMAND ./b2.exe -j4 --build-type=complete link=static runtime-link=shared variant=debug,release threading=multi ${boost_addressModel} ${boost_targets} install --prefix=${ETH_DEPENDENCY_INSTALL_DIR} |
||||
|
INSTALL_COMMAND cmake -E rename ${ETH_DEPENDENCY_INSTALL_DIR}/include/boost-1_55/boost ${ETH_DEPENDENCY_INSTALL_DIR}/include/boost |
||||
|
) |
||||
|
else() |
||||
|
|
||||
|
endif() |
||||
|
|
@ -0,0 +1,33 @@ |
|||||
|
# CryptoPP does not have good cross-platform support, there exist several different other projects to make it work ... |
||||
|
|
||||
|
# TODO the OS X build throws a lot of warnings, but compiles fine |
||||
|
if (APPLE) |
||||
|
ExternalProject_Add(cryptopp |
||||
|
URL https://downloads.sourceforge.net/project/cryptopp/cryptopp/5.6.2/cryptopp562.zip |
||||
|
BINARY_DIR cryptopp-prefix/src/cryptopp |
||||
|
CONFIGURE_COMMAND "" |
||||
|
BUILD_COMMAND make CXX=clang++ CXXFLAGS=-DCRYPTOPP_DISABLE_ASM |
||||
|
INSTALL_COMMAND make install PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} |
||||
|
) |
||||
|
elseif (WIN32) |
||||
|
file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include/cryptopp) |
||||
|
|
||||
|
ExternalProject_Add(cryptopp |
||||
|
SVN_REPOSITORY http://svn.code.sf.net/p/cryptopp/code/trunk/c5 |
||||
|
SVN_REVISION -r "541" |
||||
|
BINARY_DIR cryptopp-prefix/src/cryptopp |
||||
|
CONFIGURE_COMMAND devenv cryptest.sln /upgrade |
||||
|
BUILD_COMMAND devenv cryptest.sln /build release |
||||
|
INSTALL_COMMAND cmd /c cp Win32/DLL_Output/Release/cryptopp.dll ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp Win32/DLL_Output/Release/cryptopp.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp *.h ${ETH_DEPENDENCY_INSTALL_DIR}/include/cryptopp |
||||
|
) |
||||
|
# on Linux, the default Makefile does not work. |
||||
|
else() |
||||
|
ExternalProject_Add(cryptopp |
||||
|
URL https://github.com/mmoss/cryptopp/archive/v5.6.2.zip |
||||
|
BINARY_DIR cryptopp-prefix/src/cryptopp |
||||
|
CONFIGURE_COMMAND "" |
||||
|
BUILD_COMMAND scons --shared --prefix=${ETH_DEPENDENCY_INSTALL_DIR} |
||||
|
INSTALL_COMMAND "" |
||||
|
) |
||||
|
endif() |
||||
|
|
@ -0,0 +1,29 @@ |
|||||
|
if (APPLE) |
||||
|
ExternalProject_Add(curl |
||||
|
URL http://curl.haxx.se/download/curl-7.38.0.tar.bz2 |
||||
|
BINARY_DIR curl-prefix/src/curl |
||||
|
CONFIGURE_COMMAND ./configure --with-darwinssl --prefix=${ETH_DEPENDENCY_INSTALL_DIR} --exec-prefix=${ETH_DEPENDENCY_INSTALL_DIR} |
||||
|
BUILD_COMMAND make -j 3 |
||||
|
INSTALL_COMMAND make install |
||||
|
) |
||||
|
elseif (WIN32) |
||||
|
ExternalProject_Add(curl |
||||
|
GIT_REPOSITORY https://github.com/debris/libcurl-7.29 |
||||
|
GIT_TAG master |
||||
|
BINARY_DIR curl-prefix/src/curl |
||||
|
CONFIGURE_COMMAND "" |
||||
|
BUILD_COMMAND "" |
||||
|
INSTALL_COMMAND cmd /c cp lib/release/libcurl.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp -R include/curl ${ETH_DEPENDENCY_INSTALL_DIR}/include |
||||
|
) |
||||
|
|
||||
|
else() |
||||
|
ExternalProject_Add(curl |
||||
|
URL http://curl.haxx.se/download/curl-7.38.0.tar.bz2 |
||||
|
BINARY_DIR curl-prefix/src/curl |
||||
|
CONFIGURE_COMMAND CONFIG_CMD ./configure --prefix=${ETH_DEPENDENCY_INSTALL_DIR} --exec-prefix=${ETH_DEPENDENCY_INSTALL_DIR} |
||||
|
BUILD_COMMAND make -j 3 |
||||
|
INSTALL_COMMAND make install |
||||
|
) |
||||
|
|
||||
|
endif() |
||||
|
|
@ -0,0 +1,17 @@ |
|||||
|
if (APPLE) |
||||
|
|
||||
|
elseif (WIN32) |
||||
|
ExternalProject_Add(icu |
||||
|
GIT_REPOSITORY https://github.com/debris/icu-win32.git |
||||
|
GIT_TAG master |
||||
|
BINARY_DIR icu-prefix/src/icu |
||||
|
CONFIGURE_COMMAND "" |
||||
|
BUILD_COMMAND "" |
||||
|
INSTALL_COMMAND cmake -E copy_directory . ${ETH_DEPENDENCY_INSTALL_DIR} |
||||
|
) |
||||
|
|
||||
|
else() |
||||
|
|
||||
|
endif() |
||||
|
|
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
if (APPLE) |
||||
|
|
||||
|
|
||||
|
elseif (WIN32) |
||||
|
ExternalProject_Add(jom |
||||
|
URL http://download.qt-project.org/official_releases/jom/jom.zip |
||||
|
BINARY_DIR jom-prefix/src/jom |
||||
|
CONFIGURE_COMMAND "" |
||||
|
BUILD_COMMAND "" |
||||
|
INSTALL_COMMAND cmake -E copy jom.exe ${ETH_DEPENDENCY_INSTALL_DIR}/bin |
||||
|
) |
||||
|
|
||||
|
else() |
||||
|
|
||||
|
endif() |
||||
|
|
@ -0,0 +1,40 @@ |
|||||
|
# json-rpc-cpp is under heavy development, not yet stable, and multiplatform builds are not yet available. |
||||
|
# DO NOT MESS WITH THESE SETTINGS! IF YOU HAVE TO MAKE CHANGES HERE, CONSULT sven@ethdev.com BEFOREHAND!! |
||||
|
|
||||
|
# DO NOT CHANGE ANYTHING HERE! |
||||
|
if(APPLE) |
||||
|
ExternalProject_Add(json-rpc-cpp |
||||
|
# DEPENDS argtable2 jsoncpp |
||||
|
# DEPENDS curl # re-enable later, when we build curl again |
||||
|
GIT_REPOSITORY https://github.com/cinemast/libjson-rpc-cpp.git |
||||
|
GIT_TAG v0.3.2 |
||||
|
BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp |
||||
|
CONFIGURE_COMMAND cmake -DCMAKE_INSTALL_PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_MODULE_PATH:PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake -DETH_DEPENDENCY_INSTALL_DIR:PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST -Wno-dev . |
||||
|
BUILD_COMMAND make -j 3 |
||||
|
INSTALL_COMMAND make install && ${CMAKE_CURRENT_SOURCE_DIR}/scripts/json-rpc-cpp_osx.sh . ${ETH_DEPENDENCY_INSTALL_DIR} |
||||
|
) |
||||
|
|
||||
|
elseif (WIN32) |
||||
|
ExternalProject_Add(json-rpc-cpp |
||||
|
DEPENDS argtable2 jsoncpp curl |
||||
|
GIT_REPOSITORY https://github.com/debris/libjson-rpc-cpp.git |
||||
|
GIT_TAG windows |
||||
|
BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp |
||||
|
CONFIGURE_COMMAND cmake -DCMAKE_PREFIX_PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCURL_LIBRARIES=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libcurl.lib . |
||||
|
BUILD_COMMAND devenv libjson-rpc-cpp.sln /build release |
||||
|
INSTALL_COMMAND cmd /c cp lib/Release/* ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp -R src/jsonrpccpp ${ETH_DEPENDENCY_INSTALL_DIR}/include |
||||
|
) |
||||
|
else() |
||||
|
ExternalProject_Add(json-rpc-cpp |
||||
|
# DEPENDS argtable2 jsoncpp |
||||
|
# DEPENDS curl # re-enable later, when we build curl again |
||||
|
GIT_REPOSITORY https://github.com/cinemast/libjson-rpc-cpp.git |
||||
|
GIT_TAG v0.3.2 |
||||
|
BINARY_DIR json-rpc-cpp-prefix/src/json-rpc-cpp |
||||
|
CONFIGURE_COMMAND cmake -DCMAKE_INSTALL_PREFIX=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_MODULE_PATH:PATH=${CMAKE_CURRENT_SOURCE_DIR}/cmake -DETH_DEPENDENCY_INSTALL_DIR:PATH=${ETH_DEPENDENCY_INSTALL_DIR} -DCMAKE_BUILD_TYPE=None -DCMAKE_FIND_FRAMEWORK=LAST . |
||||
|
BUILD_COMMAND make -j 3 |
||||
|
INSTALL_COMMAND make install |
||||
|
) |
||||
|
|
||||
|
endif() |
||||
|
|
@ -0,0 +1,16 @@ |
|||||
|
if (APPLE) |
||||
|
|
||||
|
elseif (WIN32) |
||||
|
|
||||
|
file(MAKE_DIRECTORY ${ETH_DEPENDENCY_INSTALL_DIR}/include/jsoncpp) |
||||
|
ExternalProject_Add(jsoncpp |
||||
|
GIT_REPOSITORY https://github.com/open-source-parsers/jsoncpp |
||||
|
GIT_TAG svn-import |
||||
|
BINARY_DIR jsoncpp-prefix/src/jsoncpp |
||||
|
CONFIGURE_COMMAND cmake . |
||||
|
BUILD_COMMAND devenv jsoncpp.sln /build release |
||||
|
INSTALL_COMMAND cmd /c cp lib/Release/jsoncpp.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp -R include/json ${ETH_DEPENDENCY_INSTALL_DIR}/include/jsoncpp |
||||
|
) |
||||
|
|
||||
|
else() |
||||
|
endif() |
@ -0,0 +1,23 @@ |
|||||
|
if (APPLE) |
||||
|
ExternalProject_Add(leveldb |
||||
|
#DEPENDS snappy |
||||
|
URL https://leveldb.googlecode.com/files/leveldb-1.15.0.tar.gz |
||||
|
BINARY_DIR leveldb-prefix/src/leveldb |
||||
|
#CONFIGURE_COMMAND patch < ${CMAKE_CURRENT_SOURCE_DIR}/compile/leveldb_osx.patch |
||||
|
CONFIGURE_COMMAND "" |
||||
|
BUILD_COMMAND export ETH_DEPENDENCY_INSTALL_DIR=${ETH_DEPENDENCY_INSTALL_DIR} && make -j 3 |
||||
|
INSTALL_COMMAND cp -rf include/leveldb ${ETH_DEPENDENCY_INSTALL_DIR}/include/ && cp libleveldb.a ${ETH_DEPENDENCY_INSTALL_DIR}/lib && cp libleveldb.dylib.1.15 ${ETH_DEPENDENCY_INSTALL_DIR}/lib/libleveldb.dylib |
||||
|
) |
||||
|
elseif (WIN32) |
||||
|
ExternalProject_Add(leveldb |
||||
|
GIT_REPOSITORY https://github.com/debris/leveldb-win32.git |
||||
|
GIT_TAG master |
||||
|
BINARY_DIR leveldb-prefix/src/leveldb |
||||
|
CONFIGURE_COMMAND "" |
||||
|
BUILD_COMMAND "" |
||||
|
INSTALL_COMMAND cmd /c cp lib/LibLevelDB.lib ${ETH_DEPENDENCY_INSTALL_DIR}/lib/leveldb.lib && cp -R include/leveldb ${ETH_DEPENDENCY_INSTALL_DIR}/include |
||||
|
) |
||||
|
else() |
||||
|
|
||||
|
endif() |
||||
|
|
@ -0,0 +1,18 @@ |
|||||
|
--- Makefile 2014-11-07 00:54:05.000000000 +0100
|
||||
|
+++ MakefilePatch 2014-11-07 00:56:59.000000000 +0100
|
||||
|
@@ -17,11 +17,11 @@
|
||||
|
# this file is generated by the previous line to set build flags and sources |
||||
|
include build_config.mk |
||||
|
|
||||
|
-CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
|
||||
|
-CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT)
|
||||
|
+CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
|
||||
|
+CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT) -DSNAPPY -I$(ETH_DEPENDENCY_INSTALL_DIR)/include
|
||||
|
|
||||
|
-LDFLAGS += $(PLATFORM_LDFLAGS)
|
||||
|
-LIBS += $(PLATFORM_LIBS)
|
||||
|
+LDFLAGS += $(PLATFORM_LDFLAGS) -L$(ETH_DEPENDENCY_INSTALL_DIR)/lib
|
||||
|
+LIBS += $(PLATFORM_LIBS) -lsnappy
|
||||
|
|
||||
|
LIBOBJECTS = $(SOURCES:.cc=.o) |
||||
|
MEMENVOBJECTS = $(MEMENV_SOURCES:.cc=.o) |
@ -0,0 +1,32 @@ |
|||||
|
if (APPLE) |
||||
|
ExternalProject_add(qt |
||||
|
URL http://qtmirror.ics.com/pub/qtproject/official_releases/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.gz |
||||
|
BINARY_DIR qt-prefix/src/qt |
||||
|
PATCH_COMMAND patch -d qtmultimedia/src/plugins/avfoundation/mediaplayer < ${CMAKE_CURRENT_SOURCE_DIR}/compile/qt_osx.patch |
||||
|
CONFIGURE_COMMAND ./configure -prefix ${ETH_DEPENDENCY_INSTALL_DIR} -system-zlib -qt-libpng -qt-libjpeg -confirm-license -opensource -nomake tests -release -nomake examples -no-xcb -arch x86_64 |
||||
|
BUILD_COMMAND make |
||||
|
INSTALL_COMMAND make install |
||||
|
) |
||||
|
elseif(WIN32) |
||||
|
ExternalProject_Add(qt |
||||
|
DEPENDS icu jom |
||||
|
URL http://qtmirror.ics.com/pub/qtproject/official_releases/qt/5.3/5.3.2/single/qt-everywhere-opensource-src-5.3.2.tar.gz |
||||
|
BINARY_DIR qt-prefix/src/qt |
||||
|
UPDATE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/compile/qt_tools.bat |
||||
|
#PATCH_COMMAND cmake -E copy ${CMAKE_CURRENT_SOURCE_DIR}/compile/qt_configure.bat qtbase/configure.bat |
||||
|
CONFIGURE_COMMAND configure -prefix ${ETH_DEPENDENCY_INSTALL_DIR} -opensource -confirm-license -release -opengl desktop -platform win32-msvc2013 -icu -I ${ETH_DEPENDENCY_INSTALL_DIR}/include -L ${ETH_DEPENDENCY_INSTALL_DIR}/lib -nomake tests -nomake examples |
||||
|
BUILD_COMMAND nmake |
||||
|
INSTALL_COMMAND nmake install |
||||
|
) |
||||
|
|
||||
|
ExternalProject_Add_Step(qt configure_paths |
||||
|
COMMAND set PATH=${ETH_DEPENDENCY_INSTALL_DIR}/bin;%cd%/gnuwin32/bin;%cd%/qtbase/bin;%PATH% |
||||
|
DEPENDEES patch |
||||
|
DEPENDERS configure |
||||
|
) |
||||
|
|
||||
|
else() |
||||
|
|
||||
|
endif() |
||||
|
|
||||
|
|
@ -0,0 +1,111 @@ |
|||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
||||
|
:: |
||||
|
:: Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). |
||||
|
:: Contact: http://www.qt-project.org/legal |
||||
|
:: |
||||
|
:: This file is part of the tools applications of the Qt Toolkit. |
||||
|
:: |
||||
|
:: $QT_BEGIN_LICENSE:LGPL$ |
||||
|
:: Commercial License Usage |
||||
|
:: Licensees holding valid commercial Qt licenses may use this file in |
||||
|
:: accordance with the commercial license agreement provided with the |
||||
|
:: Software or, alternatively, in accordance with the terms contained in |
||||
|
:: a written agreement between you and Digia. For licensing terms and |
||||
|
:: conditions see http://qt.digia.com/licensing. For further information |
||||
|
:: use the contact form at http://qt.digia.com/contact-us. |
||||
|
:: |
||||
|
:: GNU Lesser General Public License Usage |
||||
|
:: Alternatively, this file may be used under the terms of the GNU Lesser |
||||
|
:: General Public License version 2.1 as published by the Free Software |
||||
|
:: Foundation and appearing in the file LICENSE.LGPL included in the |
||||
|
:: packaging of this file. Please review the following information to |
||||
|
:: ensure the GNU Lesser General Public License version 2.1 requirements |
||||
|
:: will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
||||
|
:: |
||||
|
:: In addition, as a special exception, Digia gives you certain additional |
||||
|
:: rights. These rights are described in the Digia Qt LGPL Exception |
||||
|
:: version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
||||
|
:: |
||||
|
:: GNU General Public License Usage |
||||
|
:: Alternatively, this file may be used under the terms of the GNU |
||||
|
:: General Public License version 3.0 as published by the Free Software |
||||
|
:: Foundation and appearing in the file LICENSE.GPL included in the |
||||
|
:: packaging of this file. Please review the following information to |
||||
|
:: ensure the GNU General Public License version 3.0 requirements will be |
||||
|
:: met: http://www.gnu.org/copyleft/gpl.html. |
||||
|
:: |
||||
|
:: |
||||
|
:: $QT_END_LICENSE$ |
||||
|
:: |
||||
|
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
||||
|
|
||||
|
@echo off |
||||
|
set QTSRC=%~dp0 |
||||
|
set QTDIR=%CD% |
||||
|
::if not exist %QTSRC%\.gitignore goto sconf |
||||
|
echo Please wait while bootstrapping configure ... |
||||
|
|
||||
|
for %%C in (cl.exe icl.exe g++.exe perl.exe) do set %%C=%%~$PATH:C |
||||
|
|
||||
|
if "%perl.exe%" == "" ( |
||||
|
echo Perl not found in PATH. Aborting. >&2 |
||||
|
exit /b 1 |
||||
|
) |
||||
|
if not exist mkspecs ( |
||||
|
md mkspecs |
||||
|
if errorlevel 1 goto exit |
||||
|
) |
||||
|
perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir %QTDIR% %QTSRC% |
||||
|
if errorlevel 1 goto exit |
||||
|
|
||||
|
if not exist tools\configure ( |
||||
|
md tools\configure |
||||
|
if errorlevel 1 goto exit |
||||
|
) |
||||
|
cd tools\configure |
||||
|
if errorlevel 1 goto exit |
||||
|
|
||||
|
echo #### Generated by configure.bat - DO NOT EDIT! ####> Makefile |
||||
|
echo/>> Makefile |
||||
|
for /f "tokens=3 usebackq" %%V in (`findstr QT_VERSION_STR %QTSRC%\src\corelib\global\qglobal.h`) do @echo QTVERSION = %%~V>> Makefile |
||||
|
if not "%cl.exe%" == "" ( |
||||
|
echo CXX = cl>>Makefile |
||||
|
echo EXTRA_CXXFLAGS =>>Makefile |
||||
|
rem This must have a trailing space. |
||||
|
echo QTSRC = %QTSRC% >> Makefile |
||||
|
set tmpl=win32 |
||||
|
set make=nmake |
||||
|
) else if not "%icl.exe%" == "" ( |
||||
|
echo CXX = icl>>Makefile |
||||
|
echo EXTRA_CXXFLAGS = /Zc:forScope>>Makefile |
||||
|
rem This must have a trailing space. |
||||
|
echo QTSRC = %QTSRC% >> Makefile |
||||
|
set tmpl=win32 |
||||
|
set make=nmake |
||||
|
) else if not "%g++.exe%" == "" ( |
||||
|
echo CXX = g++>>Makefile |
||||
|
echo EXTRA_CXXFLAGS =>>Makefile |
||||
|
rem This must NOT have a trailing space. |
||||
|
echo QTSRC = %QTSRC:\=/%>> Makefile |
||||
|
set tmpl=mingw |
||||
|
set make=mingw32-make |
||||
|
) else ( |
||||
|
echo No suitable compiler found in PATH. Aborting. >&2 |
||||
|
cd ..\.. |
||||
|
exit /b 1 |
||||
|
) |
||||
|
echo/>> Makefile |
||||
|
type %QTSRC%tools\configure\Makefile.%tmpl% >> Makefile |
||||
|
|
||||
|
%make% |
||||
|
if errorlevel 1 (cd ..\.. & exit /b 1) |
||||
|
|
||||
|
cd ..\.. |
||||
|
|
||||
|
:conf |
||||
|
configure.exe -srcdir %QTSRC% %* |
||||
|
goto exit |
||||
|
|
||||
|
:sconf |
||||
|
%QTSRC%\configure.exe %* |
||||
|
:exit |
@ -0,0 +1,11 @@ |
|||||
|
--- avfmediaplayersession.mm 2014-09-11 12:48:26.000000000 +0200
|
||||
|
+++ avfmediaplayersessionPatch.mm 2014-12-01 12:53:14.000000000 +0100
|
||||
|
@@ -295,7 +295,7 @@
|
||||
|
//AVPlayerItem "status" property value observer. |
||||
|
if (context == AVFMediaPlayerSessionObserverStatusObservationContext) |
||||
|
{ |
||||
|
- AVPlayerStatus status = [[change objectForKey:NSKeyValueChangeNewKey] integerValue];
|
||||
|
+ AVPlayerStatus status = (AVPlayerStatus)[[change objectForKey:NSKeyValueChangeNewKey] integerValue];
|
||||
|
switch (status) |
||||
|
{ |
||||
|
//Indicates that the status of the player is not yet known because |
@ -0,0 +1,2 @@ |
|||||
|
rem : import VC environment vars |
||||
|
call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86 |
@ -0,0 +1,14 @@ |
|||||
|
if (APPLE) |
||||
|
ExternalProject_Add(snappy |
||||
|
URL https://snappy.googlecode.com/files/snappy-1.1.1.tar.gz |
||||
|
BINARY_DIR snappy-prefix/src/snappy |
||||
|
CONFIGURE_COMMAND ./configure --disable-dependency-tracking --prefix=${ETH_DEPENDENCY_INSTALL_DIR} |
||||
|
BUILD_COMMAND "" |
||||
|
INSTALL_COMMAND make install |
||||
|
) |
||||
|
elseif(WIN32) |
||||
|
|
||||
|
else() |
||||
|
|
||||
|
endif() |
||||
|
|
@ -0,0 +1,74 @@ |
|||||
|
# this macro requires the following variables to be specified: |
||||
|
# |
||||
|
# ETH_DEPENDENCY_SERVER - server from which dependencies should be downloaded |
||||
|
# ETH_DEPENDENCY_INSTALL_DIR - install location for all dependencies |
||||
|
# |
||||
|
# usage: |
||||
|
# |
||||
|
# eth_download("json-rpc-cpp") |
||||
|
# eth_download("json-rpc-cpp" VERSION "0.3.2") |
||||
|
# |
||||
|
# params: |
||||
|
# VERSION - exact version we want to use |
||||
|
# OSX_SCRIPT - script which will be executed on apple in install phase |
||||
|
# UNIX_SCRIPT - script which will be executed on unix in install phase |
||||
|
# WIN_SCRIPT - script which will be executed on win in install phase |
||||
|
|
||||
|
# OSX_SCRIPT, WIN_SCRIPT, UNIX_SCRIPT are taking 2 params: |
||||
|
# $1 is package_source, |
||||
|
# $2 is ETH_DEPENDENCY_INSTALL_DIR |
||||
|
# |
||||
|
# parsing arguments |
||||
|
# http://www.cmake.org/cmake/help/v3.0/module/CMakeParseArguments.html |
||||
|
# |
||||
|
# for macos you may need to specify OSX_SCRIPT with install_name_tool to fix dylib |
||||
|
# http://stackoverflow.com/questions/2985315/using-install-name-tool-whats-going-wrong |
||||
|
# |
||||
|
# TODO: |
||||
|
# check if install_command is handling symlinks correctly on linux and windows |
||||
|
|
||||
|
macro(eth_download eth_package_name) |
||||
|
|
||||
|
set (extra_macro_args ${ARGN}) |
||||
|
set (options) |
||||
|
set (one_value_args VERSION OSX_SCRIPT UNIX_SCRIPT WIN_SCRIPT) |
||||
|
set (multi_value_args) |
||||
|
cmake_parse_arguments (ETH_DOWNLOAD "${options}" "${one_value_args}" "${multi_value_args}" ${extra_macro_args}) |
||||
|
|
||||
|
if (ETH_DOWNLOAD_VERSION) |
||||
|
set(eth_tar_name "${eth_package_name}-${ETH_DOWNLOAD_VERSION}.tar.gz") |
||||
|
else() |
||||
|
set(eth_tar_name "${eth_package_name}.tar.gz") |
||||
|
endif() |
||||
|
|
||||
|
message(STATUS "download path for ${eth_package_name} is : ${ETH_DEPENDENCY_SERVER}/${eth_tar_name}") |
||||
|
|
||||
|
# we need that to copy symlinks |
||||
|
# see http://superuser.com/questions/138587/how-to-copy-symbolic-links |
||||
|
if (APPLE) |
||||
|
set (eth_package_copy cp -a . ${ETH_DEPENDENCY_INSTALL_DIR}) |
||||
|
set (eth_package_install ${ETH_DOWNLOAD_OSX_SCRIPT}) |
||||
|
elseif (UNIX) |
||||
|
set (eth_package_copy cp -a . ${ETH_DEPENDENCY_INSTALL_DIR}) |
||||
|
set (eth_package_install ${ETH_DOWNLOAD_UNIX_SCRIPT}) |
||||
|
else () |
||||
|
set (eth_package_copy cmake -E copy_directory . ${ETH_DEPENDENCY_INSTALL_DIR}) |
||||
|
set (eth_package_install ${ETH_DOWNLOAD_WIN_SCRIPT}) |
||||
|
endif() |
||||
|
|
||||
|
if (eth_package_install) |
||||
|
message(STATUS "install script: ${eth_package_install}") |
||||
|
set (eth_package_install ${eth_package_install} . ${ETH_DEPENDENCY_INSTALL_DIR}) |
||||
|
else () |
||||
|
set (eth_package_install echo 0) # cause empty string is not handled properly |
||||
|
endif() |
||||
|
|
||||
|
ExternalProject_Add(${eth_package_name} |
||||
|
URL ${ETH_DEPENDENCY_SERVER}/${eth_tar_name} |
||||
|
BINARY_DIR ${eth_package_name}-prefix/src/${eth_package_name} |
||||
|
CONFIGURE_COMMAND "" |
||||
|
BUILD_COMMAND ${eth_package_copy} |
||||
|
INSTALL_COMMAND ${eth_package_install} |
||||
|
) |
||||
|
endmacro() |
||||
|
|
@ -0,0 +1,11 @@ |
|||||
|
# TODO this file is not used yet, but will be in future |
||||
|
include(ExternalProject) |
||||
|
|
||||
|
ExternalProject_Add(miniupnpc |
||||
|
URL http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.9.20141027.tar.gz |
||||
|
BINARY_DIR miniupnpc-prefix/src/miniupnpc |
||||
|
CONFIGURE_COMMAND "" |
||||
|
BUILD_COMMAND make -j 3 |
||||
|
INSTALL_COMMAND make install INSTALLPREFIX=${ETH_DEPENDENCY_INSTALL_DIR} |
||||
|
) |
||||
|
|
@ -0,0 +1,29 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
ETH_DEPENDENCY_SOURCE_DIR=$1 |
||||
|
ETH_DEPENDENCY_INSTALL_DIR=$2 |
||||
|
|
||||
|
OLD_COMMON_DYLIB="libjsonrpccpp-common.0.dylib" |
||||
|
|
||||
|
COMMON_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libjsonrpccpp-common.0.dylib |
||||
|
SERVER_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libjsonrpccpp-server.0.dylib |
||||
|
CLIENT_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libjsonrpccpp-client.0.dylib |
||||
|
|
||||
|
# fix bin |
||||
|
STAB_EXEC=${ETH_DEPENDENCY_INSTALL_DIR}/bin/jsonrpcstub |
||||
|
install_name_tool -change ${OLD_COMMON_DYLIB} ${COMMON_DYLIB} ${STAB_EXEC} |
||||
|
|
||||
|
# fix common |
||||
|
install_name_tool -id ${COMMON_DYLIB} ${COMMON_DYLIB} |
||||
|
|
||||
|
# fix server |
||||
|
install_name_tool -id ${SERVER_DYLIB} ${SERVER_DYLIB} |
||||
|
install_name_tool -change ${OLD_COMMON_DYLIB} ${COMMON_DYLIB} ${SERVER_DYLIB} |
||||
|
|
||||
|
# fix client |
||||
|
install_name_tool -id ${CLIENT_DYLIB} ${CLIENT_DYLIB} |
||||
|
install_name_tool -change ${OLD_COMMON_DYLIB} ${COMMON_DYLIB} ${CLIENT_DYLIB} |
||||
|
|
||||
|
# TODO fix argtable and jsoncpp once they are downloaded as dependencies |
||||
|
|
||||
|
|
@ -0,0 +1,12 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
ETH_DEPENDENCY_SOURCE_DIR=$1 |
||||
|
ETH_DEPENDENCY_INSTALL_DIR=$2 |
||||
|
|
||||
|
OLD_SNAPPY_DYLIB="/Users/marekkotewicz/ethereum/cpp-ethereum/extdep/install/darwin/lib/libsnappy.1.dylib" |
||||
|
SNAPPY_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libsnappy.dylib |
||||
|
LEVELDB_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libleveldb.dylib |
||||
|
|
||||
|
install_name_tool -id ${LEVELDB_DYLIB} ${LEVELDB_DYLIB} |
||||
|
install_name_tool -change ${OLD_SNAPPY_DYLIB} ${SNAPPY_DYLIB} ${LEVELDB_DYLIB} |
||||
|
|
@ -0,0 +1,8 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
ETH_DEPENDENCY_SOURCE_DIR=$1 |
||||
|
ETH_DEPENDENCY_INSTALL_DIR=$2 |
||||
|
|
||||
|
SNAPPY_DYLIB=${ETH_DEPENDENCY_INSTALL_DIR}/lib/libsnappy.dylib |
||||
|
install_name_tool -id ${SNAPPY_DYLIB} ${SNAPPY_DYLIB} |
||||
|
|
@ -1,117 +0,0 @@ |
|||||
cmake_policy(SET CMP0015 NEW) |
|
||||
|
|
||||
if ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
cmake_policy(SET CMP0020 NEW) |
|
||||
endif () |
|
||||
|
|
||||
|
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
|
||||
aux_source_directory(. SRC_LIST) |
|
||||
|
|
||||
include_directories(..) |
|
||||
link_directories(../libethcore) |
|
||||
link_directories(../libethereum) |
|
||||
link_directories(../libqethereum) |
|
||||
|
|
||||
# Find Qt5 for Apple and update src_list for windows |
|
||||
if (APPLE) |
|
||||
# homebrew defaults to qt4 and installs qt5 as 'keg-only' |
|
||||
# which places it into /usr/local/opt insteadof /usr/local. |
|
||||
|
|
||||
set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) |
|
||||
include_directories(/usr/local/opt/qt5/include /usr/local/include) |
|
||||
elseif ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) |
|
||||
elseif (UNIX) |
|
||||
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") |
|
||||
endif () |
|
||||
|
|
||||
|
|
||||
find_package(Qt5Widgets REQUIRED) |
|
||||
find_package(Qt5Gui REQUIRED) |
|
||||
find_package(Qt5Quick REQUIRED) |
|
||||
find_package(Qt5Qml REQUIRED) |
|
||||
find_package(Qt5Network REQUIRED) |
|
||||
qt5_wrap_ui(ui_Main.h Main.ui) |
|
||||
qt5_add_resources(RESOURCE_ADDED Resources.qrc) |
|
||||
|
|
||||
# Set name of binary and add_executable() |
|
||||
if (APPLE) |
|
||||
set(EXECUTEABLE IEthXi) |
|
||||
set(CMAKE_INSTALL_PREFIX ./) |
|
||||
set(BIN_INSTALL_DIR ".") |
|
||||
set(DOC_INSTALL_DIR ".") |
|
||||
|
|
||||
set(PROJECT_VERSION "${ETH_VERSION}") |
|
||||
set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") |
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") |
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTEABLE}) |
|
||||
include(BundleUtilities) |
|
||||
|
|
||||
add_executable(${EXECUTEABLE} MACOSX_BUNDLE Main.ui ${RESOURCE_ADDED} ${SRC_LIST}) |
|
||||
else () |
|
||||
set(EXECUTEABLE iethxi) |
|
||||
add_executable(${EXECUTEABLE} Main.ui ${RESOURCE_ADDED} ${SRC_LIST}) |
|
||||
endif () |
|
||||
|
|
||||
qt5_use_modules(${EXECUTEABLE} Core Gui Widgets Network Quick Qml) |
|
||||
target_link_libraries(${EXECUTEABLE} qethereum ethereum secp256k1 ${CRYPTOPP_LS}) |
|
||||
|
|
||||
if (APPLE) |
|
||||
if (${ADDFRAMEWORKS}) |
|
||||
set_target_properties(${EXECUTEABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") |
|
||||
endif () |
|
||||
|
|
||||
SET_SOURCE_FILES_PROPERTIES(${EXECUTEABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) |
|
||||
|
|
||||
# This is a workaround for when the build-type defaults to Debug, and when a multi-config generator like xcode is used, where the type |
|
||||
# will not be set but defaults to release. |
|
||||
set(generator_lowercase "${CMAKE_GENERATOR}") |
|
||||
string(TOLOWER "${CMAKE_GENERATOR}" generator_lowercase) |
|
||||
if ("${generator_lowercase}" STREQUAL "xcode") |
|
||||
# TODO: Not sure how to resolve this. Possibly \${TARGET_BUILD_DIR} |
|
||||
set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}/Debug") |
|
||||
else () |
|
||||
set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}") |
|
||||
endif () |
|
||||
|
|
||||
set(APPS ${binary_build_dir}/${EXECUTEABLE}.app) |
|
||||
|
|
||||
# This tool and the next will automatically looked at the linked libraries in order to determine what dependencies are required. Thus, target_link_libaries only needs to add ethereum and secp256k1 (above) |
|
||||
install(CODE " |
|
||||
include(BundleUtilities) |
|
||||
set(BU_CHMOD_BUNDLE_ITEMS 1) |
|
||||
fixup_bundle(\"${APPS}\" \"${BUNDLELIBS}\" \"../libqethereum ../libethereum ../secp256k1\") |
|
||||
" COMPONENT RUNTIME ) |
|
||||
|
|
||||
if (${ADDFRAMEWORKS}) |
|
||||
add_custom_target(addframeworks ALL |
|
||||
COMMAND /usr/local/opt/qt5/bin/macdeployqt ${binary_build_dir}/${EXECUTEABLE}.app |
|
||||
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} |
|
||||
DEPENDS ${PROJECT_NAME} |
|
||||
) |
|
||||
endif () |
|
||||
|
|
||||
elseif ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport -static-libgcc -static-libstdc++ -static") |
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s -Wl,-subsystem,windows -mthreads -L/usr/x86_64-w64-mingw32/plugins/platforms") |
|
||||
target_link_libraries(${EXECUTEABLE} gcc) |
|
||||
target_link_libraries(${EXECUTEABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32) |
|
||||
target_link_libraries(${EXECUTEABLE} boost_system-mt-s) |
|
||||
target_link_libraries(${EXECUTEABLE} boost_filesystem-mt-s) |
|
||||
target_link_libraries(${EXECUTEABLE} boost_thread_win32-mt-s) |
|
||||
target_link_libraries(${EXECUTEABLE} Qt5PlatformSupport) |
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) |
|
||||
elseif (UNIX) |
|
||||
else () |
|
||||
target_link_libraries(${EXECUTEABLE} boost_system) |
|
||||
target_link_libraries(${EXECUTEABLE} boost_filesystem) |
|
||||
find_package(Threads REQUIRED) |
|
||||
target_link_libraries(${EXECUTEABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
install( TARGETS ${EXECUTEABLE} RUNTIME DESTINATION bin ) |
|
||||
endif () |
|
||||
|
|
@ -1,38 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
|
||||
<plist version="1.0"> |
|
||||
<dict> |
|
||||
<key>CFBundleDevelopmentRegion</key> |
|
||||
<string>English</string> |
|
||||
<key>CFBundleExecutable</key> |
|
||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> |
|
||||
<key>CFBundleGetInfoString</key> |
|
||||
<string>${MACOSX_BUNDLE_INFO_STRING}</string> |
|
||||
<key>CFBundleIconFile</key> |
|
||||
<string>${MACOSX_BUNDLE_ICON_FILE}</string> |
|
||||
<key>CFBundleIdentifier</key> |
|
||||
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string> |
|
||||
<key>CFBundleInfoDictionaryVersion</key> |
|
||||
<string>6.0</string> |
|
||||
<key>CFBundleLongVersionString</key> |
|
||||
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string> |
|
||||
<key>CFBundleName</key> |
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string> |
|
||||
<key>CFBundlePackageType</key> |
|
||||
<string>APPL</string> |
|
||||
<key>CFBundleShortVersionString</key> |
|
||||
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string> |
|
||||
<key>CFBundleSignature</key> |
|
||||
<string>????</string> |
|
||||
<key>CFBundleVersion</key> |
|
||||
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string> |
|
||||
<key>CSResourcesFileMapped</key> |
|
||||
<true/> |
|
||||
<key>LSRequiresCarbon</key> |
|
||||
<true/> |
|
||||
<key>NSHumanReadableCopyright</key> |
|
||||
<string>${MACOSX_BUNDLE_COPYRIGHT}</string> |
|
||||
<key>NSHighResolutionCapable</key> |
|
||||
<true/> |
|
||||
</dict> |
|
||||
</plist> |
|
@ -1,168 +0,0 @@ |
|||||
<?xml version="1.0" encoding="UTF-8"?> |
|
||||
<ui version="4.0"> |
|
||||
<class>Main</class> |
|
||||
<widget class="QMainWindow" name="Main"> |
|
||||
<property name="geometry"> |
|
||||
<rect> |
|
||||
<x>0</x> |
|
||||
<y>0</y> |
|
||||
<width>562</width> |
|
||||
<height>488</height> |
|
||||
</rect> |
|
||||
</property> |
|
||||
<property name="windowTitle"> |
|
||||
<string>Walleth</string> |
|
||||
</property> |
|
||||
<property name="dockNestingEnabled"> |
|
||||
<bool>true</bool> |
|
||||
</property> |
|
||||
<property name="dockOptions"> |
|
||||
<set>QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::VerticalTabs</set> |
|
||||
</property> |
|
||||
<property name="sizeGripEnabled" stdset="0"> |
|
||||
<bool>true</bool> |
|
||||
</property> |
|
||||
<widget class="QWidget" name="centralwidget"> |
|
||||
<layout class="QVBoxLayout" name="verticalLayout"> |
|
||||
<property name="leftMargin"> |
|
||||
<number>0</number> |
|
||||
</property> |
|
||||
<property name="topMargin"> |
|
||||
<number>0</number> |
|
||||
</property> |
|
||||
<property name="rightMargin"> |
|
||||
<number>0</number> |
|
||||
</property> |
|
||||
<property name="bottomMargin"> |
|
||||
<number>0</number> |
|
||||
</property> |
|
||||
<item> |
|
||||
<layout class="QHBoxLayout" name="fullDisplay"> |
|
||||
<item> |
|
||||
<widget class="QLabel" name="balance"> |
|
||||
<property name="text"> |
|
||||
<string>0 wei</string> |
|
||||
</property> |
|
||||
</widget> |
|
||||
</item> |
|
||||
<item> |
|
||||
<widget class="QLabel" name="peerCount"> |
|
||||
<property name="text"> |
|
||||
<string>0 peers</string> |
|
||||
</property> |
|
||||
</widget> |
|
||||
</item> |
|
||||
<item> |
|
||||
<widget class="QLabel" name="blockCount"> |
|
||||
<property name="text"> |
|
||||
<string>1 block</string> |
|
||||
</property> |
|
||||
</widget> |
|
||||
</item> |
|
||||
</layout> |
|
||||
</item> |
|
||||
</layout> |
|
||||
</widget> |
|
||||
<widget class="QMenuBar" name="menubar"> |
|
||||
<property name="geometry"> |
|
||||
<rect> |
|
||||
<x>0</x> |
|
||||
<y>0</y> |
|
||||
<width>562</width> |
|
||||
<height>25</height> |
|
||||
</rect> |
|
||||
</property> |
|
||||
<widget class="QMenu" name="menu_File"> |
|
||||
<property name="title"> |
|
||||
<string>&File</string> |
|
||||
</property> |
|
||||
<addaction name="quit"/> |
|
||||
</widget> |
|
||||
<widget class="QMenu" name="menu_Network"> |
|
||||
<property name="title"> |
|
||||
<string>&Network</string> |
|
||||
</property> |
|
||||
<addaction name="upnp"/> |
|
||||
<addaction name="net"/> |
|
||||
<addaction name="connect"/> |
|
||||
</widget> |
|
||||
<widget class="QMenu" name="menu_Tools"> |
|
||||
<property name="title"> |
|
||||
<string>T&ools</string> |
|
||||
</property> |
|
||||
<addaction name="mine"/> |
|
||||
<addaction name="create"/> |
|
||||
<addaction name="preview"/> |
|
||||
</widget> |
|
||||
<widget class="QMenu" name="menu_Help"> |
|
||||
<property name="title"> |
|
||||
<string>&Help</string> |
|
||||
</property> |
|
||||
<addaction name="about"/> |
|
||||
</widget> |
|
||||
<addaction name="menu_File"/> |
|
||||
<addaction name="menu_Network"/> |
|
||||
<addaction name="menu_Tools"/> |
|
||||
<addaction name="menu_Help"/> |
|
||||
</widget> |
|
||||
<widget class="QStatusBar" name="statusbar"/> |
|
||||
<action name="quit"> |
|
||||
<property name="text"> |
|
||||
<string>&Quit</string> |
|
||||
</property> |
|
||||
</action> |
|
||||
<action name="upnp"> |
|
||||
<property name="checkable"> |
|
||||
<bool>true</bool> |
|
||||
</property> |
|
||||
<property name="checked"> |
|
||||
<bool>true</bool> |
|
||||
</property> |
|
||||
<property name="text"> |
|
||||
<string>Use &UPnP</string> |
|
||||
</property> |
|
||||
</action> |
|
||||
<action name="connect"> |
|
||||
<property name="text"> |
|
||||
<string>&Connect to Peer...</string> |
|
||||
</property> |
|
||||
</action> |
|
||||
<action name="net"> |
|
||||
<property name="checkable"> |
|
||||
<bool>true</bool> |
|
||||
</property> |
|
||||
<property name="text"> |
|
||||
<string>Enable &Network</string> |
|
||||
</property> |
|
||||
</action> |
|
||||
<action name="mine"> |
|
||||
<property name="checkable"> |
|
||||
<bool>true</bool> |
|
||||
</property> |
|
||||
<property name="text"> |
|
||||
<string>&Mine</string> |
|
||||
</property> |
|
||||
</action> |
|
||||
<action name="create"> |
|
||||
<property name="text"> |
|
||||
<string>&New Address</string> |
|
||||
</property> |
|
||||
</action> |
|
||||
<action name="about"> |
|
||||
<property name="text"> |
|
||||
<string>&About...</string> |
|
||||
</property> |
|
||||
</action> |
|
||||
<action name="preview"> |
|
||||
<property name="checkable"> |
|
||||
<bool>true</bool> |
|
||||
</property> |
|
||||
<property name="text"> |
|
||||
<string>&Preview</string> |
|
||||
</property> |
|
||||
</action> |
|
||||
</widget> |
|
||||
<layoutdefault spacing="6" margin="11"/> |
|
||||
<resources/> |
|
||||
<connections/> |
|
||||
</ui> |
|
@ -1,59 +0,0 @@ |
|||||
#include <QtNetwork/QNetworkReply> |
|
||||
#include <QtQuick/QQuickView> |
|
||||
#include <QtQml/QQmlContext> |
|
||||
#include <QtQml/QQmlEngine> |
|
||||
#include <QtQml/QtQml> |
|
||||
#include <QtWidgets/QMessageBox> |
|
||||
#include <QtWidgets/QInputDialog> |
|
||||
#include <QtGui/QClipboard> |
|
||||
#include <QtCore/QtCore> |
|
||||
#include <libethcore/FileSystem.h> |
|
||||
#include <libethcore/Dagger.h> |
|
||||
#include <libevmcore/Instruction.h> |
|
||||
#include <libethereum/Client.h> |
|
||||
#include <libethereum/EthereumHost.h> |
|
||||
#include "BuildInfo.h" |
|
||||
#include "MainWin.h" |
|
||||
#include "ui_Main.h" |
|
||||
using namespace std; |
|
||||
using namespace eth; |
|
||||
|
|
||||
Main::Main(QWidget *parent) : |
|
||||
QObject(parent) |
|
||||
{ |
|
||||
/* qRegisterMetaType<eth::u256>("eth::u256");
|
|
||||
qRegisterMetaType<eth::KeyPair>("eth::KeyPair"); |
|
||||
qRegisterMetaType<eth::Secret>("eth::Secret"); |
|
||||
qRegisterMetaType<eth::Address>("eth::Address"); |
|
||||
qRegisterMetaType<QmlAccount*>("QmlAccount*"); |
|
||||
qRegisterMetaType<QmlEthereum*>("QmlEthereum*"); |
|
||||
|
|
||||
qmlRegisterType<QmlEthereum>("org.ethereum", 1, 0, "Ethereum"); |
|
||||
qmlRegisterType<QmlAccount>("org.ethereum", 1, 0, "Account"); |
|
||||
qmlRegisterSingletonType<QmlU256Helper>("org.ethereum", 1, 0, "Balance", QmlEthereum::constructU256Helper); |
|
||||
qmlRegisterSingletonType<QmlKeyHelper>("org.ethereum", 1, 0, "Key", QmlEthereum::constructKeyHelper); |
|
||||
*/ |
|
||||
/*
|
|
||||
ui->librariesView->setModel(m_libraryMan); |
|
||||
ui->graphsView->setModel(m_graphMan); |
|
||||
*/ |
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
// QQmlContext* context = m_view->rootContext();
|
|
||||
// context->setContextProperty("u256", new U256Helper(this));
|
|
||||
} |
|
||||
|
|
||||
Main::~Main() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
// extra bits needed to link on VS
|
|
||||
#ifdef _MSC_VER |
|
||||
|
|
||||
// include moc file, ofuscated to hide from automoc
|
|
||||
#include\ |
|
||||
"moc_MainWin.cpp" |
|
||||
|
|
||||
#endif |
|
@ -1,18 +0,0 @@ |
|||||
#ifndef MAIN_H |
|
||||
#define MAIN_H |
|
||||
|
|
||||
#include <QtQml/QQmlApplicationEngine> |
|
||||
|
|
||||
class Main: public QObject |
|
||||
{ |
|
||||
Q_OBJECT |
|
||||
|
|
||||
public: |
|
||||
explicit Main(QWidget *parent = 0); |
|
||||
~Main(); |
|
||||
|
|
||||
private: |
|
||||
QQmlApplicationEngine* m_view; |
|
||||
}; |
|
||||
|
|
||||
#endif // MAIN_H
|
|
@ -1,5 +0,0 @@ |
|||||
<RCC> |
|
||||
<qresource prefix="/"> |
|
||||
<file>Simple.qml</file> |
|
||||
</qresource> |
|
||||
</RCC> |
|
@ -1,9 +0,0 @@ |
|||||
import QtQuick.Controls 1.1 |
|
||||
|
|
||||
ApplicationWindow { |
|
||||
title: "My App" |
|
||||
Button { |
|
||||
text: "Push Me" |
|
||||
anchors.centerIn: parent |
|
||||
} |
|
||||
} |
|
@ -1,9 +0,0 @@ |
|||||
#include <QtQml/QQmlApplicationEngine> |
|
||||
#include <QtWidgets/QApplication> |
|
||||
|
|
||||
int main(int argc, char *argv[]) |
|
||||
{ |
|
||||
QApplication a(argc, argv); |
|
||||
QQmlApplicationEngine app(QUrl("qrc:/Simple.qml")); |
|
||||
return a.exec(); |
|
||||
} |
|
@ -1,8 +0,0 @@ |
|||||
#pragma once |
|
||||
|
|
||||
#include "Common.h" |
|
||||
#include "CommonData.h" |
|
||||
#include "CommonIO.h" |
|
||||
#include "FixedHash.h" |
|
||||
#include "Log.h" |
|
||||
#include "RLP.h" |
|
@ -1,13 +0,0 @@ |
|||||
#ifdef _MSC_VER |
|
||||
#include "All.h" |
|
||||
#include "Common.cpp" |
|
||||
#include "CommonData.cpp" |
|
||||
#include "CommonIO.cpp" |
|
||||
#include "CommonJS.h" |
|
||||
#include "FixedHash.cpp" |
|
||||
#include "Guards.cpp" |
|
||||
#include "Log.cpp" |
|
||||
#include "RangeMask.cpp" |
|
||||
#include "RLP.cpp" |
|
||||
#include "Worker.cpp" |
|
||||
#endif |
|
@ -1,8 +0,0 @@ |
|||||
#pragma once |
|
||||
|
|
||||
#include "Common.h" |
|
||||
#include "AES.h" |
|
||||
#include "ECDHE.h" |
|
||||
#include "FileSystem.h" |
|
||||
#include "SHA3.h" |
|
||||
#include "TrieDB.h" |
|
@ -1,7 +0,0 @@ |
|||||
#pragma once |
|
||||
|
|
||||
#include "BlockInfo.h" |
|
||||
#include "CommonEth.h" |
|
||||
#include "ProofOfWork.h" |
|
||||
#include "Exceptions.h" |
|
||||
|
|
@ -1,7 +0,0 @@ |
|||||
#ifdef _MSC_VER |
|
||||
#include "All.h" |
|
||||
#include "BlockInfo.cpp" |
|
||||
#include "CommonEth.cpp" |
|
||||
#include "ProofOfWork.cpp" |
|
||||
#include "Exceptions.cpp" |
|
||||
#endif |
|
@ -1,6 +0,0 @@ |
|||||
#ifdef _MSC_VER |
|
||||
#include "All.h" |
|
||||
#include "ExtVMFace.cpp" |
|
||||
#include "FeeStructure.cpp" |
|
||||
#include "VM.cpp" |
|
||||
#endif |
|
@ -1,24 +1,15 @@ |
|||||
cmake_policy(SET CMP0015 NEW) |
cmake_policy(SET CMP0015 NEW) |
||||
|
# let cmake autolink dependencies on windows |
||||
# Find Qt5 for Apple and update src_list for windows |
cmake_policy(SET CMP0020 NEW) |
||||
if (APPLE) |
# this policy was introduced in cmake 3.0 |
||||
# homebrew defaults to qt4 and installs qt5 as 'keg-only' |
# remove if, once 3.0 will be used on unix |
||||
# which places it into /usr/local/opt insteadof /usr/local. |
if (${CMAKE_MAJOR_VERSION} GREATER 2) |
||||
|
cmake_policy(SET CMP0043 OLD) |
||||
set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) |
|
||||
include_directories(/usr/local/opt/qt5/include /usr/local/include) |
|
||||
elseif ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) |
|
||||
elseif (UNIX) |
|
||||
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") |
|
||||
endif() |
endif() |
||||
|
|
||||
find_package(Qt5Core) |
|
||||
|
|
||||
set(CMAKE_AUTOMOC OFF) |
set(CMAKE_AUTOMOC OFF) |
||||
|
|
||||
qt5_add_resources(JSQRC js.qrc) |
qt5_add_resources(JSQRC js.qrc) |
||||
add_library(jsqrc STATIC ${JSQRC}) |
add_library(jsqrc STATIC ${JSQRC}) |
||||
qt5_use_modules(jsqrc Core) |
target_link_libraries(jsqrc Qt5::Core) |
||||
|
|
||||
install( TARGETS jsqrc ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) |
install( TARGETS jsqrc ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) |
||||
|
@ -1,48 +1,32 @@ |
|||||
cmake_policy(SET CMP0015 NEW) |
cmake_policy(SET CMP0015 NEW) |
||||
|
# this policy was introduced in cmake 3.0 |
||||
|
# remove if, once 3.0 will be used on unix |
||||
|
if (${CMAKE_MAJOR_VERSION} GREATER 2) |
||||
|
# old policy do not use MACOSX_RPATH |
||||
|
cmake_policy(SET CMP0042 OLD) |
||||
|
endif() |
||||
|
set(CMAKE_AUTOMOC OFF) |
||||
|
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") |
||||
|
|
||||
aux_source_directory(. SRC_LIST) |
aux_source_directory(. SRC_LIST) |
||||
|
|
||||
|
include_directories(${Boost_INCLUDE_DIRS}) |
||||
|
include_directories(..) |
||||
|
|
||||
set(EXECUTABLE lll) |
set(EXECUTABLE lll) |
||||
|
|
||||
file(GLOB HEADERS "*.h") |
file(GLOB HEADERS "*.h") |
||||
|
|
||||
if(ETH_STATIC) |
if(ETH_STATIC) |
||||
add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) |
add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) |
||||
else() |
else() |
||||
add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) |
add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) |
||||
endif() |
endif() |
||||
|
|
||||
include_directories(..) |
|
||||
|
|
||||
target_link_libraries(${EXECUTABLE} evmcore) |
target_link_libraries(${EXECUTABLE} evmcore) |
||||
target_link_libraries(${EXECUTABLE} devcore) |
target_link_libraries(${EXECUTABLE} devcore) |
||||
|
|
||||
|
|
||||
if("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
target_link_libraries(${EXECUTABLE} boost_system-mt-s) |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) |
|
||||
target_link_libraries(${EXECUTABLE} iphlpapi) |
|
||||
target_link_libraries(${EXECUTABLE} ws2_32) |
|
||||
target_link_libraries(${EXECUTABLE} mswsock) |
|
||||
target_link_libraries(${EXECUTABLE} shlwapi) |
|
||||
elseif (APPLE) |
|
||||
# Latest mavericks boost libraries only come with -mt |
|
||||
target_link_libraries(${EXECUTABLE} boost_system-mt) |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread-mt) |
|
||||
find_package(Threads REQUIRED) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
elseif (UNIX) |
|
||||
target_link_libraries(${EXECUTABLE} ${Boost_SYSTEM_LIBRARY}) |
|
||||
target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
else () |
|
||||
target_link_libraries(${EXECUTABLE} boost_system) |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread) |
|
||||
find_package(Threads REQUIRED) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
endif () |
|
||||
|
|
||||
install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) |
install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) |
||||
install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) |
install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) |
||||
|
|
||||
|
@ -1,9 +0,0 @@ |
|||||
#ifdef _MSC_VER |
|
||||
#include "All.h" |
|
||||
#include "Capability.cpp" |
|
||||
#include "Common.cpp" |
|
||||
#include "Host.cpp" |
|
||||
#include "HostCapability.cpp" |
|
||||
#include "Session.cpp" |
|
||||
#include "UPnP.cpp" |
|
||||
#endif |
|
@ -1,42 +0,0 @@ |
|||||
cmake_policy(SET CMP0015 NEW) |
|
||||
|
|
||||
aux_source_directory(. SRC_LIST) |
|
||||
|
|
||||
set(EXECUTABLE pyserpent) |
|
||||
|
|
||||
# set(CMAKE_INSTALL_PREFIX ../lib) |
|
||||
add_library(${EXECUTABLE} SHARED ${SRC_LIST}) |
|
||||
|
|
||||
file(GLOB HEADERS "*.h") |
|
||||
|
|
||||
include_directories(..) |
|
||||
|
|
||||
target_link_libraries(${EXECUTABLE} serpent) |
|
||||
target_link_libraries(${EXECUTABLE} lll) |
|
||||
target_link_libraries(${EXECUTABLE} evmcore) |
|
||||
target_link_libraries(${EXECUTABLE} devcore) |
|
||||
target_link_libraries(${EXECUTABLE} ${PYTHON_LS}) |
|
||||
|
|
||||
if("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) |
|
||||
target_link_libraries(${EXECUTABLE} iphlpapi) |
|
||||
target_link_libraries(${EXECUTABLE} ws2_32) |
|
||||
target_link_libraries(${EXECUTABLE} mswsock) |
|
||||
target_link_libraries(${EXECUTABLE} shlwapi) |
|
||||
elseif (APPLE) |
|
||||
# Latest mavericks boost libraries only come with -mt |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread-mt) |
|
||||
find_package(Threads REQUIRED) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
elseif (UNIX) |
|
||||
target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
else () |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread) |
|
||||
find_package(Threads REQUIRED) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
endif () |
|
||||
|
|
||||
install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) |
|
||||
install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) |
|
||||
|
|
@ -1,173 +0,0 @@ |
|||||
#include <Python.h> |
|
||||
#include "structmember.h" |
|
||||
|
|
||||
#include <stdlib.h> |
|
||||
#include <stdio.h> |
|
||||
#include <iostream> |
|
||||
#include <libserpent/funcs.h> |
|
||||
|
|
||||
#define PYMETHOD(name, FROM, method, TO) \ |
|
||||
static PyObject * name(PyObject *, PyObject *args) { \ |
|
||||
try { \ |
|
||||
FROM(med) \ |
|
||||
return TO(method(med)); \ |
|
||||
} \ |
|
||||
catch (std::string e) { \ |
|
||||
PyErr_SetString(PyExc_Exception, e.c_str()); \ |
|
||||
return NULL; \ |
|
||||
} \ |
|
||||
} |
|
||||
|
|
||||
#define FROMSTR(v) \ |
|
||||
const char *command; \ |
|
||||
int len; \ |
|
||||
if (!PyArg_ParseTuple(args, "s#", &command, &len)) \ |
|
||||
return NULL; \ |
|
||||
std::string v = std::string(command, len); \ |
|
||||
|
|
||||
#define FROMNODE(v) \ |
|
||||
PyObject *node; \ |
|
||||
if (!PyArg_ParseTuple(args, "O", &node)) \ |
|
||||
return NULL; \ |
|
||||
Node v = cppifyNode(node); |
|
||||
|
|
||||
#define FROMLIST(v) \ |
|
||||
PyObject *node; \ |
|
||||
if (!PyArg_ParseTuple(args, "O", &node)) \ |
|
||||
return NULL; \ |
|
||||
std::vector<Node> v = cppifyNodeList(node); |
|
||||
|
|
||||
// Convert metadata into python wrapper form [file, ln, ch]
|
|
||||
PyObject* pyifyMetadata(Metadata m) { |
|
||||
PyObject* a = PyList_New(0); |
|
||||
PyList_Append(a, Py_BuildValue("s#", m.file.c_str(), m.file.length())); |
|
||||
PyList_Append(a, Py_BuildValue("i", m.ln)); |
|
||||
PyList_Append(a, Py_BuildValue("i", m.ch)); |
|
||||
return a; |
|
||||
} |
|
||||
|
|
||||
// Convert node into python wrapper form
|
|
||||
// [token=0/astnode=1, val, metadata, args]
|
|
||||
PyObject* pyifyNode(Node n) { |
|
||||
PyObject* a = PyList_New(0); |
|
||||
PyList_Append(a, Py_BuildValue("i", n.type == ASTNODE)); |
|
||||
PyList_Append(a, Py_BuildValue("s#", n.val.c_str(), n.val.length())); |
|
||||
PyList_Append(a, pyifyMetadata(n.metadata)); |
|
||||
for (unsigned i = 0; i < n.args.size(); i++) |
|
||||
PyList_Append(a, pyifyNode(n.args[i])); |
|
||||
return a; |
|
||||
} |
|
||||
|
|
||||
// Convert string into python wrapper form
|
|
||||
PyObject* pyifyString(std::string s) { |
|
||||
return Py_BuildValue("s#", s.c_str(), s.length()); |
|
||||
} |
|
||||
|
|
||||
// Convert list of nodes into python wrapper form
|
|
||||
PyObject* pyifyNodeList(std::vector<Node> n) { |
|
||||
PyObject* a = PyList_New(0); |
|
||||
for (unsigned i = 0; i < n.size(); i++) |
|
||||
PyList_Append(a, pyifyNode(n[i])); |
|
||||
return a; |
|
||||
} |
|
||||
|
|
||||
// Convert pyobject int into normal form
|
|
||||
int cppifyInt(PyObject* o) { |
|
||||
int out; |
|
||||
if (!PyArg_Parse(o, "i", &out)) |
|
||||
err("Argument should be integer", Metadata()); |
|
||||
return out; |
|
||||
} |
|
||||
|
|
||||
// Convert pyobject string into normal form
|
|
||||
std::string cppifyString(PyObject* o) { |
|
||||
const char *command; |
|
||||
if (!PyArg_Parse(o, "s", &command)) |
|
||||
err("Argument should be string", Metadata()); |
|
||||
return std::string(command); |
|
||||
} |
|
||||
|
|
||||
// Convert metadata from python wrapper form
|
|
||||
Metadata cppifyMetadata(PyObject* o) { |
|
||||
std::string file = cppifyString(PyList_GetItem(o, 0)); |
|
||||
int ln = cppifyInt(PyList_GetItem(o, 1)); |
|
||||
int ch = cppifyInt(PyList_GetItem(o, 2)); |
|
||||
return Metadata(file, ln, ch); |
|
||||
} |
|
||||
|
|
||||
// Convert node from python wrapper form
|
|
||||
Node cppifyNode(PyObject* o) { |
|
||||
Node n; |
|
||||
int isAstNode = cppifyInt(PyList_GetItem(o, 0)); |
|
||||
n.type = isAstNode ? ASTNODE : TOKEN; |
|
||||
n.val = cppifyString(PyList_GetItem(o, 1)); |
|
||||
n.metadata = cppifyMetadata(PyList_GetItem(o, 2)); |
|
||||
std::vector<Node> args; |
|
||||
for (int i = 3; i < PyList_Size(o); i++) { |
|
||||
args.push_back(cppifyNode(PyList_GetItem(o, i))); |
|
||||
} |
|
||||
n.args = args; |
|
||||
return n; |
|
||||
} |
|
||||
|
|
||||
//Convert list of nodes into normal form
|
|
||||
std::vector<Node> cppifyNodeList(PyObject* o) { |
|
||||
std::vector<Node> out; |
|
||||
for (int i = 0; i < PyList_Size(o); i++) { |
|
||||
out.push_back(cppifyNode(PyList_GetItem(o,i))); |
|
||||
} |
|
||||
return out; |
|
||||
} |
|
||||
|
|
||||
PYMETHOD(ps_compile, FROMSTR, compile, pyifyString) |
|
||||
PYMETHOD(ps_compile_chunk, FROMSTR, compileChunk, pyifyString) |
|
||||
PYMETHOD(ps_compile_to_lll, FROMSTR, compileToLLL, pyifyNode) |
|
||||
PYMETHOD(ps_compile_chunk_to_lll, FROMSTR, compileChunkToLLL, pyifyNode) |
|
||||
PYMETHOD(ps_compile_lll, FROMNODE, compileLLL, pyifyString) |
|
||||
PYMETHOD(ps_parse, FROMSTR, parseSerpent, pyifyNode) |
|
||||
PYMETHOD(ps_rewrite, FROMNODE, rewrite, pyifyNode) |
|
||||
PYMETHOD(ps_rewrite_chunk, FROMNODE, rewriteChunk, pyifyNode) |
|
||||
PYMETHOD(ps_pretty_compile, FROMSTR, prettyCompile, pyifyNodeList) |
|
||||
PYMETHOD(ps_pretty_compile_chunk, FROMSTR, prettyCompileChunk, pyifyNodeList) |
|
||||
PYMETHOD(ps_pretty_compile_lll, FROMNODE, prettyCompileLLL, pyifyNodeList) |
|
||||
PYMETHOD(ps_serialize, FROMLIST, serialize, pyifyString) |
|
||||
PYMETHOD(ps_deserialize, FROMSTR, deserialize, pyifyNodeList) |
|
||||
PYMETHOD(ps_parse_lll, FROMSTR, parseLLL, pyifyNode) |
|
||||
|
|
||||
|
|
||||
static PyMethodDef PyextMethods[] = { |
|
||||
{"compile", ps_compile, METH_VARARGS, |
|
||||
"Compile code."}, |
|
||||
{"compile_chunk", ps_compile_chunk, METH_VARARGS, |
|
||||
"Compile code chunk (no wrappers)."}, |
|
||||
{"compile_to_lll", ps_compile_to_lll, METH_VARARGS, |
|
||||
"Compile code to LLL."}, |
|
||||
{"compile_chunk_to_lll", ps_compile_chunk_to_lll, METH_VARARGS, |
|
||||
"Compile code chunk to LLL (no wrappers)."}, |
|
||||
{"compile_lll", ps_compile_lll, METH_VARARGS, |
|
||||
"Compile LLL to EVM."}, |
|
||||
{"parse", ps_parse, METH_VARARGS, |
|
||||
"Parse serpent"}, |
|
||||
{"rewrite", ps_rewrite, METH_VARARGS, |
|
||||
"Rewrite parsed serpent to LLL"}, |
|
||||
{"rewrite_chunk", ps_rewrite_chunk, METH_VARARGS, |
|
||||
"Rewrite parsed serpent to LLL (no wrappers)"}, |
|
||||
{"pretty_compile", ps_pretty_compile, METH_VARARGS, |
|
||||
"Compile to EVM opcodes"}, |
|
||||
{"pretty_compile_chunk", ps_pretty_compile_chunk, METH_VARARGS, |
|
||||
"Compile chunk to EVM opcodes (no wrappers)"}, |
|
||||
{"pretty_compile_lll", ps_pretty_compile_lll, METH_VARARGS, |
|
||||
"Compile LLL to EVM opcodes"}, |
|
||||
{"serialize", ps_serialize, METH_VARARGS, |
|
||||
"Convert EVM opcodes to bin"}, |
|
||||
{"deserialize", ps_deserialize, METH_VARARGS, |
|
||||
"Convert EVM bin to opcodes"}, |
|
||||
{"parse_lll", ps_parse_lll, METH_VARARGS, |
|
||||
"Parse LLL"}, |
|
||||
{NULL, NULL, 0, NULL} /* Sentinel */ |
|
||||
}; |
|
||||
|
|
||||
PyMODINIT_FUNC initserpent_pyext(void) |
|
||||
{ |
|
||||
Py_InitModule( "serpent_pyext", PyextMethods ); |
|
||||
} |
|
@ -1,110 +1,41 @@ |
|||||
cmake_policy(SET CMP0015 NEW) |
cmake_policy(SET CMP0015 NEW) |
||||
|
# let cmake autolink dependencies on windows |
||||
if ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
cmake_policy(SET CMP0020 NEW) |
cmake_policy(SET CMP0020 NEW) |
||||
|
# this policy was introduced in cmake 3.0 |
||||
|
# remove if, once 3.0 will be used on unix |
||||
|
if (${CMAKE_MAJOR_VERSION} GREATER 2) |
||||
|
# old policy do not use MACOSX_RPATH |
||||
|
cmake_policy(SET CMP0042 OLD) |
||||
|
cmake_policy(SET CMP0043 OLD) |
||||
endif() |
endif() |
||||
|
|
||||
|
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
set(CMAKE_INCLUDE_CURRENT_DIR ON) |
||||
aux_source_directory(. SRC_LIST) |
aux_source_directory(. SRC_LIST) |
||||
|
|
||||
|
include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) |
||||
include_directories(..) |
include_directories(..) |
||||
link_directories(../libethereum) |
|
||||
|
|
||||
# Find Qt5 for Apple and update src_list for windows |
|
||||
if (APPLE) |
|
||||
# homebrew defaults to qt4 and installs qt5 as 'keg-only' |
|
||||
# which places it into /usr/local/opt insteadof /usr/local. |
|
||||
|
|
||||
set(CMAKE_PREFIX_PATH /usr/local/opt/qt5) |
|
||||
include_directories(/usr/local/opt/qt5/include /usr/local/include) |
|
||||
elseif ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
set(SRC_LIST ${SRC_LIST} ../windows/qt_plugin_import.cpp) |
|
||||
elseif (UNIX) |
|
||||
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ";$ENV{QTDIR}/lib/cmake") |
|
||||
endif () |
|
||||
|
|
||||
find_package(Qt5Gui REQUIRED) |
|
||||
find_package(Qt5Quick REQUIRED) |
|
||||
find_package(Qt5Qml REQUIRED) |
|
||||
find_package(Qt5Network REQUIRED) |
|
||||
find_package(Qt5Widgets REQUIRED) |
|
||||
find_package(Qt5WebKit REQUIRED) |
|
||||
find_package(Qt5WebKitWidgets REQUIRED) |
|
||||
|
|
||||
set(EXECUTABLE qethereum) |
set(EXECUTABLE qethereum) |
||||
|
|
||||
# Set name of binary and add_executable() |
|
||||
if (APPLE) |
|
||||
set(CMAKE_INSTALL_PREFIX ./) |
|
||||
set(BIN_INSTALL_DIR ".") |
|
||||
set(DOC_INSTALL_DIR ".") |
|
||||
|
|
||||
set(PROJECT_VERSION "${ETH_VERSION}") |
|
||||
set(MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_NAME} ${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME} ${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}") |
|
||||
set(MACOSX_BUNDLE_COPYRIGHT "${PROJECT_COPYRIGHT_YEAR} ${PROJECT_VENDOR}") |
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_DOMAIN_SECOND}.${PROJECT_DOMAIN_FIRST}") |
|
||||
set(MACOSX_BUNDLE_BUNDLE_NAME ${EXECUTABLE}) |
|
||||
include(BundleUtilities) |
|
||||
endif () |
|
||||
file(GLOB HEADERS "*.h") |
file(GLOB HEADERS "*.h") |
||||
|
|
||||
if(ETH_STATIC) |
if(ETH_STATIC) |
||||
add_library(${EXECUTABLE} STATIC ${RESOURCE_ADDED} ${SRC_LIST} ${HEADERS}) |
add_library(${EXECUTABLE} STATIC ${RESOURCE_ADDED} ${SRC_LIST} ${HEADERS}) |
||||
else() |
else() |
||||
add_library(${EXECUTABLE} SHARED ${RESOURCE_ADDED} ${SRC_LIST} ${HEADERS}) |
add_library(${EXECUTABLE} SHARED ${RESOURCE_ADDED} ${SRC_LIST} ${HEADERS}) |
||||
endif() |
endif() |
||||
|
|
||||
include_directories(/) |
target_link_libraries(${EXECUTABLE} Qt5::Core) |
||||
qt5_use_modules(${EXECUTABLE} Core Gui WebKit WebKitWidgets Widgets Network Quick Qml) |
target_link_libraries(${EXECUTABLE} Qt5::Gui) |
||||
target_link_libraries(${EXECUTABLE} ethereum secp256k1 ${CRYPTOPP_LS} ${JSONRPC_LS}) |
target_link_libraries(${EXECUTABLE} Qt5::WebKit) |
||||
|
target_link_libraries(${EXECUTABLE} Qt5::WebKitWidgets) |
||||
if (APPLE) |
target_link_libraries(${EXECUTABLE} Qt5::Widgets) |
||||
if (${ADDFRAMEWORKS}) |
target_link_libraries(${EXECUTABLE} Qt5::Network) |
||||
set_target_properties(${EXECUTABLE} PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/EthereumMacOSXBundleInfo.plist.in") |
target_link_libraries(${EXECUTABLE} Qt5::Quick) |
||||
endif () |
target_link_libraries(${EXECUTABLE} Qt5::Qml) |
||||
|
target_link_libraries(${EXECUTABLE} ${JSON_RPC_CPP_SERVER_LIBRARIES}) |
||||
|
target_link_libraries(${EXECUTABLE} ethereum) |
||||
|
target_link_libraries(${EXECUTABLE} secp256k1) |
||||
|
|
||||
SET_SOURCE_FILES_PROPERTIES(${EXECUTABLE} PROPERTIES MACOSX_PACKAGE_LOCATION MacOS) |
|
||||
|
|
||||
# This is a workaround for when the build-type defaults to Debug, and when a multi-config generator like xcode is used, where the type |
|
||||
# will not be set but defaults to release. |
|
||||
set(generator_lowercase "${CMAKE_GENERATOR}") |
|
||||
string(TOLOWER "${CMAKE_GENERATOR}" generator_lowercase) |
|
||||
if ("${generator_lowercase}" STREQUAL "xcode") |
|
||||
# TODO: Not sure how to resolve this. Possibly \${TARGET_BUILD_DIR} |
|
||||
set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}/Debug") |
|
||||
else () |
|
||||
set(binary_build_dir "${CMAKE_CURRENT_BINARY_DIR}") |
|
||||
endif () |
|
||||
|
|
||||
set(APPS ${binary_build_dir}/${EXECUTABLE}) |
|
||||
|
|
||||
if (${ADDFRAMEWORKS}) |
|
||||
add_custom_target(addframeworks ALL |
|
||||
COMMAND /usr/local/opt/qt5/bin/macdeployqt ${binary_build_dir}/${EXECUTABLE} |
|
||||
WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} |
|
||||
DEPENDS ${PROJECT_NAME} |
|
||||
) |
|
||||
endif () |
|
||||
|
|
||||
elseif ("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-keep-inline-dllexport -static-libgcc -static-libstdc++ -static") |
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s -Wl,-subsystem,windows -mthreads -L/usr/x86_64-w64-mingw32/plugins/platforms") |
|
||||
target_link_libraries(${EXECUTABLE} gcc) |
|
||||
target_link_libraries(${EXECUTABLE} mingw32 qtmain mswsock iphlpapi qwindows shlwapi Qt5PlatformSupport gdi32 comdlg32 oleaut32 imm32 winmm ole32 uuid ws2_32) |
|
||||
target_link_libraries(${EXECUTABLE} boost_system-mt-s) |
|
||||
target_link_libraries(${EXECUTABLE} boost_filesystem-mt-s) |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) |
|
||||
target_link_libraries(${EXECUTABLE} Qt5PlatformSupport) |
|
||||
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) |
|
||||
elseif (UNIX) |
|
||||
else () |
|
||||
target_link_libraries(${EXECUTABLE} boost_system) |
|
||||
target_link_libraries(${EXECUTABLE} boost_filesystem) |
|
||||
find_package(Threads REQUIRED) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) |
install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) |
||||
endif () |
install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) |
||||
|
|
||||
|
@ -1,188 +0,0 @@ |
|||||
#if ETH_QTQML |
|
||||
#include <QtQml/QtQml> |
|
||||
#endif |
|
||||
#include <QtCore/QtCore> |
|
||||
#include <QtWebKitWidgets/QWebFrame> |
|
||||
#include <libdevcrypto/FileSystem.h> |
|
||||
#include <libevmcore/Instruction.h> |
|
||||
#include <liblll/Compiler.h> |
|
||||
#include <libethereum/Client.h> |
|
||||
#include <libethereum/EthereumHost.h> |
|
||||
#include "QmlEthereum.h" |
|
||||
using namespace std; |
|
||||
|
|
||||
// types
|
|
||||
using dev::bytes; |
|
||||
using dev::bytesConstRef; |
|
||||
using dev::h160; |
|
||||
using dev::h256; |
|
||||
using dev::u160; |
|
||||
using dev::u256; |
|
||||
using dev::u256s; |
|
||||
using dev::RLP; |
|
||||
using dev::Address; |
|
||||
using dev::eth::BlockInfo; |
|
||||
using dev::eth::Client; |
|
||||
using dev::eth::Instruction; |
|
||||
using dev::KeyPair; |
|
||||
using dev::eth::NodeMode; |
|
||||
using dev::Secret; |
|
||||
using dev::eth::Transaction; |
|
||||
using dev::p2p::PeerInfo; |
|
||||
|
|
||||
// functions
|
|
||||
using dev::toHex; |
|
||||
using dev::fromHex; |
|
||||
using dev::right160; |
|
||||
using dev::simpleDebugOut; |
|
||||
using dev::toLog2; |
|
||||
using dev::toString; |
|
||||
using dev::eth::disassemble; |
|
||||
using dev::eth::formatBalance; |
|
||||
using dev::eth::units; |
|
||||
|
|
||||
// vars
|
|
||||
using dev::g_logPost; |
|
||||
using dev::g_logVerbosity; |
|
||||
|
|
||||
// Horrible global for the mainwindow. Needed for the QmlEthereums to find the Main window which acts as multiplexer for now.
|
|
||||
// Can get rid of this once we've sorted out ITC for signalling & multiplexed querying.
|
|
||||
dev::eth::Client* g_qmlClient; |
|
||||
QObject* g_qmlMain; |
|
||||
#if 0 |
|
||||
QmlAccount::QmlAccount(QObject*) |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
QmlAccount::~QmlAccount() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
void QmlAccount::setEthereum(QmlEthereum* _eth) |
|
||||
{ |
|
||||
if (m_eth == _eth) |
|
||||
return; |
|
||||
// if (m_eth)
|
|
||||
// disconnect(m_eth, SIGNAL(changed()), this, SIGNAL(changed()));
|
|
||||
m_eth = _eth; |
|
||||
// if (m_eth)
|
|
||||
// connect(m_eth, SIGNAL(changed()), this, SIGNAL(changed()));
|
|
||||
ethChanged(); |
|
||||
// changed();
|
|
||||
} |
|
||||
|
|
||||
dev::u256 QmlAccount::balance() const |
|
||||
{ |
|
||||
if (m_eth) |
|
||||
return m_eth->balanceAt(m_address); |
|
||||
return u256(0); |
|
||||
} |
|
||||
|
|
||||
double QmlAccount::txCount() const |
|
||||
{ |
|
||||
if (m_eth) |
|
||||
return m_eth->txCountAt(m_address); |
|
||||
return 0; |
|
||||
} |
|
||||
|
|
||||
bool QmlAccount::isContract() const |
|
||||
{ |
|
||||
if (m_eth) |
|
||||
return m_eth->isContractAt(m_address); |
|
||||
return 0; |
|
||||
} |
|
||||
|
|
||||
QmlEthereum::QmlEthereum(QObject* _p): QObject(_p) |
|
||||
{ |
|
||||
// connect(g_qmlMain, SIGNAL(changed()), SIGNAL(changed()));
|
|
||||
} |
|
||||
|
|
||||
QmlEthereum::~QmlEthereum() |
|
||||
{ |
|
||||
} |
|
||||
|
|
||||
Client* QmlEthereum::client() const |
|
||||
{ |
|
||||
return g_qmlClient; |
|
||||
} |
|
||||
|
|
||||
Address QmlEthereum::coinbase() const |
|
||||
{ |
|
||||
return client()->address(); |
|
||||
} |
|
||||
|
|
||||
void QmlEthereum::setCoinbase(Address _a) |
|
||||
{ |
|
||||
if (client()->address() != _a) |
|
||||
{ |
|
||||
client()->setAddress(_a); |
|
||||
// changed();
|
|
||||
} |
|
||||
} |
|
||||
|
|
||||
u256 QmlEthereum::balanceAt(Address _a) const |
|
||||
{ |
|
||||
return client()->postState().balance(_a); |
|
||||
} |
|
||||
|
|
||||
bool QmlEthereum::isContractAt(Address _a) const |
|
||||
{ |
|
||||
return client()->postState().addressHasCode(_a); |
|
||||
} |
|
||||
|
|
||||
bool QmlEthereum::isMining() const |
|
||||
{ |
|
||||
return client()->isMining(); |
|
||||
} |
|
||||
|
|
||||
bool QmlEthereum::isListening() const |
|
||||
{ |
|
||||
return client()->haveNetwork(); |
|
||||
} |
|
||||
|
|
||||
void QmlEthereum::setMining(bool _l) |
|
||||
{ |
|
||||
if (_l) |
|
||||
client()->startMining(); |
|
||||
else |
|
||||
client()->stopMining(); |
|
||||
} |
|
||||
|
|
||||
void QmlEthereum::setListening(bool _l) |
|
||||
{ |
|
||||
if (_l) |
|
||||
client()->startNetwork(); |
|
||||
else |
|
||||
client()->stopNetwork(); |
|
||||
} |
|
||||
|
|
||||
double QmlEthereum::txCountAt(Address _a) const |
|
||||
{ |
|
||||
return (double)client()->postState().transactionsFrom(_a); |
|
||||
} |
|
||||
|
|
||||
unsigned QmlEthereum::peerCount() const |
|
||||
{ |
|
||||
return (unsigned)client()->peerCount(); |
|
||||
} |
|
||||
|
|
||||
void QmlEthereum::transact(Secret _secret, u256 _amount, u256 _gasPrice, u256 _gas, QByteArray _init) |
|
||||
{ |
|
||||
client()->transact(_secret, _amount, bytes(_init.data(), _init.data() + _init.size()), _gas, _gasPrice); |
|
||||
} |
|
||||
|
|
||||
void QmlEthereum::transact(Secret _secret, Address _dest, u256 _amount, u256 _gasPrice, u256 _gas, QByteArray _data) |
|
||||
{ |
|
||||
client()->transact(_secret, _amount, _dest, bytes(_data.data(), _data.data() + _data.size()), _gas, _gasPrice); |
|
||||
} |
|
||||
|
|
||||
#endif |
|
||||
|
|
||||
// extra bits needed to link on VS
|
|
||||
#ifdef _MSC_VER |
|
||||
|
|
||||
// include moc file, ofuscated to hide from automoc
|
|
||||
#include\ |
|
||||
"moc_QmlEthereum.cpp" |
|
||||
|
|
||||
#endif |
|
@ -1,283 +0,0 @@ |
|||||
#pragma once |
|
||||
|
|
||||
#include <QtCore/QAbstractListModel> |
|
||||
#if ETH_QTQML |
|
||||
#include <QtQml/QtQml> |
|
||||
#endif |
|
||||
#include <libdevcore/CommonIO.h> |
|
||||
#include <libethcore/CommonEth.h> |
|
||||
|
|
||||
namespace dev { namespace eth { |
|
||||
class Client; |
|
||||
class State; |
|
||||
}} |
|
||||
|
|
||||
class QQmlEngine; |
|
||||
class QmlAccount; |
|
||||
class QmlEthereum; |
|
||||
|
|
||||
extern dev::eth::Client* g_qmlClient; |
|
||||
extern QObject* g_qmlMain; |
|
||||
|
|
||||
Q_DECLARE_METATYPE(dev::u256) |
|
||||
Q_DECLARE_METATYPE(dev::Address) |
|
||||
Q_DECLARE_METATYPE(dev::Secret) |
|
||||
Q_DECLARE_METATYPE(dev::KeyPair) |
|
||||
//Q_DECLARE_METATYPE(QmlAccount*)
|
|
||||
//Q_DECLARE_METATYPE(QmlEthereum*)
|
|
||||
|
|
||||
class QmlU256Helper: public QObject |
|
||||
{ |
|
||||
Q_OBJECT |
|
||||
|
|
||||
public: |
|
||||
QmlU256Helper(QObject* _p = nullptr): QObject(_p) {} |
|
||||
|
|
||||
Q_INVOKABLE dev::u256 add(dev::u256 _a, dev::u256 _b) const { return _a + _b; } |
|
||||
Q_INVOKABLE dev::u256 sub(dev::u256 _a, dev::u256 _b) const { return _a - _b; } |
|
||||
Q_INVOKABLE dev::u256 mul(dev::u256 _a, int _b) const { return _a * _b; } |
|
||||
Q_INVOKABLE dev::u256 mul(int _a, dev::u256 _b) const { return _a * _b; } |
|
||||
Q_INVOKABLE dev::u256 div(dev::u256 _a, int _b) const { return _a / _b; } |
|
||||
|
|
||||
Q_INVOKABLE dev::u256 wei(double _s) const { return (dev::u256)_s; } |
|
||||
Q_INVOKABLE dev::u256 szabo(double _s) const { return (dev::u256)(_s * (double)dev::eth::szabo); } |
|
||||
Q_INVOKABLE dev::u256 finney(double _s) const { return (dev::u256)(_s * (double)dev::eth::finney); } |
|
||||
Q_INVOKABLE dev::u256 ether(double _s) const { return (dev::u256)(_s * (double)dev::eth::ether); } |
|
||||
Q_INVOKABLE dev::u256 wei(unsigned _s) const { return (dev::u256)_s; } |
|
||||
Q_INVOKABLE dev::u256 szabo(unsigned _s) const { return (dev::u256)(_s * dev::eth::szabo); } |
|
||||
Q_INVOKABLE dev::u256 finney(unsigned _s) const { return (dev::u256)(_s * dev::eth::finney); } |
|
||||
Q_INVOKABLE dev::u256 ether(unsigned _s) const { return (dev::u256)(_s * dev::eth::ether); } |
|
||||
Q_INVOKABLE double toWei(dev::u256 _t) const { return (double)_t; } |
|
||||
Q_INVOKABLE double toSzabo(dev::u256 _t) const { return toWei(_t) / (double)dev::eth::szabo; } |
|
||||
Q_INVOKABLE double toFinney(dev::u256 _t) const { return toWei(_t) / (double)dev::eth::finney; } |
|
||||
Q_INVOKABLE double toEther(dev::u256 _t) const { return toWei(_t) / (double)dev::eth::ether; } |
|
||||
|
|
||||
Q_INVOKABLE double value(dev::u256 _t) const { return (double)_t; } |
|
||||
|
|
||||
Q_INVOKABLE QString stringOf(dev::u256 _t) const { return QString::fromStdString(dev::eth::formatBalance(_t)); } |
|
||||
}; |
|
||||
|
|
||||
class QmlKeyHelper: public QObject |
|
||||
{ |
|
||||
Q_OBJECT |
|
||||
|
|
||||
public: |
|
||||
QmlKeyHelper(QObject* _p = nullptr): QObject(_p) {} |
|
||||
|
|
||||
Q_INVOKABLE dev::KeyPair create() const { return dev::KeyPair::create(); } |
|
||||
Q_INVOKABLE dev::Address address(dev::KeyPair _p) const { return _p.address(); } |
|
||||
Q_INVOKABLE dev::Secret secret(dev::KeyPair _p) const { return _p.secret(); } |
|
||||
Q_INVOKABLE dev::KeyPair keypair(dev::Secret _k) const { return dev::KeyPair(_k); } |
|
||||
|
|
||||
Q_INVOKABLE bool isNull(dev::Address _a) const { return !_a; } |
|
||||
|
|
||||
Q_INVOKABLE dev::Address addressOf(QString _s) const { return dev::Address(_s.toStdString()); } |
|
||||
Q_INVOKABLE QString stringOf(dev::Address _a) const { return QString::fromStdString(dev::toHex(_a.asArray())); } |
|
||||
Q_INVOKABLE QString toAbridged(dev::Address _a) const { return QString::fromStdString(_a.abridged()); } |
|
||||
}; |
|
||||
#if 0 |
|
||||
class QmlAccount: public QObject |
|
||||
{ |
|
||||
Q_OBJECT |
|
||||
|
|
||||
public: |
|
||||
QmlAccount(QObject* _p = nullptr); |
|
||||
virtual ~QmlAccount(); |
|
||||
|
|
||||
Q_INVOKABLE QmlEthereum* ethereum() const { return m_eth; } |
|
||||
Q_INVOKABLE dev::u256 balance() const; |
|
||||
Q_INVOKABLE double txCount() const; |
|
||||
Q_INVOKABLE bool isContract() const; |
|
||||
Q_INVOKABLE dev::Address address() const { return m_address; } |
|
||||
|
|
||||
// TODO: past transactions models.
|
|
||||
|
|
||||
public slots: |
|
||||
void setEthereum(QmlEthereum* _eth); |
|
||||
void setAddress(dev::Address _a) { m_address = _a; } |
|
||||
|
|
||||
signals: |
|
||||
void changed(); |
|
||||
void ethChanged(); |
|
||||
|
|
||||
private: |
|
||||
QmlEthereum* m_eth = nullptr; |
|
||||
dev::Address m_address; |
|
||||
|
|
||||
Q_PROPERTY(dev::u256 balance READ balance NOTIFY changed STORED false) |
|
||||
Q_PROPERTY(double txCount READ txCount NOTIFY changed STORED false) |
|
||||
Q_PROPERTY(bool isContract READ isContract NOTIFY changed STORED false) |
|
||||
Q_PROPERTY(dev::Address address READ address WRITE setAddress NOTIFY changed) |
|
||||
Q_PROPERTY(QmlEthereum* ethereum READ ethereum WRITE setEthereum NOTIFY ethChanged) |
|
||||
}; |
|
||||
|
|
||||
class QmlEthereum: public QObject |
|
||||
{ |
|
||||
Q_OBJECT |
|
||||
|
|
||||
public: |
|
||||
QmlEthereum(QObject* _p = nullptr); |
|
||||
virtual ~QmlEthereum(); |
|
||||
|
|
||||
dev::eth::Client* client() const; |
|
||||
|
|
||||
static QObject* constructU256Helper(QQmlEngine*, QJSEngine*) { return new QmlU256Helper; } |
|
||||
static QObject* constructKeyHelper(QQmlEngine*, QJSEngine*) { return new QmlKeyHelper; } |
|
||||
|
|
||||
Q_INVOKABLE dev::Address coinbase() const; |
|
||||
|
|
||||
Q_INVOKABLE bool isListening() const; |
|
||||
Q_INVOKABLE bool isMining() const; |
|
||||
|
|
||||
Q_INVOKABLE dev::u256 balanceAt(dev::Address _a) const; |
|
||||
Q_INVOKABLE double txCountAt(dev::Address _a) const; |
|
||||
Q_INVOKABLE bool isContractAt(dev::Address _a) const; |
|
||||
|
|
||||
Q_INVOKABLE unsigned peerCount() const; |
|
||||
|
|
||||
Q_INVOKABLE QmlEthereum* self() { return this; } |
|
||||
|
|
||||
public slots: |
|
||||
void transact(dev::Secret _secret, dev::Address _dest, dev::u256 _amount, dev::u256 _gasPrice, dev::u256 _gas, QByteArray _data); |
|
||||
void transact(dev::Secret _secret, dev::u256 _amount, dev::u256 _gasPrice, dev::u256 _gas, QByteArray _init); |
|
||||
void setCoinbase(dev::Address); |
|
||||
void setMining(bool _l); |
|
||||
|
|
||||
void setListening(bool _l); |
|
||||
|
|
||||
signals: |
|
||||
void coinbaseChanged(); |
|
||||
// void netChanged();
|
|
||||
// void miningChanged();
|
|
||||
|
|
||||
private: |
|
||||
Q_PROPERTY(dev::Address coinbase READ coinbase WRITE setCoinbase NOTIFY coinbaseChanged) |
|
||||
Q_PROPERTY(bool listening READ isListening WRITE setListening) |
|
||||
Q_PROPERTY(bool mining READ isMining WRITE setMining) |
|
||||
}; |
|
||||
#endif |
|
||||
#if 0 |
|
||||
template <class T> T to(QVariant const& _s) { if (_s.type() != QVariant::String) return T(); auto s = _s.toString().toLatin1(); assert(s.size() == sizeof(T)); return *(T*)s.data(); } |
|
||||
template <class T> QVariant toQJS(T const& _s) { QLatin1String ret((char*)&_s, sizeof(T)); assert(QVariant(QString(ret)).toString().toLatin1().size() == sizeof(T)); assert(*(T*)(QVariant(QString(ret)).toString().toLatin1().data()) == _s); return QVariant(QString(ret)); } |
|
||||
|
|
||||
class U256Helper: public QObject |
|
||||
{ |
|
||||
Q_OBJECT |
|
||||
|
|
||||
public: |
|
||||
U256Helper(QObject* _p = nullptr): QObject(_p) {} |
|
||||
|
|
||||
static dev::u256 in(QVariant const& _s) { return to<dev::u256>(_s); } |
|
||||
static QVariant out(dev::u256 const& _s) { return toQJS(_s); } |
|
||||
|
|
||||
Q_INVOKABLE QVariant add(QVariant _a, QVariant _b) const { return out(in(_a) + in(_b)); } |
|
||||
Q_INVOKABLE QVariant sub(QVariant _a, QVariant _b) const { return out(in(_a) - in(_b)); } |
|
||||
Q_INVOKABLE QVariant mul(QVariant _a, int _b) const { return out(in(_a) * in(_b)); } |
|
||||
Q_INVOKABLE QVariant mul(int _a, QVariant _b) const { return out(in(_a) * in(_b)); } |
|
||||
Q_INVOKABLE QVariant div(QVariant _a, int _b) const { return out(in(_a) / in(_b)); } |
|
||||
|
|
||||
Q_INVOKABLE QVariant wei(double _s) const { return out(dev::u256(_s)); } |
|
||||
Q_INVOKABLE QVariant szabo(double _s) const { return out(dev::u256(_s * (double)dev::eth::szabo)); } |
|
||||
Q_INVOKABLE QVariant finney(double _s) const { return out(dev::u256(_s * (double)dev::eth::finney)); } |
|
||||
Q_INVOKABLE QVariant ether(double _s) const { return out(dev::u256(_s * (double)dev::eth::ether)); } |
|
||||
Q_INVOKABLE QVariant wei(unsigned _s) const { return value(_s); } |
|
||||
Q_INVOKABLE QVariant szabo(unsigned _s) const { return out(dev::u256(_s) * dev::eth::szabo); } |
|
||||
Q_INVOKABLE QVariant finney(unsigned _s) const { return out(dev::u256(_s) * dev::eth::finney); } |
|
||||
Q_INVOKABLE QVariant ether(unsigned _s) const { return out(dev::u256(_s) * dev::eth::ether); } |
|
||||
Q_INVOKABLE double toWei(QVariant _t) const { return toValue(_t); } |
|
||||
Q_INVOKABLE double toSzabo(QVariant _t) const { return toWei(_t) / (double)dev::eth::szabo; } |
|
||||
Q_INVOKABLE double toFinney(QVariant _t) const { return toWei(_t) / (double)dev::eth::finney; } |
|
||||
Q_INVOKABLE double toEther(QVariant _t) const { return toWei(_t) / (double)dev::eth::ether; } |
|
||||
|
|
||||
Q_INVOKABLE QVariant value(unsigned _s) const { return out(dev::u256(_s)); } |
|
||||
Q_INVOKABLE double toValue(QVariant _t) const { return (double)in(_t); } |
|
||||
|
|
||||
Q_INVOKABLE QString ethOf(QVariant _t) const { return QString::fromStdString(dev::eth::formatBalance(in(_t))); } |
|
||||
Q_INVOKABLE QString stringOf(QVariant _t) const { return QString::fromStdString(dev::eth::toString(in(_t))); } |
|
||||
|
|
||||
Q_INVOKABLE QByteArray bytesOf(QVariant _t) const { dev::h256 b = in(_t); return QByteArray((char const*)&b, sizeof(dev::h256)); } |
|
||||
Q_INVOKABLE QVariant fromHex(QString _s) const { return out((dev::u256)dev::h256(_s.toStdString())); } |
|
||||
|
|
||||
Q_INVOKABLE QVariant fromAddress(QVariant/*dev::Address*/ _a) const { return out((dev::eth::u160)to<dev::Address>(_a)); } |
|
||||
Q_INVOKABLE QVariant toAddress(QVariant/*dev::Address*/ _a) const { return toQJS<dev::Address>((dev::eth::u160)in(_a)); } |
|
||||
|
|
||||
Q_INVOKABLE bool isNull(QVariant/*dev::Address*/ _a) const { return !in(_a); } |
|
||||
}; |
|
||||
|
|
||||
class KeyHelper: public QObject |
|
||||
{ |
|
||||
Q_OBJECT |
|
||||
|
|
||||
public: |
|
||||
KeyHelper(QObject* _p = nullptr): QObject(_p) {} |
|
||||
|
|
||||
static dev::Address in(QVariant const& _s) { return to<dev::Address>(_s); } |
|
||||
static QVariant out(dev::Address const& _s) { return toQJS(_s); } |
|
||||
|
|
||||
Q_INVOKABLE QVariant/*dev::KeyPair*/ create() const { return toQJS(dev::KeyPair::create()); } |
|
||||
Q_INVOKABLE QVariant/*dev::Address*/ address(QVariant/*dev::KeyPair*/ _p) const { return out(to<dev::KeyPair>(_p).address()); } |
|
||||
Q_INVOKABLE QVariant/*dev::Secret*/ secret(QVariant/*dev::KeyPair*/ _p) const { return toQJS(to<dev::KeyPair>(_p).secret()); } |
|
||||
Q_INVOKABLE QVariant/*dev::KeyPair*/ keypair(QVariant/*dev::Secret*/ _k) const { return toQJS(dev::KeyPair(to<dev::Secret>(_k))); } |
|
||||
|
|
||||
Q_INVOKABLE bool isNull(QVariant/*dev::Address*/ _a) const { return !in(_a); } |
|
||||
|
|
||||
Q_INVOKABLE QVariant/*dev::Address*/ addressOf(QString _s) const { return out(dev::Address(_s.toStdString())); } |
|
||||
Q_INVOKABLE QString stringOf(QVariant/*dev::Address*/ _a) const { return QString::fromStdString(dev::eth::toHex(in(_a).asArray())); } |
|
||||
Q_INVOKABLE QString toAbridged(QVariant/*dev::Address*/ _a) const { return QString::fromStdString(in(_a).abridged()); } |
|
||||
|
|
||||
}; |
|
||||
|
|
||||
class BytesHelper: public QObject |
|
||||
{ |
|
||||
Q_OBJECT |
|
||||
|
|
||||
public: |
|
||||
BytesHelper(QObject* _p = nullptr): QObject(_p) {} |
|
||||
|
|
||||
Q_INVOKABLE QByteArray concat(QVariant _v, QVariant _w) const |
|
||||
{ |
|
||||
QByteArray ba; |
|
||||
if (_v.type() == QVariant::ByteArray) |
|
||||
ba = _v.toByteArray(); |
|
||||
else |
|
||||
ba = _v.toString().toLatin1(); |
|
||||
QByteArray ba2; |
|
||||
if (_w.type() == QVariant::ByteArray) |
|
||||
ba2 = _w.toByteArray(); |
|
||||
else |
|
||||
ba2 = _w.toString().toLatin1(); |
|
||||
ba.append(ba2); |
|
||||
return QByteArray(ba); |
|
||||
} |
|
||||
Q_INVOKABLE QByteArray concat(QByteArray _v, QByteArray _w) const |
|
||||
{ |
|
||||
_v.append(_w); |
|
||||
return _v; |
|
||||
} |
|
||||
Q_INVOKABLE QByteArray fromString(QString _s) const |
|
||||
{ |
|
||||
return _s.toLatin1(); |
|
||||
} |
|
||||
Q_INVOKABLE QByteArray fromString(QString _s, unsigned _padding) const |
|
||||
{ |
|
||||
QByteArray b = _s.toLatin1(); |
|
||||
for (unsigned i = b.size(); i < _padding; ++i) |
|
||||
b.append((char)0); |
|
||||
b.resize(_padding); |
|
||||
return b; |
|
||||
} |
|
||||
Q_INVOKABLE QString toString(QByteArray _b) const |
|
||||
{ |
|
||||
while (_b.size() && !_b[_b.size() - 1]) |
|
||||
_b.resize(_b.size() - 1); |
|
||||
return QString::fromLatin1(_b); |
|
||||
} |
|
||||
Q_INVOKABLE QVariant u256of(QByteArray _s) const |
|
||||
{ |
|
||||
while (_s.size() < 32) |
|
||||
_s.append((char)0); |
|
||||
dev::h256 ret((uint8_t const*)_s.data(), dev::h256::ConstructFromPointer); |
|
||||
return toQJS<dev::u256>(ret); |
|
||||
} |
|
||||
}; |
|
||||
#endif |
|
@ -1,45 +1,32 @@ |
|||||
cmake_policy(SET CMP0015 NEW) |
cmake_policy(SET CMP0015 NEW) |
||||
|
# this policy was introduced in cmake 3.0 |
||||
|
# remove if, once 3.0 will be used on unix |
||||
|
if (${CMAKE_MAJOR_VERSION} GREATER 2) |
||||
|
# old policy do not use MACOSX_RPATH |
||||
|
cmake_policy(SET CMP0042 OLD) |
||||
|
endif() |
||||
|
set(CMAKE_AUTOMOC OFF) |
||||
|
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") |
||||
|
|
||||
aux_source_directory(. SRC_LIST) |
aux_source_directory(. SRC_LIST) |
||||
|
|
||||
|
include_directories(..) |
||||
|
|
||||
set(EXECUTABLE serpent) |
set(EXECUTABLE serpent) |
||||
|
|
||||
file(GLOB HEADERS "*.h") |
file(GLOB HEADERS "*.h") |
||||
|
|
||||
if(ETH_STATIC) |
if(ETH_STATIC) |
||||
add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) |
add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) |
||||
else() |
else() |
||||
add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) |
add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) |
||||
endif() |
endif() |
||||
|
|
||||
include_directories(..) |
|
||||
|
|
||||
target_link_libraries(${EXECUTABLE} lll) |
target_link_libraries(${EXECUTABLE} lll) |
||||
target_link_libraries(${EXECUTABLE} evmcore) |
target_link_libraries(${EXECUTABLE} evmcore) |
||||
target_link_libraries(${EXECUTABLE} devcore) |
target_link_libraries(${EXECUTABLE} devcore) |
||||
|
|
||||
if("${TARGET_PLATFORM}" STREQUAL "w64") |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread_win32-mt-s) |
|
||||
target_link_libraries(${EXECUTABLE} iphlpapi) |
|
||||
target_link_libraries(${EXECUTABLE} ws2_32) |
|
||||
target_link_libraries(${EXECUTABLE} mswsock) |
|
||||
target_link_libraries(${EXECUTABLE} shlwapi) |
|
||||
elseif (APPLE) |
|
||||
# Latest mavericks boost libraries only come with -mt |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread-mt) |
|
||||
find_package(Threads REQUIRED) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
elseif (UNIX) |
|
||||
target_link_libraries(${EXECUTABLE} ${Boost_THREAD_LIBRARY}) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
else () |
|
||||
target_link_libraries(${EXECUTABLE} boost_thread) |
|
||||
find_package(Threads REQUIRED) |
|
||||
target_link_libraries(${EXECUTABLE} ${CMAKE_THREAD_LIBS_INIT}) |
|
||||
endif () |
|
||||
|
|
||||
install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) |
install( TARGETS ${EXECUTABLE} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) |
||||
install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) |
install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) |
||||
#install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libserpent.so DESTINATION lib ) |
|
||||
|
|
||||
|
@ -1,351 +1,311 @@ |
|||||
/**
|
/**
|
||||
* THIS FILE IS GENERATED BY jsonrpcstub, DO NOT CHANGE IT!!!!! |
* This file is generated by jsonrpcstub, DO NOT CHANGE IT MANUALLY! |
||||
*/ |
*/ |
||||
|
|
||||
#ifndef _ABSTRACTWEBTHREESTUBSERVER_H_ |
#ifndef JSONRPC_CPP_STUB_ABSTRACTWEBTHREESTUBSERVER_H_ |
||||
#define _ABSTRACTWEBTHREESTUBSERVER_H_ |
#define JSONRPC_CPP_STUB_ABSTRACTWEBTHREESTUBSERVER_H_ |
||||
|
|
||||
#include <jsonrpc/rpc.h> |
#include <jsonrpccpp/server.h> |
||||
|
|
||||
class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThreeStubServer> |
class AbstractWebThreeStubServer : public jsonrpc::AbstractServer<AbstractWebThreeStubServer> |
||||
{ |
{ |
||||
public: |
public: |
||||
AbstractWebThreeStubServer(jsonrpc::AbstractServerConnector* conn) : |
AbstractWebThreeStubServer(jsonrpc::AbstractServerConnector &conn) : jsonrpc::AbstractServer<AbstractWebThreeStubServer>(conn) |
||||
jsonrpc::AbstractServer<AbstractWebThreeStubServer>(conn) |
|
||||
{ |
{ |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("db_get", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("db_getString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getStringI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("db_put", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("db_putString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putStringI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_accounts", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_accountsI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_balanceAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_balanceAtI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_blockByHashI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_blockByNumberI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_call", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_callI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_changedI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_codeAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_codeAtI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_coinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_coinbaseI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_coinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_coinbaseI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_compilers", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_compilersI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setCoinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_setCoinbaseI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_countAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_REAL, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_countAtI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_defaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_defaultBlockI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_filterLogs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_filterLogsI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_gasPrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_gasPriceI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_listening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_listeningI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_listening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_listeningI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_lll", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_lllI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setListening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setListeningI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_logs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_logsI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_mining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_miningI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_mining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_miningI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_newFilterI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setMining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setMiningI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilterString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_newFilterStringI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_gasPrice", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_gasPriceI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_number", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_numberI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_accounts", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_accountsI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_peerCount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_peerCountI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_peerCount", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_peerCountI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_serpent", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_serpentI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_defaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_defaultBlockI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setCoinbase", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_setCoinbaseI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setDefaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_setDefaultBlockI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setDefaultBlock", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_setDefaultBlockI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setListening", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setListeningI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_number", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_numberI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_setMining", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_BOOLEAN, NULL), &AbstractWebThreeStubServer::eth_setMiningI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_balanceAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_balanceAtI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_solidity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_solidityI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_stateAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_stateAtI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_stateAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_stateAtI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_storageAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_storageAtI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_storageAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_storageAtI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_countAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_REAL, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_countAtI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_codeAt", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_codeAtI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transact", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_transactI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transact", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_transactI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_call", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_callI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_blockByHashI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_blockByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_blockByNumberI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transactionByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_transactionByHashI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transactionByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_transactionByHashI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transactionByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_transactionByNumberI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_transactionByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_transactionByNumberI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uncleByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uncleByHashI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uncleByHash", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uncleByHashI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uncleByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uncleByNumberI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uncleByNumber", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_OBJECT, "param1",jsonrpc::JSON_INTEGER,"param2",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uncleByNumberI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_compilers", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, NULL), &AbstractWebThreeStubServer::eth_compilersI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_lll", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_lllI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_solidity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_solidityI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_serpent", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_serpentI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_newFilterI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_newFilterString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::eth_newFilterStringI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uninstallFilterI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_uninstallFilterI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_addToGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_addToGroupI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_changedI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_changedI); |
this->bindAndAddMethod(new jsonrpc::Procedure("eth_filterLogs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::eth_filterLogsI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("eth_logs", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::eth_logsI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("db_put", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("db_get", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("db_putString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING,"param3",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_putStringI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("db_getString", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::db_getStringI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("shh_post", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_postI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newIdentityI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_haveIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_haveIdentityI); |
this->bindAndAddMethod(new jsonrpc::Procedure("shh_haveIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_haveIdentityI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_newFilterI); |
|
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newGroupI); |
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newGroupI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newIdentity", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_newIdentityI); |
this->bindAndAddMethod(new jsonrpc::Procedure("shh_addToGroup", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_STRING, "param1",jsonrpc::JSON_STRING,"param2",jsonrpc::JSON_STRING, NULL), &AbstractWebThreeStubServer::shh_addToGroupI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_post", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_postI); |
this->bindAndAddMethod(new jsonrpc::Procedure("shh_newFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_INTEGER, "param1",jsonrpc::JSON_OBJECT, NULL), &AbstractWebThreeStubServer::shh_newFilterI); |
||||
this->bindAndAddMethod(new jsonrpc::Procedure("shh_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_uninstallFilterI); |
this->bindAndAddMethod(new jsonrpc::Procedure("shh_uninstallFilter", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_BOOLEAN, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_uninstallFilterI); |
||||
|
this->bindAndAddMethod(new jsonrpc::Procedure("shh_changed", jsonrpc::PARAMS_BY_POSITION, jsonrpc::JSON_ARRAY, "param1",jsonrpc::JSON_INTEGER, NULL), &AbstractWebThreeStubServer::shh_changedI); |
||||
} |
} |
||||
|
|
||||
inline virtual void db_getI(const Json::Value& request, Json::Value& response) |
inline virtual void eth_coinbaseI(const Json::Value &request, Json::Value &response) |
||||
{ |
{ |
||||
response = this->db_get(request[0u].asString(), request[1u].asString()); |
(void)request; |
||||
|
response = this->eth_coinbase(); |
||||
} |
} |
||||
|
inline virtual void eth_setCoinbaseI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void db_getStringI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->db_getString(request[0u].asString(), request[1u].asString()); |
response = this->eth_setCoinbase(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_listeningI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void db_putI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->db_put(request[0u].asString(), request[1u].asString(), request[2u].asString()); |
(void)request; |
||||
|
response = this->eth_listening(); |
||||
} |
} |
||||
|
inline virtual void eth_setListeningI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void db_putStringI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->db_putString(request[0u].asString(), request[1u].asString(), request[2u].asString()); |
response = this->eth_setListening(request[0u].asBool()); |
||||
} |
} |
||||
|
inline virtual void eth_miningI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_accountsI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_accounts(); |
(void)request; |
||||
|
response = this->eth_mining(); |
||||
} |
} |
||||
|
inline virtual void eth_setMiningI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_balanceAtI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_balanceAt(request[0u].asString()); |
response = this->eth_setMining(request[0u].asBool()); |
||||
} |
} |
||||
|
inline virtual void eth_gasPriceI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_blockByHashI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_blockByHash(request[0u].asString()); |
(void)request; |
||||
|
response = this->eth_gasPrice(); |
||||
} |
} |
||||
|
inline virtual void eth_accountsI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_blockByNumberI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_blockByNumber(request[0u].asInt()); |
(void)request; |
||||
|
response = this->eth_accounts(); |
||||
} |
} |
||||
|
inline virtual void eth_peerCountI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_callI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_call(request[0u]); |
(void)request; |
||||
|
response = this->eth_peerCount(); |
||||
} |
} |
||||
|
inline virtual void eth_defaultBlockI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_changedI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_changed(request[0u].asInt()); |
(void)request; |
||||
|
response = this->eth_defaultBlock(); |
||||
} |
} |
||||
|
inline virtual void eth_setDefaultBlockI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_codeAtI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_codeAt(request[0u].asString()); |
response = this->eth_setDefaultBlock(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_numberI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_coinbaseI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_coinbase(); |
(void)request; |
||||
|
response = this->eth_number(); |
||||
} |
} |
||||
|
inline virtual void eth_balanceAtI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_compilersI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_compilers(); |
response = this->eth_balanceAt(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_stateAtI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_countAtI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_countAt(request[0u].asString()); |
response = this->eth_stateAt(request[0u].asString(), request[1u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_storageAtI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_defaultBlockI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_defaultBlock(); |
response = this->eth_storageAt(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_countAtI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_filterLogsI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_filterLogs(request[0u].asInt()); |
response = this->eth_countAt(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_codeAtI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_gasPriceI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_gasPrice(); |
response = this->eth_codeAt(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_transactI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_listeningI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_listening(); |
response = this->eth_transact(request[0u]); |
||||
} |
} |
||||
|
inline virtual void eth_callI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_lllI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_lll(request[0u].asString()); |
response = this->eth_call(request[0u]); |
||||
} |
} |
||||
|
inline virtual void eth_blockByHashI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_logsI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_logs(request[0u]); |
response = this->eth_blockByHash(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_blockByNumberI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_miningI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_mining(); |
response = this->eth_blockByNumber(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_transactionByHashI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_newFilterI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_newFilter(request[0u]); |
response = this->eth_transactionByHash(request[0u].asString(), request[1u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_transactionByNumberI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_newFilterStringI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_newFilterString(request[0u].asString()); |
response = this->eth_transactionByNumber(request[0u].asInt(), request[1u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_uncleByHashI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_numberI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_number(); |
response = this->eth_uncleByHash(request[0u].asString(), request[1u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_uncleByNumberI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_peerCountI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_peerCount(); |
response = this->eth_uncleByNumber(request[0u].asInt(), request[1u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_compilersI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_serpentI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_serpent(request[0u].asString()); |
(void)request; |
||||
|
response = this->eth_compilers(); |
||||
} |
} |
||||
|
inline virtual void eth_lllI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_setCoinbaseI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_setCoinbase(request[0u].asString()); |
response = this->eth_lll(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_solidityI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_setDefaultBlockI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_setDefaultBlock(request[0u].asInt()); |
response = this->eth_solidity(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_serpentI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_setListeningI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_setListening(request[0u].asBool()); |
response = this->eth_serpent(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_newFilterI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_setMiningI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_setMining(request[0u].asBool()); |
response = this->eth_newFilter(request[0u]); |
||||
} |
} |
||||
|
inline virtual void eth_newFilterStringI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_solidityI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_solidity(request[0u].asString()); |
response = this->eth_newFilterString(request[0u].asString()); |
||||
} |
} |
||||
|
inline virtual void eth_uninstallFilterI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_stateAtI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_stateAt(request[0u].asString(), request[1u].asString()); |
response = this->eth_uninstallFilter(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_changedI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_storageAtI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_storageAt(request[0u].asString()); |
response = this->eth_changed(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_filterLogsI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_transactI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_transact(request[0u]); |
response = this->eth_filterLogs(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void eth_logsI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_transactionByHashI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_transactionByHash(request[0u].asString(), request[1u].asInt()); |
response = this->eth_logs(request[0u]); |
||||
} |
} |
||||
|
inline virtual void db_putI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_transactionByNumberI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_transactionByNumber(request[0u].asInt(), request[1u].asInt()); |
response = this->db_put(request[0u].asString(), request[1u].asString(), request[2u].asString()); |
||||
} |
} |
||||
|
inline virtual void db_getI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_uncleByHashI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_uncleByHash(request[0u].asString(), request[1u].asInt()); |
response = this->db_get(request[0u].asString(), request[1u].asString()); |
||||
} |
} |
||||
|
inline virtual void db_putStringI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_uncleByNumberI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_uncleByNumber(request[0u].asInt(), request[1u].asInt()); |
response = this->db_putString(request[0u].asString(), request[1u].asString(), request[2u].asString()); |
||||
} |
} |
||||
|
inline virtual void db_getStringI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void eth_uninstallFilterI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->eth_uninstallFilter(request[0u].asInt()); |
response = this->db_getString(request[0u].asString(), request[1u].asString()); |
||||
} |
} |
||||
|
inline virtual void shh_postI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_addToGroupI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_addToGroup(request[0u].asString(), request[1u].asString()); |
response = this->shh_post(request[0u]); |
||||
} |
} |
||||
|
inline virtual void shh_newIdentityI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_changedI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_changed(request[0u].asInt()); |
(void)request; |
||||
|
response = this->shh_newIdentity(); |
||||
} |
} |
||||
|
|
||||
inline virtual void shh_haveIdentityI(const Json::Value &request, Json::Value &response) |
inline virtual void shh_haveIdentityI(const Json::Value &request, Json::Value &response) |
||||
{ |
{ |
||||
response = this->shh_haveIdentity(request[0u].asString()); |
response = this->shh_haveIdentity(request[0u].asString()); |
||||
} |
} |
||||
|
|
||||
inline virtual void shh_newFilterI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
|
||||
response = this->shh_newFilter(request[0u]); |
|
||||
} |
|
||||
|
|
||||
inline virtual void shh_newGroupI(const Json::Value &request, Json::Value &response) |
inline virtual void shh_newGroupI(const Json::Value &request, Json::Value &response) |
||||
{ |
{ |
||||
response = this->shh_newGroup(request[0u].asString(), request[1u].asString()); |
response = this->shh_newGroup(request[0u].asString(), request[1u].asString()); |
||||
} |
} |
||||
|
inline virtual void shh_addToGroupI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_newIdentityI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_newIdentity(); |
response = this->shh_addToGroup(request[0u].asString(), request[1u].asString()); |
||||
} |
} |
||||
|
inline virtual void shh_newFilterI(const Json::Value &request, Json::Value &response) |
||||
inline virtual void shh_postI(const Json::Value& request, Json::Value& response) |
|
||||
{ |
{ |
||||
response = this->shh_post(request[0u]); |
response = this->shh_newFilter(request[0u]); |
||||
} |
} |
||||
|
|
||||
inline virtual void shh_uninstallFilterI(const Json::Value &request, Json::Value &response) |
inline virtual void shh_uninstallFilterI(const Json::Value &request, Json::Value &response) |
||||
{ |
{ |
||||
response = this->shh_uninstallFilter(request[0u].asInt()); |
response = this->shh_uninstallFilter(request[0u].asInt()); |
||||
} |
} |
||||
|
inline virtual void shh_changedI(const Json::Value &request, Json::Value &response) |
||||
|
{ |
||||
virtual std::string db_get(const std::string& param1, const std::string& param2) = 0; |
response = this->shh_changed(request[0u].asInt()); |
||||
virtual std::string db_getString(const std::string& param1, const std::string& param2) = 0; |
} |
||||
virtual bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) = 0; |
|
||||
virtual bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) = 0; |
|
||||
virtual Json::Value eth_accounts() = 0; |
|
||||
virtual std::string eth_balanceAt(const std::string& param1) = 0; |
|
||||
virtual Json::Value eth_blockByHash(const std::string& param1) = 0; |
|
||||
virtual Json::Value eth_blockByNumber(const int& param1) = 0; |
|
||||
virtual std::string eth_call(const Json::Value& param1) = 0; |
|
||||
virtual bool eth_changed(const int& param1) = 0; |
|
||||
virtual std::string eth_codeAt(const std::string& param1) = 0; |
|
||||
virtual std::string eth_coinbase() = 0; |
virtual std::string eth_coinbase() = 0; |
||||
virtual Json::Value eth_compilers() = 0; |
virtual bool eth_setCoinbase(const std::string& param1) = 0; |
||||
virtual double eth_countAt(const std::string& param1) = 0; |
|
||||
virtual int eth_defaultBlock() = 0; |
|
||||
virtual Json::Value eth_filterLogs(const int& param1) = 0; |
|
||||
virtual std::string eth_gasPrice() = 0; |
|
||||
virtual bool eth_listening() = 0; |
virtual bool eth_listening() = 0; |
||||
virtual std::string eth_lll(const std::string& param1) = 0; |
virtual bool eth_setListening(const bool& param1) = 0; |
||||
virtual Json::Value eth_logs(const Json::Value& param1) = 0; |
|
||||
virtual bool eth_mining() = 0; |
virtual bool eth_mining() = 0; |
||||
virtual int eth_newFilter(const Json::Value& param1) = 0; |
virtual bool eth_setMining(const bool& param1) = 0; |
||||
virtual int eth_newFilterString(const std::string& param1) = 0; |
virtual std::string eth_gasPrice() = 0; |
||||
virtual int eth_number() = 0; |
virtual Json::Value eth_accounts() = 0; |
||||
virtual int eth_peerCount() = 0; |
virtual int eth_peerCount() = 0; |
||||
virtual std::string eth_serpent(const std::string& param1) = 0; |
virtual int eth_defaultBlock() = 0; |
||||
virtual bool eth_setCoinbase(const std::string& param1) = 0; |
|
||||
virtual bool eth_setDefaultBlock(const int& param1) = 0; |
virtual bool eth_setDefaultBlock(const int& param1) = 0; |
||||
virtual bool eth_setListening(const bool& param1) = 0; |
virtual int eth_number() = 0; |
||||
virtual bool eth_setMining(const bool& param1) = 0; |
virtual std::string eth_balanceAt(const std::string& param1) = 0; |
||||
virtual std::string eth_solidity(const std::string& param1) = 0; |
|
||||
virtual std::string eth_stateAt(const std::string& param1, const std::string& param2) = 0; |
virtual std::string eth_stateAt(const std::string& param1, const std::string& param2) = 0; |
||||
virtual Json::Value eth_storageAt(const std::string& param1) = 0; |
virtual Json::Value eth_storageAt(const std::string& param1) = 0; |
||||
|
virtual double eth_countAt(const std::string& param1) = 0; |
||||
|
virtual std::string eth_codeAt(const std::string& param1) = 0; |
||||
virtual std::string eth_transact(const Json::Value& param1) = 0; |
virtual std::string eth_transact(const Json::Value& param1) = 0; |
||||
|
virtual std::string eth_call(const Json::Value& param1) = 0; |
||||
|
virtual Json::Value eth_blockByHash(const std::string& param1) = 0; |
||||
|
virtual Json::Value eth_blockByNumber(const int& param1) = 0; |
||||
virtual Json::Value eth_transactionByHash(const std::string& param1, const int& param2) = 0; |
virtual Json::Value eth_transactionByHash(const std::string& param1, const int& param2) = 0; |
||||
virtual Json::Value eth_transactionByNumber(const int& param1, const int& param2) = 0; |
virtual Json::Value eth_transactionByNumber(const int& param1, const int& param2) = 0; |
||||
virtual Json::Value eth_uncleByHash(const std::string& param1, const int& param2) = 0; |
virtual Json::Value eth_uncleByHash(const std::string& param1, const int& param2) = 0; |
||||
virtual Json::Value eth_uncleByNumber(const int& param1, const int& param2) = 0; |
virtual Json::Value eth_uncleByNumber(const int& param1, const int& param2) = 0; |
||||
|
virtual Json::Value eth_compilers() = 0; |
||||
|
virtual std::string eth_lll(const std::string& param1) = 0; |
||||
|
virtual std::string eth_solidity(const std::string& param1) = 0; |
||||
|
virtual std::string eth_serpent(const std::string& param1) = 0; |
||||
|
virtual int eth_newFilter(const Json::Value& param1) = 0; |
||||
|
virtual int eth_newFilterString(const std::string& param1) = 0; |
||||
virtual bool eth_uninstallFilter(const int& param1) = 0; |
virtual bool eth_uninstallFilter(const int& param1) = 0; |
||||
virtual std::string shh_addToGroup(const std::string& param1, const std::string& param2) = 0; |
virtual bool eth_changed(const int& param1) = 0; |
||||
virtual Json::Value shh_changed(const int& param1) = 0; |
virtual Json::Value eth_filterLogs(const int& param1) = 0; |
||||
|
virtual Json::Value eth_logs(const Json::Value& param1) = 0; |
||||
|
virtual bool db_put(const std::string& param1, const std::string& param2, const std::string& param3) = 0; |
||||
|
virtual std::string db_get(const std::string& param1, const std::string& param2) = 0; |
||||
|
virtual bool db_putString(const std::string& param1, const std::string& param2, const std::string& param3) = 0; |
||||
|
virtual std::string db_getString(const std::string& param1, const std::string& param2) = 0; |
||||
|
virtual bool shh_post(const Json::Value& param1) = 0; |
||||
|
virtual std::string shh_newIdentity() = 0; |
||||
virtual bool shh_haveIdentity(const std::string& param1) = 0; |
virtual bool shh_haveIdentity(const std::string& param1) = 0; |
||||
virtual int shh_newFilter(const Json::Value& param1) = 0; |
|
||||
virtual std::string shh_newGroup(const std::string& param1, const std::string& param2) = 0; |
virtual std::string shh_newGroup(const std::string& param1, const std::string& param2) = 0; |
||||
virtual std::string shh_newIdentity() = 0; |
virtual std::string shh_addToGroup(const std::string& param1, const std::string& param2) = 0; |
||||
virtual bool shh_post(const Json::Value& param1) = 0; |
virtual int shh_newFilter(const Json::Value& param1) = 0; |
||||
virtual bool shh_uninstallFilter(const int& param1) = 0; |
virtual bool shh_uninstallFilter(const int& param1) = 0; |
||||
|
virtual Json::Value shh_changed(const int& param1) = 0; |
||||
}; |
}; |
||||
#endif //_ABSTRACTWEBTHREESTUBSERVER_H_
|
|
||||
|
#endif //JSONRPC_CPP_ABSTRACTWEBTHREESTUBSERVER_H_
|
||||
|
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue