Browse Source

Add separate marketmaker targets for mainnet and testnet.

patch-3
Artem Pikulin 7 years ago
parent
commit
918e836a4f
  1. 19
      README.md
  2. 10
      iguana/exchanges/CMakeLists.txt
  3. 13
      iguana/exchanges/etomicswap/CMakeLists.txt
  4. 1
      iguana/exchanges/etomicswap/etomiccurl.h
  5. 1
      iguana/exchanges/etomicswap/etomiclib.h

19
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`

10
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)
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)

13
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)
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)

1
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

1
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"

Loading…
Cancel
Save