diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..6439216
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "src/xmregcore"]
+ path = src/xmregcore
+ url = git@github.com:moneroexamples/xmregcore.git
diff --git a/.ycm_extra_conf.py b/.ycm_extra_conf.py
index 920d5b0..c614441 100644
--- a/.ycm_extra_conf.py
+++ b/.ycm_extra_conf.py
@@ -1,4 +1,4 @@
-# Generated by YCM Generator at 2019-01-02 17:01:50.568923
+# Generated by YCM Generator at 2019-02-04 14:20:15.172928
# This file is NOT licensed under the GPLv3, which is the license for the rest
# of YouCompleteMe.
@@ -45,7 +45,8 @@ flags = [
'-I/home/mwo2/monero/external/easylogging++',
'-I/home/mwo2/monero/src',
'-I/home/mwo2/openmonero/ext/restbed/source',
- '-I/tmp/tmp9cWyau/gen',
+ '-I/home/mwo2/openmonero/src/xmregcore',
+ '-I/tmp/tmpgXp0yM/gen',
'-I/usr/include/mysql',
'-I/usr/local/include',
'-I/usr/local/include/mysql',
@@ -54,7 +55,7 @@ flags = [
'-Weffc++',
'-Wextra',
'-Wno-unknown-pragmas',
- '-std=c++11',
+ '-std=c++14',
'-std=gnu++14',
'-isystem', '/home/mwo2/openmonero/ext/restbed/dependency/asio/asio/include',
'-isystem', '/home/mwo2/openmonero/ext/restbed/dependency/kashmir',
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a8547a5..fde1eb0 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,7 @@ set(PROJECT_NAME
project(${PROJECT_NAME})
set(CMAKE_CXX_STANDARD 14)
+set(CMAKE_BUILD_TYPE Debug)
if(CMAKE_SIZEOF_VOID_P EQUAL "4")
add_definitions(-DMDB_VL32)
@@ -15,6 +16,8 @@ if (NOT MONERO_DIR)
set(MONERO_DIR ~/monero)
endif()
+set( CMAKE_EXPORT_COMPILE_COMMANDS ON )
+
option(BUILD_TESTS "Build tests for the project" OFF)
message(STATUS MONERO_DIR ": ${MONERO_DIR}")
@@ -31,6 +34,8 @@ set(MY_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake"
list(APPEND CMAKE_MODULE_PATH "${MY_CMAKE_DIR}")
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/src/xmregcore/cmake")
+
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${MONERO_BUILD_DIR}"
CACHE PATH "Add Monero directory for library searching")
@@ -47,15 +52,17 @@ if (${BUILD_TESTS})
'${CMAKE_SOURCE_DIR}/tests/*')
endif()
-find_package(Monero)
-
find_package(MYSQL)
if (NOT MYSQL_INCLUDE_DIR)
- message(SEND_ERROR "MySQL libraries not found! Please install mysql++/mysqlpp libraries")
+ message(SEND_ERROR "MySQL libraries not found!
+ Please install mysql++/mysqlpp libraries")
return()
endif()
+
+
+
include_directories(${MYSQL_INCLUDE_DIR})
# include boost headers
@@ -79,7 +86,8 @@ link_directories(
create_git_version()
-configure_files(${CMAKE_CURRENT_SOURCE_DIR}/config ${CMAKE_CURRENT_BINARY_DIR}/config)
+configure_files(${CMAKE_CURRENT_SOURCE_DIR}/config
+ ${CMAKE_CURRENT_BINARY_DIR}/config)
# find boost
@@ -96,6 +104,11 @@ find_package(Boost COMPONENTS
REQUIRED)
+# add XMREGCORE submodule
+set(BUILD_XMREGCORE_TESTS OFF CACHE INTERNAL "")
+add_subdirectory(src/xmregcore)
+
+
# add src/ subfolder
add_subdirectory(src/)
@@ -109,36 +122,24 @@ set(SOURCE_FILES
add_executable(${PROJECT_NAME}
${SOURCE_FILES})
+target_include_directories(${PROJECT_NAME}
+ PRIVATE src/xmregcore)
+
+# include monero headers
+target_include_monero_directories(${PROJECT_NAME})
+
set(LIBRARIES
myxrm
+ myxrmcore
+ ${Monero_LIBRARIES}
restbed
- wallet
- cryptonote_core
- blockchain_db
- cryptonote_protocol
- cryptonote_basic
- daemonizer
- cncrypto
- blocks
- lmdb
- ringct
- ringct_basic
- common
- mnemonics
- epee
- easylogging
mysqlpp
mysqlclient
- device
- epee
- checkpoints
- version
- sodium
${Boost_LIBRARIES}
+ sodium
pthread
unbound
curl
- cncrypto
ssl
crypto)
diff --git a/cmake/FindMonero.cmake b/cmake/FindMonero.cmake
deleted file mode 100755
index 2f27d1a..0000000
--- a/cmake/FindMonero.cmake
+++ /dev/null
@@ -1,77 +0,0 @@
-#------------------------------------------------------------------------------
-# CMake helper for the majority of the cpp-ethereum modules.
-#
-# This module defines
-# Monero_XXX_LIBRARIES, the libraries needed to use ethereum.
-# Monero_FOUND, If false, do not try to use ethereum.
-#
-# File addetped from cpp-ethereum
-#
-# The documentation for cpp-ethereum is hosted at http://cpp-ethereum.org
-#
-# ------------------------------------------------------------------------------
-# This file is part of cpp-ethereum.
-#
-# cpp-ethereum is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# cpp-ethereum is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with cpp-ethereum. If not, see
-#
-# (c) 2014-2016 cpp-ethereum contributors.
-#------------------------------------------------------------------------------
-
-set(LIBS common;blocks;cryptonote_basic;cryptonote_core;
- cryptonote_protocol;daemonizer;mnemonics;epee;lmdb;device;
- blockchain_db;ringct;wallet;cncrypto;easylogging;version;checkpoints)
-
-set(Xmr_INCLUDE_DIRS "${CPP_MONERO_DIR}")
-
-# if the project is a subset of main cpp-ethereum project
-# use same pattern for variables as Boost uses
-
-foreach (l ${LIBS})
-
- string(TOUPPER ${l} L)
-
- find_library(Xmr_${L}_LIBRARY
- NAMES ${l}
- PATHS ${CMAKE_LIBRARY_PATH}
- PATH_SUFFIXES "/src/${l}" "/src/" "/external/db_drivers/lib${l}" "/lib" "/src/crypto" "/contrib/epee/src" "/external/easylogging++/"
- NO_DEFAULT_PATH
- )
-
- set(Xmr_${L}_LIBRARIES ${Xmr_${L}_LIBRARY})
-
- message(STATUS FindMonero " Xmr_${L}_LIBRARIES ${Xmr_${L}_LIBRARY}")
-
- add_library(${l} STATIC IMPORTED)
- set_property(TARGET ${l} PROPERTY IMPORTED_LOCATION ${Xmr_${L}_LIBRARIES})
-
-endforeach()
-
-
-if (EXISTS ${MONERO_BUILD_DIR}/src/ringct/libringct_basic.a)
- message(STATUS FindMonero " found libringct_basic.a")
- add_library(ringct_basic STATIC IMPORTED)
- set_property(TARGET ringct_basic
- PROPERTY IMPORTED_LOCATION ${MONERO_BUILD_DIR}/src/ringct/libringct_basic.a)
-endif()
-
-message(STATUS ${MONERO_SOURCE_DIR}/build)
-
-# include monero headers
-include_directories(
- ${MONERO_SOURCE_DIR}/src
- ${MONERO_SOURCE_DIR}/external
- ${MONERO_SOURCE_DIR}/build
- ${MONERO_SOURCE_DIR}/external/easylogging++
- ${MONERO_SOURCE_DIR}/contrib/epee/include
- ${MONERO_SOURCE_DIR}/external/db_drivers/liblmdb)
\ No newline at end of file
diff --git a/cmake/MyUtils.cmake b/cmake/MyUtils.cmake
deleted file mode 100755
index a348abe..0000000
--- a/cmake/MyUtils.cmake
+++ /dev/null
@@ -1,99 +0,0 @@
-
-macro(configure_files srcDir destDir)
- message(STATUS "Configuring directory ${destDir}")
- make_directory(${destDir})
-
- file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/*)
- foreach(templateFile ${templateFiles})
- set(srcTemplatePath ${srcDir}/${templateFile})
- if(NOT IS_DIRECTORY ${srcTemplatePath})
- message(STATUS "Configuring file ${templateFile}")
- configure_file(
- ${srcTemplatePath}
- ${destDir}/${templateFile}
- @ONLY)
- endif(NOT IS_DIRECTORY ${srcTemplatePath})
- endforeach(templateFile)
-endmacro(configure_files)
-
-macro(create_git_version)
- # Get the current working branch
- execute_process(
- COMMAND git rev-parse --abbrev-ref HEAD
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_VARIABLE GIT_BRANCH
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- # http://xit0.org/2013/04/cmake-use-git-branch-and-commit-details-in-project/
- # Get the latest abbreviated commit hash of the working branch
- execute_process(
- COMMAND git log -1 --format=%h
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_VARIABLE GIT_COMMIT_HASH
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- # Get the date and time of last commit
- execute_process(
- COMMAND git log -1 --format=%cd --date=short
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_VARIABLE GIT_COMMIT_DATETIME
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- # Get current branch name
- execute_process(
- COMMAND git rev-parse --abbrev-ref HEAD
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- OUTPUT_VARIABLE GIT_BRANCH_NAME
- OUTPUT_STRIP_TRAILING_WHITESPACE
- )
-
- configure_file(
- ${CMAKE_SOURCE_DIR}/src/version.h.in
- ${CMAKE_BINARY_DIR}/gen/version.h
- )
-
- include_directories(${CMAKE_BINARY_DIR}/gen)
-
-endmacro(create_git_version)
-
-
-
-macro(resource_dir srcDir)
- # Scan through resource folder for updated files and copy if none existing or changed
- file (GLOB_RECURSE resources "${srcDir}/*.*")
-
- foreach(resource ${resources})
- get_filename_component(filename ${resource} NAME)
- get_filename_component(dir ${resource} DIRECTORY)
- get_filename_component(dirname ${dir} NAME)
-
- # message("${dirname} ${srcDir}")
-
- set(topdir ${dirname})
-
- set(output "")
-
- while(NOT ${dirname} STREQUAL ${srcDir})
- get_filename_component(path_component ${dir} NAME)
- set (output "${path_component}/${output}")
- get_filename_component(dir ${dir} DIRECTORY)
- get_filename_component(dirname ${dir} NAME)
- endwhile()
-
- set(output "${CMAKE_CURRENT_BINARY_DIR}/${topdir}/${filename}")
-
- add_custom_command(
- COMMENT "Moving updated resource-file '${filename}' to ${output}"
- OUTPUT ${output}
- DEPENDS ${resource}
- COMMAND ${CMAKE_COMMAND} -E copy_if_different
- ${resource}
- ${output}
- )
- add_custom_target("${dirname}${filename}" ALL DEPENDS ${resource} ${output})
-
- endforeach()
-endmacro(resource_dir)
diff --git a/ext/json.hpp b/ext/json.hpp
deleted file mode 100755
index 51f16de..0000000
--- a/ext/json.hpp
+++ /dev/null
@@ -1,18590 +0,0 @@
-/*
- __ _____ _____ _____
- __| | __| | | | JSON for Modern C++
-| | |__ | | | | | | version 3.1.2
-|_____|_____|_____|_|___| https://github.com/nlohmann/json
-
-Licensed under the MIT License .
-SPDX-License-Identifier: MIT
-Copyright (c) 2013-2018 Niels Lohmann .
-
-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.
-*/
-
-#ifndef NLOHMANN_JSON_HPP
-#define NLOHMANN_JSON_HPP
-
-#define NLOHMANN_JSON_VERSION_MAJOR 3
-#define NLOHMANN_JSON_VERSION_MINOR 1
-#define NLOHMANN_JSON_VERSION_PATCH 2
-
-#include // all_of, find, for_each
-#include // assert
-#include // and, not, or
-#include // nullptr_t, ptrdiff_t, size_t
-#include // hash, less
-#include // initializer_list
-#include // istream, ostream
-#include // iterator_traits, random_access_iterator_tag
-#include // accumulate
-#include // string, stoi, to_string
-#include // declval, forward, move, pair, swap
-
-// #include
-#ifndef NLOHMANN_JSON_FWD_HPP
-#define NLOHMANN_JSON_FWD_HPP
-
-#include // int64_t, uint64_t
-#include