diff --git a/.travis.yml b/.travis.yml index 145e4ba91..5134babf8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,8 +20,9 @@ before_install: - git submodule update --init --recursive script: + - export VERSION=`echo "$(git tag -l --points-at HEAD)"` - mkdir build && cd build - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -DCMAKE_C_COMPILER=/usr/bin/gcc-7 -DCMAKE_CXX_COMPILER=/usr/bin/g++-7 ..; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then cmake -DMM_VERSION="$VERSION" -DCMAKE_C_COMPILER=/usr/bin/gcc-7 -DCMAKE_CXX_COMPILER=/usr/bin/g++-7 ..; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cmake ..; fi - cmake --build . --target marketmaker-mainnet - cmake --build . --target marketmaker-testnet diff --git a/appveyor.yml b/appveyor.yml index a909db77a..c227d9031 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,7 @@ artifacts: name: marketmaker-mainnet deploy: - release: marketmaker-v$(appveyor_build_version) + release: v$(appveyor_build_version) provider: GitHub auth_token: secure: iabzoz73JgtOIyE/Nmz4a4XefmK+7pIeup+1Hunj4hGKrdfesFN+176DMApgfu8t diff --git a/iguana/exchanges/CMakeLists.txt b/iguana/exchanges/CMakeLists.txt index 793aeb5a4..011e4cd37 100644 --- a/iguana/exchanges/CMakeLists.txt +++ b/iguana/exchanges/CMakeLists.txt @@ -31,4 +31,9 @@ target_link_libraries(marketmaker-mainnet ${MM_LIBS} etomiclib-mainnet) if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") target_link_libraries(marketmaker-mainnet -static-libgcc -static-libstdc++) target_link_libraries(marketmaker-testnet -static-libgcc -static-libstdc++) -endif() \ No newline at end of file +endif() +if(NOT DEFINED MM_VERSION) + SET(MM_VERSION UNKNOWN) +endif() +target_compile_definitions(marketmaker-mainnet PRIVATE -DMM_VERSION="${MM_VERSION}") +target_compile_definitions(marketmaker-testnet PRIVATE -DMM_VERSION="${MM_VERSION}") \ No newline at end of file diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index d715efc8c..55d74e87a 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -30,6 +30,9 @@ // there is an issue about waiting for notarization for a swap that never starts (expiration ok) #include +#ifndef MM_VERSION +#define MM_VERSION "UNKNOWN" +#endif long LP_cjson_allocated,LP_cjson_total,LP_cjson_count; @@ -1290,8 +1293,7 @@ extern int32_t bitcoind_RPC_inittime; void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybusport,char *passphrase,int32_t amclient,char *userhome,cJSON *argjson) { - char *myipaddr=0,version[64]; long filesize,n; int32_t valid,timeout; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128],*coins_str=0; cJSON *coinsjson=0; void *ctx = bitcoin_ctx(); - sprintf(version,"Marketmaker %s.%s %s rsize.%ld",LP_MAJOR_VERSION,LP_MINOR_VERSION,LP_BUILD_NUMBER,sizeof(struct basilisk_request)); + char *myipaddr=0; long filesize,n; int32_t valid,timeout; struct LP_peerinfo *mypeer=0; char pushaddr[128],subaddr[128],bindaddr[128],*coins_str=0; cJSON *coinsjson=0; void *ctx = bitcoin_ctx(); bitcoind_RPC_inittime = 1; if ( LP_MAXPRICEINFOS > 256 ) { @@ -1299,7 +1301,7 @@ void LPinit(uint16_t myport,uint16_t mypullport,uint16_t mypubport,uint16_t mybu exit(-1); } LP_showwif = juint(argjson,"wif"); - printf("showwif.%d %s %u\n",LP_showwif,version,calc_crc32(0,version,(int32_t)strlen(version))); + printf("showwif.%d version: %s %u\n",LP_showwif,MM_VERSION,calc_crc32(0,MM_VERSION,(int32_t)strlen(MM_VERSION))); if ( passphrase == 0 || passphrase[0] == 0 ) { printf("jeezy says we cant use the nullstring as passphrase and I agree\n"); diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index c35046538..f83b6c2a2 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -164,6 +164,7 @@ int main(int argc, const char * argv[]) { char dirname[512]; double incr; cJSON *retjson; OS_init(); + printf("BarterDEX Marketmaker %s \n",MM_VERSION); if ( strstr(argv[0],"btc2kmd") != 0 && argv[1] != 0 ) { bits256 privkey,checkkey; uint8_t tmptype; char kmdwif[64],str[65],str2[65],*retstr; diff --git a/marketmaker_build_etomic.cmd b/marketmaker_build_etomic.cmd index ed76db72c..cd0d5bbd0 100644 --- a/marketmaker_build_etomic.cmd +++ b/marketmaker_build_etomic.cmd @@ -16,7 +16,7 @@ call scripts\install_deps.bat cd .. mkdir build_win64_release cd build_win64_release -cmake .. -G "Visual Studio 14 2015 Win64" +cmake .. -G "Visual Studio 14 2015 Win64" -DMM_VERSION="%APPVEYOR_BUILD_VERSION%" rem Steps before build: rem