From 918e836a4ffed7a457c99367d87a8d796410447f Mon Sep 17 00:00:00 2001 From: Artem Pikulin Date: Wed, 7 Mar 2018 18:58:18 +0700 Subject: [PATCH] Add separate marketmaker targets for mainnet and testnet. --- README.md | 19 ++++++++++--------- iguana/exchanges/CMakeLists.txt | 10 +++++----- iguana/exchanges/etomicswap/CMakeLists.txt | 13 +++++++------ iguana/exchanges/etomicswap/etomiccurl.h | 1 - iguana/exchanges/etomicswap/etomiclib.h | 1 - 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index b0577f2a1..b0c77724c 100755 --- a/README.md +++ b/README.md @@ -257,13 +257,14 @@ Execute the OSX deploy script: The iguana binary and its linked libraries are in ```$HOME/tmp/iguana```. # Cmake build of marketmaker with linked etomic lib for ETH/ERC20 atomic swaps: -0. `make sure g++-7 ln to /usr/bin/g++` +1. `make sure g++-7 ln to /usr/bin/g++` 1. `cd ~/SuperNET` -2. `git checkout dev` -3. `git submodule update --init --recursive` -4. `mkdir build` -5. `cd build` -6. `cmake ..` -7. `cmake --build . --target marketmaker` -8. `cd build/iguana/exchanges` -9. `./marketmaker` +1. `git checkout dev` +1. `git submodule update --init --recursive` +1. `mkdir build` +1. `cd build` +1. `cmake ..` +1. `cmake --build . --target marketmaker-testnet` for Ropsten Ethereum testnet. +1. `cmake --build . --target marketmaker-mainnet` for Ethereum mainnet. +1. `cd build/iguana/exchanges` +1. `./marketmaker-testnet` or `./marketmaker-mainnet` diff --git a/iguana/exchanges/CMakeLists.txt b/iguana/exchanges/CMakeLists.txt index 696d2557c..edd42c9c8 100644 --- a/iguana/exchanges/CMakeLists.txt +++ b/iguana/exchanges/CMakeLists.txt @@ -1,7 +1,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -add_executable(marketmaker mm.c) +add_executable(marketmaker-testnet mm.c ../mini-gmp.c ../groestl.c ../segwit_addr.c) +add_executable(marketmaker-mainnet mm.c ../mini-gmp.c ../groestl.c ../segwit_addr.c) include_directories(../../crypto777) -target_sources(marketmaker PRIVATE ../mini-gmp.c) -target_sources(marketmaker PRIVATE ../groestl.c) -target_sources(marketmaker PRIVATE ../segwit_addr.c) -target_link_libraries(marketmaker PRIVATE nanomsg curl pthread m libcrypto777 libjpeg libsecp256k1 "-Wl,--allow-multiple-definition" etomiclib) \ No newline at end of file +target_compile_definitions(marketmaker-testnet PRIVATE ETOMIC_TESTNET) +target_link_libraries(marketmaker-testnet PRIVATE nanomsg curl pthread m libcrypto777 libjpeg libsecp256k1 "-Wl,--allow-multiple-definition" etomiclib-testnet) +target_link_libraries(marketmaker-mainnet PRIVATE nanomsg curl pthread m libcrypto777 libjpeg libsecp256k1 "-Wl,--allow-multiple-definition" etomiclib-mainnet) \ No newline at end of file diff --git a/iguana/exchanges/etomicswap/CMakeLists.txt b/iguana/exchanges/etomicswap/CMakeLists.txt index 0df98500a..eb23965a3 100644 --- a/iguana/exchanges/etomicswap/CMakeLists.txt +++ b/iguana/exchanges/etomicswap/CMakeLists.txt @@ -1,10 +1,11 @@ cmake_minimum_required(VERSION 2.8.9) -add_library(etomiclib etomiclib.cpp) -add_library(etomiccurl etomiccurl.c) +add_library(etomiclib-testnet etomiclib.cpp etomiccurl.c) +add_library(etomiclib-mainnet etomiclib.cpp etomiccurl.c) +target_compile_definitions(etomiclib-testnet PRIVATE ETOMIC_TESTNET) add_executable(alice alice.c) add_executable(bob bob.c) include_directories("${CMAKE_SOURCE_DIR}/cpp-ethereum") -target_link_libraries(etomiccurl PUBLIC curl libcrypto777) -target_link_libraries(etomiclib PUBLIC ethcore devcrypto devcore etomiccurl) -target_link_libraries(alice PUBLIC etomiclib) -target_link_libraries(bob PUBLIC etomiclib etomiccurl) \ No newline at end of file +target_link_libraries(etomiclib-testnet PUBLIC curl libcrypto777 ethcore devcrypto devcore) +target_link_libraries(etomiclib-mainnet PUBLIC curl libcrypto777 ethcore devcrypto devcore) +target_link_libraries(alice PUBLIC etomiclib-testnet) +target_link_libraries(bob PUBLIC etomiclib-testnet) \ No newline at end of file diff --git a/iguana/exchanges/etomicswap/etomiccurl.h b/iguana/exchanges/etomicswap/etomiccurl.h index 1661201b6..a27f67c11 100644 --- a/iguana/exchanges/etomicswap/etomiccurl.h +++ b/iguana/exchanges/etomicswap/etomiccurl.h @@ -8,7 +8,6 @@ extern "C"{ #endif -#define ETOMIC_TESTNET #ifdef ETOMIC_TESTNET #define ETOMIC_URL "https://ropsten.infura.io/y07GHxUyTgeN2mdfOonu" #define DEFAULT_GAS_PRICE 100 diff --git a/iguana/exchanges/etomicswap/etomiclib.h b/iguana/exchanges/etomicswap/etomiclib.h index 6c0714e97..fdc64ae59 100644 --- a/iguana/exchanges/etomicswap/etomiclib.h +++ b/iguana/exchanges/etomicswap/etomiclib.h @@ -7,7 +7,6 @@ extern "C" { #endif -#define ETOMIC_TESTNET #ifdef ETOMIC_TESTNET #define ETOMIC_ALICECONTRACT "0xe1d4236c5774d35dc47dcc2e5e0ccfc463a3289c" #define ETOMIC_BOBCONTRACT "0x9387fd3a016bb0205e4e131dde886b9d2bc000a2"