diff --git a/.gitignore b/.gitignore index 48ca7cb38..5cb2be3fe 100755 --- a/.gitignore +++ b/.gitignore @@ -259,3 +259,6 @@ build .idea Release/* + +build_win64_release/* +DB/* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..5730c4869 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,30 @@ +language: c + +matrix: + include: + - os: linux + compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-7 + env: OS_NAME=Linux MATRIX_EVAL="CC=gcc-7 && CXX=g++-7" + - os: osx + compiler: clang + env: OS_NAME=Darwin + osx_image: xcode9.2 + +before_install: + - git submodule update --init --recursive + +script: + - 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" == "osx" ]]; then cmake ..; fi + - cmake --build . --target marketmaker-mainnet + +cache: + directories: + - $HOME/.hunter \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 173fb54da..feb0c7acb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9.6) +cmake_minimum_required(VERSION 3.9.2) include("cmake/HunterGate.cmake") HunterGate( URL "https://github.com/ruslo/hunter/archive/v0.19.173.tar.gz" @@ -23,7 +23,7 @@ download_project(PROJ nanomsg UPDATE_DISCONNECTED 1 ) -find_library(NANOMSG_LIBRARY NAMES nanomsg PATHS ${DEPS_INSTALL_PREFIX}/lib) +find_library(NANOMSG_LIBRARY NAMES nanomsg PATHS ${DEPS_INSTALL_PREFIX}/lib NO_DEFAULT_PATH) include_directories("${CMAKE_SOURCE_DIR}") add_subdirectory(cpp-ethereum) add_subdirectory(iguana/exchanges) diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..f7bb536b0 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,20 @@ +pipeline { + agent { + docker { + image 'artempikulin/cmake-ubuntu' + } + + } + stages { + stage('Build') { + steps { + sh '''git submodule update --init --recursive +rm -rf build +mkdir build +cd build +cmake .. +cmake --build . --target marketmaker-testnet''' + } + } + } +} \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..de2123bc5 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,6 @@ +version: 1.0.{build} +branches: + only: + - etomic +build_script: +- cmd: marketmaker_build_etomic.cmd \ No newline at end of file diff --git a/cpp-ethereum b/cpp-ethereum index 633c62c08..c25a98257 160000 --- a/cpp-ethereum +++ b/cpp-ethereum @@ -1 +1 @@ -Subproject commit 633c62c08bc73c7c3935c948a8d6c656a3659976 +Subproject commit c25a98257e7104875503e183dd0f27d49b3efd56 diff --git a/crypto777/CMakeLists.txt b/crypto777/CMakeLists.txt index dbe0cf18d..ac2316e04 100644 --- a/crypto777/CMakeLists.txt +++ b/crypto777/CMakeLists.txt @@ -2,4 +2,10 @@ file(GLOB sources "*.c") file(GLOB headers "*.h") add_library(libcrypto777 ${sources} ${headers}) target_compile_definitions(libcrypto777 PRIVATE USE_STATIC_NANOMSG) -target_link_libraries(libcrypto777 PUBLIC curl ${NANOMSG_LIBRARY}) \ No newline at end of file +target_link_libraries(libcrypto777 PUBLIC curl ${NANOMSG_LIBRARY}) +if(WIN32) +add_definitions(-DNATIVE_WINDOWS) +add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +include_directories("${CMAKE_SOURCE_DIR}/includes") +endif() diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 810b2c96d..4a38e90b3 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -73,8 +73,8 @@ char *post_process_bitcoind_RPC(char *debugstr,char *command,char *rpcstr,char * long i,j,len; char *retstr = 0; cJSON *json,*result,*error; -#ifdef FROM_MARKETMAKER - //usleep(1000); +#ifndef FROM_MARKETMAKER + usleep(1000); #endif //printf("<<<<<<<<<<< bitcoind_RPC: %s post_process_bitcoind_RPC.%s.[%s]\n",debugstr,command,rpcstr); if ( command == 0 || rpcstr == 0 || rpcstr[0] == 0 ) @@ -164,7 +164,11 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * if ( url[0] == 0 ) strcpy(url,"http://127.0.0.1:7776"); if ( specialcase != 0 && (0) ) + { + //int32_t zeroval(); printf("<<<<<<<<<<< bitcoind_RPC: userpass.(%s) url.(%s) command.(%s) params.(%s)\n",userpass,url,command,params); + //printf("die.%d\n",1/zeroval()); + } try_again: if ( retstrp != 0 ) *retstrp = 0; diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index 645baefea..36c2e03a4 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -557,7 +557,7 @@ int _increasing_uint64(const void *a,const void *b) #undef uint64_b } -static int _decreasing_uint64(const void *a,const void *b) +int _decreasing_uint64(const void *a,const void *b) { #define uint64_a (*(uint64_t *)a) #define uint64_b (*(uint64_t *)b) @@ -570,7 +570,7 @@ static int _decreasing_uint64(const void *a,const void *b) #undef uint64_b } -static int _decreasing_uint32(const void *a,const void *b) +int _decreasing_uint32(const void *a,const void *b) { #define uint32_a (*(uint32_t *)a) #define uint32_b (*(uint32_t *)b) diff --git a/iguana/dPoW.h b/iguana/dPoW.h index 7862fe36d..49461af75 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -23,8 +23,8 @@ #define DPOW_MIN_ASSETCHAIN_SIGS 11 //#define DPOW_M(bp) ((bp)->minsigs) // (((bp)->numnotaries >> 1) + 1) #define DPOW_MODIND(bp,offset) (((((bp)->height / DPOW_CHECKPOINTFREQ) % (bp)->numnotaries) + (offset)) % (bp)->numnotaries) -#define DPOW_VERSION 0x1781 -#define DPOW_UTXOSIZE 50000 +#define DPOW_VERSION 0x1782 +#define DPOW_UTXOSIZE 10000//50000 #define DPOW_MINOUTPUT 6000 #define DPOW_DURATION 600 #define DPOW_RATIFYDURATION (3600 * 24) diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index eb5638ff4..ccd30bbec 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -260,19 +260,22 @@ int32_t dpow_txhasnotarization(uint64_t *signedmaskp,int32_t *nothtp,struct supe if ( numnotaries >= DPOW_MIN_ASSETCHAIN_SIGS ) { hasnotarization = 1; - *nothtp = height - 10; + *nothtp = 0; if ( (vouts= jarray(&numvouts,txobj,"vout")) != 0 ) { bits256 blockhash,txid,MoM; uint32_t MoMdepth; char symbol[65];//,str[65],str2[65],str3[65]; vout = jitem(vouts,numvouts-1); - if ( (sobj= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(sobj,"hex")) != 0 && (len= is_hexstr(hexstr,0)) > 35*2 && len < sizeof(script)*2 ) + if ( (sobj= jobj(vout,"scriptPubKey")) != 0 && (hexstr= jstr(sobj,"hex")) != 0 && (len= is_hexstr(hexstr,0)) > 36*2 && len < sizeof(script)*2 ) { len >>= 1; decode_hex(script,len,hexstr); if ( dpow_opreturn_parsesrc(&blockhash,nothtp,&txid,symbol,&MoM,&MoMdepth,script,len) > 0 ) { - if ( bits256_nonz(MoM) == 0 || MoMdepth == 0 || *nothtp >= height || *nothtp < 0 ) - *nothtp = 0; + if ( Notaries_port != DPOW_SOCKPORT ) + { + if ( bits256_nonz(MoM) == 0 || MoMdepth == 0 || *nothtp >= height || *nothtp < 0 ) + *nothtp = 0; + } //printf("%s.%d notarizationht.%d %s -> %s MoM.%s [%d]\n",symbol,height,*nothtp,bits256_str(str,blockhash),bits256_str(str2,txid),bits256_str(str3,MoM),MoMdepth); } } @@ -329,7 +332,7 @@ bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct igu { breakht = notht; //free_json(blockjson); - //printf("%s has notarization at %d for breakht.%d\n",coin->symbol,ht,notht); + printf("%s has notarization at %d for breakht.%d\n",coin->symbol,ht,notht); } merkle = jbits256(blockjson,"merkleroot"); free_json(blockjson); @@ -349,6 +352,7 @@ bits256 dpow_calcMoM(uint32_t *MoMdepthp,struct supernet_info *myinfo,struct igu break; } ht = height - MoMdepth; + usleep(10000); } if ( MoMdepth > 0 ) { @@ -400,10 +404,9 @@ void dpow_statemachinestart(void *ptr) else if ( strcmp(dest->symbol,"KMD") == 0 ) { kmdheight = dest->longestchain; - //portable_mutex_lock(&myinfo->MoM_mutex); - //if ( Notaries_port != DPOW_SOCKPORT ) - MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); - //portable_mutex_unlock(&myinfo->MoM_mutex); + portable_mutex_lock(&src->MoM_mutex); + MoM = dpow_calcMoM(&MoMdepth,myinfo,src,checkpoint.blockhash.height); + portable_mutex_unlock(&src->MoM_mutex); } if ( (bp= dp->blocks[checkpoint.blockhash.height]) == 0 ) { diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index b649708a1..a44e02fbc 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -230,7 +230,7 @@ int32_t dpow_paxpending(uint8_t *hex,uint32_t *paxwdcrcp,bits256 MoM,uint32_t Mo { struct iguana_info *coin; char *retstr,*hexstr; cJSON *retjson; int32_t n=0; uint32_t paxwdcrc; paxwdcrc = 0; - if ( Notaries_port != DPOW_SOCKPORT ) + //if ( Notaries_port != DPOW_SOCKPORT ) { n += iguana_rwbignum(1,&hex[n],sizeof(MoM),MoM.bytes); n += iguana_rwnum(1,&hex[n],sizeof(MoMdepth),(uint32_t *)&MoMdepth); @@ -1277,6 +1277,8 @@ int32_t dpow_issuer_iteration(struct dpow_info *dp,struct iguana_info *coin,int3 if ( height <= 0 ) height = 1; *isrealtimep = 0; + if ( coin->getinfostr[0] == 0 ) + strcpy(coin->getinfostr,"getinfo"); if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)coin->getinfostr,0,port)) != 0 ) { if ( (infoobj= cJSON_Parse(retstr)) != 0 ) diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index dad95859c..e2e6f5798 100755 --- a/iguana/dpow/dpow_tx.c +++ b/iguana/dpow/dpow_tx.c @@ -232,7 +232,7 @@ int32_t dpow_voutstandard(struct dpow_block *bp,uint8_t *serialized,int32_t m,in printf("%02x",extras[i]); printf(" <- withdraw.%d %08x\n",n,paxwdcrc); } - else if ( Notaries_port != DPOW_SOCKPORT && bp->MoMdepth > 0 && strcmp(bp->destcoin->symbol,"KMD") == 0 ) // only testnets for now + else if ( bp->MoMdepth > 0 && strcmp(bp->destcoin->symbol,"KMD") == 0 ) // Notaries_port != DPOW_SOCKPORT && { n = dpow_paxpending(extras,&paxwdcrc,bp->MoM,bp->MoMdepth); //n += iguana_rwbignum(1,&extras[n],sizeof(bp->MoM),bp->MoM.bytes); diff --git a/iguana/exchanges/CMakeLists.txt b/iguana/exchanges/CMakeLists.txt index d5c1613f2..793aeb5a4 100644 --- a/iguana/exchanges/CMakeLists.txt +++ b/iguana/exchanges/CMakeLists.txt @@ -1,14 +1,34 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}) set(MM_SOURCES mm.c ../mini-gmp.c ../groestl.c ../segwit_addr.c ../keccak.c LP_etomic.c) set(MM_LIBS curl pthread libcrypto777 libjpeg libsecp256k1) +if(WIN32) +link_directories(${CMAKE_SOURCE_DIR}/marketmaker_depends/curl/build_msvc_2015_win64/lib/Release ${CMAKE_SOURCE_DIR}/marketmaker_depends/pthread-win32/bin/x64_MSVC2015.Release ${CMAKE_SOURCE_DIR}/marketmaker_depends/nanomsg/build_msvc_2015_win64/Release) +set(MM_LIBS ${MM_LIBS} nanomsg) +endif() add_executable(marketmaker-testnet ${MM_SOURCES}) add_executable(marketmaker-mainnet ${MM_SOURCES}) include_directories(../../crypto777) +if(WIN32) +target_compile_definitions(marketmaker-mainnet PRIVATE) +target_compile_definitions(marketmaker-testnet PRIVATE ETOMIC_TESTNET) +else() target_compile_definitions(marketmaker-testnet PRIVATE ETOMIC_TESTNET USE_STATIC_NANOMSG) target_compile_definitions(marketmaker-mainnet PRIVATE USE_STATIC_NANOMSG) +endif() if(UNIX) target_link_libraries(marketmaker-testnet m) target_link_libraries(marketmaker-mainnet m) endif() +if(WIN32) +add_definitions(-DNATIVE_WINDOWS) +add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +add_definitions(-D_CRT_SECURE_NO_WARNINGS) +include_directories("${CMAKE_SOURCE_DIR}/includes") +endif() target_link_libraries(marketmaker-testnet ${MM_LIBS} etomiclib-testnet) 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 diff --git a/iguana/exchanges/DEXstats.h b/iguana/exchanges/DEXstats.h index dc1f89864..3758a4e55 100644 --- a/iguana/exchanges/DEXstats.h +++ b/iguana/exchanges/DEXstats.h @@ -928,7 +928,7 @@ char *stats_prices(char *symbol,char *dest,struct DEXstats_disp *prices,int32_t #ifndef FROM_MARKETMAKER #ifndef FROM_PRIVATEBET -char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port) +char *stats_JSON(void *ctx,int32_t fastflag,char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port) { char *method,*agent,*retstr,*source,*dest; struct tai T; uint32_t endtimestamp; struct DEXstats_disp prices[365]; int32_t leftdatenum,seconds,numdates; if ( (method= jstr(argjson,"method")) == 0 ) diff --git a/iguana/exchanges/LP_coins.c b/iguana/exchanges/LP_coins.c index a493654e6..e3a75cb8b 100644 --- a/iguana/exchanges/LP_coins.c +++ b/iguana/exchanges/LP_coins.c @@ -238,9 +238,10 @@ cJSON *LP_coinjson(struct iguana_info *coin,int32_t showwif) } #ifndef NOTETOMIC else if (coin->etomic[0] != 0) { - balance = LP_etomic_get_balance(coin, coin->smartaddr); + //balance = LP_etomic_get_balance(coin, coin->smartaddr); jaddnum(item,"height",-1); - jaddnum(item,"balance",dstr(balance)); + //jaddnum(item,"balance",dstr(balance)); + jaddnum(item,"balance",0); } #endif else diff --git a/iguana/exchanges/LP_commands.c b/iguana/exchanges/LP_commands.c index 3a862ac0a..8ad5cf94c 100644 --- a/iguana/exchanges/LP_commands.c +++ b/iguana/exchanges/LP_commands.c @@ -32,7 +32,7 @@ char *LP_numutxos() return(jprint(retjson,1)); } -char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port +char *stats_JSON(void *ctx,int32_t fastflag,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port) // from rpc port { char *method,*userpass,*base,*rel,*coin,*passphrase,*retstr = 0; int32_t authenticated=0,changed,flag = 0; cJSON *retjson,*reqjson = 0; struct iguana_info *ptr; method = jstr(argjson,"method"); @@ -168,10 +168,12 @@ timelock(coin, duration, destaddr=(tradeaddr), amount)\n\ unlockedspend(coin, txid)\n\ opreturndecrypt(coin, txid, passphrase)\n\ getendpoint(port=5555)\n\ +getfee(coin)\n\ +sleep(seconds=60)\n\ +listtransactions(coin, address, count=10, skip=0)\n\ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ \"}")); - //sell(base, rel, price, basevolume, timeout=10, duration=3600)\n\ - + if ( (base= jstr(argjson,"base")) == 0 ) base = ""; if ((rel= jstr(argjson,"rel")) == 0 ) @@ -317,6 +319,13 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ LP_millistats_update(0); return(clonestr("{\"result\":\"success\"}")); } + else if ( strcmp(method,"sleep") == 0 ) + { + if ( jint(argjson,"seconds") == 0 ) + sleep(60); + else sleep(jint(argjson,"seconds")); + return(clonestr("{\"result\":\"success\",\"status\":\"feeling good after sleeping\"}")); + } else if ( strcmp(method,"getprices") == 0 ) return(LP_prices()); else if ( strcmp(method,"getpeers") == 0 ) @@ -375,6 +384,11 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ jaddbits256(retjson,"privkey",privkey); bitcoin_priv2wif(coin,wiftaddr,wifstr,privkey,wiftype); jaddstr(retjson,"wif",wifstr); +#ifndef NOTETOMIC + char ethaddr[50]; + LP_etomic_pubkeystr_to_addr(pubsecp, ethaddr); + jaddstr(retjson,"ethaddr",ethaddr); +#endif return(jprint(retjson,1)); } else return(clonestr("{\"error\":\"need to have passphrase\"}")); } @@ -477,18 +491,30 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ } else if ( strcmp(method,"buy") == 0 ) { - //* + int32_t fomo = 0; double vol; + if ( jobj(argjson,"fomo") != 0 ) + { + fomo = 1; + price = 1.; + vol = jdouble(argjson,"fomo"); + } else vol = jdouble(argjson,"relvolume"); if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,base,rel,price,jdouble(argjson,"relvolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"destpubkey"),0)); + return(LP_autobuy(ctx,fomo,myipaddr,pubsock,base,rel,price,vol,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"destpubkey"),0)); } else return(clonestr("{\"error\":\"no price set\"}")); } else if ( strcmp(method,"sell") == 0 ) { - //* + int32_t fomo = 0; double vol; + if ( jobj(argjson,"dump") != 0 ) + { + fomo = 1; + price = 1.; + vol = jdouble(argjson,"dump"); + } else vol = jdouble(argjson,"basevolume"); if ( price > SMALLVAL ) { - return(LP_autobuy(ctx,myipaddr,pubsock,rel,base,1./price,jdouble(argjson,"basevolume"),jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"destpubkey"),0)); + return(LP_autobuy(ctx,fomo,myipaddr,pubsock,rel,base,1./price,vol,jint(argjson,"timeout"),jint(argjson,"duration"),jstr(argjson,"gui"),juint(argjson,"nonce"),jbits256(argjson,"destpubkey"),0)); } else return(clonestr("{\"error\":\"no price set\"}")); } } @@ -567,6 +593,19 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ return(jprint(LP_address_balance(ptr,jstr(argjson,"address"),1),1)); else return(clonestr("{\"error\":\"cant find coind\"}")); } + else if ( strcmp(method,"getfee") == 0 ) + { + uint64_t txfee; + if ( (ptr= LP_coinsearch(coin)) != 0 ) + { + txfee = LP_txfeecalc(ptr,0,0); + retjson = cJSON_CreateObject(); + jaddstr(retjson,"result","success"); + jaddstr(retjson,"coin",coin); + jaddnum(retjson,"txfee",dstr(txfee)); + return(jprint(retjson,1)); + } else return(clonestr("{\"error\":\"cant find coind\"}")); + } else if ( strcmp(method,"electrum") == 0 ) { if ( (ptr= LP_coinsearch(coin)) != 0 ) @@ -595,6 +634,12 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ { return(LP_unlockedspend(ctx,coin,jbits256(argjson,"txid"))); } + // cJSON *LP_listtransactions(char *symbol,char *coinaddr,int32_t count,int32_t skip) + else if ( strcmp(method,"listtransactions") == 0 ) + { + if ( (ptr= LP_coinfind(coin)) != 0 ) + return(jprint(LP_listtransactions(coin,jstr(argjson,"address"),juint(argjson,"count"),juint(argjson,"skip")),1)); + } else if ( strcmp(method,"getrawtransaction") == 0 ) { return(jprint(LP_gettx("stats_JSON",coin,jbits256(argjson,"txid"),0),1)); @@ -661,14 +706,14 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ } if ( strcmp(method,"inventory") == 0 ) { - struct iguana_info *ptr; + struct iguana_info *ptr; int32_t num; if ( (ptr= LP_coinfind(coin)) != 0 ) { LP_address(ptr,ptr->smartaddr); if ( jint(argjson,"reset") != 0 ) { ptr->privkeydepth = 0; - LP_address_utxo_reset(ptr); + LP_address_utxo_reset(&num,ptr); LP_passphrase_init(jstr(argjson,"passphrase"),G.gui,G.netid,G.seednode); } if ( bits256_nonz(G.LP_privkey) != 0 ) @@ -682,7 +727,7 @@ jpg(srcfile, destfile, power2=7, password, data="", required, ind=0)\n\ //jadd(retjson,"alice",LP_inventory(coin)); //jadd(retjson,"bob",LP_inventory(coin,1)); //LP_smartutxos_push(ptr); - LP_address_utxo_reset(ptr); + LP_address_utxo_reset(&num,ptr); return(jprint(retjson,1)); } } diff --git a/iguana/exchanges/LP_etomic.h b/iguana/exchanges/LP_etomic.h index 31da07237..af5de5f63 100644 --- a/iguana/exchanges/LP_etomic.h +++ b/iguana/exchanges/LP_etomic.h @@ -51,4 +51,6 @@ uint8_t LP_etomic_is_empty_tx_id(char *txId); uint64_t LP_etomic_get_balance(struct iguana_info *coin, char *coinaddr); +void LP_etomic_pubkeystr_to_addr(char *pubkey, char *output); + #endif //SUPERNET_LP_ETOMIC_H diff --git a/iguana/exchanges/LP_include.h b/iguana/exchanges/LP_include.h index f1bdb2fb1..ad95be0d9 100644 --- a/iguana/exchanges/LP_include.h +++ b/iguana/exchanges/LP_include.h @@ -35,7 +35,7 @@ voind dontprintf(char *formatstr,...) {} #define LP_MAJOR_VERSION "0" #define LP_MINOR_VERSION "1" -#define LP_BUILD_NUMBER "27771" +#define LP_BUILD_NUMBER "27772" #define LP_BARTERDEX_VERSION 1 #define LP_MAGICBITS 1 @@ -303,7 +303,7 @@ struct iguana_info portable_mutex_t txmutex,addrmutex,addressutxo_mutex; struct LP_transaction *transactions; struct LP_address *addresses; uint64_t txfee; int32_t numutxos,notarized,longestchain,firstrefht,firstscanht,lastscanht,height; uint16_t busport,did_addrutxo_reset; - uint32_t txversion,dPoWtime,lastresetutxo,loadedcache,electrumlist,lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; + uint32_t txversion,dPoWtime,lastautosplit,lastresetutxo,loadedcache,electrumlist,lastunspent,importedprivkey,lastpushtime,lastutxosync,addr_listunspent_requested,lastutxos,updaterate,counter,inactive,lastmempool,lastgetinfo,ratetime,heighttime,lastmonitor,obooktime; uint8_t pubtype,p2shtype,isPoS,wiftype,wiftaddr,taddr,noimportprivkey_flag,userconfirms,isassetchain,maxconfirms; char symbol[128],smartaddr[64],userpass[1024],serverport[128],instantdex_address[64],estimatefeestr[32],getinfostr[32],etomic[64]; // portfolio @@ -498,6 +498,7 @@ int32_t LP_numconfirms(char *symbol,char *coinaddr,bits256 txid,int32_t vout,int void LP_aliceid(uint32_t tradeid,uint64_t aliceid,char *event,uint32_t requestid,uint32_t quoteid); void LP_autoprices_update(char *method,char *base,double basevol,char *rel,double relvol); cJSON *LP_cache_transaction(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len); +uint64_t LP_balance(uint64_t *valuep,int32_t iambob,char *symbol,char *coinaddr); cJSON *LP_transaction_fromdata(struct iguana_info *coin,bits256 txid,uint8_t *serialized,int32_t len); uint64_t LP_RTsmartbalance(struct iguana_info *coin); int32_t LP_getheight(int32_t *notarizedp,struct iguana_info *coin); @@ -555,6 +556,7 @@ uint16_t LP_randpeer(char *destip); void LP_tradebot_pauseall(); int32_t LP_etomic_pub2addr(char *coinaddr,uint8_t pub64[64]); void LP_portfolio_reset(); +int32_t LP_autoref_clear(char *base,char *rel); int32_t bitcoin_addr2rmd160(char *symbol,uint8_t taddr,uint8_t *addrtypep,uint8_t rmd160[20],char *coinaddr); struct LP_pubkey_info *LP_pubkeyadd(bits256 pubkey); uint32_t LP_atomic_locktime(char *base,char *rel); @@ -572,6 +574,7 @@ int64_t LP_dynamictrust(int64_t credits,bits256 pubkey,int64_t kmdvalue); struct LP_address *LP_addressfind(struct iguana_info *coin,char *coinaddr); int64_t LP_outpoint_amount(char *symbol,bits256 txid,int32_t vout); void LP_initpeers(int32_t pubsock,struct LP_peerinfo *mypeer,char *myipaddr,uint16_t myport,uint16_t netid,char *seednode); +int _decreasing_uint64(const void *a,const void *b); void LP_listunspent_query(char *symbol,char *coinaddr); int32_t bitcoin_priv2wif(char *symbol,uint8_t wiftaddr,char *wifstr,bits256 privkey,uint8_t addrtype); diff --git a/iguana/exchanges/LP_instantdex.c b/iguana/exchanges/LP_instantdex.c index 1aac5d4e5..f3ddcb523 100644 --- a/iguana/exchanges/LP_instantdex.c +++ b/iguana/exchanges/LP_instantdex.c @@ -678,13 +678,13 @@ cJSON *LP_swapstats_item(struct LP_swapstats *sp,int32_t iambob) struct iguana_info *bob,*alice; int32_t flag = 0; char *retstr,*swapstr; bits256 zero; cJSON *item,*reqjson,*swapjson; item = cJSON_CreateObject(); jaddnum(item,"iambob",iambob); - jaddnum(item,"aliceid",sp->aliceid); + jadd64bits(item,"aliceid",sp->aliceid); jaddnum(item,"requestid",sp->Q.R.requestid); jaddnum(item,"quoteid",sp->Q.R.quoteid); jaddstr(item,"base",sp->Q.srccoin); - jaddnum(item,"satoshis",sp->Q.satoshis); + jadd64bits(item,"satoshis",sp->Q.satoshis); jaddstr(item,"rel",sp->Q.destcoin); - jaddnum(item,"destsatoshis",sp->Q.destsatoshis); + jadd64bits(item,"destsatoshis",sp->Q.destsatoshis); jaddnum(item,"price",sp->Q.destsatoshis/((double)sp->Q.satoshis+1)); if ( LP_swap_finished(sp,1) == 0 ) { diff --git a/iguana/exchanges/LP_nativeDEX.c b/iguana/exchanges/LP_nativeDEX.c index a5e473324..d715efc8c 100644 --- a/iguana/exchanges/LP_nativeDEX.c +++ b/iguana/exchanges/LP_nativeDEX.c @@ -204,7 +204,7 @@ char *LP_command_process(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson return(0); if ( stats_JSONonly != 0 || LP_tradecommand(ctx,myipaddr,pubsock,argjson,data,datalen) <= 0 ) { - if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,"127.0.0.1",stats_JSONonly)) != 0 ) + if ( (retstr= stats_JSON(ctx,0,myipaddr,pubsock,argjson,"127.0.0.1",stats_JSONonly)) != 0 ) { //printf("%s PULL.[%d]-> (%s)\n",myipaddr != 0 ? myipaddr : "127.0.0.1",datalen,retstr); //if ( pubsock >= 0 ) //strncmp("{\"error\":",retstr,strlen("{\"error\":")) != 0 && @@ -425,7 +425,7 @@ int32_t LP_sock_check(char *typestr,void *ctx,char *myipaddr,int32_t pubsock,int //portable_mutex_lock(&LP_commandmutex); if ( LP_tradecommand(ctx,myipaddr,pubsock,argjson,0,0) <= 0 ) { - if ( (retstr= stats_JSON(ctx,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) + if ( (retstr= stats_JSON(ctx,0,myipaddr,pubsock,argjson,remoteaddr,0)) != 0 ) free(retstr); } //portable_mutex_unlock(&LP_commandmutex); @@ -566,7 +566,8 @@ void LP_coinsloop(void *_coins) continue; if ( coin->did_addrutxo_reset == 0 ) { - LP_address_utxo_reset(coin); + int32_t num; + LP_address_utxo_reset(&num,coin); coin->did_addrutxo_reset = 1; } if ( coin->longestchain == 1 ) // special init value diff --git a/iguana/exchanges/LP_network.c b/iguana/exchanges/LP_network.c index f5fb75a26..85b9467a7 100644 --- a/iguana/exchanges/LP_network.c +++ b/iguana/exchanges/LP_network.c @@ -445,7 +445,7 @@ void LP_commandQ_loop(void *ctx) portable_mutex_unlock(&LP_commandQmutex); if ( ptr->stats_JSONonly < 0 ) // broadcast passthrough { - if ( 1 && ptr->responsesock >= 0 ) + if ( ptr->responsesock >= 0 ) { if ( (result= cJSON_Parse(ptr->msg)) != 0 ) { @@ -461,6 +461,7 @@ void LP_commandQ_loop(void *ctx) } else if ( (argjson= cJSON_Parse(ptr->msg)) != 0 ) { + //printf("deQ.(%s)\n",jprint(argjson,0)); if ( (retstr= LP_command_process(ctx,"127.0.0.1",ptr->responsesock,argjson,(uint8_t *)ptr->msg,ptr->msglen,ptr->stats_JSONonly)) != 0 ) { if ( ptr->retstrp != 0 ) diff --git a/iguana/exchanges/LP_ordermatch.c b/iguana/exchanges/LP_ordermatch.c index fcdea155f..baeffc595 100644 --- a/iguana/exchanges/LP_ordermatch.c +++ b/iguana/exchanges/LP_ordermatch.c @@ -1444,9 +1444,9 @@ int32_t LP_tradecommand(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson, return(retval); } -char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey,uint32_t tradeid) +char *LP_autobuy(void *ctx,int32_t fomoflag,char *myipaddr,int32_t mypubsock,char *base,char *rel,double maxprice,double relvolume,int32_t timeout,int32_t duration,char *gui,uint32_t nonce,bits256 destpubkey,uint32_t tradeid) { - uint64_t desttxfee,txfee; uint32_t lastnonce; int64_t bestsatoshis=0,destsatoshis; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,B,A; struct LP_quoteinfo Q; bits256 pubkeys[100]; struct LP_address_utxo *utxos[4096]; int32_t maxiters=100,i,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); + uint64_t desttxfee,txfee,balance; uint32_t lastnonce; int64_t bestsatoshis=0,destsatoshis; struct iguana_info *basecoin,*relcoin; struct LP_utxoinfo *autxo,B,A; struct LP_quoteinfo Q; bits256 pubkeys[100]; struct LP_address_utxo *utxos[4096]; int32_t num=0,maxiters=100,i,max=(int32_t)(sizeof(utxos)/sizeof(*utxos)); basecoin = LP_coinfind(base); relcoin = LP_coinfind(rel); if ( gui == 0 ) @@ -1483,15 +1483,46 @@ char *LP_autobuy(void *ctx,char *myipaddr,int32_t mypubsock,char *base,char *rel jaddnum(retjson,"wait",Alice_expiration-time(NULL)); return(jprint(retjson,1)); } else LP_alicequery_clear(); + if ( relcoin->etomic[0] != 0 ) + LP_address_utxo_reset(&num,LP_coinfind("ETOMIC")); + else + { + LP_address_utxo_reset(&num,relcoin); + if ( num <= 1 ) + { + if ( time(NULL) > relcoin->lastautosplit+300 ) + { + relcoin->lastautosplit = (uint32_t)time(NULL); + return(LP_autosplit(relcoin)); + } + return(clonestr("{\"error\":\"not enough utxo, please make more deposits\"}")); + } + } + LP_txfees(&txfee,&desttxfee,base,rel); + if ( txfee != 0 && txfee < 10000 ) + txfee = 10000; + if ( desttxfee != 0 && desttxfee < 10000 ) + desttxfee = 10000; + if ( fomoflag != 0 ) + { + uint64_t median,minutxo,maxutxo; + maxprice = 0.; // fomo -> price is 1. and needs to be set + LP_address_minmax(0,&median,&minutxo,&maxutxo,relcoin,relcoin->smartaddr); // limit to largest utxo + if ( maxutxo > 0 ) + { + relvolume = MIN(relvolume,dstr(maxutxo) - dstr(desttxfee)*3); + printf("maxutxo %.8f relvolume %.8f desttxfee %.8f\n",dstr(maxutxo),relvolume,dstr(desttxfee)); + maxprice = LP_fomoprice(base,rel,&relvolume); + printf("fomoprice %.8f relvolume %.8f\n",maxprice,relvolume); + } else printf("no utxo available\n"); + } if ( maxprice <= 0. || relvolume <= 0. || LP_priceinfofind(base) == 0 || LP_priceinfofind(rel) == 0 ) return(clonestr("{\"error\":\"invalid parameter\"}")); if ( strcmp("BTC",rel) == 0 ) maxprice *= 1.01; else maxprice *= 1.001; memset(pubkeys,0,sizeof(pubkeys)); - LP_txfees(&txfee,&desttxfee,base,rel); destsatoshis = SATOSHIDEN * relvolume + 2*desttxfee; - LP_address_utxo_reset(relcoin); autxo = 0; for (i=0; i SMALLVAL ) { - if ( strcmp(rel,"KMD") == 0 && kmd_btc > SMALLVAL ) - price = kmd_btc / price_btc; - else if ( strcmp(rel,"BCH") == 0 && bch_btc > SMALLVAL ) - price = bch_btc / price_btc; - else if ( strcmp(rel,"BTC") == 0 ) - price = 1. / price_btc; - else continue; + if ( LP_autorefs[i].usdpeg != 0 ) + { + if ( price_usd > SMALLVAL ) + price = 1. / price_usd; + else continue; + } + else + { + if ( strcmp(rel,"KMD") == 0 && kmd_btc > SMALLVAL ) + price = kmd_btc / price_btc; + else if ( strcmp(rel,"BCH") == 0 && bch_btc > SMALLVAL ) + price = bch_btc / price_btc; + else if ( strcmp(rel,"BTC") == 0 ) + price = 1. / price_btc; + else continue; + } if ( factor > 0. ) + { + //printf("USD %.8f KMDBTC %.8f pricebtc %.8f price %.8f -> factor %.8f %.8f\n",price_usd,kmd_btc,price_btc,price,factor,(price * factor) + offset); price = (price * factor) + offset; + } newprice = (price * (1. + buymargin)); if ( LP_autorefs[i].lastbid < SMALLVAL ) LP_autorefs[i].lastbid = newprice; @@ -597,7 +633,7 @@ void LP_autoprice_iter(void *ctx,struct LP_priceinfo *btcpp) newprice = LP_autorefs[i].lastask; LP_mypriceset(&changed,base,rel,newprice); LP_pricepings(ctx,LP_myipaddr,LP_mypubsock,base,rel,newprice); - } + } //else printf("null return from CMC\n"); } else { @@ -677,7 +713,7 @@ int32_t LP_autoprice(void *ctx,char *base,char *rel,cJSON *argjson) refrel = jstr(argjson,"refrel"); fundvalue_bid = jstr(argjson,"fundvalue_bid"); fundvalue_ask = jstr(argjson,"fundvalue_ask"); - if ( fundvalue_bid != 0 || fundvalue_ask != 0 || fixedprice > SMALLVAL || (refbase != 0 && refrel != 0) ) + if ( fundvalue_bid != 0 || fundvalue_ask != 0 || fixedprice > SMALLVAL || (refbase != 0 && refrel != 0 && strlen(refbase) > 0 && strlen(refrel) > 0) ) { if ( fixedprice > SMALLVAL ) { @@ -718,8 +754,9 @@ int32_t LP_autoprice(void *ctx,char *base,char *rel,cJSON *argjson) safecopy(LP_autorefs[num_LP_autorefs].fundbid,fundvalue_bid,sizeof(LP_autorefs[num_LP_autorefs].fundbid)); safecopy(LP_autorefs[num_LP_autorefs].fundask,fundvalue_ask,sizeof(LP_autorefs[num_LP_autorefs].fundask)); } - LP_autorefs[i].buymargin = buymargin; - LP_autorefs[i].sellmargin = sellmargin; + LP_autorefs[num_LP_autorefs].usdpeg = juint(argjson,"usdpeg"); + LP_autorefs[num_LP_autorefs].buymargin = buymargin; + LP_autorefs[num_LP_autorefs].sellmargin = sellmargin; LP_autorefs[num_LP_autorefs].factor = factor; LP_autorefs[num_LP_autorefs].offset = offset; safecopy(LP_autorefs[num_LP_autorefs].refbase,refbase,sizeof(LP_autorefs[num_LP_autorefs].refbase)); @@ -762,7 +799,7 @@ int32_t LP_portfolio_trade(void *ctx,uint32_t *requestidp,uint32_t *quoteidp,str //if ( LP_utxo_bestfit(sell->symbol,SATOSHIDEN * relvolume) != 0 ) { memset(zero.bytes,0,sizeof(zero)); - if ( (retstr2= LP_autobuy(ctx,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600,gui,LP_lastnonce+1,zero,1)) != 0 ) + if ( (retstr2= LP_autobuy(ctx,0,"127.0.0.1",-1,buy->symbol,sell->symbol,maxprice,relvolume,60,24*3600,gui,LP_lastnonce+1,zero,1)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr2)) != 0 ) { @@ -857,14 +894,15 @@ void prices_loop(void *ctx) char *retstr; cJSON *retjson,*array; char *buycoin,*sellcoin; struct iguana_info *buy,*sell; uint32_t requestid,quoteid; int32_t i,n,m; struct LP_portfoliotrade trades[256]; struct LP_priceinfo *btcpp; strcpy(prices_loop_stats.name,"prices_loop"); prices_loop_stats.threshold = 600000.; + printf("start prices_loop\n"); while ( LP_STOP_RECEIVED == 0 ) { + //printf("G.initializing.%d prices loop autoprices.%d autorefs.%d\n",G.initializing,LP_autoprices,num_LP_autorefs); if ( G.initializing != 0 ) { - sleep(1); + sleep(30); continue; } - //printf("prices loop autoprices.%d autorefs.%d\n",LP_autoprices,num_LP_autorefs); LP_millistats_update(&prices_loop_stats); LP_tradebots_timeslice(ctx); if ( (btcpp= LP_priceinfofind("BTC")) == 0 ) diff --git a/iguana/exchanges/LP_prices.c b/iguana/exchanges/LP_prices.c index 56ad84514..f160561b4 100644 --- a/iguana/exchanges/LP_prices.c +++ b/iguana/exchanges/LP_prices.c @@ -532,6 +532,7 @@ int32_t LP_mypriceset(int32_t *changedp,char *base,char *rel,double price) relpp->sellmargins[basepp->ind] = 0.; relpp->offsets[basepp->ind] = 0.; relpp->factors[basepp->ind] = 0.; + LP_autoref_clear(base,rel); margin = 0.; } else if ( (minprice= basepp->minprices[relpp->ind]) > SMALLVAL && price < minprice ) @@ -755,9 +756,9 @@ cJSON *LP_orderbookjson(char *symbol,struct LP_orderbookentry *op) jaddstr(item,"address",op->coinaddr); jaddnum(item,"price",op->price); jaddnum(item,"numutxos",op->numutxos); - jaddnum(item,"avevolume",dstr(op->avesatoshis)*0.8); - jaddnum(item,"maxvolume",dstr(op->maxsatoshis)*0.8); - jaddnum(item,"depth",dstr(op->depth)*0.8); + jaddnum(item,"avevolume",dstr(op->avesatoshis)); + jaddnum(item,"maxvolume",dstr(op->maxsatoshis)); + jaddnum(item,"depth",dstr(op->depth)); jaddbits256(item,"pubkey",op->pubkey); jaddnum(item,"age",time(NULL)-op->timestamp); jaddnum(item,"zcredits",dstr(op->dynamictrust)); @@ -969,6 +970,43 @@ char *LP_orderbook(char *base,char *rel,int32_t duration) return(jprint(retjson,1)); } +double LP_fomoprice(char *base,char *rel,double *relvolumep) +{ + char *retstr; cJSON *retjson,*asks,*item; int32_t i,numasks; double maxvol=0.,relvolume,biggest,price,fomoprice = 0.; + relvolume = *relvolumep; + if ( (retstr= LP_orderbook(base,rel,0)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (asks= jarray(&numasks,retjson,"asks")) != 0 && numasks > 0 ) + { + for (i=0; i maxvol ) + { + maxvol = biggest; + fomoprice = price; + } + printf("fomoprice (%.8f) i.%d %.8f vol %.8f [max %.8f @ %.8f]\n",relvolume,i,price,biggest,maxvol,fomoprice); + } + } + free_json(retjson); + } + free(retstr); + } + if ( maxvol > 0. && fomoprice > 0. ) + { + if ( maxvol < relvolume ) + relvolume = maxvol * 0.98; + fomoprice /= 0.95; + } else fomoprice = 0.; + *relvolumep = relvolume; + return(fomoprice); +} + int64_t LP_KMDvalue(struct iguana_info *coin,int64_t balance) { double price = 0.; int64_t KMDvalue=0; @@ -1193,7 +1231,7 @@ double LP_CMCbtcprice(double *price_usdp,char *symbol) item = jitem(ticker,0); price_btc = jdouble(item,"price_btc"); *price_usdp = jdouble(item,"price_usd"); - //printf("%.8f item.(%s)\n",price_btc,jprint(item,0)); +//printf("%.8f item.(%s)\n",price_btc,jprint(item,0)); free_json(ticker); } free(retstr); diff --git a/iguana/exchanges/LP_remember.c b/iguana/exchanges/LP_remember.c index 4140f90e9..ca08c52ec 100644 --- a/iguana/exchanges/LP_remember.c +++ b/iguana/exchanges/LP_remember.c @@ -440,7 +440,7 @@ int32_t basilisk_isbobcoin(int32_t iambob,int32_t ind) } } -int32_t basilisk_swap_isfinished(uint32_t requestid,uint32_t quoteid,uint32_t expiration,int32_t iambob,bits256 *txids,int32_t *sentflags,bits256 paymentspent,bits256 Apaymentspent,bits256 depositspent) +int32_t basilisk_swap_isfinished(uint32_t requestid,uint32_t quoteid,uint32_t expiration,int32_t iambob,bits256 *txids,int32_t *sentflags,bits256 paymentspent,bits256 Apaymentspent,bits256 depositspent,uint32_t lockduration) { int32_t i,n = 0; uint32_t now = (uint32_t)time(NULL); if ( bits256_nonz(paymentspent) != 0 && bits256_nonz(Apaymentspent) != 0 && bits256_nonz(depositspent) != 0 ) @@ -460,7 +460,7 @@ int32_t basilisk_swap_isfinished(uint32_t requestid,uint32_t quoteid,uint32_t ex } else return(1); } } - if ( now > expiration - INSTANTDEX_LOCKTIME ) + if ( now > expiration - lockduration ) { if ( bits256_nonz(paymentspent) != 0 ) n++; @@ -683,7 +683,7 @@ cJSON *LP_swap_json(struct LP_swap_remember *rswap) int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t quoteid,int32_t forceflag) { - char fname[1024],*fstr,*secretstr,*srcstr,*deststr,*dest33,*txname; long fsize; cJSON *item,*txobj,*array; bits256 privkey; struct iguana_info *coin; uint32_t r,q; int32_t i,j,n; uint8_t other33[33]; + char fname[1024],*fstr,*secretstr,*srcstr,*deststr,*dest33,*txname; long fsize; cJSON *item,*txobj,*array; bits256 privkey; struct iguana_info *coin; uint32_t r,q; int32_t i,j,n; uint8_t other33[33]; uint32_t lockduration; memset(rswap,0,sizeof(*rswap)); rswap->requestid = requestid; rswap->quoteid = quoteid; @@ -816,7 +816,8 @@ int32_t LP_rswap_init(struct LP_swap_remember *rswap,uint32_t requestid,uint32_t } free_json(txobj); } - rswap->origfinishedflag = basilisk_swap_isfinished(requestid,quoteid,rswap->expiration,rswap->iambob,rswap->txids,rswap->sentflags,rswap->paymentspent,rswap->Apaymentspent,rswap->depositspent); + lockduration = LP_atomic_locktime(rswap->bobcoin,rswap->alicecoin); + rswap->origfinishedflag = basilisk_swap_isfinished(requestid,quoteid,rswap->expiration,rswap->iambob,rswap->txids,rswap->sentflags,rswap->paymentspent,rswap->Apaymentspent,rswap->depositspent,lockduration); rswap->finishedflag = rswap->origfinishedflag; if ( forceflag != 0 ) rswap->finishedflag = rswap->origfinishedflag = 0; @@ -1067,7 +1068,7 @@ int32_t LP_spends_set(struct LP_swap_remember *rswap) cJSON *basilisk_remember(int32_t fastflag,int64_t *KMDtotals,int64_t *BTCtotals,uint32_t requestid,uint32_t quoteid,int32_t forceflag,int32_t pendingonly) { static void *ctx; - struct LP_swap_remember rswap; int32_t i,j,flag,numspent,len,secretstart,redeemlen; char str[65],*srcAdest,*srcBdest,*destAdest,*destBdest,otheraddr[64],*fstr,fname[512],bobtomic[128],alicetomic[128],bobstr[65],alicestr[65]; cJSON *item,*txoutobj,*retjson; bits256 rev,revAm,signedtxid,zero,deadtxid; uint32_t claimtime; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; long fsize; + struct LP_swap_remember rswap; int32_t i,j,flag,numspent,len,secretstart,redeemlen; char str[65],*srcAdest,*srcBdest,*destAdest,*destBdest,otheraddr[64],*fstr,fname[512],bobtomic[128],alicetomic[128],bobstr[65],alicestr[65]; cJSON *item,*txoutobj,*retjson; bits256 rev,revAm,signedtxid,zero,deadtxid; uint32_t claimtime,lockduration; struct iguana_info *bob=0,*alice=0; uint8_t redeemscript[1024],userdata[1024]; long fsize; sprintf(fname,"%s/SWAPS/%u-%u.finished",GLOBAL_DBDIR,requestid,quoteid), OS_compatible_path(fname); if ( (fstr= OS_filestr(&fsize,fname)) != 0 ) { @@ -1096,6 +1097,7 @@ cJSON *basilisk_remember(int32_t fastflag,int64_t *KMDtotals,int64_t *BTCtotals, bob = LP_coinfind(rswap.bobcoin); LP_etomicsymbol(bobstr,bobtomic,rswap.src); LP_etomicsymbol(alicestr,alicetomic,rswap.dest); + lockduration = LP_atomic_locktime(rswap.bobcoin,rswap.alicecoin); if ( rswap.bobcoin[0] == 0 || rswap.alicecoin[0] == 0 || strcmp(rswap.bobcoin,bobstr) != 0 || strcmp(rswap.alicecoin,alicestr) != 0 ) { //printf("legacy r%u-q%u DB SWAPS.(%u %u) %llu files BOB.(%s) Alice.(%s) src.(%s) dest.(%s)\n",requestid,quoteid,rswap.requestid,rswap.quoteid,(long long)rswap.aliceid,rswap.bobcoin,rswap.alicecoin,rswap.src,rswap.dest); @@ -1216,7 +1218,7 @@ cJSON *basilisk_remember(int32_t fastflag,int64_t *KMDtotals,int64_t *BTCtotals, rswap.paymentspent = basilisk_swap_spendupdate(rswap.iambob,rswap.bobcoin,rswap.bobpaymentaddr,rswap.sentflags,rswap.txids,BASILISK_BOBPAYMENT,BASILISK_ALICESPEND,BASILISK_BOBRECLAIM,0,srcAdest,srcBdest,rswap.Adestaddr,rswap.destaddr); rswap.Apaymentspent = basilisk_swap_spendupdate(rswap.iambob,rswap.alicecoin,rswap.alicepaymentaddr,rswap.sentflags,rswap.txids,BASILISK_ALICEPAYMENT,BASILISK_ALICERECLAIM,BASILISK_BOBSPEND,0,destAdest,destBdest,rswap.Adestaddr,rswap.destaddr); rswap.depositspent = basilisk_swap_spendupdate(rswap.iambob,rswap.bobcoin,rswap.bobdepositaddr,rswap.sentflags,rswap.txids,BASILISK_BOBDEPOSIT,BASILISK_ALICECLAIM,BASILISK_BOBREFUND,0,srcAdest,srcBdest,rswap.Adestaddr,rswap.destaddr); - rswap.finishedflag = basilisk_swap_isfinished(requestid,quoteid,rswap.expiration,rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); + rswap.finishedflag = basilisk_swap_isfinished(requestid,quoteid,rswap.expiration,rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent,lockduration); LP_spends_set(&rswap); if ( rswap.iambob == 0 ) { @@ -1455,7 +1457,14 @@ cJSON *basilisk_remember(int32_t fastflag,int64_t *KMDtotals,int64_t *BTCtotals, free_json(txoutobj), flag = 0; else flag = -1, rswap.depositspent = deadtxid; } - if ( flag == 0 && (bits256_nonz(rswap.Apaymentspent) != 0 || time(NULL) > rswap.dlocktime-777 || (bits256_nonz(rswap.txids[BASILISK_ALICEPAYMENT]) == 0 && time(NULL) > rswap.plocktime-777) || (bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) == 0 && time(NULL) > rswap.dlocktime-3*INSTANTDEX_LOCKTIME/2)) ) + //printf("lockduration.%d plocktime.%u lag.%d\n",lockduration,rswap.plocktime,(int32_t)(time(NULL) - (rswap.plocktime-lockduration+1800))); + if ( flag == 0 && ( + bits256_nonz(rswap.Apaymentspent) != 0 || + time(NULL) > rswap.dlocktime-777 || + (bits256_nonz(rswap.txids[BASILISK_ALICEPAYMENT]) == 0 && time(NULL) > rswap.plocktime-777) || + (bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) != 0 && rswap.sentflags[BASILISK_BOBPAYMENT] == 0 && time(NULL) > rswap.plocktime-lockduration+1800) || // failed bobpayment + (bits256_nonz(rswap.txids[BASILISK_BOBPAYMENT]) == 0 && time(NULL) > rswap.dlocktime-3*lockduration/2) + ) ) { //printf("do the refund! paymentspent.%s now.%u vs expiration.%u\n",bits256_str(str,rswap.paymentspent),(uint32_t)time(NULL),rswap.expiration); //if ( txbytes[BASILISK_BOBREFUND] == 0 ) @@ -1508,7 +1517,7 @@ cJSON *basilisk_remember(int32_t fastflag,int64_t *KMDtotals,int64_t *BTCtotals, LP_totals_update(rswap.iambob,rswap.alicecoin,rswap.bobcoin,KMDtotals,BTCtotals,rswap.sentflags,rswap.values); if ( (numspent= LP_spends_set(&rswap)) == 3 ) rswap.finishedflag = 1; - else rswap.finishedflag = basilisk_swap_isfinished(requestid,quoteid,rswap.expiration,rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent); + else rswap.finishedflag = basilisk_swap_isfinished(requestid,quoteid,rswap.expiration,rswap.iambob,rswap.txids,rswap.sentflags,rswap.paymentspent,rswap.Apaymentspent,rswap.depositspent,lockduration); if ( rswap.origfinishedflag == 0 && rswap.finishedflag != 0 ) { char fname[1024],*itemstr; FILE *fp; @@ -1763,7 +1772,7 @@ char *LP_recent_swaps(int32_t limit) jaddstr(item,"alice",LP_Alicequery.destcoin); jaddstr(item,"rel",LP_Alicequery.destcoin); jaddnum(item,"relvalue",dstr(LP_Alicequery.destsatoshis)); - jaddnum(item,"aliceid",LP_aliceid_calc(LP_Alicequery.desttxid,LP_Alicequery.destvout,LP_Alicequery.feetxid,LP_Alicequery.feevout)); + jadd64bits(item,"aliceid",LP_aliceid_calc(LP_Alicequery.desttxid,LP_Alicequery.destvout,LP_Alicequery.feetxid,LP_Alicequery.feevout)); jadd(retjson,"pending",item); } else Alice_expiration = 0; return(jprint(retjson,1)); diff --git a/iguana/exchanges/LP_rpc.c b/iguana/exchanges/LP_rpc.c index b670ce090..b2b7da969 100644 --- a/iguana/exchanges/LP_rpc.c +++ b/iguana/exchanges/LP_rpc.c @@ -150,6 +150,7 @@ uint64_t LP_RTsmartbalance(struct iguana_info *coin) item = jitem(array,i); value = LP_value_extract(item,1); valuesum += value; + //printf("%s -> %.8f\n",jprint(item,0),dstr(value)); } } free_json(array); @@ -370,7 +371,7 @@ int32_t LP_address_iswatchonly(char *symbol,char *address) return(0); if ( (retjson= LP_validateaddress(symbol,address)) != 0 ) { - if ( (obj= jobj(retjson,"iswatchonly")) != 0 && is_cJSON_True(obj) != 0 ) + if ( ((obj= jobj(retjson,"iswatchonly")) != 0 || (obj= jobj(retjson,"watchonly")) != 0) && is_cJSON_True(obj) != 0 ) { doneflag = 1; //printf("%s iswatchonly (%s)\n",address,jprint(retjson,0)); @@ -411,15 +412,18 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr,bits256 reftxid,bits256 reftxi { if ( (ap= LP_addressfind(coin,coinaddr)) != 0 ) { - if ( ap->unspenttime == 0 ) + if ( ap->unspenttime == 0 || strcmp(coin->symbol,"DYN") == 0 ) usecache = 0; - else if ( G.LP_pendingswaps != 0 && time(NULL) > ap->unspenttime+1 ) + else if ( time(NULL) > ap->unspenttime+3 ) usecache = 0; + //printf("%s %s usecache.%d iswatched.%d\n",coin->symbol,coinaddr,usecache,LP_address_iswatchonly(symbol,coinaddr)); if ( usecache != 0 && (retstr= LP_unspents_filestr(symbol,coinaddr)) != 0 ) { retjson = cJSON_Parse(retstr); free(retstr); - return(retjson); + if ( cJSON_GetArraySize(retjson) > 0 ) + return(retjson); + else free_json(retjson); } } //printf("%s %s usecache.%d iswatched.%d\n",coin->symbol,coinaddr,usecache,LP_address_iswatchonly(symbol,coinaddr)); @@ -429,8 +433,8 @@ cJSON *LP_listunspent(char *symbol,char *coinaddr,bits256 reftxid,bits256 reftxi numconfs = 0; else numconfs = 1; sprintf(buf,"[%d, 99999999, [\"%s\"]]",numconfs,coinaddr); -//printf("LP_listunspent.(%s %s)\n",symbol,coinaddr); retjson = bitcoin_json(coin,"listunspent",buf); +//printf("LP_listunspent.(%s %s) -> %s\n",symbol,coinaddr,jprint(retjson,0)); if ( (n= cJSON_GetArraySize(retjson)) > 0 ) { array = cJSON_CreateArray(); @@ -491,6 +495,39 @@ cJSON *LP_listreceivedbyaddress(char *symbol,char *coinaddr) } else return(electrum_address_gethistory(symbol,coin->electrum,&retjson,coinaddr,zero)); } + +cJSON *LP_listtransactions(char *symbol,char *coinaddr,int32_t count,int32_t skip) +{ + char buf[128],*addr; bits256 zero; cJSON *retjson,*array,*item; int32_t i,n; struct iguana_info *coin; + if ( symbol == 0 || symbol[0] == 0 ) + return(cJSON_Parse("{\"error\":\"null symbol\"}")); + coin = LP_coinfind(symbol); + if ( coin == 0 || (IAMLP == 0 && coin->inactive != 0) ) + return(cJSON_Parse("{\"error\":\"no coin\"}")); + memset(zero.bytes,0,sizeof(zero)); + if ( coin->electrum == 0 ) + { + if ( count == 0 ) + count = 10; + sprintf(buf,"[\"\", %d, %d, true]",count,skip); + retjson = cJSON_CreateArray(); + if ( (array= bitcoin_json(coin,"listtransactions",buf)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; ielectrum,&retjson,coinaddr,zero)); +} + int64_t LP_listunspent_parseitem(struct iguana_info *coin,bits256 *txidp,int32_t *voutp,int32_t *heightp,cJSON *item) { int64_t satoshis = 0; @@ -575,7 +612,7 @@ int32_t LP_importaddress(char *symbol,char *address) //printf("validated.(%s)\n",jprint(validatejson,0)); if ( (isvalid= is_cJSON_True(jobj(validatejson,"isvalid")) != 0) != 0 ) { - if ( is_cJSON_True(jobj(validatejson,"iswatchonly")) != 0 || is_cJSON_True(jobj(validatejson,"ismine")) != 0 ) + if ( is_cJSON_True(jobj(validatejson,"iswatchonly")) != 0 || is_cJSON_True(jobj(validatejson,"watchonly")) != 0 || is_cJSON_True(jobj(validatejson,"ismine")) != 0 ) doneflag = 1; } free_json(validatejson); diff --git a/iguana/exchanges/LP_signatures.c b/iguana/exchanges/LP_signatures.c index 774e77b05..329172271 100644 --- a/iguana/exchanges/LP_signatures.c +++ b/iguana/exchanges/LP_signatures.c @@ -422,9 +422,8 @@ int32_t LP_price_sigadd(cJSON *item,uint32_t timestamp,bits256 priv,uint8_t *pub char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *rel,double price) { - struct iguana_info *basecoin,*relcoin,*kmd; struct LP_address *ap; char pubsecpstr[67]; uint32_t numutxos,timestamp; uint64_t price64,balance,minsize,maxsize; bits256 zero; cJSON *reqjson; + struct iguana_info *basecoin,*relcoin,*kmd; struct LP_address *ap; char pubsecpstr[67]; uint32_t numutxos,timestamp; uint64_t price64,median,minsize,maxsize; bits256 zero; cJSON *reqjson; reqjson = cJSON_CreateObject(); - // LP_addsig if ( (basecoin= LP_coinfind(base)) != 0 && (relcoin= LP_coinfind(rel)) != 0 )//&& basecoin->electrum == 0 )//&& relcoin->electrum == 0 ) { memset(zero.bytes,0,sizeof(zero)); @@ -441,12 +440,12 @@ char *LP_pricepings(void *ctx,char *myipaddr,int32_t pubsock,char *base,char *re jaddstr(reqjson,"pubsecp",pubsecpstr); if ( (kmd= LP_coinfind("KMD")) != 0 && (ap= LP_address(kmd,kmd->smartaddr)) != 0 && ap->instantdex_credits != 0 ) jaddnum(reqjson,"credits",dstr(ap->instantdex_credits)); - if ( (numutxos= LP_address_minmax(&balance,&minsize,&maxsize,basecoin,basecoin->smartaddr)) != 0 ) + if ( (numutxos= LP_address_minmax(1,&median,&minsize,&maxsize,basecoin,basecoin->smartaddr)) != 0 ) { - //printf("send %s numutxos.%d balance %.8f min %.8f max %.8f\n",base,numutxos,dstr(balance),dstr(minsize),dstr(maxsize)); + //printf("send %s numutxos.%d median %.8f min %.8f max %.8f\n",base,numutxos,dstr(median),dstr(minsize),dstr(maxsize)); jaddstr(reqjson,"utxocoin",base); jaddnum(reqjson,"n",numutxos); - jaddnum(reqjson,"bal",dstr(balance)); + jaddnum(reqjson,"bal",dstr(median) * numutxos); jaddnum(reqjson,"min",dstr(minsize)); jaddnum(reqjson,"max",dstr(maxsize)); } diff --git a/iguana/exchanges/LP_tradebots.c b/iguana/exchanges/LP_tradebots.c index d6d3a596a..66380ba37 100644 --- a/iguana/exchanges/LP_tradebots.c +++ b/iguana/exchanges/LP_tradebots.c @@ -338,7 +338,7 @@ void LP_tradebot_timeslice(void *ctx,struct LP_tradebot *bot) { if ( remaining < 0.001 ) break; - if ( (retstr= LP_autobuy(ctx,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining/i,0,0,G.gui,0,destpubkey,tradeid)) != 0 ) + if ( (retstr= LP_autobuy(ctx,0,LP_myipaddr,LP_mypubsock,bot->base,bot->rel,bot->maxprice,remaining/i,0,0,G.gui,0,destpubkey,tradeid)) != 0 ) { if ( (retjson2= cJSON_Parse(retstr)) != 0 ) { diff --git a/iguana/exchanges/LP_transaction.c b/iguana/exchanges/LP_transaction.c index 5c793ea06..c429b78c9 100644 --- a/iguana/exchanges/LP_transaction.c +++ b/iguana/exchanges/LP_transaction.c @@ -1521,12 +1521,12 @@ char *LP_opreturndecrypt(void *ctx,char *symbol,bits256 utxotxid,char *passphras char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) { static void *ctx; - int32_t broadcast,allocated_outputs=0,iter,i,utxovout,autofee,completed=0,maxV,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; struct LP_address *ap; char changeaddr[64],vinaddr[64],str[65],*signret,*signedtx=0,*rawtx=0; struct vin_info *V; uint32_t locktime; cJSON *retjson,*item,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 utxotxid,signedtxid; uint64_t txfee,newtxfee=10000; + int32_t broadcast,allocated_outputs=0,iter,i,num,utxovout,autofee,completed=0,maxV,numvins,numvouts,datalen,suppress_pubkeys; bits256 privkey; struct LP_address *ap; char changeaddr[64],vinaddr[64],str[65],*signret,*signedtx=0,*rawtx=0; struct vin_info *V; uint32_t locktime; cJSON *retjson,*item,*outputs,*vins=0,*txobj=0,*privkeys=0; struct iguana_msgtx msgtx; bits256 utxotxid,signedtxid; uint64_t txfee,newtxfee=10000; //printf("withdraw.%s %s\n",coin->symbol,jprint(argjson,0)); if ( coin->etomic[0] != 0 ) { if ( (coin= LP_coinfind("ETOMIC")) == 0 ) - return(0); + return(clonestr("{\"error\":\"use LP_eth_withdraw for ETH or ERC20\"}")); } if ( ctx == 0 ) ctx = bitcoin_ctx(); @@ -1569,14 +1569,7 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) V = malloc(maxV * sizeof(*V)); for (iter=0; iter<2; iter++) { - if ( (ap= LP_address_utxo_reset(coin)) == 0 ) - { - printf("LP_withdraw error utxo reset %s\n",coin->symbol); - free(V); - if ( allocated_outputs != 0 ) - free_json(outputs); - return(0); - } + LP_address_utxo_reset(&num,coin); privkeys = cJSON_CreateArray(); vins = cJSON_CreateArray(); memset(V,0,sizeof(*V) * maxV); @@ -1660,6 +1653,42 @@ char *LP_withdraw(struct iguana_info *coin,cJSON *argjson) return(jprint(retjson,1)); } +char *LP_autosplit(struct iguana_info *coin) +{ + char *retstr; cJSON *argjson,*withdrawjson,*outputs,*item; int64_t total,balance,halfval; + if ( coin->etomic[0] == 0 ) + { + if ( coin->electrum != 0 ) + balance = LP_unspents_load(coin->symbol,coin->smartaddr); + else balance = LP_RTsmartbalance(coin); + //printf("%s balance %.8f\n",coin->symbol,dstr(balance)); + balance -= coin->txfee - 0.001; + if ( balance > coin->txfee ) + { + halfval = (balance / 100) * 45; + argjson = cJSON_CreateObject(); + outputs = cJSON_CreateArray(); + item = cJSON_CreateObject(); + jaddnum(item,coin->smartaddr,dstr(halfval)); + jaddi(outputs,item); + item = cJSON_CreateObject(); + jaddnum(item,coin->smartaddr,dstr(halfval)); + jaddi(outputs,item); + item = cJSON_CreateObject(); + jaddnum(item,coin->smartaddr,dstr(balance - 2*halfval)); + jaddi(outputs,item); + jadd(argjson,"outputs",outputs); + jaddnum(argjson,"broadcast",1); + jaddstr(argjson,"coin",coin->symbol); + //printf("autosplit.(%s)\n",jprint(argjson,0)); + retstr = LP_withdraw(coin,argjson); + free_json(argjson); + return(retstr); + } else return(clonestr("{\"error\":\"less than 0.0011 in balance\"}")); + } + return(clonestr("{\"error\":\"couldnt autosplit\"}")); +} + #ifndef NOTETOMIC char *LP_eth_withdraw(struct iguana_info *coin,cJSON *argjson) @@ -1685,6 +1714,8 @@ char *LP_eth_withdraw(struct iguana_info *coin,cJSON *argjson) #endif + + int32_t basilisk_rawtx_gen(void *ctx,char *str,uint32_t swapstarted,uint8_t *pubkey33,int32_t iambob,int32_t lockinputs,struct basilisk_rawtx *rawtx,uint32_t locktime,uint8_t *script,int32_t scriptlen,int64_t txfee,int32_t minconf,int32_t delay,bits256 privkey,uint8_t *changermd160,char *vinaddr) { struct iguana_info *coin; int32_t len,retval=-1; char *retstr,*hexstr; cJSON *argjson,*outputs,*item,*retjson,*obj; diff --git a/iguana/exchanges/LP_utxo.c b/iguana/exchanges/LP_utxo.c index bd84dbbf8..ee2a8a336 100644 --- a/iguana/exchanges/LP_utxo.c +++ b/iguana/exchanges/LP_utxo.c @@ -283,30 +283,64 @@ struct LP_address *LP_address(struct iguana_info *coin,char *coinaddr) return(ap); } -int32_t LP_address_minmax(uint64_t *balancep,uint64_t *minp,uint64_t *maxp,struct iguana_info *coin,char *coinaddr) +int32_t LP_address_minmax(int32_t iambob,uint64_t *medianp,uint64_t *minp,uint64_t *maxp,struct iguana_info *coin,char *coinaddr) { - cJSON *array,*item; bits256 txid,zero; int64_t value; int32_t i,vout,height,n = 0; - *minp = *maxp = *balancep = 0; + cJSON *array,*item; bits256 txid,zero; int64_t max,max2,value; uint64_t *buf; int32_t i,m=0,vout,height,n = 0; + *minp = *maxp = *medianp = max = max2 = 0; memset(zero.bytes,0,sizeof(zero)); if ( (array= LP_listunspent(coin->symbol,coinaddr,zero,zero)) != 0 ) { //printf("address minmax.(%s)\n",jprint(array,0)); if ( (n= cJSON_GetArraySize(array)) > 0 ) { - for (i=0; i *maxp ) - *maxp = value; + if ( LP_allocated(txid,vout) != 0 ) + continue; + buf[m++] = value; + if ( value > max ) + { + max2 = max; + max = value; + } + else if ( value > max2 ) + max2 = value; if ( *minp == 0 || value < *minp ) *minp = value; - *balancep += value; } + if ( m > 1 ) + { + revsort64s(buf,m,sizeof(*buf)); + if ( iambob != 0 ) + { + if ( max == buf[0] && max2 == buf[1] ) + { + for (i=1; i= LP_DEPOSITSATOSHIS(buf[i]) ) + { + *maxp = buf[i]; + *medianp = buf[m/2]; + break; + } + } + } else printf("sort error? max %.8f != %.8f\n",dstr(max),dstr(buf[0])); + } + else + { + *maxp = buf[0]; + *medianp = buf[m/2]; + printf("alice addressmin max %s %.8f %.8f %.8f num.%d\n",coin->symbol,dstr(*minp),dstr(*maxp),dstr(*medianp),m); + } + } else *minp = *maxp = *medianp = 0; + free(buf); } free_json(array); } - return(n); + return(m/2); } int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_address_utxo **utxos,int32_t max,struct LP_address *ap,char *coinaddr) @@ -326,7 +360,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a { if ( LP_value_extract(txout,0) == 0 ) { - //printf("LP_address_utxo_ptrs skip zero value %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); +//char str[65]; printf("LP_address_utxo_ptrs skip zero value %s/v%d\n",bits256_str(str,up->U.txid),up->U.vout); free_json(txout); up->spendheight = 1; if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) @@ -337,7 +371,7 @@ int32_t LP_address_utxo_ptrs(struct iguana_info *coin,int32_t iambob,struct LP_a } else { - //printf("LP_address_utxo_ptrs skips %s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); +//char str[65]; printf("LP_address_utxo_ptrs skips %s %s payment %s/v%d is spent\n",coin->symbol,coinaddr,bits256_str(str,up->U.txid),up->U.vout); up->spendheight = 1; if ( (tx= LP_transactionfind(coin,up->U.txid)) != 0 && up->U.vout < tx->numvouts ) tx->outpoints[up->U.vout].spendheight = 1; @@ -482,9 +516,12 @@ int32_t LP_address_utxoadd(int32_t skipsearch,uint32_t timestamp,char *debug,str return(retval); } -struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) +struct LP_address *LP_address_utxo_reset(int32_t *nump,struct iguana_info *coin) { struct LP_address *ap; struct LP_address_utxo *up,*tmp; int32_t i,n,numconfs,m,vout,height; cJSON *array,*item,*txobj; bits256 zero; int64_t value; bits256 txid; uint32_t now; + *nump = 0; + if ( coin == 0 ) + return(0); LP_address(coin,coin->smartaddr); memset(zero.bytes,0,sizeof(zero)); LP_listunspent_issue(coin->symbol,coin->smartaddr,2,zero,zero); @@ -499,7 +536,6 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) portable_mutex_lock(&coin->addressutxo_mutex); if ( (array= LP_listunspent(coin->symbol,coin->smartaddr,zero,zero)) != 0 ) { - //printf("reset %s ap->utxos\n",coin->symbol); portable_mutex_lock(&coin->addrmutex); portable_mutex_lock(&LP_gcmutex); DL_FOREACH_SAFE(ap->utxos,up,tmp) @@ -514,9 +550,9 @@ struct LP_address *LP_address_utxo_reset(struct iguana_info *coin) if ( (n= cJSON_GetArraySize(array)) > 0 ) { char str[65]; + *nump = n; for (i=m=0; isymbol,coin->smartaddr,txid,vout)) == 0 ) { - //printf("skip null gettxout %s.v%d\n",bits256_str(str,txid),vout); +//printf("skip null gettxout %s.v%d\n",bits256_str(str,txid),vout); continue; } else free_json(txobj); if ( (numconfs= LP_numconfirms(coin->symbol,coin->smartaddr,txid,vout,0)) <= 0 ) { - //printf("skip numconfs.%d %s.v%d\n",numconfs,bits256_str(str,txid),vout); +//printf("skip numconfs.%d %s.v%d\n",numconfs,bits256_str(str,txid),vout); continue; } } LP_address_utxoadd(1,now,"withdraw",coin,coin->smartaddr,txid,vout,value,height,-1); if ( (up= LP_address_utxofind(coin,coin->smartaddr,txid,vout)) == 0 ) { - //printf("couldnt find just added %s/%d ht.%d %.8f\n",bits256_str(str,txid),vout,height,dstr(value)); +//printf("couldnt find just added %s/%d ht.%d %.8f\n",bits256_str(str,txid),vout,height,dstr(value)); } else { @@ -641,6 +677,7 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr { cJSON *array,*retjson,*item; bits256 zero; int32_t i,n; uint64_t balance = 0; memset(zero.bytes,0,sizeof(zero)); + //printf("address balance call LP_listunspent %s electrum.%p etomic.%d\n",coin->symbol,coin->electrum,coin->etomic[0]); #ifndef NOTETOMIC if (coin->etomic[0] != 0) { balance = LP_etomic_get_balance(coin, coinaddr); @@ -650,16 +687,21 @@ cJSON *LP_address_balance(struct iguana_info *coin,char *coinaddr,int32_t electr { if ( (array= LP_listunspent(coin->symbol,coinaddr,zero,zero)) != 0 ) { + //printf("got address balance (%s)\n",jprint(array,0)); if ( (n= cJSON_GetArraySize(array)) > 0 ) { for (i=0; isymbol,coin->smartaddr); + //balance3 = LP_RTsmartbalance(coin); + //printf("balance %.8f vs balance2 %.8f vs balance3 %.8f\n",dstr(balance),dstr(balance2),dstr(balance3)); } else { diff --git a/iguana/exchanges/auto_usd b/iguana/exchanges/auto_usd new file mode 100644 index 000000000..3dfa13808 --- /dev/null +++ b/iguana/exchanges/auto_usd @@ -0,0 +1,2 @@ +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"autoprice\",\"base\":\"KMD\",\"rel\":\"OOT\",\"factor\":0.15,\"buymargin\":0.0001,\"sellmargin\":0.2,\"refbase\":\"komodo\",\"refrel\":\"coinmarketcap\",\"usdpeg\":1}" diff --git a/iguana/exchanges/client b/iguana/exchanges/client index e55a74bff..8f5502a1d 100755 --- a/iguana/exchanges/client +++ b/iguana/exchanges/client @@ -3,7 +3,7 @@ source passphrase source coins ./stop git pull; -cp ../exchanges/updateprices;./updateprices +cp ../exchanges/updateprices .;./updateprices cd ..; ./m_mm; pkill -15 marketmaker; diff --git a/iguana/exchanges/coins b/iguana/exchanges/coins index 72e067d81..750f2695f 100644 --- a/iguana/exchanges/coins +++ b/iguana/exchanges/coins @@ -1,2 +1,2 @@ -export coins="[{\"coin\":\"PXT\",\"name\":\"populous-xbrl-token\",\"etomic\":\"0xc14830e53aa344e8c14603a91229a0b925b0b262\",\"rpcport\":80}, {\"coin\":\"USDT\",\"name\":\"tether\",\"etomic\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"rpcport\":80}, {\"coin\":\"ELI\",\"name\":\"elicoin\",\"rpcport\":9332,\"pubtype\":33,\"p2shtype\":102,\"wiftype\":205,\"txfee\":10000}, {\"coin\":\"SCRIV\",\"name\":\"scriv\",\"confpath\":\"${HOME#}/.scrivcore/scriv.conf\",\"rpcport\":7998,\"pubtype\":125,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"ELP\",\"name\":\"ellerium\",\"rpcport\":61020,\"pubtype\":23,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"ROI\",\"name\":\"ROIcoin\",\"rpcport\":3376,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XCOIN\",\"name\":\"xcoin\",\"rpcport\":22717,\"pubtype\":137,\"p2shtype\":15,\"wiftype\":75,\"txfee\":100000}, {\"coin\":\"BBT\",\"name\":\"bitboost\",\"etomic\":\"0x1500205f50bf3fd976466d0662905c9ff254fc9c\",\"rpcport\":80}, {\"coin\":\"TRX\",\"name\":\"tron\",\"etomic\":\"0xf230b790e05390fc8295f4d3f60332c93bed42e2\",\"rpcport\":80}, {\"coin\":\"OMG\",\"name\":\"omisego\",\"etomic\":\"0xd26114cd6EE289AccF82350c8d8487fedB8A0C07\",\"rpcport\":80}, {\"coin\":\"ICX\",\"name\":\"icon\",\"etomic\":\"0xb5a5f22694352c15b00323844ad545abb2b11028\",\"rpcport\":80}, {\"coin\":\"BNB\",\"name\":\"binance-coin\",\"etomic\":\"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\"rpcport\":80}, {\"coin\":\"DGD\",\"name\":\"digixdao\",\"etomic\":\"0xE0B7927c4aF23765Cb51314A0E0521A9645F0E2A\",\"rpcport\":80}, {\"coin\":\"PPT\",\"name\":\"populous\",\"etomic\":\"0xd4fa1460F537bb9085d22C7bcCB5DD450Ef28e3a\",\"rpcport\":80}, {\"coin\":\"MKR\",\"name\":\"maker\",\"etomic\":\"0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2\",\"rpcport\":80}, {\"coin\":\"SNT\",\"name\":\"status\",\"etomic\":\"0x744d70FDBE2Ba4CF95131626614a1763DF805B9E\",\"rpcport\":80}, {\"coin\":\"REP\",\"name\":\"augur\",\"etomic\":\"0xE94327D07Fc17907b4DB788E5aDf2ed424adDff6\",\"rpcport\":80}, {\"coin\":\"ZRX\",\"name\":\"0x\",\"etomic\":\"0xE41d2489571d322189246DaFA5ebDe1F4699F498\",\"rpcport\":80}, {\"coin\":\"BAT\",\"name\":\"basic-attention-token\",\"etomic\":\"0x0D8775F648430679A709E98d2b0Cb6250d2887EF\",\"rpcport\":80}, {\"coin\":\"GNT\",\"name\":\"golem\",\"etomic\":\"0xa74476443119A942dE498590Fe1f2454d7D4aC0d\",\"rpcport\":80}, {\"coin\":\"ETHOS\",\"name\":\"ethos\",\"etomic\":\"0x5Af2Be193a6ABCa9c8817001F45744777Db30756\",\"rpcport\":80}, {\"coin\":\"QASH\",\"name\":\"qash\",\"etomic\":\"0x618E75Ac90b12c6049Ba3b27f5d5F8651b0037F6\",\"rpcport\":80}, {\"coin\":\"FUN\",\"name\":\"funfair\",\"etomic\":\"0x419D0d8BdD9aF5e606Ae2232ed285Aff190E711b\",\"rpcport\":80}, {\"coin\":\"KNC\",\"name\":\"kyber-network\",\"etomic\":\"0xdd974D5C2e2928deA5F71b9825b8b646686BD200\",\"rpcport\":80}, {\"coin\":\"SALT\",\"name\":\"salt\",\"etomic\":\"0x4156D3342D5c385a87D264F90653733592000581\",\"rpcport\":80}, {\"coin\":\"BNT\",\"name\":\"bancor\",\"etomic\":\"0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C\",\"rpcport\":80}, {\"coin\":\"ICN\",\"name\":\"iconomi\",\"etomic\":\"0x888666CA69E0f178DED6D75b5726Cee99A87D698\",\"rpcport\":80}, {\"coin\":\"PAY\",\"name\":\"tenx\",\"etomic\":\"0xB97048628DB6B661D4C2aA833e95Dbe1A905B280\",\"rpcport\":80}, {\"coin\":\"REQ\",\"name\":\"request-network\",\"etomic\":\"0x8f8221aFbB33998d8584A2B05749bA73c37a938a\",\"rpcport\":80}, {\"coin\":\"STORJ\",\"name\":\"storj\",\"etomic\":\"0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC\",\"rpcport\":80}, {\"coin\":\"GNO\",\"name\":\"gnosis-gno\",\"etomic\":\"0x6810e776880C02933D47DB1b9fc05908e5386b96\",\"rpcport\":80}, {\"coin\":\"RLC\",\"name\":\"rlc\",\"etomic\":\"0x607F4C5BB672230e8672085532f7e901544a7375\",\"rpcport\":80}, {\"coin\":\"ENJ\",\"name\":\"enjin-coin\",\"etomic\":\"0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c\",\"rpcport\":80}, {\"coin\":\"QSP\",\"name\":\"quantstamp\",\"etomic\":\"0x99ea4dB9EE77ACD40B119BD1dC4E33e1C070b80d\",\"rpcport\":80}, {\"coin\":\"RDN\",\"name\":\"raiden-network-token\",\"etomic\":\"0x255Aa6DF07540Cb5d3d297f0D0D4D84cb52bc8e6\",\"rpcport\":80}, {\"coin\":\"CVC\",\"name\":\"civic\",\"etomic\":\"0x41e5560054824eA6B0732E656E3Ad64E20e94E45\",\"rpcport\":80}, {\"coin\":\"SAN\",\"name\":\"santiment\",\"etomic\":\"0x7C5A0CE9267ED19B22F8cae653F198e3E8daf098\",\"rpcport\":80}, {\"coin\":\"ANT\",\"name\":\"aragon\",\"etomic\":\"0x960b236A07cf122663c4303350609A66A7B288C0\",\"rpcport\":80}, {\"coin\":\"MANA\",\"name\":\"decentraland\",\"etomic\":\"0x0F5D2fB29fb7d3CFeE444a200298f468908cC942\",\"rpcport\":80}, {\"coin\":\"MCO\",\"name\":\"monaco\",\"etomic\":\"0xB63B606Ac810a52cCa15e44bB630fd42D8d1d83d\",\"rpcport\":80}, {\"coin\":\"MTL\",\"name\":\"metal\",\"etomic\":\"0xF433089366899D83a9f26A773D59ec7eCF30355e\",\"rpcport\":80}, {\"coin\":\"EDG\",\"name\":\"edgeless\",\"etomic\":\"0x08711D3B02C8758F2FB3ab4e80228418a7F8e39c\",\"rpcport\":80}, {\"coin\":\"MLN\",\"name\":\"melon\",\"etomic\":\"0xBEB9eF514a379B997e0798FDcC901Ee474B6D9A1\",\"rpcport\":80}, {\"coin\":\"AMB\",\"name\":\"amber\",\"etomic\":\"0x4DC3643DbC642b72C158E7F3d2ff232df61cb6CE\",\"rpcport\":80}, {\"coin\":\"WINGS\",\"name\":\"wings\",\"etomic\":\"0x667088b212ce3d06a1b553a7221E1fD19000d9aF\",\"rpcport\":80}, {\"coin\":\"RCN\",\"name\":\"ripio-credit-network\",\"etomic\":\"0xF970b8E36e23F7fC3FD752EeA86f8Be8D83375A6\",\"rpcport\":80}, {\"coin\":\"SNGLS\",\"name\":\"singulardtv\",\"etomic\":\"0xaeC2E87E0A235266D9C5ADc9DEb4b2E29b54D009\",\"rpcport\":80}, {\"coin\":\"TAAS\",\"name\":\"taas\",\"etomic\":\"0xE7775A6e9Bcf904eb39DA2b68c5efb4F9360e08C\",\"rpcport\":80}, {\"coin\":\"DNT\",\"name\":\"district0x\",\"etomic\":\"0x0AbdAce70D3790235af448C88547603b945604ea\",\"rpcport\":80}, {\"coin\":\"CFI\",\"name\":\"cofound-it\",\"etomic\":\"0x12FEF5e57bF45873Cd9B62E9DBd7BFb99e32D73e\",\"rpcport\":80}, {\"coin\":\"LUN\",\"name\":\"lunyr\",\"etomic\":\"0xfa05A73FfE78ef8f1a739473e462c54bae6567D9\",\"rpcport\":80}, {\"coin\":\"ADT\",\"name\":\"adtoken\",\"etomic\":\"0xD0D6D6C5Fe4a677D343cC433536BB717bAe167dD\",\"rpcport\":80}, {\"coin\":\"AST\",\"name\":\"airswap\",\"etomic\":\"0x27054b13b1B798B345b591a4d22e6562d47eA75a\",\"rpcport\":80}, {\"coin\":\"CDT\",\"name\":\"blox\",\"etomic\":\"0x177d39AC676ED1C67A2b268AD7F1E58826E5B0af\",\"rpcport\":80}, {\"coin\":\"TKN\",\"name\":\"tokencard\",\"etomic\":\"0xaAAf91D9b90dF800Df4F55c205fd6989c977E73a\",\"rpcport\":80}, {\"coin\":\"HMQ\",\"name\":\"humaniq\",\"etomic\":\"0xcbCC0F036ED4788F63FC0fEE32873d6A7487b908\",\"rpcport\":80}, {\"coin\":\"BCAP\",\"name\":\"bcap\",\"etomic\":\"0xFf3519eeeEA3e76F1F699CCcE5E23ee0bdDa41aC\",\"rpcport\":80}, {\"coin\":\"NMR\",\"name\":\"numeraire\",\"etomic\":\"0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671\",\"rpcport\":80}, {\"coin\":\"NET\",\"name\":\"nimiq\",\"etomic\":\"0xcfb98637bcae43C13323EAa1731cED2B716962fD\",\"rpcport\":80}, {\"coin\":\"TRST\",\"name\":\"trust\",\"etomic\":\"0xCb94be6f13A1182E4A4B6140cb7bf2025d28e41B\",\"rpcport\":80}, {\"coin\":\"GUP\",\"name\":\"guppy\",\"etomic\":\"0xf7B098298f7C69Fc14610bf71d5e02c60792894C\",\"rpcport\":80}, {\"coin\":\"1ST\",\"name\":\"firstblood\",\"etomic\":\"0xAf30D2a7E90d7DC361c8C4585e9BB7D2F6f15bc7\",\"rpcport\":80}, {\"coin\":\"TIME\",\"name\":\"chronobank\",\"etomic\":\"0x6531f133e6DeeBe7F2dcE5A0441aA7ef330B4e53\",\"rpcport\":80}, {\"coin\":\"SWT\",\"name\":\"swarm-city\",\"etomic\":\"0xB9e7F8568e08d5659f5D29C4997173d84CdF2607\",\"rpcport\":80}, {\"coin\":\"ROL\",\"name\":\"dice\",\"etomic\":\"0x2e071D2966Aa7D8dECB1005885bA1977D6038A65\",\"rpcport\":80}, {\"coin\":\"XAUR\",\"name\":\"xaurum\",\"etomic\":\"0x4DF812F6064def1e5e029f1ca858777CC98D2D81\",\"rpcport\":80}, {\"coin\":\"PLU\",\"name\":\"pluton\",\"etomic\":\"0xD8912C10681D8B21Fd3742244f44658dBA12264E\",\"rpcport\":80}, {\"coin\":\"HGT\",\"name\":\"hellogold\",\"etomic\":\"0xba2184520A1cC49a6159c57e61E1844E085615B6\",\"rpcport\":80}, {\"coin\":\"VSL\",\"name\":\"vslice\",\"etomic\":\"0x5c543e7AE0A1104f78406C340E9C64FD9fCE5170\",\"rpcport\":80}, {\"coin\":\"IND\",\"name\":\"indorse-token\",\"etomic\":\"0xf8e386EDa857484f5a12e4B5DAa9984E06E73705\",\"rpcport\":80}, {\"coin\":\"FYN\",\"name\":\"fundyourselfnow\",\"etomic\":\"0x88FCFBc22C6d3dBaa25aF478C578978339BDe77a\",\"rpcport\":80},{\"coin\":\"SMART\",\"name\":\"smartcash\",\"rpcport\":9679,\"pubtype\":63,\"p2shtype\":18,\"wiftype\":191,\"txfee\":200000}, {\"coin\":\"BTCP\",\"name\":\"btcprivate\",\"rpcport\":7932,\"taddr\":19,\"pubtype\":37,\"p2shtype\":175,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DNR\",\"isPoS\":1,\"active\":1,\"name\":\"denarius\",\"rpcport\":32339,\"pubtype\":30,\"p2shtype\":90,\"wiftype\":158,\"txfee\":10000}, {\"coin\":\"RVN\",\"name\":\"raven\",\"rpcport\":8766,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"VIVO\",\"name\":\"vivo\",\"confpath\":\"${HOME#}/.vivocore/vivo.conf\",\"rpcport\":9998,\"pubtype\":70,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"KNG\",\"name\":\"kings\",\"rpcport\":44888,\"pubtype\":75,\"p2shtype\":125,\"wiftype\":203,\"txfee\":10000}, {\"coin\":\"UFO\",\"name\":\"ufocoin\",\"confpath\":\"${HOME#}/.ufo/ufocoin.conf\",\"rpcport\":9888,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":155,\"txfee\":100000}, {\"coin\":\"ETH\",\"name\":\"ethereum\",\"etomic\":\"0x0000000000000000000000000000000000000000\",\"rpcport\":80}, {\"coin\":\"EOS\",\"name\":\"EOS\",\"etomic\":\"0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0\",\"rpcport\":80}, {\"coin\":\"KREDS\",\"name\":\"kreds\",\"rpcport\":3850,\"pubtype\":45,\"p2shtype\":5,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"SNG\",\"name\":\"snowgem\",\"rpcport\":16112,\"taddr\":28,\"pubtype\":40,\"p2shtype\":45,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"ZEL\",\"name\":\"zelcash\",\"rpcport\":16124,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"HTML\",\"name\":\"htmlcoin\",\"rpcport\":4889,\"pubtype\":41,\"p2shtype\":100,\"wiftype\":169,\"txfee\":400000}, {\"coin\":\"MNX\",\"name\":\"Minexcoin\",\"rpcport\":17786,\"pubtype\":75,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LTZ\",\"name\":\"litecoinz\",\"rpcport\":29332,\"taddr\":10,\"pubtype\":179,\"p2shtype\":184,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BAY\",\"name\":\"bitbay\",\"isPoS\":1,\"rpcport\":19915,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"OOT\",\"asset\":\"OOT\",\"rpcport\":12467}, {\"coin\":\"ZOI\",\"name\":\"zoin\",\"rpcport\":8255,\"pubtype\":80,\"p2shtype\":7,\"wiftype\":208,\"txfee\":1000}, {\"coin\": \"PIZZA\",\"asset\": \"PIZZA\",\"rpcport\": 11116},{\"coin\": \"BEER\",\"asset\": \"BEER\",\"rpcport\": 8923}, {\"coin\":\"GRS\",\"name\":\"groestlcoin\",\"rpcport\":1441,\"pubtype\":36,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XMCC\",\"name\":\"monoeci\",\"confpath\":\"${HOME#}/.monoeciCore/monoeci.conf\",\"rpcport\":24156,\"pubtype\":50,\"p2shtype\":73,\"wiftype\":77,\"txfee\":10000}, {\"coin\":\"BTCH\",\"asset\":\"BTCH\",\"rpcport\":8800},{\"coin\":\"ETOMIC\",\"asset\":\"ETOMIC\",\"rpcport\":10271},{\"coin\":\"AXO\",\"asset\":\"AXO\",\"rpcport\":12927},{\"coin\":\"CRC\",\"name\":\"crowdcoin\",\"confpath\":\"${HOME#}/.crowdcoincore/crowdcoin.conf\",\"rpcport\":11998,\"pubtype\":28,\"p2shtype\":88,\"wiftype\":0,\"txfee\":10000}, {\"coin\":\"VOT\",\"name\":\"votecoin\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"INN\",\"name\":\"innova\",\"confpath\":\"${HOME#}/.innovacore/innova.conf\",\"rpcport\":8818,\"pubtype\":102,\"p2shtype\":20,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":28,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"EFL\",\"name\":\"egulden\",\"confpath\":\"${HOME#}/.egulden/coin.conf\",\"rpcport\":21015,\"pubtype\":48,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"GBX\",\"name\":\"gobyte\",\"confpath\":\"${HOME#}/.gobytecore/gobyte.conf\",\"rpcport\":12454,\"pubtype\":38,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"BCO\",\"name\":\"bridgecoin\",\"rpcport\":6332,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"confpath\":\"${HOME#}/.lore/blackcoin.conf\",\"isPoS\":1,\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":100000}, {\"coin\":\"BTG\",\"name\":\"bitcoingold\",\"rpcport\":8332,\"pubtype\":38,\"p2shtype\":23,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BCH\",\"name\":\"bch\",\"rpcport\":33333,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"ABY\",\"name\":\"applebyte\",\"rpcport\":8607,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":100000}, {\"coin\":\"STAK\",\"name\":\"straks\",\"rpcport\":7574,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"XZC\",\"name\":\"zcoin\",\"rpcport\":8888,\"pubtype\":82,\"p2shtype\":7,\"wiftype\":210,\"txfee\":10000}, {\"coin\":\"QTUM\",\"name\":\"qtum\",\"rpcport\":3889,\"pubtype\":58,\"p2shtype\":50,\"wiftype\":128,\"txfee\":400000}, {\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":100000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":10000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"MSHARK\",\"asset\":\"MSHARK\",\"rpcport\":8846}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" +export coins="[{\"coin\":\"BTCL\",\"name\":\"btclite\",\"etomic\":\"0x5acd19b9c91e596b1f062f18e3d02da7ed8d1e50\",\"rpcport\":80}, {\"coin\":\"SEQ\",\"name\":\"sequence\",\"rpcport\":16663,\"isPoS\":1,\"pubtype\":63,\"p2shtype\":64,\"wiftype\":170,\"txfee\":10000}, {\"coin\":\"DYN\",\"name\":\"dynamic\",\"rpcport\":33350,\"pubtype\":30,\"p2shtype\":10,\"wiftype\":140,\"txfee\":10000}, {\"coin\":\"SBTC\",\"name\":\"SuperBitcoin\",\"rpcport\":28282,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000,\"confpath\":\"${HOME#}/.sbtc/sbtc.conf\"}, {\"coin\":\"FJC\",\"name\":\"fujicoin\",\"rpcport\":3776,\"pubtype\":36,\"p2shtype\":16,\"wiftype\":164,\"txfee\":100000}, {\"coin\":\"AIR\",\"name\":\"airtoken\",\"etomic\":\"0x27dce1ec4d3f72c3e457cc50354f1f975ddef488\",\"rpcport\":80}, {\"coin\":\"VRT\",\"name\":\"virtus\",\"confpath\":\"${HOME#}/.virtuscore/virtus.conf\",\"rpcport\":13880,\"pubtype\":70,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"DRT\",\"name\":\"domraider\",\"etomic\":\"0x9af4f26941677c706cfecf6d3379ff01bb85d5ab\",\"rpcport\":80}, {\"coin\":\"BITS\",\"name\":\"bitstar\",\"rpcport\":15715,\"isPoS\":1,\"pubtype\":25,\"p2shtype\":8,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"FTC\",\"name\":\"feathercoin\",\"rpcport\":9337,\"pubtype\":14,\"p2shtype\":5,\"wiftype\":142,\"txfee\":1000000}, {\"coin\":\"PXT\",\"name\":\"populous-xbrl-token\",\"etomic\":\"0xc14830e53aa344e8c14603a91229a0b925b0b262\",\"rpcport\":80}, {\"coin\":\"USDT\",\"name\":\"tether\",\"etomic\":\"0xdac17f958d2ee523a2206206994597c13d831ec7\",\"rpcport\":80}, {\"coin\":\"ELI\",\"name\":\"elicoin\",\"rpcport\":9332,\"pubtype\":33,\"p2shtype\":102,\"wiftype\":205,\"txfee\":10000}, {\"coin\":\"SCRIV\",\"name\":\"scriv\",\"confpath\":\"${HOME#}/.scrivcore/scriv.conf\",\"rpcport\":7998,\"pubtype\":125,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"ELP\",\"name\":\"ellerium\",\"rpcport\":61020,\"pubtype\":23,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"ROI\",\"name\":\"ROIcoin\",\"rpcport\":3376,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XCOIN\",\"name\":\"xcoin\",\"rpcport\":22717,\"pubtype\":137,\"p2shtype\":15,\"wiftype\":75,\"txfee\":100000}, {\"coin\":\"BBT\",\"name\":\"bitboost\",\"etomic\":\"0x1500205f50bf3fd976466d0662905c9ff254fc9c\",\"rpcport\":80}, {\"coin\":\"TRX\",\"name\":\"tron\",\"etomic\":\"0xf230b790e05390fc8295f4d3f60332c93bed42e2\",\"rpcport\":80}, {\"coin\":\"OMG\",\"name\":\"omisego\",\"etomic\":\"0xd26114cd6EE289AccF82350c8d8487fedB8A0C07\",\"rpcport\":80}, {\"coin\":\"ICX\",\"name\":\"icon\",\"etomic\":\"0xb5a5f22694352c15b00323844ad545abb2b11028\",\"rpcport\":80}, {\"coin\":\"BNB\",\"name\":\"binance-coin\",\"etomic\":\"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\"rpcport\":80}, {\"coin\":\"DGD\",\"name\":\"digixdao\",\"etomic\":\"0xE0B7927c4aF23765Cb51314A0E0521A9645F0E2A\",\"rpcport\":80}, {\"coin\":\"PPT\",\"name\":\"populous\",\"etomic\":\"0xd4fa1460F537bb9085d22C7bcCB5DD450Ef28e3a\",\"rpcport\":80}, {\"coin\":\"MKR\",\"name\":\"maker\",\"etomic\":\"0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2\",\"rpcport\":80}, {\"coin\":\"SNT\",\"name\":\"status\",\"etomic\":\"0x744d70FDBE2Ba4CF95131626614a1763DF805B9E\",\"rpcport\":80}, {\"coin\":\"REP\",\"name\":\"augur\",\"etomic\":\"0xE94327D07Fc17907b4DB788E5aDf2ed424adDff6\",\"rpcport\":80}, {\"coin\":\"ZRX\",\"name\":\"0x\",\"etomic\":\"0xE41d2489571d322189246DaFA5ebDe1F4699F498\",\"rpcport\":80}, {\"coin\":\"BAT\",\"name\":\"basic-attention-token\",\"etomic\":\"0x0D8775F648430679A709E98d2b0Cb6250d2887EF\",\"rpcport\":80}, {\"coin\":\"GNT\",\"name\":\"golem\",\"etomic\":\"0xa74476443119A942dE498590Fe1f2454d7D4aC0d\",\"rpcport\":80}, {\"coin\":\"ETHOS\",\"name\":\"ethos\",\"etomic\":\"0x5Af2Be193a6ABCa9c8817001F45744777Db30756\",\"rpcport\":80}, {\"coin\":\"QASH\",\"name\":\"qash\",\"etomic\":\"0x618E75Ac90b12c6049Ba3b27f5d5F8651b0037F6\",\"rpcport\":80}, {\"coin\":\"FUN\",\"name\":\"funfair\",\"etomic\":\"0x419D0d8BdD9aF5e606Ae2232ed285Aff190E711b\",\"rpcport\":80}, {\"coin\":\"KNC\",\"name\":\"kyber-network\",\"etomic\":\"0xdd974D5C2e2928deA5F71b9825b8b646686BD200\",\"rpcport\":80}, {\"coin\":\"SALT\",\"name\":\"salt\",\"etomic\":\"0x4156D3342D5c385a87D264F90653733592000581\",\"rpcport\":80}, {\"coin\":\"BNT\",\"name\":\"bancor\",\"etomic\":\"0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C\",\"rpcport\":80}, {\"coin\":\"ICN\",\"name\":\"iconomi\",\"etomic\":\"0x888666CA69E0f178DED6D75b5726Cee99A87D698\",\"rpcport\":80}, {\"coin\":\"PAY\",\"name\":\"tenx\",\"etomic\":\"0xB97048628DB6B661D4C2aA833e95Dbe1A905B280\",\"rpcport\":80}, {\"coin\":\"REQ\",\"name\":\"request-network\",\"etomic\":\"0x8f8221aFbB33998d8584A2B05749bA73c37a938a\",\"rpcport\":80}, {\"coin\":\"STORJ\",\"name\":\"storj\",\"etomic\":\"0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC\",\"rpcport\":80}, {\"coin\":\"GNO\",\"name\":\"gnosis-gno\",\"etomic\":\"0x6810e776880C02933D47DB1b9fc05908e5386b96\",\"rpcport\":80}, {\"coin\":\"RLC\",\"name\":\"rlc\",\"etomic\":\"0x607F4C5BB672230e8672085532f7e901544a7375\",\"rpcport\":80}, {\"coin\":\"ENJ\",\"name\":\"enjin-coin\",\"etomic\":\"0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c\",\"rpcport\":80}, {\"coin\":\"QSP\",\"name\":\"quantstamp\",\"etomic\":\"0x99ea4dB9EE77ACD40B119BD1dC4E33e1C070b80d\",\"rpcport\":80}, {\"coin\":\"RDN\",\"name\":\"raiden-network-token\",\"etomic\":\"0x255Aa6DF07540Cb5d3d297f0D0D4D84cb52bc8e6\",\"rpcport\":80}, {\"coin\":\"CVC\",\"name\":\"civic\",\"etomic\":\"0x41e5560054824eA6B0732E656E3Ad64E20e94E45\",\"rpcport\":80}, {\"coin\":\"SAN\",\"name\":\"santiment\",\"etomic\":\"0x7C5A0CE9267ED19B22F8cae653F198e3E8daf098\",\"rpcport\":80}, {\"coin\":\"ANT\",\"name\":\"aragon\",\"etomic\":\"0x960b236A07cf122663c4303350609A66A7B288C0\",\"rpcport\":80}, {\"coin\":\"MANA\",\"name\":\"decentraland\",\"etomic\":\"0x0F5D2fB29fb7d3CFeE444a200298f468908cC942\",\"rpcport\":80}, {\"coin\":\"MCO\",\"name\":\"monaco\",\"etomic\":\"0xB63B606Ac810a52cCa15e44bB630fd42D8d1d83d\",\"rpcport\":80}, {\"coin\":\"MTL\",\"name\":\"metal\",\"etomic\":\"0xF433089366899D83a9f26A773D59ec7eCF30355e\",\"rpcport\":80}, {\"coin\":\"EDG\",\"name\":\"edgeless\",\"etomic\":\"0x08711D3B02C8758F2FB3ab4e80228418a7F8e39c\",\"rpcport\":80}, {\"coin\":\"MLN\",\"name\":\"melon\",\"etomic\":\"0xBEB9eF514a379B997e0798FDcC901Ee474B6D9A1\",\"rpcport\":80}, {\"coin\":\"AMB\",\"name\":\"amber\",\"etomic\":\"0x4DC3643DbC642b72C158E7F3d2ff232df61cb6CE\",\"rpcport\":80}, {\"coin\":\"WINGS\",\"name\":\"wings\",\"etomic\":\"0x667088b212ce3d06a1b553a7221E1fD19000d9aF\",\"rpcport\":80}, {\"coin\":\"RCN\",\"name\":\"ripio-credit-network\",\"etomic\":\"0xF970b8E36e23F7fC3FD752EeA86f8Be8D83375A6\",\"rpcport\":80}, {\"coin\":\"SNGLS\",\"name\":\"singulardtv\",\"etomic\":\"0xaeC2E87E0A235266D9C5ADc9DEb4b2E29b54D009\",\"rpcport\":80}, {\"coin\":\"TAAS\",\"name\":\"taas\",\"etomic\":\"0xE7775A6e9Bcf904eb39DA2b68c5efb4F9360e08C\",\"rpcport\":80}, {\"coin\":\"DNT\",\"name\":\"district0x\",\"etomic\":\"0x0AbdAce70D3790235af448C88547603b945604ea\",\"rpcport\":80}, {\"coin\":\"CFI\",\"name\":\"cofound-it\",\"etomic\":\"0x12FEF5e57bF45873Cd9B62E9DBd7BFb99e32D73e\",\"rpcport\":80}, {\"coin\":\"LUN\",\"name\":\"lunyr\",\"etomic\":\"0xfa05A73FfE78ef8f1a739473e462c54bae6567D9\",\"rpcport\":80}, {\"coin\":\"ADT\",\"name\":\"adtoken\",\"etomic\":\"0xD0D6D6C5Fe4a677D343cC433536BB717bAe167dD\",\"rpcport\":80}, {\"coin\":\"AST\",\"name\":\"airswap\",\"etomic\":\"0x27054b13b1B798B345b591a4d22e6562d47eA75a\",\"rpcport\":80}, {\"coin\":\"CDT\",\"name\":\"blox\",\"etomic\":\"0x177d39AC676ED1C67A2b268AD7F1E58826E5B0af\",\"rpcport\":80}, {\"coin\":\"TKN\",\"name\":\"tokencard\",\"etomic\":\"0xaAAf91D9b90dF800Df4F55c205fd6989c977E73a\",\"rpcport\":80}, {\"coin\":\"HMQ\",\"name\":\"humaniq\",\"etomic\":\"0xcbCC0F036ED4788F63FC0fEE32873d6A7487b908\",\"rpcport\":80}, {\"coin\":\"BCAP\",\"name\":\"bcap\",\"etomic\":\"0xFf3519eeeEA3e76F1F699CCcE5E23ee0bdDa41aC\",\"rpcport\":80}, {\"coin\":\"NMR\",\"name\":\"numeraire\",\"etomic\":\"0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671\",\"rpcport\":80}, {\"coin\":\"NET\",\"name\":\"nimiq\",\"etomic\":\"0xcfb98637bcae43C13323EAa1731cED2B716962fD\",\"rpcport\":80}, {\"coin\":\"TRST\",\"name\":\"trust\",\"etomic\":\"0xCb94be6f13A1182E4A4B6140cb7bf2025d28e41B\",\"rpcport\":80}, {\"coin\":\"GUP\",\"name\":\"guppy\",\"etomic\":\"0xf7B098298f7C69Fc14610bf71d5e02c60792894C\",\"rpcport\":80}, {\"coin\":\"1ST\",\"name\":\"firstblood\",\"etomic\":\"0xAf30D2a7E90d7DC361c8C4585e9BB7D2F6f15bc7\",\"rpcport\":80}, {\"coin\":\"TIME\",\"name\":\"chronobank\",\"etomic\":\"0x6531f133e6DeeBe7F2dcE5A0441aA7ef330B4e53\",\"rpcport\":80}, {\"coin\":\"SWT\",\"name\":\"swarm-city\",\"etomic\":\"0xB9e7F8568e08d5659f5D29C4997173d84CdF2607\",\"rpcport\":80}, {\"coin\":\"ROL\",\"name\":\"dice\",\"etomic\":\"0x2e071D2966Aa7D8dECB1005885bA1977D6038A65\",\"rpcport\":80}, {\"coin\":\"XAUR\",\"name\":\"xaurum\",\"etomic\":\"0x4DF812F6064def1e5e029f1ca858777CC98D2D81\",\"rpcport\":80}, {\"coin\":\"PLU\",\"name\":\"pluton\",\"etomic\":\"0xD8912C10681D8B21Fd3742244f44658dBA12264E\",\"rpcport\":80}, {\"coin\":\"HGT\",\"name\":\"hellogold\",\"etomic\":\"0xba2184520A1cC49a6159c57e61E1844E085615B6\",\"rpcport\":80}, {\"coin\":\"VSL\",\"name\":\"vslice\",\"etomic\":\"0x5c543e7AE0A1104f78406C340E9C64FD9fCE5170\",\"rpcport\":80}, {\"coin\":\"IND\",\"name\":\"indorse-token\",\"etomic\":\"0xf8e386EDa857484f5a12e4B5DAa9984E06E73705\",\"rpcport\":80}, {\"coin\":\"FYN\",\"name\":\"fundyourselfnow\",\"etomic\":\"0x88FCFBc22C6d3dBaa25aF478C578978339BDe77a\",\"rpcport\":80},{\"coin\":\"SMART\",\"name\":\"smartcash\",\"rpcport\":9679,\"pubtype\":63,\"p2shtype\":18,\"wiftype\":191,\"txfee\":200000}, {\"coin\":\"BTCP\",\"name\":\"btcprivate\",\"rpcport\":7932,\"taddr\":19,\"pubtype\":37,\"p2shtype\":175,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DNR\",\"isPoS\":1,\"active\":1,\"name\":\"denarius\",\"rpcport\":32339,\"pubtype\":30,\"p2shtype\":90,\"wiftype\":158,\"txfee\":10000}, {\"coin\":\"RVN\",\"name\":\"raven\",\"rpcport\":8766,\"pubtype\":60,\"p2shtype\":122,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"VIVO\",\"name\":\"vivo\",\"confpath\":\"${HOME#}/.vivocore/vivo.conf\",\"rpcport\":9998,\"pubtype\":70,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"KNG\",\"name\":\"kings\",\"rpcport\":44888,\"pubtype\":75,\"p2shtype\":125,\"wiftype\":203,\"txfee\":10000}, {\"coin\":\"UFO\",\"name\":\"ufocoin\",\"confpath\":\"${HOME#}/.ufo/ufocoin.conf\",\"rpcport\":9888,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":155,\"txfee\":100000}, {\"coin\":\"ETH\",\"name\":\"ethereum\",\"etomic\":\"0x0000000000000000000000000000000000000000\",\"rpcport\":80}, {\"coin\":\"EOS\",\"name\":\"EOS\",\"etomic\":\"0x86fa049857e0209aa7d9e616f7eb3b3b78ecfdb0\",\"rpcport\":80}, {\"coin\":\"KREDS\",\"name\":\"kreds\",\"rpcport\":3850,\"pubtype\":45,\"p2shtype\":5,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"SNG\",\"name\":\"snowgem\",\"rpcport\":16112,\"taddr\":28,\"pubtype\":40,\"p2shtype\":45,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"ZEL\",\"name\":\"zelcash\",\"rpcport\":16124,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"PIVX\",\"name\":\"pivx\",\"rpcport\":51473,\"pubtype\":30,\"p2shtype\":13,\"wiftype\":212,\"txfee\":10000}, {\"coin\":\"HTML\",\"name\":\"htmlcoin\",\"rpcport\":4889,\"pubtype\":41,\"p2shtype\":100,\"wiftype\":169,\"txfee\":400000}, {\"coin\":\"MNX\",\"name\":\"Minexcoin\",\"rpcport\":17786,\"pubtype\":75,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LTZ\",\"name\":\"litecoinz\",\"rpcport\":29332,\"taddr\":10,\"pubtype\":179,\"p2shtype\":184,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"BAY\",\"name\":\"bitbay\",\"isPoS\":1,\"rpcport\":19915,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":10000}, {\"coin\":\"OOT\",\"asset\":\"OOT\",\"rpcport\":12467}, {\"coin\":\"ZOI\",\"name\":\"zoin\",\"rpcport\":8255,\"pubtype\":80,\"p2shtype\":7,\"wiftype\":208,\"txfee\":1000}, {\"coin\": \"PIZZA\",\"asset\": \"PIZZA\",\"rpcport\": 11116},{\"coin\": \"BEER\",\"asset\": \"BEER\",\"rpcport\": 8923}, {\"coin\":\"GRS\",\"name\":\"groestlcoin\",\"rpcport\":1441,\"pubtype\":36,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"XMCC\",\"name\":\"monoeci\",\"confpath\":\"${HOME#}/.monoeciCore/monoeci.conf\",\"rpcport\":24156,\"pubtype\":50,\"p2shtype\":73,\"wiftype\":77,\"txfee\":10000}, {\"coin\":\"BTCH\",\"asset\":\"BTCH\",\"rpcport\":8800},{\"coin\":\"ETOMIC\",\"asset\":\"ETOMIC\",\"rpcport\":10271},{\"coin\":\"AXO\",\"asset\":\"AXO\",\"rpcport\":12927},{\"coin\":\"CRC\",\"name\":\"crowdcoin\",\"confpath\":\"${HOME#}/.crowdcoincore/crowdcoin.conf\",\"rpcport\":11998,\"pubtype\":28,\"p2shtype\":88,\"wiftype\":0,\"txfee\":10000}, {\"coin\":\"VOT\",\"name\":\"votecoin\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"INN\",\"name\":\"innova\",\"confpath\":\"${HOME#}/.innovacore/innova.conf\",\"rpcport\":8818,\"pubtype\":102,\"p2shtype\":20,\"wiftype\":195,\"txfee\":10000}, {\"coin\":\"MOON\",\"name\":\"mooncoin\",\"rpcport\":44663,\"pubtype\":3,\"p2shtype\":22,\"wiftype\":131,\"txfee\":100000}, {\"coin\":\"CRW\",\"name\":\"crown\",\"rpcport\":9341,\"pubtype\":0,\"p2shtype\":28,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"EFL\",\"name\":\"egulden\",\"confpath\":\"${HOME#}/.egulden/coin.conf\",\"rpcport\":21015,\"pubtype\":48,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"GBX\",\"name\":\"gobyte\",\"confpath\":\"${HOME#}/.gobytecore/gobyte.conf\",\"rpcport\":12454,\"pubtype\":38,\"p2shtype\":10,\"wiftype\":198,\"txfee\":10000}, {\"coin\":\"BCO\",\"name\":\"bridgecoin\",\"rpcport\":6332,\"pubtype\":27,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BLK\",\"name\":\"blackcoin\",\"confpath\":\"${HOME#}/.lore/blackcoin.conf\",\"isPoS\":1,\"rpcport\":15715,\"pubtype\":25,\"p2shtype\":85,\"wiftype\":153,\"txfee\":100000}, {\"coin\":\"BTG\",\"name\":\"bitcoingold\",\"rpcport\":8332,\"pubtype\":38,\"p2shtype\":23,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BCH\",\"name\":\"bch\",\"rpcport\":33333,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"ABY\",\"name\":\"applebyte\",\"rpcport\":8607,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":100000}, {\"coin\":\"STAK\",\"name\":\"straks\",\"rpcport\":7574,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"XZC\",\"name\":\"zcoin\",\"rpcport\":8888,\"pubtype\":82,\"p2shtype\":7,\"wiftype\":210,\"txfee\":10000}, {\"coin\":\"QTUM\",\"name\":\"qtum\",\"rpcport\":3889,\"pubtype\":58,\"p2shtype\":50,\"wiftype\":128,\"txfee\":400000}, {\"coin\":\"PURA\",\"name\":\"pura\",\"rpcport\":55555,\"pubtype\":55,\"p2shtype\":16,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"DSR\",\"name\":\"desire\",\"confpath\":\"${HOME#}/.desirecore/desire.conf\",\"rpcport\":9918,\"pubtype\":30,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"MNZ\",\"asset\":\"MNZ\",\"rpcport\":14337},{\"coin\":\"BTCZ\",\"name\":\"bitcoinz\",\"rpcport\":1979,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"MAGA\",\"name\":\"magacoin\",\"rpcport\":5332,\"pubtype\":23,\"p2shtype\":50,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"BSD\",\"name\":\"bitsend\",\"rpcport\":8800,\"pubtype\":102,\"p2shtype\":5,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"IOP\",\"name\":\"IoP\",\"rpcport\":8337,\"pubtype\":117,\"p2shtype\":174,\"wiftype\":49,\"txfee\":10000}, {\"coin\":\"BLOCK\",\"name\":\"blocknetdx\",\"rpcport\":41414,\"pubtype\":26,\"p2shtype\":28,\"wiftype\":154,\"txfee\":10000}, {\"coin\":\"CHIPS\", \"name\": \"chips\", \"rpcport\":57776,\"pubtype\":60, \"p2shtype\":85, \"wiftype\":188, \"txfee\":10000}, {\"coin\":\"888\",\"name\":\"octocoin\",\"rpcport\":22888,\"pubtype\":18,\"p2shtype\":5,\"wiftype\":176,\"txfee\":2000000}, {\"coin\":\"ARG\",\"name\":\"argentum\",\"rpcport\":13581,\"pubtype\":23,\"p2shtype\":5,\"wiftype\":151,\"txfee\":50000}, {\"coin\":\"GLT\",\"name\":\"globaltoken\",\"rpcport\":9320,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":166,\"txfee\":10000}, {\"coin\":\"ZER\",\"name\":\"zero\",\"rpcport\":23801,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"HODLC\",\"name\":\"hodlcoin\",\"rpcport\":11989,\"pubtype\":40,\"p2shtype\":5,\"wiftype\":168,\"txfee\":5000}, {\"coin\":\"UIS\",\"name\":\"unitus\",\"rpcport\":50604,\"pubtype\":68,\"p2shtype\":10,\"wiftype\":132,\"txfee\":2000000}, {\"coin\":\"HUC\",\"name\":\"huntercoin\",\"rpcport\":8399,\"pubtype\":40,\"p2shtype\":13,\"wiftype\":168,\"txfee\":100000}, {\"coin\":\"BDL\",\"name\":\"bitdeal\",\"rpcport\":9332,\"pubtype\":38,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"ARC\",\"name\":\"arcticcoin\",\"confpath\":\"${HOME#}/.arcticcore/arcticcoin.conf\",\"rpcport\":7208,\"pubtype\":23,\"p2shtype\":8,\"wiftype\":176,\"txfee\":10000}, {\"coin\":\"ZCL\",\"name\":\"zclassic\",\"rpcport\":8023,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000}, {\"coin\":\"VIA\",\"name\":\"viacoin\",\"rpcport\":5222,\"pubtype\":71,\"p2shtype\":33,\"wiftype\":199,\"txfee\":100000}, {\"coin\":\"ERC\",\"name\":\"europecoin\",\"rpcport\":11989,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":168,\"txfee\":10000},{\"coin\":\"FAIR\",\"name\":\"faircoin\",\"confpath\":\"${HOME#}/.faircoin2/faircoin.conf\",\"rpcport\":40405,\"pubtype\":95,\"p2shtype\":36,\"wiftype\":223,\"txfee\":1000000}, {\"coin\":\"FLO\",\"name\":\"florincoin\",\"rpcport\":7313,\"pubtype\":35,\"p2shtype\":8,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"SXC\",\"name\":\"sexcoin\",\"rpcport\":9561,\"pubtype\":62,\"p2shtype\":5,\"wiftype\":190,\"txfee\":100000}, {\"coin\":\"CREA\",\"name\":\"creativecoin\",\"rpcport\":17711,\"pubtype\":28,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000}, {\"coin\":\"TRC\",\"name\":\"terracoin\",\"confpath\":\"${HOME#}/.terracoincore/terracoin.conf\",\"rpcport\":13332,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"BTA\",\"name\":\"bata\",\"rpcport\":5493,\"pubtype\":25,\"p2shtype\":5,\"wiftype\":188,\"txfee\":100000}, {\"coin\":\"SMC\",\"name\":\"smartcoin\",\"rpcport\":58583,\"pubtype\":63,\"p2shtype\":5,\"wiftype\":191,\"txfee\":1000000}, {\"coin\":\"NMC\",\"name\":\"namecoin\",\"rpcport\":8336,\"pubtype\":52,\"p2shtype\":13,\"wiftype\":180,\"txfee\":100000}, {\"coin\":\"NAV\",\"name\":\"navcoin\",\"isPoS\":1,\"confpath\":\"${HOME#}/.navcoin4/navcoin.conf\",\"rpcport\":44444,\"pubtype\":53,\"p2shtype\":85,\"wiftype\":150,\"txfee\":10000}, {\"coin\":\"EMC2\",\"name\":\"einsteinium\",\"rpcport\":41879,\"pubtype\":33,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"SYS\",\"name\":\"syscoin\",\"rpcport\":8370,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"I0C\",\"name\":\"i0coin\",\"rpcport\":7332,\"pubtype\":105,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"DASH\",\"confpath\":\"${HOME#}/.dashcore/dash.conf\",\"name\":\"dashcore\",\"rpcport\":9998,\"pubtype\":76,\"p2shtype\":16,\"wiftype\":204,\"txfee\":10000}, {\"coin\":\"STRAT\", \"name\": \"stratis\", \"active\":0, \"rpcport\":16174,\"pubtype\":63, \"p2shtype\":125, \"wiftype\":191, \"txfee\":10000}, {\"confpath\":\"${HOME#}/.muecore/mue.conf\",\"coin\":\"MUE\",\"name\":\"muecore\",\"rpcport\":29683,\"pubtype\":16,\"p2shtype\":76,\"wiftype\":126,\"txfee\":10000}, {\"coin\":\"MONA\",\"name\":\"monacoin\",\"rpcport\":9402,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":176,\"txfee\":100000},{\"coin\":\"XMY\",\"name\":\"myriadcoin\",\"rpcport\":10889,\"pubtype\":50,\"p2shtype\":9,\"wiftype\":178,\"txfee\":5000}, {\"coin\":\"MAC\",\"name\":\"machinecoin\",\"rpcport\":40332,\"pubtype\":50,\"p2shtype\":5,\"wiftype\":178,\"txfee\":100000}, {\"coin\":\"BTX\",\"name\":\"bitcore\",\"rpcport\":8556,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":50000}, {\"coin\":\"XRE\",\"name\":\"revolvercoin\",\"rpcport\":8775,\"pubtype\":0,\"p2shtype\":5,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"LBC\",\"name\":\"lbrycrd\",\"rpcport\":9245,\"pubtype\":85,\"p2shtype\":122,\"wiftype\":28,\"txfee\":10000}, {\"coin\":\"SIB\",\"name\":\"sibcoin\",\"rpcport\":1944,\"pubtype\":63,\"p2shtype\":40,\"wiftype\":128,\"txfee\":10000}, {\"coin\":\"VTC\", \"name\":\"vertcoin\", \"rpcport\":5888, \"pubtype\":71, \"p2shtype\":5, \"wiftype\":128, \"txfee\":100000 }, {\"coin\":\"REVS\",\"active\":0, \"asset\":\"REVS\",\"rpcport\":10196}, {\"coin\":\"JUMBLR\",\"active\":0, \"asset\":\"JUMBLR\",\"rpcport\":15106}, {\"coin\":\"DOGE\",\"name\":\"dogecoin\",\"rpcport\":22555,\"pubtype\":30,\"p2shtype\":22,\"wiftype\":158,\"txfee\":100000000}, {\"coin\":\"HUSH\",\"name\":\"hush\",\"rpcport\":8822,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":1000 }, {\"active\":0,\"coin\":\"ZEC\",\"name\":\"zcash\",\"rpcport\":8232,\"taddr\":28,\"pubtype\":184,\"p2shtype\":189,\"wiftype\":128,\"txfee\":10000 }, {\"coin\":\"DGB\",\"name\":\"digibyte\",\"rpcport\":14022,\"pubtype\":30,\"p2shtype\":5,\"wiftype\":128,\"txfee\":100000}, {\"coin\":\"ZET\", \"name\":\"zetacoin\", \"pubtype\":80, \"p2shtype\":9,\"rpcport\":8332, \"wiftype\":224, \"txfee\":10000}, {\"coin\":\"GAME\", \"rpcport\":40001, \"name\":\"gamecredits\", \"pubtype\":38, \"p2shtype\":5, \"wiftype\":166, \"txfee\":100000}, {\"coin\":\"LTC\", \"name\":\"litecoin\", \"rpcport\":9332, \"pubtype\":48, \"p2shtype\":5, \"wiftype\":176, \"txfee\":100000 }, {\"coin\":\"SUPERNET\",\"asset\":\"SUPERNET\",\"rpcport\":11341}, {\"coin\":\"WLC\",\"asset\":\"WLC\",\"rpcport\":12167}, {\"coin\":\"PANGEA\",\"asset\":\"PANGEA\",\"rpcport\":14068}, {\"coin\":\"DEX\",\"asset\":\"DEX\",\"rpcport\":11890}, {\"coin\":\"BET\",\"asset\":\"BET\",\"rpcport\":14250}, {\"coin\":\"CRYPTO\",\"asset\":\"CRYPTO\",\"rpcport\":8516}, {\"coin\":\"HODL\",\"asset\":\"HODL\",\"rpcport\":14431}, {\"coin\":\"MSHARK\",\"asset\":\"MSHARK\",\"rpcport\":8846}, {\"coin\":\"BOTS\",\"asset\":\"BOTS\",\"rpcport\":11964}, {\"coin\":\"MGW\",\"asset\":\"MGW\",\"rpcport\":12386}, {\"coin\":\"COQUI\",\"asset\":\"COQUI\",\"rpcport\":14276}, {\"coin\":\"KV\",\"asset\":\"KV\",\"rpcport\":8299}, {\"coin\":\"CEAL\",\"asset\":\"CEAL\",\"rpcport\":11116}, {\"coin\":\"MESH\",\"asset\":\"MESH\",\"rpcport\":9455}]" #, {\"coin\":\"AUD\",\"asset\":\"AUD\",\"rpcport\":8045}, {\"coin\":\"BGN\",\"asset\":\"BGN\",\"rpcport\":9110}, {\"coin\":\"CAD\",\"asset\":\"CAD\",\"rpcport\":8720}, {\"coin\":\"CHF\",\"asset\":\"CHF\",\"rpcport\":15312}, {\"coin\":\"CNY\",\"asset\":\"CNY\",\"rpcport\":10384}, {\"coin\":\"CZK\",\"asset\":\"CZK\",\"rpcport\":9482}, {\"coin\":\"DKK\",\"asset\":\"DKK\",\"rpcport\":13830}, {\"coin\":\"EUR\",\"asset\":\"EUR\",\"rpcport\":8065}, {\"coin\":\"GBP\",\"asset\":\"GBP\",\"rpcport\":11505}, {\"coin\":\"HKD\",\"asset\":\"HKD\",\"rpcport\":15409}, {\"coin\":\"HRK\",\"asset\":\"HRK\",\"rpcport\":12617}, {\"coin\":\"HUF\",\"asset\":\"HUF\",\"rpcport\":13699}, {\"coin\":\"IDR\",\"asset\":\"IDR\",\"rpcport\":14459}, {\"coin\":\"ILS\",\"asset\":\"ILS\",\"rpcport\":14638}, {\"coin\":\"INR\",\"asset\":\"INR\",\"rpcport\":10536}, {\"coin\":\"JPY\",\"asset\":\"JPY\",\"rpcport\":13145}, {\"coin\":\"KRW\",\"asset\":\"KRW\",\"rpcport\":14020}, {\"coin\":\"MXN\",\"asset\":\"MXN\",\"rpcport\":13970}, {\"coin\":\"MYR\",\"asset\":\"MYR\",\"rpcport\":10688}, {\"coin\":\"NOK\",\"asset\":\"NOK\",\"rpcport\":11588}, {\"coin\":\"NZD\",\"asset\":\"NZD\",\"rpcport\":10915}, {\"coin\":\"PHP\",\"asset\":\"PHP\",\"rpcport\":11181}, {\"coin\":\"PLN\",\"asset\":\"PLN\",\"rpcport\":13493}, {\"coin\":\"BRL\",\"asset\":\"BRL\",\"rpcport\":9914}, {\"coin\":\"RON\",\"asset\":\"RON\",\"rpcport\":8675}, {\"coin\":\"RUB\",\"asset\":\"RUB\",\"rpcport\":8199}, {\"coin\":\"SEK\",\"asset\":\"SEK\",\"rpcport\":11447}, {\"coin\":\"SGD\",\"asset\":\"SGD\",\"rpcport\":14475}, {\"coin\":\"THB\",\"asset\":\"THB\",\"rpcport\":11847}, {\"coin\":\"TRY\",\"asset\":\"TRY\",\"rpcport\":13924}, {\"coin\":\"USD\",\"asset\":\"USD\",\"rpcport\":13967}, {\"coin\":\"ZAR\",\"asset\":\"ZAR\",\"rpcport\":15160}]" diff --git a/iguana/exchanges/dump b/iguana/exchanges/dump new file mode 100755 index 000000000..65f444120 --- /dev/null +++ b/iguana/exchanges/dump @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"sell\",\"base\":\"KMD\",\"rel\":\"HODL\",\"dump\":40.00038}" diff --git a/iguana/exchanges/etomicswap/CMakeLists.txt b/iguana/exchanges/etomicswap/CMakeLists.txt index 46c2d2adf..ace34d80f 100644 --- a/iguana/exchanges/etomicswap/CMakeLists.txt +++ b/iguana/exchanges/etomicswap/CMakeLists.txt @@ -4,6 +4,14 @@ 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) +if(WIN32) +add_definitions(-DNATIVE_WINDOWS) +add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +add_definitions(-D_CRT_SECURE_NO_WARNINGS) +add_definitions(-DNOMINMAX) +include_directories("${CMAKE_SOURCE_DIR}/includes") +endif() include_directories("${CMAKE_SOURCE_DIR}/cpp-ethereum") target_link_libraries(etomiclib-testnet PUBLIC curl libcrypto777 ethcore devcrypto devcore pthread) target_link_libraries(etomiclib-mainnet PUBLIC curl libcrypto777 ethcore devcrypto devcore pthread) diff --git a/iguana/exchanges/fasttest b/iguana/exchanges/fasttest new file mode 100755 index 000000000..a420ed864 --- /dev/null +++ b/iguana/exchanges/fasttest @@ -0,0 +1,6 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"queueid\":1,\"userpass\":\"$userpass\",\"method\":\"sleep\",\"seconds\":10}" & +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"orderbook\",\"base\":\"REVS\",\"rel\":\"KMD\"}" +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"orderbook\",\"base\":\"REVS\",\"rel\":\"KMD\"}" +curl --url "http://127.0.0.1:7783" --data "{\"queueid\":2,\"userpass\":\"$userpass\",\"method\":\"getcoin\",\"coin\":\"REVS\",\"rel\":\"KMD\"}" diff --git a/iguana/exchanges/fomo b/iguana/exchanges/fomo new file mode 100755 index 000000000..4621b7edd --- /dev/null +++ b/iguana/exchanges/fomo @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"buy\",\"base\":\"KMD\",\"rel\":\"HODL\",\"fomo\":40.00038}" diff --git a/iguana/exchanges/getfee b/iguana/exchanges/getfee new file mode 100755 index 000000000..147bd344f --- /dev/null +++ b/iguana/exchanges/getfee @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"getfee\",\"coin\":\"BTC\"}" diff --git a/iguana/exchanges/listtransactions b/iguana/exchanges/listtransactions new file mode 100755 index 000000000..513a1647f --- /dev/null +++ b/iguana/exchanges/listtransactions @@ -0,0 +1,3 @@ +#!/bin/bash +source userpass +curl --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"listtransactions\",\"coin\":\"CHIPS\",\"address\":\"RMfQwu5ey23eWJ4as2ckd8dqsQJwo836ny\"}" diff --git a/iguana/exchanges/mm.c b/iguana/exchanges/mm.c index 234565e32..c35046538 100644 --- a/iguana/exchanges/mm.c +++ b/iguana/exchanges/mm.c @@ -37,7 +37,7 @@ void PNACL_message(char *arg,...) uint32_t DOCKERFLAG; #define MAX(a,b) ((a) > (b) ? (a) : (b)) -char *stats_JSON(void *ctx,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port); +char *stats_JSON(void *ctx,int32_t fastflag,char *myipaddr,int32_t pubsock,cJSON *argjson,char *remoteaddr,uint16_t port); #include "stats.c" void LP_priceupdate(char *base,char *rel,double price,double avebid,double aveask,double highbid,double lowask,double PAXPRICES[32]); diff --git a/iguana/exchanges/run_osx b/iguana/exchanges/run_osx deleted file mode 100755 index 970217843..000000000 --- a/iguana/exchanges/run_osx +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -source passphrase -source coins -pkill -15 marketmaker; -git pull; -cd ..; -./m_mm; -$1 ./marketmaker "{\"gui\":\"nogui\", \"profitmargin\":0.01, \"userhome\":\"/${HOME#"/"}/Library/Application\ Support\", \"passphrase\":\"$passphrase\", \"coins\":$coins}" & diff --git a/iguana/exchanges/stats.c b/iguana/exchanges/stats.c index 6c8daa4f5..5d50c6a52 100644 --- a/iguana/exchanges/stats.c +++ b/iguana/exchanges/stats.c @@ -28,7 +28,7 @@ #define STATS_DESTDIR "/var/www/html" #define STATS_DEST "/var/www/html/DEXstats.json" #include "DEXstats.h" -char *stats_JSON(void *ctx,char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port); +char *stats_JSON(void *ctx,int32_t fastflag,char *myipaddr,int32_t mypubsock,cJSON *argjson,char *remoteaddr,uint16_t port); void LP_queuecommand(char **retstrp,char *buf,int32_t responsesock,int32_t stats_JSONonly,uint32_t queueid); extern uint32_t DOCKERFLAG; @@ -331,6 +331,10 @@ cJSON *SuperNET_urlconv(char *value,int32_t bufsize,char *urlstr) extern void *bitcoin_ctx(); extern int32_t IPC_ENDPOINT; +extern portable_mutex_t LP_gcmutex,LP_commandmutex; +extern struct rpcrequest_info *LP_garbage_collector; +uint16_t RPC_port; +static int32_t spawned,maxspawned; char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *postflagp,char *urlstr,char *remoteaddr,char *filetype,uint16_t port) { @@ -530,7 +534,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po //free(buf); //while ( retstr == 0 ) // usleep(10000); - if ( (retstr= stats_JSON(ctx,"127.0.0.1",-1,argjson,remoteaddr,port)) != 0 ) + if ( (retstr= stats_JSON(ctx,0,"127.0.0.1",-1,argjson,remoteaddr,port)) != 0 ) { if ( (retitem= cJSON_Parse(retstr)) != 0 ) jaddi(retarray,retitem); @@ -543,7 +547,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po //free(buf); //while ( retstr == 0 ) // usleep(10000); - if ( (retstr= stats_JSON(ctx,myipaddr,-1,argjson,remoteaddr,port)) != 0 ) + if ( (retstr= stats_JSON(ctx,0,myipaddr,-1,argjson,remoteaddr,port)) != 0 ) { if ( (retitem= cJSON_Parse(retstr)) != 0 ) jaddi(retarray,retitem); @@ -557,7 +561,7 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po } else { - cJSON *arg; char *buf; + cJSON *arg; char *buf,*method; int32_t fastflag; if ( jstr(argjson,"agent") != 0 && strcmp(jstr(argjson,"agent"),"bitcoinrpc") != 0 && jobj(argjson,"params") != 0 ) { arg = jobj(argjson,"params"); @@ -567,16 +571,24 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po //printf("ARGJSON.(%s)\n",jprint(arg,0)); if ( userpass != 0 && jstr(arg,"userpass") == 0 ) jaddstr(arg,"userpass",userpass); + if ( (fastflag= jint(arg,"fast")) == 0 ) + { + if ( (method= jstr(arg,"method")) != 0 && (strcmp(method,"orderbook") == 0 || strcmp(method,"portfolio") == 0) ) + fastflag = 1; + } + if ( fastflag == 0 ) + portable_mutex_lock(&LP_commandmutex); #ifdef FROM_MARKETMAKER if ( strcmp(remoteaddr,"127.0.0.1") == 0 || LP_valid_remotemethod(arg) > 0 ) { if ( IPC_ENDPOINT >= 0 && (queueid= juint(arg,"queueid")) > 0 ) { buf = jprint(arg,0); + //printf("Q command\n"); LP_queuecommand(&retstr,buf,IPC_ENDPOINT,1,queueid); free(buf); retstr = clonestr("{\"result\":\"success\",\"status\":\"queued\"}"); - } else retstr = stats_JSON(ctx,"127.0.0.1",-1,arg,remoteaddr,port); + } else retstr = stats_JSON(ctx,jint(arg,"fast"),"127.0.0.1",-1,arg,remoteaddr,port); } else retstr = clonestr("{\"error\":\"invalid remote method\"}"); #else if ( IPC_ENDPOINT >= 0 && (queueid= juint(arg,"queueid")) > 0 ) @@ -584,8 +596,10 @@ char *stats_rpcparse(char *retbuf,int32_t bufsize,int32_t *jsonflagp,int32_t *po buf = jprint(arg,0); LP_queuecommand(&retstr,buf,IPC_ENDPOINT,1,queueid); free(buf); - } else retstr = stats_JSON(ctx,myipaddr,-1,arg,remoteaddr,port); + } else retstr = stats_JSON(ctx,jint(arg,"fast"),myipaddr,-1,arg,remoteaddr,port); #endif + if ( fastflag == 0 ) + portable_mutex_unlock(&LP_commandmutex); } free_json(argjson); } @@ -625,13 +639,8 @@ int32_t iguana_getheadersize(char *buf,int32_t recvlen) return(recvlen); } -uint16_t RPC_port; -extern portable_mutex_t LP_commandmutex,LP_gcmutex; -extern struct rpcrequest_info *LP_garbage_collector; - void LP_rpc_processreq(void *_ptr) { - static uint32_t spawned,maxspawned; char filetype[128],content_type[128]; int32_t recvlen,flag,postflag=0,contentlen,remains,sock,numsent,jsonflag=0,hdrsize,len; char helpname[512],remoteaddr[64],*buf,*retstr,space[8192],space2[32786],*jsonbuf; struct rpcrequest_info *req = _ptr; @@ -641,11 +650,11 @@ void LP_rpc_processreq(void *_ptr) sock = req->sock; recvlen = flag = 0; retstr = 0; - //space = calloc(1,size); jsonbuf = calloc(1,size); - //printf("alloc jsonbuf.%p\n",jsonbuf); remains = size-1; buf = jsonbuf; + if ( spawned < 0 ) + spawned = 0; spawned++; if ( spawned > maxspawned ) { @@ -708,9 +717,7 @@ void LP_rpc_processreq(void *_ptr) if ( recvlen > 0 ) { jsonflag = postflag = 0; - //portable_mutex_lock(&LP_commandmutex); retstr = stats_rpcparse(space,size,&jsonflag,&postflag,jsonbuf,remoteaddr,filetype,req->port); - //portable_mutex_unlock(&LP_commandmutex); if ( filetype[0] != 0 ) { static cJSON *mimejson; char *tmp,*typestr=0; long tmpsize; @@ -795,7 +802,8 @@ void LP_rpc_processreq(void *_ptr) //printf("free req.%p\n",req); free(req); } - spawned--; + if ( spawned > 0 ) + spawned--; } extern int32_t IAMLP,LP_STOP_RECEIVED; @@ -854,14 +862,14 @@ void stats_rpcloop(void *args) continue; } req = calloc(1,sizeof(*req)); - //printf("alloc req.%p\n",req); + //printf("LP_rpc_processreq req.%p\n",req); req->sock = sock; req->ipbits = ipbits; req->port = port; - LP_rpc_processreq(req); - continue; + if ( spawned > 0 ) + LP_rpc_processreq(req); // this might lead to "cant open file errors" - if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) + else if ( (retval= OS_thread_create(&req->T,NULL,(void *)LP_rpc_processreq,req)) != 0 ) { printf("error launching rpc handler on port %d, retval.%d\n",port,retval); LP_rpc_processreq(req); diff --git a/iguana/iguana777.c b/iguana/iguana777.c index 9d7bd35ed..9bfb1764b 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -48,6 +48,7 @@ struct iguana_info *iguana_coinadd(char *symbol,char *name,cJSON *argjson,int32_ { myinfo->allcoins_being_added = 1; coin = mycalloc('C',1,sizeof(*coin)); + strcpy(coin->getinfostr,"getinfo"); coin->blockspacesize = IGUANA_MAXPACKETSIZE + 8192; coin->blockspace = calloc(1,coin->blockspacesize); if ( virtcoin != 0 || ((privatechain= jstr(argjson,"geckochain")) != 0 && privatechain[0] != 0) ) diff --git a/iguana/iguana_init.c b/iguana/iguana_init.c index bb3c92135..473b46953 100755 --- a/iguana/iguana_init.c +++ b/iguana/iguana_init.c @@ -68,6 +68,7 @@ void iguana_initcoin(struct iguana_info *coin,cJSON *argjson) portable_mutex_init(&coin->RTmutex); portable_mutex_init(&coin->kmdmutex); portable_mutex_init(&coin->peers_mutex); + portable_mutex_init(&coin->MoM_mutex); portable_mutex_init(&coin->blocks_mutex); portable_mutex_init(&coin->special_mutex); portable_mutex_init(&coin->allcoins_mutex); diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index a45e8fa19..73a6a167a 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -139,7 +139,7 @@ void dpow_srcupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t he { if ( (0) && strcmp("CHIPS",dp->symbol) == 0 ) printf("ht.%d maxblocks.%d\n",ht,dp->maxblocks); - for (i=ht-500; i>ht-10000; i--) + for (i=ht-500; i>ht-10000&&i>100; i--) { if ( (i % 100) != 0 && (bp= dp->blocks[i]) != 0 && bp->state == 0xffffffff ) { diff --git a/iguana/iguana_wallet.c b/iguana/iguana_wallet.c index e125aea2a..acf956890 100755 --- a/iguana/iguana_wallet.c +++ b/iguana/iguana_wallet.c @@ -1342,7 +1342,7 @@ ZERO_ARGS(bitcoinrpc,walletlock) TWOSTRINGS_AND_INT(bitcoinrpc,walletpassphrase,password,permanentfile,timeout) { - char *retstr; + char *retstr,*tmpstr; cJSON *retjson; if ( remoteaddr != 0 ) return(clonestr("{\"error\":\"no remote\"}")); if ( timeout <= 0 ) @@ -1368,9 +1368,22 @@ TWOSTRINGS_AND_INT(bitcoinrpc,walletpassphrase,password,permanentfile,timeout) bitcoin_address(coin->changeaddr,coin->chain->pubtype,myinfo->persistent_pubkey33,33); if ( coin->FULLNODE < 0 ) { - char wifstr[64]; - bitcoin_priv2wif(wifstr,myinfo->persistent_priv,coin->chain->wiftype); - jumblr_importprivkey(myinfo,coin,wifstr); + char wifstr[64]; int32_t destvalid = 0; cJSON *ismine; + if ( (tmpstr= dpow_validateaddress(myinfo,coin,coin->changeaddr)) != 0 ) + { + retjson = cJSON_Parse(tmpstr); + if ( (ismine= jobj(json,"ismine")) != 0 && is_cJSON_True(ismine) != 0 ) + destvalid = 1; + else destvalid = 0; + free(tmpstr); + free(retjson); + tmpstr = 0; + } + if ( destvalid == 0 ) + { + bitcoin_priv2wif(wifstr,myinfo->persistent_priv,coin->chain->wiftype); + jumblr_importprivkey(myinfo,coin,wifstr); + } } } if ( bits256_nonz(myinfo->persistent_priv) != 0 ) diff --git a/iguana/m_mm b/iguana/m_mm index 72a0f895f..39df45ee7 100755 --- a/iguana/m_mm +++ b/iguana/m_mm @@ -10,4 +10,5 @@ if [[ "$OSTYPE" == "darwin"* ]]; then nanomsg_lib="../OSlibs/osx/$(uname -m)/libnanomsg-static.a" fi +rm marketmaker gcc -g -o marketmaker -DNOTETOMIC -I../crypto777 exchanges/mm.c ../crypto777/cJSON.c mini-gmp.c keccak.c groestl.c segwit_addr.c secp256k1.o ../agents/libcrypto777.a $nanomsg_lib -lcurl -lpthread -lm diff --git a/includes/iguana_structs.h b/includes/iguana_structs.h index e92e40fa3..feaf910e7 100755 --- a/includes/iguana_structs.h +++ b/includes/iguana_structs.h @@ -511,7 +511,7 @@ struct iguana_info struct OS_memspace TXMEM,MEM,MEMB[IGUANA_MAXBUNDLESIZE]; queue_t acceptQ,hdrsQ,blocksQ,priorityQ,possibleQ,cacheQ,recvQ,msgrequestQ,jsonQ,finishedQ; double parsemillis,avetime; uint32_t Launched[8],Terminated[8]; - portable_mutex_t peers_mutex,blocks_mutex,special_mutex,RTmutex,allcoins_mutex; + portable_mutex_t peers_mutex,blocks_mutex,special_mutex,RTmutex,allcoins_mutex,MoM_mutex; char changeaddr[64]; struct iguana_bundle *bundles[IGUANA_MAXBUNDLES],*current,*lastpending; struct OS_memspace RTrawmem,RTmem,RThashmem; // struct iguana_ramchain RTramchain; diff --git a/marketmaker_build_depends.cmd b/marketmaker_build_depends.cmd index bdfbb92ca..a09e0ea04 100644 --- a/marketmaker_build_depends.cmd +++ b/marketmaker_build_depends.cmd @@ -75,7 +75,7 @@ cd curl mkdir build_msvc_2015_win32 mkdir build_msvc_2015_win64 cd build_msvc_2015_win64 -cmake -G "Visual Studio 14 2015 Win64" .. +cmake -G "Visual Studio 14 2015 Win64" -DCMAKE_USE_WINSSL:BOOL=ON .. cmake --build . --config Release --target libcurl rem cmake .. -G"Visual Studio 14 2015 Win64" -DCURL_STATICLIB=ON -DCURL_DISABLE_LDAP=ON -DCURL_STATIC_CRT=ON diff --git a/marketmaker_build_etomic.cmd b/marketmaker_build_etomic.cmd new file mode 100644 index 000000000..ed76db72c --- /dev/null +++ b/marketmaker_build_etomic.cmd @@ -0,0 +1,56 @@ +@echo off +rem (c) Decker + +echo [#1] Build nanomsg, curl and pthreads ... +call marketmaker_build_depends.cmd +copy marketmaker_depends\curl\build_msvc_2015_win64\lib\Release\libcurl_imp.lib marketmaker_depends\curl\build_msvc_2015_win64\lib\Release\curl.lib +copy marketmaker_depends\pthread-win32\bin\x64_MSVC2015.Release\pthread_lib.lib marketmaker_depends\pthread-win32\bin\x64_MSVC2015.Release\pthread.lib + +echo [#2] Prepare build etomic needed things ... +git submodule init +git submodule update --init --recursive +cd cpp-ethereum +rem git submodule init +rem git submodule update --init +call scripts\install_deps.bat +cd .. +mkdir build_win64_release +cd build_win64_release +cmake .. -G "Visual Studio 14 2015 Win64" + +rem Steps before build: +rem +rem crypto777\CMakeLists.txt +rem Add: +rem if(WIN32) +rem add_definitions(-DNATIVE_WINDOWS) +rem add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +rem add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +rem include_directories("${CMAKE_SOURCE_DIR}/includes") +rem endif() +rem +rem iguana\exchanges\CMakeLists.txt +rem +rem if(WIN32) +rem add_definitions(-DNATIVE_WINDOWS) +rem add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +rem add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +rem add_definitions(-D_CRT_SECURE_NO_WARNINGS) +rem include_directories("${CMAKE_SOURCE_DIR}/includes") +rem endif() +rem +rem iguana\exchanges\etomicswap\CMakeLists.txt +rem +rem if(WIN32) +rem add_definitions(-DNATIVE_WINDOWS) +rem add_definitions(-DIGUANA_LOG2PACKETSIZE=20) +rem add_definitions(-DIGUANA_MAXPACKETSIZE=1572864) +rem add_definitions(-D_CRT_SECURE_NO_WARNINGS) +rem add_definitions(-DNOMINMAX) +rem include_directories("${CMAKE_SOURCE_DIR}/includes") +rem endif() + +echo [#3] Build marketmaker-mainnet ... + +cmake --build . --config Release --target marketmaker-mainnet +cd .. \ No newline at end of file