diff --git a/basilisk/basilisk.c b/basilisk/basilisk.c index 39c49c775..e024dfd35 100755 --- a/basilisk/basilisk.c +++ b/basilisk/basilisk.c @@ -773,7 +773,7 @@ void basilisk_msgprocess(struct supernet_info *myinfo,void *_addr,uint32_t sende int32_t basilisk_p2pQ_process(struct supernet_info *myinfo,int32_t maxiters) { struct basilisk_p2pitem *ptr; char senderip[64]; uint32_t n=0,basilisktag,len; - while ( n < maxiters && (ptr= queue_dequeue(&myinfo->p2pQ,0)) != 0 ) + while ( n < maxiters && (ptr= queue_dequeue(&myinfo->p2pQ)) != 0 ) { len = 0; expand_ipbits(senderip,ptr->ipbits); @@ -835,7 +835,7 @@ void basilisk_p2p(struct supernet_info *myinfo,struct iguana_info *coin,struct i ipbits = (uint32_t)calc_ipbits(senderip); else ipbits = myinfo->myaddr.myipbits; ptr = basilisk_p2pitem_create(coin,addr,type,ipbits,data,datalen); - queue_enqueue("p2pQ",&myinfo->p2pQ,ptr,0); + queue_enqueue("p2pQ",&myinfo->p2pQ,ptr); } int32_t basilisk_issued_purge(struct supernet_info *myinfo,int32_t timepad) @@ -862,6 +862,47 @@ int32_t basilisk_issued_purge(struct supernet_info *myinfo,int32_t timepad) return(n); } +/*#define issue_curl2(cmdstr) bitcoind_RPC(0,(char *)"curl",(char *)"http://127.0.0.1:7778",0,0,(char *)(cmdstr)) + +void komodo_iteration(char *symbol) +{ + char *retstr,*base,*coinaddr,*txidstr,cmd[512]; uint64_t value,fiatoshis; cJSON *array,*item; int32_t i,n,vout,shortflag,height,fiatheight; bits256 txid; uint8_t rmd160[20],addrtype; + //if ( ASSETCHAINS_SYMBOL[0] == 0 ) + { + sprintf(cmd,"{\"agent\":\"dpow\",\"method\":\"pending\",\"fiat\":\"%s\"}",symbol); + if ( (retstr= issue_curl2(cmd)) != 0 ) + { + if ( (array= cJSON_Parse(retstr)) != 0 ) + { + if ( (n= cJSON_GetArraySize(array)) > 0 ) + { + for (i=0; i 0 && height > 0 ) + { + fiatoshis = jdouble(item,base) * SATOSHIDEN; + decode_hex((uint8_t *)&txid,sizeof(txid),txidstr); + bitcoin_addr2rmd160(&addrtype,rmd160,coinaddr); + //komodo_gateway_deposit(coinaddr,value,shortflag,base,fiatoshis,rmd160,txid,vout,height,fiatheight); + } + } + } + } + printf("retstr.(%s)\n",retstr); + free(retstr); + } + } +}*/ + void basilisks_loop(void *arg) { static uint32_t counter; @@ -882,13 +923,18 @@ void basilisks_loop(void *arg) basilisk_ping_send(myinfo,relay); counter++; if ( (counter % 10) == 0 && myinfo->numdpows == 1 ) + { iguana_dPoWupdate(myinfo,&myinfo->DPOWS[0]); + endmilli = startmilli + 500; + } else if ( myinfo->numdpows > 1 ) { dp = &myinfo->DPOWS[counter % myinfo->numdpows]; iguana_dPoWupdate(myinfo,dp); + if ( (counter % myinfo->numdpows) != 0 ) + iguana_dPoWupdate(myinfo,&myinfo->DPOWS[0]); + endmilli = startmilli + 200; } - endmilli = startmilli + 500; } else if ( myinfo->IAMLP != 0 ) endmilli = startmilli + 1000; diff --git a/basilisk/basilisk_MSG.c b/basilisk/basilisk_MSG.c index 332aaaaf8..ba6fd9739 100755 --- a/basilisk/basilisk_MSG.c +++ b/basilisk/basilisk_MSG.c @@ -198,7 +198,7 @@ char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int3 //printf("overwrite update of msg.[%d] <- datalen.%d\n",msg->datalen,datalen); memcpy(msg->data,data,datalen); if ( sendping != 0 ) - queue_enqueue("basilisk_message",&myinfo->msgQ,&msg->DL,0); + queue_enqueue("basilisk_message",&myinfo->msgQ,&msg->DL); } portable_mutex_unlock(&myinfo->messagemutex); return(clonestr("{\"result\":\"message updated\"}")); @@ -223,7 +223,7 @@ char *basilisk_respond_addmessage(struct supernet_info *myinfo,uint8_t *key,int3 //if ( myinfo->NOTARY.RELAYID >= 0 ) // dpow_handler(myinfo,msg); if ( sendping != 0 ) - queue_enqueue("basilisk_message",&myinfo->msgQ,&msg->DL,0); + queue_enqueue("basilisk_message",&myinfo->msgQ,&msg->DL); return(clonestr("{\"result\":\"message added to hashtable\"}")); } diff --git a/basilisk/basilisk_ping.c b/basilisk/basilisk_ping.c index 53d5aa2d4..c02e805f2 100755 --- a/basilisk/basilisk_ping.c +++ b/basilisk/basilisk_ping.c @@ -143,7 +143,7 @@ int32_t basilisk_ping_processMSG(struct supernet_info *myinfo,uint32_t senderipb int32_t basilisk_ping_genMSG(struct supernet_info *myinfo,uint8_t *data,int32_t maxlen) { struct basilisk_message *msg; int32_t datalen = 0; - if ( maxlen > sizeof(msg->key) && (msg= queue_dequeue(&myinfo->msgQ,0)) != 0 ) // oneshot ping + if ( maxlen > sizeof(msg->key) && (msg= queue_dequeue(&myinfo->msgQ)) != 0 ) // oneshot ping { data[datalen++] = 1; data[datalen++] = msg->keylen; diff --git a/crypto777/OS_portable.h b/crypto777/OS_portable.h index 1b8603042..f0d61365e 100755 --- a/crypto777/OS_portable.h +++ b/crypto777/OS_portable.h @@ -133,6 +133,8 @@ int32_t hseek(HUFF *hp,int32_t offset,int32_t mode); struct allocitem { uint32_t allocsize,type; } PACKED; struct queueitem { struct queueitem *next,*prev; uint32_t allocsize,type; } PACKED; +struct stritem { struct queueitem DL; char str[]; }; + typedef struct queue { struct queueitem *list; @@ -249,14 +251,14 @@ void OS_randombytes(uint8_t *x,long xlen); long myallocated(uint8_t type,long change); void *mycalloc(uint8_t type,int32_t n,long itemsize); void myfree(void *_ptr,long allocsize); -void free_queueitem(void *itemdata); +//void free_queueitem(void *itemdata); void *myrealloc(uint8_t type,void *oldptr,long oldsize,long newsize); void *myaligned_alloc(uint64_t allocsize); int32_t myaligned_free(void *ptr,long size); -void *queueitem(char *str); -void queue_enqueue(char *name,queue_t *queue,struct queueitem *origitem,int32_t offsetflag); -void *queue_dequeue(queue_t *queue,int32_t offsetflag); +struct queueitem *queueitem(char *str); +void queue_enqueue(char *name,queue_t *queue,struct queueitem *origitem);//,int32_t offsetflag); +void *queue_dequeue(queue_t *queue);//,int32_t offsetflag); void *queue_delete(queue_t *queue,struct queueitem *copy,int32_t copysize,int32_t freeitem); void *queue_free(queue_t *queue); void *queue_clone(queue_t *clone,queue_t *queue,int32_t size); diff --git a/crypto777/bitcoind_RPC.c b/crypto777/bitcoind_RPC.c index 7d95e40a0..658be29d1 100755 --- a/crypto777/bitcoind_RPC.c +++ b/crypto777/bitcoind_RPC.c @@ -134,7 +134,7 @@ char *bitcoind_RPC(char **retstrp,char *debugstr,char *url,char *userpass,char * specialcase = 1; else specialcase = 0; if ( url[0] == 0 ) - strcpy(url,"http://127.0.0.1:7876/nxt"); + strcpy(url,"http://127.0.0.1:7776"); if ( specialcase != 0 && 0 ) printf("<<<<<<<<<<< bitcoind_RPC: debug.(%s) url.(%s) command.(%s) params.(%s)\n",debugstr,url,command,params); try_again: diff --git a/crypto777/iguana_OS.c b/crypto777/iguana_OS.c index a430535ab..d53a0ccbd 100755 --- a/crypto777/iguana_OS.c +++ b/crypto777/iguana_OS.c @@ -41,7 +41,7 @@ void OS_randombytes(unsigned char *x,long xlen) { OS_portable_randombytes(x,xlen); } - + static double _kb(double n) { return(n / 1024.); } static double _mb(double n) { return(n / (1024.*1024.)); } static double _gb(double n) { return(n / (1024.*1024.*1024.)); } @@ -94,6 +94,7 @@ long myallocated(uint8_t type,long change) void *mycalloc(uint8_t type,int32_t n,long itemsize) { +#ifdef USE_MYCALLOC //static portable_mutex_t MEMmutex; struct allocitem *item; int64_t allocsize = ((uint64_t)n * itemsize); if ( type == 0 && n == 0 && itemsize == 0 ) @@ -115,30 +116,39 @@ void *mycalloc(uint8_t type,int32_t n,long itemsize) item->type = type; //portable_mutex_unlock(&MEMmutex); return((void *)((long)item + sizeof(*item))); +#else + return(calloc(n,itemsize)); +#endif } -void *queueitem(char *str) +struct queueitem *queueitem(char *str) { - struct queueitem *item; int32_t n,allocsize; char *data; uint8_t type = 'y'; - //portable_mutex_lock(&MEMmutex); - n = (uint32_t)strlen(str) + 1; - allocsize = (uint32_t)(sizeof(struct queueitem) + n); - myallocated(type,allocsize); - while ( (item= calloc(1,allocsize)) == 0 ) - { - char str[65]; - printf("queueitem: need to wait for memory.(%d,%ld) %s to be available\n",n,(long)sizeof(*item),mbstr(str,allocsize)); - sleep(1); - } - item->allocsize = (uint32_t)allocsize; - item->type = type; - data = (void *)(long)((long)item + sizeof(*item)); - memcpy(data,str,n); - //printf("(%c) queueitem.%p itemdata.%p n.%d allocsize.%d\n",type,item,data,n,allocsize); - //portable_mutex_unlock(&MEMmutex); - return(data); + /*struct queueitem *item; int32_t n,allocsize; char *data; uint8_t type = 'y'; + //portable_mutex_lock(&MEMmutex); + n = (uint32_t)strlen(str) + 1; + allocsize = (uint32_t)(sizeof(struct queueitem) + n); + myallocated(type,allocsize); + while ( (item= calloc(1,allocsize)) == 0 ) + { + char str[65]; + printf("queueitem: need to wait for memory.(%d,%ld) %s to be available\n",n,(long)sizeof(*item),mbstr(str,allocsize)); + sleep(1); + } + item->allocsize = (uint32_t)allocsize; + item->type = type; + data = (void *)(long)((long)item + sizeof(*item)); + memcpy(data,str,n); + //printf("(%c) queueitem.%p itemdata.%p n.%d allocsize.%d\n",type,item,data,n,allocsize); + //portable_mutex_unlock(&MEMmutex); + return(data);*/ + struct stritem *sitem; int32_t len; + len = (int32_t)strlen(str); + sitem = calloc(1,sizeof(*sitem) + len + 16); + memcpy(sitem->str,str,len); + return(&sitem->DL); } +#ifdef USE_MYCALLOC void _myfree(uint8_t type,int32_t origallocsize,void *origptr,int32_t allocsize) { //portable_mutex_lock(&MEMmutex); @@ -171,12 +181,12 @@ void myfree(void *_ptr,long allocsize) _myfree(item->type,item->allocsize,item,(uint32_t)allocsize); } -void free_queueitem(void *itemdata) -{ - struct queueitem *item = (void *)((long)itemdata - sizeof(struct queueitem)); - //printf("freeq item.%p itemdata.%p size.%d\n",item,itemdata,item->allocsize); - _myfree(item->type,item->allocsize,item,item->allocsize); -} +/*void free_queueitem(void *itemdata) + { + struct queueitem *item = (void *)((long)itemdata - sizeof(struct queueitem)); + //printf("freeq item.%p itemdata.%p size.%d\n",item,itemdata,item->allocsize); + _myfree(item->type,item->allocsize,item,item->allocsize); + }*/ void *myrealloc(uint8_t type,void *oldptr,long oldsize,long newsize) { @@ -190,6 +200,17 @@ void *myrealloc(uint8_t type,void *oldptr,long oldsize,long newsize) } return(newptr); } +#else +void myfree(void *_ptr,long allocsize) +{ + free(_ptr); +} + +void *myrealloc(uint8_t type,void *oldptr,long oldsize,long newsize) +{ + return(realloc(oldptr,newsize)); +} +#endif static uint64_t _align16(uint64_t ptrval) { if ( (ptrval & 15) != 0 ) ptrval += 16 - (ptrval & 15); return(ptrval); } @@ -235,25 +256,20 @@ void lock_queue(queue_t *queue) portable_mutex_lock(&queue->mutex); } -void queue_enqueue(char *name,queue_t *queue,struct queueitem *origitem,int32_t offsetflag) +void queue_enqueue(char *name,queue_t *queue,struct queueitem *item)//,int32_t offsetflag) { - struct queueitem *item; + //struct queueitem *item; if ( queue->name[0] == 0 && name != 0 && name[0] != 0 ) strcpy(queue->name,name);//,sizeof(queue->name)); - if ( origitem == 0 ) - { - printf("FATAL type error: queueing empty value\n");//, getchar(); - return; - } - //fprintf(stderr,"enqueue.(%s) %p offset.%d\n",queue->name,origitem,offsetflag); + //fprintf(stderr,"enqueue.(%s) %p\n",queue->name,item); lock_queue(queue); - item = (struct queueitem *)((long)origitem - offsetflag*sizeof(struct queueitem)); + //item = (struct queueitem *)((long)origitem - offsetflag*sizeof(struct queueitem)); DL_APPEND(queue->list,item); portable_mutex_unlock(&queue->mutex); //printf("queue_enqueue name.(%s) origitem.%p append.%p list.%p\n",name,origitem,item,queue->list); } -void *queue_dequeue(queue_t *queue,int32_t offsetflag) +void *queue_dequeue(queue_t *queue)//,int32_t offsetflag) { struct queueitem *item = 0; lock_queue(queue); @@ -264,9 +280,10 @@ void *queue_dequeue(queue_t *queue,int32_t offsetflag) DL_DELETE(queue->list,item); } portable_mutex_unlock(&queue->mutex); - if ( item != 0 && offsetflag != 0 ) - return((void *)((long)item + sizeof(struct queueitem))); - else return(item); + //if ( item != 0 && offsetflag != 0 ) + // return((void *)((long)item + sizeof(struct queueitem))); + //else + return(item); } void *queue_delete(queue_t *queue,struct queueitem *copy,int32_t copysize,int32_t freeitem) @@ -321,7 +338,7 @@ void *queue_clone(queue_t *clone,queue_t *queue,int32_t size) { ptr = mycalloc('c',1,sizeof(*ptr)); memcpy(ptr,item,size); - queue_enqueue(queue->name,clone,ptr,0); + queue_enqueue(queue->name,clone,ptr); } //printf("name.(%s) dequeue.%p list.%p\n",queue->name,item,queue->list); } @@ -543,8 +560,8 @@ void OS_remove_directory(char *dirname) OS_removefile(buf,0); fclose(fp); } -//printf("skip rmdir.(%s)\n",dirname); -return; + //printf("skip rmdir.(%s)\n",dirname); + return; sprintf(buf,"rmdir %s",dirname); if ( system(buf) != 0 ) { @@ -876,14 +893,14 @@ void *OS_mapfile(char *fname,long *filesizep,int32_t enablewrite) // win and pna } /*int32_t OS_syncmap(struct OS_mappedptr *mp,long len) // pnacl doesnt implement sync -{ - return(OS_portable_syncmap(mp,len)); -} - -void *OS_tmpalloc(char *dirname,char *name,struct OS_memspace *mem,long origsize) // no syncmap no tmpalloc -{ - return(OS_portable_tmpalloc(dirname,name,mem,origsize)); -}*/ + { + return(OS_portable_syncmap(mp,len)); + } + + void *OS_tmpalloc(char *dirname,char *name,struct OS_memspace *mem,long origsize) // no syncmap no tmpalloc + { + return(OS_portable_tmpalloc(dirname,name,mem,origsize)); + }*/ void OS_init() { @@ -934,19 +951,19 @@ int32_t OS_getline(int32_t waitflag,char *line,int32_t max,char *dispstr) //////////// test suite for: /* -int64_t OS_filesize(char *fname); -void OS_ensure_directory(char *dirname); -long OS_ensurefilesize(char *fname,long filesize,int32_t truncateflag); -int32_t OS_truncate(char *fname,long filesize); -int32_t OS_renamefile(char *fname,char *newfname); -int32_t OS_removefile(char *fname,int32_t scrubflag); - -void *OS_mapfile(char *fname,long *filesizep,int32_t enablewrite); -int32_t OS_releasemap(void *ptr,uint64_t filesize); - -double OS_milliseconds(); -void OS_randombytes(uint8_t *x,long xlen); -*/ + int64_t OS_filesize(char *fname); + void OS_ensure_directory(char *dirname); + long OS_ensurefilesize(char *fname,long filesize,int32_t truncateflag); + int32_t OS_truncate(char *fname,long filesize); + int32_t OS_renamefile(char *fname,char *newfname); + int32_t OS_removefile(char *fname,int32_t scrubflag); + + void *OS_mapfile(char *fname,long *filesizep,int32_t enablewrite); + int32_t OS_releasemap(void *ptr,uint64_t filesize); + + double OS_milliseconds(); + void OS_randombytes(uint8_t *x,long xlen); + */ int32_t iguana_OStests() { diff --git a/crypto777/iguana_utils.c b/crypto777/iguana_utils.c index da95b8179..b477880f8 100755 --- a/crypto777/iguana_utils.c +++ b/crypto777/iguana_utils.c @@ -263,12 +263,12 @@ int32_t iguana_numthreads(struct iguana_info *coin,int32_t mask) void iguana_launcher(void *ptr) { - struct iguana_thread *t = ptr; struct iguana_info *coin; - coin = t->coin; + struct iguana_thread *t = ptr; //struct iguana_info *coin; + //coin = t->coin; t->funcp(t->arg); - if ( coin != 0 ) - coin->Terminated[t->type % (sizeof(coin->Terminated)/sizeof(*coin->Terminated))]++; - queue_enqueue("TerminateQ",&TerminateQ,&t->DL,0); + //if ( coin != 0 ) + // coin->Terminated[t->type % (sizeof(coin->Terminated)/sizeof(*coin->Terminated))]++; + queue_enqueue("TerminateQ",&TerminateQ,&t->DL); } void iguana_terminate(struct iguana_thread *t) @@ -296,7 +296,7 @@ struct iguana_thread *iguana_launch(struct iguana_info *coin,char *name,iguana_f retval = OS_thread_create(&t->handle,NULL,(void *)iguana_launcher,(void *)t); if ( retval != 0 ) printf("error launching %s\n",t->name); - while ( (t= queue_dequeue(&TerminateQ,0)) != 0 ) + while ( (t= queue_dequeue(&TerminateQ)) != 0 ) { if ( (rand() % 100000) == 0 && coin != 0 ) printf("terminated.%d launched.%d terminate.%p\n",coin->Terminated[t->type],coin->Launched[t->type],t); @@ -359,11 +359,13 @@ int32_t decode_hex(unsigned char *bytes,int32_t n,char *hex) { int32_t adjust,i = 0; //printf("decode.(%s)\n",hex); - if ( is_hexstr(hex,n) == 0 ) + if ( is_hexstr(hex,n) <= 0 ) { memset(bytes,0,n); return(n); } + if ( hex[n-1] == '\n' || hex[n-1] == '\r' ) + hex[--n] = 0; if ( n == 0 || (hex[n*2+1] == 0 && hex[n*2] != 0) ) { if ( n > 0 ) diff --git a/datachain/datachain.c b/datachain/datachain.c index 6f6bfeda5..12600b0da 100755 --- a/datachain/datachain.c +++ b/datachain/datachain.c @@ -323,11 +323,11 @@ int64_t datachain_update(struct supernet_info *myinfo,int32_t ordered,struct igu if ( memcmp(rmd160,CRYPTO777_RMD160,20) == 0 ) { crypto777_payment += value; - printf("datachain_update crypto777 %.8f += %.8f\n",dstr(crypto777_payment),dstr(value)); + //printf("datachain_update crypto777 %.8f += %.8f\n",dstr(crypto777_payment),dstr(value)); } else if ( crypto777_payment != 0 && (type == IGUANA_SCRIPT_OPRETURN || type == IGUANA_SCRIPT_3of3 || type == IGUANA_SCRIPT_2of2 || type == IGUANA_SCRIPT_1of1) ) { - printf("datachain_update opreturn\n"); + //printf("datachain_update opreturn\n"); iguana_opreturn(myinfo,ordered,coin,timestamp,bp,crypto777_payment,height,hdrsi_unspentind,value,fileid,scriptpos,scriptlen); } else datachain_update_spend(myinfo,ordered,coin,timestamp,bp,height,txid,vout,rmd160,value); return(crypto777_payment); diff --git a/deprecated/obsolete.h b/deprecated/obsolete.h index 61cf7e345..689977c6e 100755 --- a/deprecated/obsolete.h +++ b/deprecated/obsolete.h @@ -19636,3 +19636,24 @@ len = 0; } free(retstr); } + /*pthread_mutex_lock(&komodo_mutex); + tmp = 0; + if ( PAX != 0 ) + { + pax = (struct pax_transaction *)PAX->hh.next; + while ( pax != 0 && pax != tmp && n++ < 1000000 ) + { + printf("PAX.[%p %p] pax.%p marked.%d fiat %.8f KMD %.8f\n",PAX->hh.next,PAX->hh.prev,pax,pax->marked,dstr(pax->fiatoshis),dstr(pax->komodoshis)); + if ( pax->marked == 0 ) + { + if ( komodo_is_issuer() != 0 ) + total += pax->fiatoshis; + else total += pax->komodoshis; + } + tmp = pax; + pax = (struct pax_transaction *)pax->hh.next; + } + } + pthread_mutex_unlock(&komodo_mutex); + if ( n >= 1000000 ) + printf("komodo_paxtotal n.%d iterations?\n",n);*/ diff --git a/gecko/gecko_blocks.c b/gecko/gecko_blocks.c index a48dba97d..a8c5583aa 100755 --- a/gecko/gecko_blocks.c +++ b/gecko/gecko_blocks.c @@ -132,7 +132,7 @@ int32_t gecko_hwmset(struct supernet_info *myinfo,struct iguana_info *virt,struc printf("no bundle for %s.%d\n",virt->symbol,block->height); return(-1); } - if ( iguana_ramchain_data(myinfo,virt,addr,txdata,txarray,block->RO.txn_count,data,datalen,bp,block) >= 0 ) + if ( iguana_ramchain_data(myinfo,virt,addr,txdata,txarray,block->RO.txn_count,data,datalen,bp,block,0) >= 0 ) { block->fpipbits = (uint32_t)addr->ipbits; block->RO.recvlen = datalen; diff --git a/iguana/coins/allofus b/iguana/coins/allofus index 3a266ad55..ffc2afc10 100755 --- a/iguana/coins/allofus +++ b/iguana/coins/allofus @@ -1,3 +1,4 @@ +#!/bin/bash ../agents/iguana coins/genbtcd.json & sleep 5 ../agents/iguana coins/genbtc.json & diff --git a/iguana/coins/basilisk b/iguana/coins/basilisk index d4782d1e0..0c953b89d 100755 --- a/iguana/coins/basilisk +++ b/iguana/coins/basilisk @@ -1,3 +1,4 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":16,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":14631,\"rpc\":14632}" curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":5,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":16,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":8333}" #curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":0,\"VALIDATE\":0,\"prefetchlag\":11,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":128,\"maxpeers\":16,\"newcoin\":\"LTC\",\"name\":\"Litecoin\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"fbc0b6db\",\"p2p\":9333,\"rpc\":9334,\"pubval\":48,\"p2shval\":5,\"wifval\":176,\"txfee_satoshis\":\"100000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2\",\"genesis\":{\"version\":1,\"timestamp\":1317972665,\"nBits\":\"1e0ffff0\",\"nonce\":2084524493,\"merkle_root\":\"97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9\"},\"alertpubkey\":\"040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9\",\"protover\":70002}" diff --git a/iguana/coins/btc b/iguana/coins/btc index 3f4bacdb3..aa81323d5 100755 --- a/iguana/coins/btc +++ b/iguana/coins/btc @@ -1 +1,3 @@ -curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"bitcoin.conf\",\"path\":\"root/.bitcoin\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":8333,\"minconfirms\":1}" +#!/bin/bash +curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"bitcoin.conf\",\"path\":\"${HOME#"/"}/.bitcoin\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":8333,\"minconfirms\":1}" + diff --git a/iguana/coins/btc_7776 b/iguana/coins/btc_7776 index c2483cd9a..cfc05bbe8 100755 --- a/iguana/coins/btc_7776 +++ b/iguana/coins/btc_7776 @@ -1 +1,2 @@ -curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"bitcoin.conf\",\"path\":\"root/.bitcoin\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":8333,\"minconfirms\":1}" +#!/bin/bash +curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"bitcoin.conf\",\"path\":\"${HOME#"/"}/.bitcoin\",\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":0,\"maxpeers\":512,\"RELAY\":-1,\"VALIDATE\":0,\"portp2p\":8333,\"minconfirms\":1}" diff --git a/iguana/coins/fastbtcd b/iguana/coins/fastbtcd index 659d8a3f4..65b965721 100755 --- a/iguana/coins/fastbtcd +++ b/iguana/coins/fastbtcd @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":4096,\"endpend\":4096,\"services\":129,\"maxpeers\":256,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632}" diff --git a/iguana/coins/genNAME b/iguana/coins/genNAME new file mode 100755 index 000000000..6d228ef77 --- /dev/null +++ b/iguana/coins/genNAME @@ -0,0 +1,3 @@ +#!/bin/bash +curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":100,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":4,\"endpend\":4,\"services\":129,\"maxpeers\":8,\"newcoin\":\"NAME\",\"name\":\"NAME\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"a06210d8\",\"p2p\":15233,\"rpc\":15234,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0,\"seedipaddr\":\"78.47.196.146\"}" + diff --git a/iguana/coins/genanc b/iguana/coins/genanc index f860d74a8..531f56964 100755 --- a/iguana/coins/genanc +++ b/iguana/coins/genanc @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"ANC\",\"name\":\"AnonCoin\",\"netmagic\":\"facabada\",\"p2p\":9377,\"rpc\":28332,\"pubval\":23,\"p2shval\":5,\"wifval\":151,\"txfee_satoshis\":\"2000000\",\"minconfirms\":2,\"genesishash\":\"00000be19c5a519257aa921349037d55548af7cabf112741eb905a26bb73e468\",\"genesis\":{\"version\":1,\"timestamp\":1370190760,\"nBits\":\"1e0ffff0\",\"nonce\":347089008,\"merkle_root\":\"7ce7004d764515f9b43cb9f07547c8e2e00d94c9348b3da33c8681d350f2c736\"},\"alertpubkey\":\"04c6db35c11724e526f6725cc5bd5293b4bc9382397856e1bcef7111fb44ce357fd12442b34c496d937a348c1dca1e36ae0c0e128905eb3d301433887e8f0b4536\",\"protover\":70010}" diff --git a/iguana/coins/genblk b/iguana/coins/genblk index 759438be2..c1aa09f0e 100755 --- a/iguana/coins/genblk +++ b/iguana/coins/genblk @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"BLK\",\"name\":\"BlackCoin\",\"netmagic\":\"70352205\",\"p2p\":15714,\"rpc\":15715,\"pubval\":25,\"p2shval\":85,\"wifval\":153,\"txfee_satoshis\":\"10000\",\"minconfirms\":2,\"genesishash\":\"000001faef25dec4fbcf906e6242621df2c183bf232f263d0ba5b101911e4563\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1393221600,\"nBits\":\"1e0fffff\",\"nonce\":164482,\"merkle_root\":\"12630d16a97f24b287c8c2594dda5fb98c9e6c70fc61d44191931ea2aa08dc90\"},\"alertpubkey\":\"0486bce1bac0d543f104cbff2bd23680056a3b9ea05e1137d2ff90eeb5e08472eb500322593a2cb06fbf8297d7beb6cd30cb90f98153b5b7cce1493749e41e0284\",\"isPoS\":1,\"debug\":1}" diff --git a/iguana/coins/genbtc b/iguana/coins/genbtc index 3545834df..839825619 100755 --- a/iguana/coins/genbtc +++ b/iguana/coins/genbtc @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":-1,\"poll\":1,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTC\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":512,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":8333,\"minconfirms\":1}" diff --git a/iguana/coins/genbtcd b/iguana/coins/genbtcd index 48fea130b..9bf34747f 100755 --- a/iguana/coins/genbtcd +++ b/iguana/coins/genbtcd @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":11,\"poll\":50,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":512,\"endpend\":512,\"services\":129,\"maxpeers\":512,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":14631,\"rpc\":14632,\"minconfirms\":5}" diff --git a/iguana/coins/genbtcdsigs b/iguana/coins/genbtcdsigs index 662f95c1c..7aca343eb 100755 --- a/iguana/coins/genbtcdsigs +++ b/iguana/coins/genbtcdsigs @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"prefetchlag\":-1,\"poll\":50,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"BTCD\",\"startpend\":8,\"endpend\":4,\"services\":129,\"maxpeers\":64,\"RELAY\":1,\"VALIDATE\":2,\"portp2p\":14631,\"rpc\":14632}" diff --git a/iguana/coins/genbtm b/iguana/coins/genbtm index c9e1227f9..9310a1057 100755 --- a/iguana/coins/genbtm +++ b/iguana/coins/genbtm @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"BTM\",\"name\":\"Bitmark\",\"netmagic\":\"f9beb4d9\",\"p2p\":9265,\"rpc\":9266,\"pubval\":85,\"p2shval\":5,\"wifval\":213,\"txfee_satoshis\":\"0\",\"minconfirms\":2,\"genesishash\":\"c1fb746e87e89ae75bdec2ef0639a1f6786744639ce3d0ece1dcf979b79137cb\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1405274442,\"nBits\":\"1d00ffff\",\"nonce\":14385103,\"merkle_root\":\"d4715adf41222fae3d4bf41af30c675bc27228233d0f3cfd4ae0ae1d3e760ba8\"},\"alertpubkey\":\"04bf5a75ff0f823840ef512b08add20bb4275ff6e097f2830ad28645e28cb5ea4dc2cfd0972b94019ad46f331b45ef4ba679f2e6c87fd19c864365fadb4f8d2269\"}" diff --git a/iguana/coins/gencarb b/iguana/coins/gencarb index 1517d5226..203347a2c 100755 --- a/iguana/coins/gencarb +++ b/iguana/coins/gencarb @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"CARB\",\"name\":\"Carboncoin\",\"netmagic\":\"abccbbdf\",\"p2p\":9350,\"rpc\":9351,\"pubval\":47,\"p2shval\":5,\"wifval\":175,\"txfee_satoshis\":\"0\",\"minconfirms\":2,\"genesishash\":\"a94f1aae8c409a0bd1e53cbca92d7e506b61c51d955cf56f76da501718d48d6c\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1389199888,\"nBits\":\"1e0ffff0\",\"nonce\":605268,\"merkle_root\":\"074bbb9d355731bfa8f67130e2179db7518d1387ad52e55309d4debe7d4e6383\"},\"alertpubkey\":\"046d6918a7c0c053aa942dbb8861499be4bd915c8bfb6a2b77b3787e207097cc2734b9321226ff107c1a95dae98570a66baec66e350d78ceba091b54411654d33f\"}" diff --git a/iguana/coins/gendgb b/iguana/coins/gendgb index b056034b6..f140ba527 100755 --- a/iguana/coins/gendgb +++ b/iguana/coins/gendgb @@ -1,3 +1,4 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"startpend\":16,\"endpend\":8,\"services\":129,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"DGB\",\"name\":\"Digibyte\",\"netmagic\":\"FAC3B6DA\",\"p2p\":12024,\"rpc\":14022,\"pubval\":30,\"p2shval\":5,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"minconfirms\":2,\"genesishash\":\"7497ea1b465eb39f1c8f507bc877078fe016d6fcb6dfad3a64c98dcc6e1e8496\",\"genesis\":{\"version\":1,\"timestamp\":1389388394,\"nBits\":\"1e0ffff0\",\"nonce\":2447652,\"merkle_root\":\"72ddd9496b004221ed0557358846d9248ecd4c440ebd28ed901efc18757d0fad\"},\"alertpubkey\":\"04F04441C4757F356290A37C313C3772C5BC5003E898EB2E0CF365795543A7BF690C8BBBFA32EE3A3325477CE2000B7D0453EFBB203329D0F9DF34D5927D022BC9\"}" diff --git a/iguana/coins/gendoge b/iguana/coins/gendoge index 34f665878..6f03a3427 100755 --- a/iguana/coins/gendoge +++ b/iguana/coins/gendoge @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"startpend\":8,\"endpend\":4,\"services\":129,\"auxpow\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"DOGE\",\"name\":\"Dogecoin\",\"netmagic\":\"C0C0C0C0\",\"p2p\":22556,\"rpc\":22555,\"pubval\":30,\"p2shval\":5,\"wifval\":128,\"txfee_satoshis\":\"100000000\",\"minconfirms\":2,\"genesishash\":\"1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691\",\"genesis\":{\"hashalgo\": \"scrypt\",\"version\":1,\"timestamp\":1386325540,\"nBits\":\"1e0ffff0\",\"nonce\":99943,\"merkle_root\":\"5b2a3f53f605d62c53e62932dac6925e3d74afa5a4b459745c36d42d0ed26a69\"},\"alertpubkey\":\"04d4da7a5dae4db797d9b0644d57a5cd50e05a70f36091cd62e2fc41c98ded06340be5a43a35e185690cd9cde5d72da8f6d065b499b06f51dcfba14aad859f443a\"}" diff --git a/iguana/coins/geneac b/iguana/coins/geneac index e7906a2a1..36b3de221 100755 --- a/iguana/coins/geneac +++ b/iguana/coins/geneac @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"services\":129,\"auxpow\":0,\"txhastimestamp\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"EAC\",\"name\":\"EarthCoin\",\"netmagic\":\"C0DBF1FD\",\"p2p\":15677,\"rpc\":15678,\"pubval\":30,\"p2shval\":5,\"wifval\":221,\"txfee_satoshis\":\"1000000\",\"minconfirms\":2,\"genesishash\":\"21717d4df403301c0538f1cb9af718e483ad06728bbcd8cc6c9511e2f9146ced\",\"genesis\":{\"version\":1,\"timestamp\":1386746168,\"nBits\":\"1e0ffff0\",\"nonce\":12468024,\"merkle_root\":\"13757c3610411891452ac1f04d7f81946339b0e5b5aba216e6646e81805c4bb1\"},\"alertpubkey\":\"04dcba12349012341234900abcd12223abcd455abcd77788abcd000000aaaaabbbbbcccccdddddeeeeeff00ff00ff00ff001234567890abcdef0022446688abc11\"}" diff --git a/iguana/coins/genfrk b/iguana/coins/genfrk index 9e955dfd1..7f03fc406 100755 --- a/iguana/coins/genfrk +++ b/iguana/coins/genfrk @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"FRK\",\"name\":\"Franko\",\"netmagic\":\"7defaced\",\"p2p\":7912,\"rpc\":7913,\"pubval\":35,\"p2shval\":5,\"wifval\":163,\"txfee_satoshis\":\"0\",\"minconfirms\":2,\"genesishash\":\"19225ae90d538561217b5949e98ca4964ac91af39090d1a4407c892293e4f44f\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1368144664,\"nBits\":\"1e0ffff0\",\"nonce\":731837,\"merkle_root\":\"b78f79f1d10029cc45ed3d5a1db7bd423d4ee170c03baf110a62565d16a21dca\"},\"alertpubkey\":\"04d4da7a5dae4db797d9b0644d57a5cd50e05a70f36091cd62e2fc41c98ded06340be5a43a35e185690cd9cde5d72da8f6d065b499b06f51dcfba14aad859f443a\"}" diff --git a/iguana/coins/gengmc b/iguana/coins/gengmc index 23bf12a35..b07fd5261 100755 --- a/iguana/coins/gengmc +++ b/iguana/coins/gengmc @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"startpend\":8,\"endpend\":4,\"services\":129,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"GMC\",\"name\":\"GameCredits\",\"netmagic\":\"fbc0b6db\",\"p2p\":40002,\"rpc\":40001,\"pubval\":38,\"p2shval\":5,\"wifval\":166,\"txfee_satoshis\":\"100000\",\"minconfirms\":2,\"genesishash\":\"91ec5f25ee9a0ffa1af7d4da4db9a552228dd2dc77cdb15b738be4e1f55f30ee\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1392757140,\"nBits\":\"1e0ffff0\",\"nonce\":2084565393,\"merkle_root\":\"d849db99a14164f4b4c8ad6d2d8d7e2b1ba7f89963e9f4bf9fad5ff1a4754429\"},\"alertpubkey\":\"04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284\",\"auxpow\":1,\"protover\":80006,\"isPoS\":0,\"fixit\":0}" diff --git a/iguana/coins/genkmd b/iguana/coins/genkmd index abde907f0..cd2fc11c4 100755 --- a/iguana/coins/genkmd +++ b/iguana/coins/genkmd @@ -1,2 +1,4 @@ -curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":1,\"endpend\":1,\"services\":129,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}" +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":64,\"endpend\":64,\"services\":129,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}" diff --git a/iguana/coins/genltc b/iguana/coins/genltc index d2dd64f2c..df691b5d6 100755 --- a/iguana/coins/genltc +++ b/iguana/coins/genltc @@ -1,2 +1,4 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":68,\"endpend\":68,\"services\":129,\"maxpeers\":256,\"newcoin\":\"LTC\",\"name\":\"Litecoin\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"fbc0b6db\",\"p2p\":9333,\"rpc\":9332,\"pubval\":48,\"p2shval\":5,\"wifval\":176,\"txfee_satoshis\":\"100000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"12a765e31ffd4059bada1e25190f6e98c99d9714d334efa41a195a7e7e04bfe2\",\"genesis\":{\"version\":1,\"timestamp\":1317972665,\"nBits\":\"1e0ffff0\",\"nonce\":2084524493,\"merkle_root\":\"97ddfbbae6be97fd6cdf3e7ca13232a3afff2353e29badfab7f73011edd4ced9\"},\"alertpubkey\":\"040184710fa689ad5023690c80f3a49c8f13f8d45b8c857fbcbc8bc4a8e4d3eb4b10f4d4604fa08dce601aaf0f470216fe1b51850b4acf21b179c45070ac7b03a9\",\"protover\":70002}" diff --git a/iguana/coins/genmzc b/iguana/coins/genmzc index 0f3c41e6f..c2327a0a4 100755 --- a/iguana/coins/genmzc +++ b/iguana/coins/genmzc @@ -1 +1,3 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"services\":129,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"MZC\",\"name\":\"MazaCoin\",\"netmagic\":\"f8b503df\",\"p2p\":12835,\"rpc\":12832,\"pubval\":50,\"p2shval\":9,\"wifval\":224,\"txfee_satoshis\":\"0\",\"minconfirms\":2,\"genesishash\":\"00000c7c73d8ce604178dae13f0fc6ec0be3275614366d44b1b4b5c6e238c60c\",\"genesis\":{\"version\":1,\"timestamp\":1390747675,\"nBits\":\"1e0ffff0\",\"nonce\":2091390249,\"merkle_root\":\"62d496378e5834989dd9594cfc168dbb76f84a39bbda18286cddc7d1d1589f4f\"},\"alertpubkey\":\"04f09702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284\"}" diff --git a/iguana/coins/gennmc b/iguana/coins/gennmc index 6165ad19e..ffc6900f3 100755 --- a/iguana/coins/gennmc +++ b/iguana/coins/gennmc @@ -1 +1,3 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"NMC\",\"active\":1,\"maxpeers\":128,\"services\":129,\"poll\":1,\"minconfirms\":3,\"estblocktime\":600,\"txfee_satoshis\":500000,\"useaddmultisig\":1,\"hastimestamp\":0,\"pubval\":\"00\",\"scriptval\":\"05\",\"wiftype\":\"80\",\"netmagic\":\"fba4c795\",\"genesishash\":\"000000000062b72c5e2ceb45fbc8587e807c155b0da735e6483dfba2f0a9c770\",\"genesis\":{\"hashalgo\":\"sha256\",\"version\":1,\"timestamp\":1303000001,\"nbits\":\"1c007fff\",\"nonce\":2719916434,\"merkle_root\":\"41c62dbd9068c89a449525e3cd5ac61b20ece28c3c38b3f35b2161f0e6d3cb0d\"},\"p2p\":8334,\"rpc\":8836}" diff --git a/iguana/coins/gennotary b/iguana/coins/gennotary index 204cdaa7e..87322604d 100755 --- a/iguana/coins/gennotary +++ b/iguana/coins/gennotary @@ -1 +1,3 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7776" --data "{\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"NOTARY\",\"services\":129,\"maxpeers\":2048,\"RELAY\":1,\"VALIDATE\":1,\"portp2p\":7775,\"rpc\":0}" diff --git a/iguana/coins/gensys b/iguana/coins/gensys index b4e5b39c6..483910f4e 100755 --- a/iguana/coins/gensys +++ b/iguana/coins/gensys @@ -1,2 +1,4 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":18,\"endpend\":18,\"services\":129,\"maxpeers\":256,\"newcoin\":\"SYS\",\"name\":\"SYScoin\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"f9beb4d9\",\"p2p\":8369,\"rpc\":8370,\"pubval\":0,\"p2shval\":5,\"wifval\":128,\"txfee_satoshis\":\"100000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"0000072d66e51ab87de265765cc8bdd2d229a4307c672a1b3d5af692519cf765\",\"genesis\":{\"version\":1,\"timestamp\":1450473723,\"nBits\":\"1e0ffff0\",\"nonce\":5258726,\"merkle_root\":\"5215c5a2af9b63f2550b635eb2b354bb13645fd8fa31275394eb161944303065\"},\"protover\":70012,\"auxpow\":1,\"fixit\":0}" diff --git a/iguana/coins/gentaz b/iguana/coins/gentaz index 1efcd29a3..4baac3bf2 100755 --- a/iguana/coins/gentaz +++ b/iguana/coins/gentaz @@ -1,2 +1,4 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"TAZ\",\"name\":\"Test Zcash\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"a5f1e726\",\"p2p\":18233,\"rpc\":18232,\"pubval\":111,\"p2shval\":196,\"wifval\":239,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"0cdf00b25a93ded11d73ebe1728cf7867f18e1f62aca9554b95e0f3026174e33\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a0000000000000000000000000000000000000000000000000000000000000000dae5494d0f0f0f200900000000000000000000000000000000000000000000000000000000000000fd4005003423da3e41f916bf3ff0ee770eb844a240361abe08a8c9d46bd30226e2ad411a4047b6ddc230d173c60537e470e24f764120f5a2778b2a1285b0727bf79a0b085ad67e6266fb38fd72ef17f827315c42f921720248c983d4100e6ebd1c4b5e8762a973bac3bec7f7153b93752ebbb465f0fc9520bcfc30f9abfe303627338fed6ede9cf1b9173a736cf270cf4d9c6999ff4c3a301a78fd50dab6ccca67a0c5c2e41f216a1f3efd049a74bbe6252f9773bc309d3f9e554d996913ce8e1cec672a1fa4ea59726b61ea9e75d5ce9aa5dbfa96179a293810e02787f26de324fe7c88376ff57e29574a55faff7c2946f3e40e451861c32bf67da7377de3136858a18f34fab1bc8da37726ca2c25fc7b312a5427554ec944da81c7e27255d6c94ade9987ff7daedc2d1cc63d7d4cf93e691d13326fb1c7ee72ccdc0b134eb665fc6a9821e6fef6a6d45e4aac6dca6b505a0100ad56ea4f6fa4cdc2f0d1b65f730104a515172e34163bdb422f99d083e6eb860cf6b3f66642c4dbaf0d0fa1dca1b6166f1d1ffaa55a9d6d6df628afbdd14f1622c1c8303259299521a253bc28fcc93676723158067270fc710a09155a1e50c533e9b79ed5edba4ab70a08a9a2fc0eef0ddae050d75776a9804f8d6ad7e30ccb66c6a98d86710ca7a4dfb4feb159484796b9a015c5764aa3509051c87f729b9877ea41f8b470898c01388ed9098b1e006d3c30fc6e7c781072fa3f75d918505ee8ca75840fc62f67c57060666aa42578a2dd022eda62e3f1e447d7364074d34fd60ad9b138f60422afa6cfcb913fd6c213b496144dbfda7bfc7c24540cfe40ad0c0fd5a8c0902127f53d3178ba1b2a87bf1224d53d3a15e49ccdf121ae872a011c996d1b9793153cdcd4c0a7e99f8a35669788551cca2b62769eda24b6b55e2f4e0ac0d30aa50ecf33c6cdb24adfc922006a7bf434ced800fefe814c94c6fc8caa37b372d5088bb31d2f6b11a7a67ad3f70abbac0d5c256b637828de6cc525978cf151a2e50798e0c591787639a030291272c9ced3ab7d682e03f8c7db51f60163baa85315789666ea8c5cd6f789a7f4a5de4f8a9dfefce20f353cec606492fde8eab3e3b487b3a3a57434f8cf252a4b643fc125c8a5948b06744f5dc306aa587bdc85364c7488235c6edddd78763675e50a9637181519be06dd30c4ba0d845f9ba320d01706fd6dd64d1aa3cd4211a4a7d1d3f2c1ef2766d27d5d2cdf8e7f5e3ea309d4f149bb737305df1373a7f5313abe5986f4aa620bec4b0065d48aafac3631de3771f5c4d2f6eec67b09d9c70a3c1969fecdb014cb3c69832b63cc9d6efa378bff0ef95ffacdeb1675bb326e698f022c1a3a2e1c2b0f05e1492a6d2b7552388eca7ee8a2467ef5d4207f65d4e2ae7e33f13eb473954f249d7c20158ae703e1accddd4ea899f026618695ed2949715678a32a153df32c08922fafad68b1895e3b10e143e712940104b3b352369f4fe79bd1f1dbe03ea9909dbcf5862d1f15b3d1557a6191f54c891513cdb3c729bb9ab08c0d4c35a3ed67d517ffe1e2b7a798521aed15ff9822169c0ec860d7b897340bc2ef4c37f7eb73bd7dafef12c4fd4e6f5dd3690305257ae14ed03df5e3327b68467775a90993e613173fa6650ffa2a26e84b3ce79606bf234eda9f4053307f344099e3b10308d3785b8726fd02d8e94c2759bebd05748c3fe7d5fe087dc63608fb77f29708ab167a13f32da251e249a544124ed50c270cfc6986d9d1814273d2f0510d0d2ea335817207db6a4a23ae9b079967b63b25cb3ceea7001b65b879263f5009ac84ab89738a5b8b71fd032beb9f297326f1f5afa630a5198d684514e242f315a4d95fa6802e82799a525bb653b80b4518ec610a5996403b1391\",\"debug\":0}" diff --git a/iguana/coins/genuno b/iguana/coins/genuno index a8733b364..08eecd7dc 100755 --- a/iguana/coins/genuno +++ b/iguana/coins/genuno @@ -1 +1,3 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"services\":129,\"auxpow\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"UNO\",\"name\":\"Unobtanium\",\"netmagic\":\"03d5b503\",\"p2p\":65534,\"rpc\":65535,\"pubval\":130,\"p2shval\":30,\"wifval\":224,\"txfee_satoshis\":\"1000000\",\"minconfirms\":2,\"genesishash\":\"000004c2fc5fffb810dccc197d603690099a68305232e552d96ccbe8e2c52b75\",\"genesis\":{\"version\":1,\"timestamp\":1375548986,\"nBits\":\"1e0fffff\",\"nonce\":1211565,\"merkle_root\":\"36a192e90f70131a884fe541a1e8a5643a28ba4cb24cbb2924bd0ee483f7f484\"},\"alertpubkey\":\"04fd68acb6a895f3462d91b43eef0da845f0d531958a858554feab3ac330562bf76910700b3f7c29ee273ddc4da2bb5b953858f6958a50e8831eb43ee30c32f21d\"}" diff --git a/iguana/coins/genvia b/iguana/coins/genvia index 2b7bad89a..84f84d150 100755 --- a/iguana/coins/genvia +++ b/iguana/coins/genvia @@ -1,2 +1,4 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"services\":129,\"startpend\":4,\"endpend\":4,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"VIA\",\"name\":\"Viacoin\",\"netmagic\":\"0f68c6cb\",\"p2p\":5223,\"rpc\":38332,\"pubval\":71,\"p2shval\":33,\"wifval\":199,\"txfee_satoshis\":\"100000\",\"minconfirms\":2,\"genesishash\":\"4e9b54001f9976049830128ec0331515eaabe35a70970d79971da1539a400ba1\",\"genesis\":{\"version\":1,\"timestamp\":1405164774,\"nBits\":\"1e01ffff\",\"nonce\":4016033,\"merkle_root\":\"0317d32e01a2adf6f2ac6f58c7cdaab6c656edc6fdb45986c739290053275200\"},\"alertpubkey\":\"047885d9f6c0cf9e918d04634d4dd696cf172763f1975aad099daddca3f3c712c98754eae293b36484055e0d414800e519f5a342e56e09217faf07abff5bd96507\"}" diff --git a/iguana/coins/genvpn b/iguana/coins/genvpn index d87aa3ab8..45543d25b 100755 --- a/iguana/coins/genvpn +++ b/iguana/coins/genvpn @@ -1 +1,3 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":256,\"newcoin\":\"VPN\",\"name\":\"VPNcoin\",\"hasheaders\":1,\"useaddmultisig\":0,\"isPoS\":1,\"minoutput\":10000,\"minconfirms\":2,\"txfee_satoshis\":\"10000\",\"genesishash\":\"00000ac7d764e7119da60d3c832b1d4458da9bc9ef9d5dd0d91a15f690a46d99\",\"genesis\":{\"version\":1,\"timestamp\":1409839200,\"nBits\":\"1e0fffff\",\"nonce\":64881664,\"merkle_root\":\"698a93a1cacd495a7a4fb3864ad8d06ed4421dedbc57f9aaad733ea53b1b5828\"},\"protover\":70002,\"netmagic\":\"fbc0b6db\",\"p2p\":1920,\"rpc\":1921,\"pubval\":71,\"p2shval\":5,\"wifval\":199}" diff --git a/iguana/coins/genvrc b/iguana/coins/genvrc index b285d1416..d69d10108 100755 --- a/iguana/coins/genvrc +++ b/iguana/coins/genvrc @@ -1 +1,3 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"VRC\",\"name\":\"VeriCoin\",\"netmagic\":\"70352205\",\"p2p\":58684,\"rpc\":58683,\"pubval\":70,\"p2shval\":132,\"wifval\":153,\"txfee_satoshis\":\"10000\",\"minconfirms\":10,\"genesishash\":\"000004da58a02be894a6c916d349fe23cc29e21972cafb86b5d3f07c4b8e6bb8\",\"genesis\":{\"hashalgo\":\"scrypt\",\"version\":1,\"timestamp\":1399690945,\"nBits\":\"1e0fffff\",\"nonce\":612416,\"merkle_root\":\"60424046d38de827de0ed1a20a351aa7f3557e3e1d3df6bfb34a94bc6161ec68\"},\"alertpubkey\":\"047eba500c7134efcaf721e9f438f25b948ceaa5f059b877b3a64f6fa2cf0ea6f41091bd9b1ff9448727db97e4ad44d49496dc41949c677c49fe632d1d7996a515\",\"isPoS\":1,\"debug\":1}" diff --git a/iguana/coins/genzcash b/iguana/coins/genzcash index fbdf0ccda..84762c711 100755 --- a/iguana/coins/genzcash +++ b/iguana/coins/genzcash @@ -1,2 +1,4 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"ZEC\",\"name\":\"Zcash\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"6df6e755\",\"p2p\":18333,\"rpc\":18332,\"pubval\":111,\"p2shval\":196,\"wifval\":239,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"27d1f4ce03fc473c9dd6e1e307c682c8f802eae1f5a2f61402aa1ae8702ed3b6\",\"protover\":70002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4adae5494dffff7f200000000000000000000000000000000000000000000000000000000000000000209d0900001dc600004fba000024e20100e5660000778100007e190100222f0100720e000056e50100eb12010089920100583d00002e660000844e01001bfe0100cf0c0000892a0000f5230000f9680000976e00009b7b000046770000afd80100bd0d000057650000048f000082b100006a2500004e0601006fef000048410100\"}" diff --git a/iguana/coins/genzec b/iguana/coins/genzec index a164df567..aec6d186a 100755 --- a/iguana/coins/genzec +++ b/iguana/coins/genzec @@ -1 +1,3 @@ -curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"ZEC\",\"name\":\"Zcash\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"24e92764\",\"p2p\":8233,\"rpc\":8232,\"pubval\":184,\"p2shval\":189,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08\",\"protover\":170002,\"genesisblock\":\"040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce157\",\"debug\":0}" +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"path\":\"${HOME#"/"}/.path\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"ZEC\",\"name\":\"Zcash\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"24e92764\",\"p2p\":8233,\"rpc\":8232,\"pubval\":184,\"p2shval\":189,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08\",\"protover\":170002,\"genesisblock\":\"040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce157\",\"debug\":0}" diff --git a/iguana/coins/genzet b/iguana/coins/genzet index b2a82272b..d7e972a3e 100755 --- a/iguana/coins/genzet +++ b/iguana/coins/genzet @@ -1 +1,3 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"services\":129,\"RELAY\":1,\"VALIDATE\":1,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"maxpeers\":256,\"newcoin\":\"ZET\",\"name\":\"Zetacoin\",\"netmagic\":\"fab503df\",\"p2p\":17333,\"rpc\":17335,\"pubval\":80,\"p2shval\":9,\"wifval\":224,\"txfee_satoshis\":\"10000\",\"minconfirms\":2,\"genesishash\":\"000006cab7aa2be2da91015902aa4458dd5fbb8778d175c36d429dc986f2bff4\",\"genesis\":{\"version\":1,\"timestamp\":1375548986,\"nBits\":\"1e0fffff\",\"nonce\":2089928209,\"merkle_root\":\"d0227b8c3e3d07bce9656b3d9e474f050d23458aaead93357dcfdac9ab9b79f9\"},\"alertpubkey\":\"045337216002ca6a71d63edf062895417610a723d453e722bf4728996c58661cdac3d4dec5cecd449b9086e9602b35cc726a9e0163e1a4d40f521fbdaebb674658\"}" diff --git a/iguana/coins/kmd b/iguana/coins/kmd index c02b18ecb..d8adec760 100755 --- a/iguana/coins/kmd +++ b/iguana/coins/kmd @@ -1,2 +1,4 @@ -curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"komodo.conf\",\"path\":\"root/.komodo\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":0,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}" +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"conf\":\"komodo.conf\",\"path\":\"${HOME#"/"}/.komodo\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":0,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}" diff --git a/iguana/coins/kmd_7776 b/iguana/coins/kmd_7776 index b7dc2e85a..00cc8469d 100755 --- a/iguana/coins/kmd_7776 +++ b/iguana/coins/kmd_7776 @@ -1,2 +1,4 @@ -curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"komodo.conf\",\"path\":\"root/.komodo\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":0,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}" +#!/bin/bash + +curl --url "http://127.0.0.1:7776" --data "{\"conf\":\"komodo.conf\",\"path\":\"${HOME#"/"}/.komodo\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":0,\"maxpeers\":32,\"newcoin\":\"KMD\",\"name\":\"Komodo\",\"hasheaders\":1,\"useaddmultisig\":0,\"netmagic\":\"f9eee48d\",\"p2p\":7770,\"rpc\":7771,\"pubval\":60,\"p2shval\":85,\"wifval\":188,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"027e3758c3a65b12aa1046462b486d0a63bfa1beae327897f56c5cfb7daaae71\",\"protover\":170002,\"genesisblock\":\"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a000000000000000000000000000000000000000000000000000000000000000029ab5f490f0f0f200b00000000000000000000000000000000000000000000000000000000000000fd4005000d5ba7cda5d473947263bf194285317179d2b0d307119c2e7cc4bd8ac456f0774bd52b0cd9249be9d40718b6397a4c7bbd8f2b3272fed2823cd2af4bd1632200ba4bf796727d6347b225f670f292343274cc35099466f5fb5f0cd1c105121b28213d15db2ed7bdba490b4cedc69742a57b7c25af24485e523aadbb77a0144fc76f79ef73bd8530d42b9f3b9bed1c135ad1fe152923fafe98f95f76f1615e64c4abb1137f4c31b218ba2782bc15534788dda2cc08a0ee2987c8b27ff41bd4e31cd5fb5643dfe862c9a02ca9f90c8c51a6671d681d04ad47e4b53b1518d4befafefe8cadfb912f3d03051b1efbf1dfe37b56e93a741d8dfd80d576ca250bee55fab1311fc7b3255977558cdda6f7d6f875306e43a14413facdaed2f46093e0ef1e8f8a963e1632dcbeebd8e49fd16b57d49b08f9762de89157c65233f60c8e38a1f503a48c555f8ec45dedecd574a37601323c27be597b956343107f8bd80f3a925afaf30811df83c402116bb9c1e5231c70fff899a7c82f73c902ba54da53cc459b7bf1113db65cc8f6914d3618560ea69abd13658fa7b6af92d374d6eca9529f8bd565166e4fcbf2a8dfb3c9b69539d4d2ee2e9321b85b331925df195915f2757637c2805e1d4131e1ad9ef9bc1bb1c732d8dba4738716d351ab30c996c8657bab39567ee3b29c6d054b711495c0d52e1cd5d8e55b4f0f0325b97369280755b46a02afd54be4ddd9f77c22272b8bbb17ff5118fedbae2564524e797bd28b5f74f7079d532ccc059807989f94d267f47e724b3f1ecfe00ec9e6541c961080d8891251b84b4480bc292f6a180bea089fef5bbda56e1e41390d7c0e85ba0ef530f7177413481a226465a36ef6afe1e2bca69d2078712b3912bba1a99b1fbff0d355d6ffe726d2bb6fbc103c4ac5756e5bee6e47e17424ebcbf1b63d8cb90ce2e40198b4f4198689daea254307e52a25562f4c1455340f0ffeb10f9d8e914775e37d0edca019fb1b9c6ef81255ed86bc51c5391e0591480f66e2d88c5f4fd7277697968656a9b113ab97f874fdd5f2465e5559533e01ba13ef4a8f7a21d02c30c8ded68e8c54603ab9c8084ef6d9eb4e92c75b078539e2ae786ebab6dab73a09e0aa9ac575bcefb29e930ae656e58bcb513f7e3c17e079dce4f05b5dbc18c2a872b22509740ebe6a3903e00ad1abc55076441862643f93606e3dc35e8d9f2caef3ee6be14d513b2e062b21d0061de3bd56881713a1a5c17f5ace05e1ec09da53f99442df175a49bd154aa96e4949decd52fed79ccf7ccbce32941419c314e374e4a396ac553e17b5340336a1a25c22f9e42a243ba5404450b650acfc826a6e432971ace776e15719515e1634ceb9a4a35061b668c74998d3dfb5827f6238ec015377e6f9c94f38108768cf6e5c8b132e0303fb5a200368f845ad9d46343035a6ff94031df8d8309415bb3f6cd5ede9c135fdabcc030599858d803c0f85be7661c88984d88faa3d26fb0e9aac0056a53f1b5d0baed713c853c4a2726869a0a124a8a5bbc0fc0ef80c8ae4cb53636aa02503b86a1eb9836fcc259823e2692d921d88e1ffc1e6cb2bde43939ceb3f32a611686f539f8f7c9f0bf00381f743607d40960f06d347d1cd8ac8a51969c25e37150efdf7aa4c2037a2fd0516fb444525ab157a0ed0a7412b2fa69b217fe397263153782c0f64351fbdf2678fa0dc8569912dcd8e3ccad38f34f23bbbce14c6a26ac24911b308b82c7e43062d180baeac4ba7153858365c72c63dcf5f6a5b08070b730adb017aeae925b7d0439979e2679f45ed2f25a7edcfd2fb77a8794630285ccb0a071f5cce410b46dbf9750b0354aae8b65574501cc69efb5b6a43444074fee116641bb29da56c2b4a7f456991fc92b2\",\"debug\":0}" diff --git a/iguana/coins/m_extract_genesis b/iguana/coins/m_extract_genesis index eaa0bcae4..b9bb28180 100755 --- a/iguana/coins/m_extract_genesis +++ b/iguana/coins/m_extract_genesis @@ -1 +1,3 @@ +#!/bin/bash + gcc -o extract_genesis extract_genesis.c diff --git a/iguana/coins/notary b/iguana/coins/notary index c1cefe0a9..db25e84a0 100755 --- a/iguana/coins/notary +++ b/iguana/coins/notary @@ -1 +1,3 @@ +#!/bin/bash + curl --url "http://127.0.0.1:7778" --data "{\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"newcoin\":\"NOTARY\",\"services\":128,\"maxpeers\":2048,\"RELAY\":0,\"VALIDATE\":0,\"portp2p\":7775,\"rpc\":0}" diff --git a/iguana/coins/zec b/iguana/coins/zec index ef2892025..8722e4d4f 100755 --- a/iguana/coins/zec +++ b/iguana/coins/zec @@ -1 +1,3 @@ -curl --url "http://127.0.0.1:7778" --data "{\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"ZEC\",\"name\":\"Zcash\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"24e92764\",\"p2p\":8233,\"rpc\":8232,\"pubval\":184,\"p2shval\":189,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08\",\"protover\":170002,\"genesisblock\":\"040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce157\",\"debug\":0}" +#!/bin/bash + +curl --url "http://127.0.0.1:7778" --data "{\"path\":\"${HOME#"/"}/.zcash\",\"unitval\":\"20\",\"zcash\":1,\"RELAY\":-1,\"VALIDATE\":0,\"prefetchlag\":-1,\"poll\":10,\"active\":1,\"agent\":\"iguana\",\"method\":\"addcoin\",\"startpend\":8,\"endpend\":8,\"services\":129,\"maxpeers\":32,\"newcoin\":\"ZEC\",\"name\":\"Zcash\",\"hasheaders\":0,\"useaddmultisig\":0,\"netmagic\":\"24e92764\",\"p2p\":8233,\"rpc\":8232,\"pubval\":184,\"p2shval\":189,\"wifval\":128,\"txfee_satoshis\":\"10000\",\"isPoS\":0,\"minoutput\":10000,\"minconfirms\":2,\"genesishash\":\"00040fe8ec8471911baa1db1266ea15dd06b4a8a5c453883c000b031973dce08\",\"protover\":170002,\"genesisblock\":\"040000000000000000000000000000000000000000000000000000000000000000000000db4d7a85b768123f1dff1d4c4cece70083b2d27e117b4ac2e31d087988a5eac4000000000000000000000000000000000000000000000000000000000000000090041358ffff071f5712000000000000000000000000000000000000000000000000000000000000fd4005000a889f00854b8665cd555f4656f68179d31ccadc1b1f7fb0952726313b16941da348284d67add4686121d4e3d930160c1348d8191c25f12b267a6a9c131b5031cbf8af1f79c9d513076a216ec87ed045fa966e01214ed83ca02dc1797270a454720d3206ac7d931a0a680c5c5e099057592570ca9bdf6058343958b31901fce1a15a4f38fd347750912e14004c73dfe588b903b6c03166582eeaf30529b14072a7b3079e3a684601b9b3024054201f7440b0ee9eb1a7120ff43f713735494aa27b1f8bab60d7f398bca14f6abb2adbf29b04099121438a7974b078a11635b594e9170f1086140b4173822dd697894483e1c6b4e8b8dcd5cb12ca4903bc61e108871d4d915a9093c18ac9b02b6716ce1013ca2c1174e319c1a570215bc9ab5f7564765f7be20524dc3fdf8aa356fd94d445e05ab165ad8bb4a0db096c097618c81098f91443c719416d39837af6de85015dca0de89462b1d8386758b2cf8a99e00953b308032ae44c35e05eb71842922eb69797f68813b59caf266cb6c213569ae3280505421a7e3a0a37fdf8e2ea354fc5422816655394a9454bac542a9298f176e211020d63dee6852c40de02267e2fc9d5e1ff2ad9309506f02a1a71a0501b16d0d36f70cdfd8de78116c0c506ee0b8ddfdeb561acadf31746b5a9dd32c21930884397fb1682164cb565cc14e089d66635a32618f7eb05fe05082b8a3fae620571660a6b89886eac53dec109d7cbb6930ca698a168f301a950be152da1be2b9e07516995e20baceebecb5579d7cdbc16d09f3a50cb3c7dffe33f26686d4ff3f8946ee6475e98cf7b3cf9062b6966e838f865ff3de5fb064a37a21da7bb8dfd2501a29e184f207caaba364f36f2329a77515dcb710e29ffbf73e2bbd773fab1f9a6b005567affff605c132e4e4dd69f36bd201005458cfbd2c658701eb2a700251cefd886b1e674ae816d3f719bac64be649c172ba27a4fd55947d95d53ba4cbc73de97b8af5ed4840b659370c556e7376457f51e5ebb66018849923db82c1c9a819f173cccdb8f3324b239609a300018d0fb094adf5bd7cbb3834c69e6d0b3798065c525b20f040e965e1a161af78ff7561cd874f5f1b75aa0bc77f720589e1b810f831eac5073e6dd46d00a2793f70f7427f0f798f2f53a67e615e65d356e66fe40609a958a05edb4c175bcc383ea0530e67ddbe479a898943c6e3074c6fcc252d6014de3a3d292b03f0d88d312fe221be7be7e3c59d07fa0f2f4029e364f1f355c5d01fa53770d0cd76d82bf7e60f6903bc1beb772e6fde4a70be51d9c7e03c8d6d8dfb361a234ba47c470fe630820bbd920715621b9fbedb49fcee165ead0875e6c2b1af16f50b5d6140cc981122fcbcf7c5a4e3772b3661b628e08380abc545957e59f634705b1bbde2f0b4e055a5ec5676d859be77e20962b645e051a880fddb0180b4555789e1f9344a436a84dc5579e2553f1e5fb0a599c137be36cabbed0319831fea3fddf94ddc7971e4bcf02cdc93294a9aab3e3b13e3b058235b4f4ec06ba4ceaa49d675b4ba80716f3bc6976b1fbf9c8bf1f3e3a4dc1cd83ef9cf816667fb94f1e923ff63fef072e6a19321e4812f96cb0ffa864da50ad74deb76917a336f31dce03ed5f0303aad5e6a83634f9fcc371096f8288b8f02ddded5ff1bb9d49331e4a84dbe1543164438fde9ad71dab024779dcdde0b6602b5ae0a6265c14b94edd83b37403f4b78fcd2ed555b596402c28ee81d87a909c4e8722b30c71ecdd861b05f61f8b1231795c76adba2fdefa451b283a5d527955b9f3de1b9828e7b2e74123dd47062ddcc09b05e7fa13cb2212a6fdbc65d7e852cec463ec6fd929f5b8483cf3052113b13dac91b69f49d1b7d1aec01c4a68e41ce157\",\"debug\":0}" diff --git a/iguana/dPoW.h b/iguana/dPoW.h index eb84cb095..5f24e5d43 100755 --- a/iguana/dPoW.h +++ b/iguana/dPoW.h @@ -22,12 +22,14 @@ #define DPOW_MINSIGS 7 #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 0x0303 +#define DPOW_VERSION 0x0404 #define DPOW_UTXOSIZE 10000 #define DPOW_MINOUTPUT 6000 #define DPOW_DURATION 300 #define DPOW_RATIFYDURATION (3600 * 24) +#define DPOW_ENTRIESCHANNEL ('e' | ('n' << 8) | ('t' << 16) | ('r' << 24)) +#define DPOW_BTCENTRIESCHANNEL (~DPOW_ENTRIESCHANNEL) #define DPOW_UTXOCHANNEL ('d' | ('P' << 8) | ('o' << 16) | ('W' << 24)) #define DPOW_SIGCHANNEL ('s' | ('i' << 8) | ('g' << 16) | ('s' << 24)) #define DPOW_SIGBTCCHANNEL (~DPOW_SIGCHANNEL) @@ -37,7 +39,7 @@ #define DPOW_FIFOSIZE 64 #define DPOW_MAXTX 8192 -#define DPOW_THIRDPARTY_CONFIRMS 10 +#define DPOW_THIRDPARTY_CONFIRMS 0 #define DPOW_KOMODOCONFIRMS 3 #define DPOW_BTCCONFIRMS 1 #define DPOW_MAXRELAYS 64 @@ -104,14 +106,26 @@ struct dpow_block char signedtx[32768];//,rawtx[32768]; }; +struct pax_transaction +{ + UT_hash_handle hh; + bits256 txid; + uint64_t komodoshis,fiatoshis; + int32_t marked,height,kmdheight; + uint16_t vout; + char symbol[16],coinaddr[64]; uint8_t rmd160[20],shortflag; +}; + struct dpow_info { char symbol[16],dest[16]; uint8_t minerkey33[33],minerid; uint64_t lastrecvmask; struct dpow_checkpoint checkpoint,last,destchaintip,srcfifo[DPOW_FIFOSIZE],destfifo[DPOW_FIFOSIZE]; struct dpow_hashheight approved[DPOW_FIFOSIZE],notarized[DPOW_FIFOSIZE]; bits256 srctx[DPOW_MAXTX],desttx[DPOW_MAXTX]; - uint32_t destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify,crcs[1024]; - int32_t maxblocks; + uint32_t SRCREALTIME,destupdated,srcconfirms,numdesttx,numsrctx,lastsplit,cancelratify,crcs[16]; + int32_t maxblocks,SRCHEIGHT,SHORTFLAG; + struct pax_transaction *PAX; + portable_mutex_t mutex; struct dpow_block **blocks; }; diff --git a/iguana/dpow/dpow_fsm.c b/iguana/dpow/dpow_fsm.c index 67bfd2392..2293c35e7 100755 --- a/iguana/dpow/dpow_fsm.c +++ b/iguana/dpow/dpow_fsm.c @@ -92,25 +92,31 @@ void dpow_utxosync(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow //char str[65],str2[65]; //printf("send.(%s %s)\n",bits256_str(str,bp->notaries[i].dest.prev_hash),bits256_str(str2,bp->notaries[i].src.prev_hash)); if ( (len= dpow_rwutxobuf(1,utxodata,&U,bp)) > 0 ) - dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,DPOW_UTXOCHANNEL,bp->height,utxodata,len,bp->utxocrcs); + dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,DPOW_UTXOCHANNEL,bp->height,utxodata,len); } } -void dpow_sync(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,uint64_t refmask,int32_t myind,bits256 srchash,uint32_t channel,int32_t src_or_dest) +void dpow_sync(struct supernet_info *myinfo,int32_t forceflag,struct dpow_info *dp,struct dpow_block *bp,int8_t bestk,uint64_t refmask,int32_t myind,bits256 srchash,uint32_t channel,int32_t src_or_dest) { int8_t lastk; uint64_t mask; - mask = dpow_maskmin(refmask,bp,&lastk); + if ( bestk < 0 ) + mask = dpow_maskmin(refmask,bp,&lastk); + else + { + lastk = bestk; + mask = refmask; + } //dpow_utxosync(myinfo,bp,mask,myind,srchash); - if ( bp->notaries[myind].masks[lastk] == 0 ) + if ( forceflag || bp->notaries[myind].masks[lastk] == 0 ) dpow_signedtxgen(myinfo,dp,(src_or_dest != 0) ? bp->destcoin : bp->srccoin,bp,lastk,mask,myind,src_or_dest != 0 ? DPOW_SIGBTCCHANNEL : DPOW_SIGCHANNEL,src_or_dest); } int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint32_t channel,uint32_t height,uint8_t *data,int32_t datalen) { - bits256 txid,commit,srchash; struct dpow_block *bp = 0; uint32_t flag = 0; int32_t src_or_dest,senderind,i,myind = -1; char str[65],str2[65]; struct dpow_sigentry dsig; struct dpow_entry *ep; struct dpow_coinentry *cp; struct dpow_utxoentry U; struct iguana_info *coin; + bits256 txid,commit,srchash,hashmsg; struct dpow_block *bp = 0; uint32_t flag = 0; int32_t src_or_dest,senderind,i,iter,rlen,myind = -1; char str[65],str2[65]; struct dpow_sigentry dsig; struct dpow_entry *ep; struct dpow_coinentry *cp; struct dpow_utxoentry U; struct iguana_info *coin; if ( (bp= dpow_heightfind(myinfo,dp,height)) == 0 ) { - if ( (rand() % 100) == 0 && height > 0 ) + if ( 0 && (rand() % 100) == 0 && height > 0 ) printf("couldnt find height.%d | if you just started notary dapp this is normal\n",height); return(-1); } @@ -122,7 +128,55 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3 } for (i=0; i<32; i++) srchash.bytes[i] = dp->minerkey33[i+1]; - if ( channel == DPOW_UTXOCHANNEL ) + if ( channel == DPOW_ENTRIESCHANNEL ) + { + struct dpow_entry notaries[DPOW_MAXRELAYS]; uint8_t n; int8_t bestk; struct dpow_coinentry *ptr,*refptr; + rlen = 0; + bestk = data[rlen++]; + n = data[rlen++]; + rlen += iguana_rwbignum(0,&data[rlen],sizeof(hashmsg),hashmsg.bytes); + //printf("got ENTRIES bestk.%d (%d %llx) recv.%llx numnotaries.%d\n",bestk,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask,n); + if ( bits256_cmp(hashmsg,bp->hashmsg) == 0 ) + { + memset(notaries,0,sizeof(notaries)); + for (i=0; i<64; i++) + notaries[i].bestk = -1; + rlen += dpow_rwcoinentrys(0,&data[rlen],notaries,n,bestk); + //printf("matched hashmsg rlen.%d vs datalen.%d\n",rlen,datalen); + for (i=0; inotaries[i].dest : &bp->notaries[i].src; + if ( bits256_nonz(ptr->prev_hash) != 0 ) + { + if ( bits256_nonz(refptr->prev_hash) == 0 ) + { + printf(">>>>>>>>> %s got utxo.[%d] indirectly <<<<<<<<<<<\n",iter!=0?"dest":"src",i); + refptr->prev_hash = ptr->prev_hash; + refptr->prev_vout = ptr->prev_vout; + if ( iter == 1 && bits256_nonz(notaries[i].src.prev_hash) != 0 ) + bp->recvmask |= (1LL << i); + } + } + if ( (bestk= notaries[i].bestk) >= 0 ) + { + if ( ptr->siglens[bestk] > 0 && refptr->siglens[bestk] == 0 ) + { + printf(">>>>>>>>>> got %s siglen.%d for [%d] indirectly bestk.%d <<<<<<<<<<\n",iter!=0?"dest":"src",ptr->siglens[bestk],i,bestk); + memcpy(refptr->sigs[bestk],ptr->sigs[bestk],ptr->siglens[bestk]); + refptr->siglens[bestk] = ptr->siglens[bestk]; + if ( iter != 0 ) + bp->destsigsmasks[bestk] |= (1LL << i); + else bp->srcsigsmasks[bestk] |= (1LL << i); + } + } + } + } + } + } + else if ( channel == DPOW_UTXOCHANNEL ) { src_or_dest = 1; coin = (src_or_dest != 0) ? bp->destcoin : bp->srccoin; @@ -132,7 +186,7 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3 printf("error from rwutxobuf\n"); return(0); } - if ( bits256_cmp(U.hashmsg,bp->hashmsg) != 0 ) + if ( bits256_cmp(U.hashmsg,bp->hashmsg) != 0 && bits256_nonz(bp->hashmsg) != 0 ) { printf("unexpected mismatch hashmsg.%s vs %s\n",bits256_str(str,U.hashmsg),bits256_str(str2,bp->hashmsg)); return(0); @@ -145,9 +199,10 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3 dpow_utxosync(myinfo,dp,bp,0,myind,srchash); bp->recvmask |= (1LL << senderind); } - dpow_sync(myinfo,dp,bp,ep->recvmask,myind,srchash,channel,src_or_dest); + dpow_sync(myinfo,1,dp,bp,-1,ep->recvmask,myind,srchash,channel,src_or_dest); flag = 1; } + //printf("bestk.%d %llx vs recv.%llx\n",bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask); if ( 0 && flag == 0 && bp != 0 ) printf("ep.%p sender.%d UTXO.%d hashmsg.(%s) txid.(%s) v%d %llx\n",ep,senderind,height,bits256_str(str,U.hashmsg),bits256_str(str2,src_or_dest!=0?U.desthash:U.srchash),src_or_dest!=0?U.destvout:U.srcvout,(long long)bp->recvmask); } @@ -158,18 +213,19 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3 printf("rwsigentry error\n"); return(0); } + //printf("got sig.%x (%d %d) <<<<<<<<<< from.%d (%d %llx) sigs.%llx\n",channel,channel == DPOW_SIGCHANNEL,channel == DPOW_SIGBTCCHANNEL,dsig.senderind,dsig.lastk,(long long)dsig.mask,(long long)(dsig.lastk>=0?bp->destsigsmasks[dsig.lastk]:0)); if ( channel == DPOW_SIGBTCCHANNEL ) { src_or_dest = 1; coin = bp->destcoin; cp = &bp->notaries[dsig.senderind].dest; + //printf("gotsig %s channel.%x from %d bestk.%d %llx\n",coin->symbol,channel,dsig.senderind,dsig.lastk,(long long)dsig.mask); } else { src_or_dest = 0; coin = bp->srccoin; cp = &bp->notaries[dsig.senderind].src; - printf("got %s channel.%x from %d\n",coin->symbol,channel,dsig.senderind); } if ( dsig.senderind >= 0 && dsig.senderind < DPOW_MAXRELAYS ) { @@ -200,15 +256,15 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3 dpow_sigscheck(myinfo,dp,bp,DPOW_SIGCHANNEL,myind,0); } } - printf(" (%d %llx) <<<<<<<< %s from.%d got lastk.%d %llx/%llx siglen.%d >>>>>>>>>\n",bp->bestk,(long long)bp->bestmask,coin->symbol,dsig.senderind,dsig.lastk,(long long)dsig.mask,(long long)bp->destsigsmasks[dsig.lastk],dsig.siglen); - dpow_sync(myinfo,dp,bp,dsig.mask,myind,srchash,channel,src_or_dest); + //printf(" ht.%d (%d %llx) <<<<<<<< %s from.%d got lastk.%d %llx/%llx siglen.%d >>>>>>>>>\n",bp->height,bp->bestk,(long long)bp->bestmask,coin->symbol,dsig.senderind,dsig.lastk,(long long)dsig.mask,(long long)bp->destsigsmasks[dsig.lastk],dsig.siglen); + dpow_sync(myinfo,1,dp,bp,dsig.lastk,dsig.mask,myind,srchash,channel,src_or_dest); flag = 1; } } else printf("%s pubkey mismatch for senderind.%d %llx vs %llx\n",coin->symbol,dsig.senderind,*(long long *)dsig.senderpub,*(long long *)bp->notaries[dsig.senderind].pubkey); } else printf("%s illegal lastk.%d or senderind.%d or senderpub.%llx\n",coin->symbol,dsig.lastk,dsig.senderind,*(long long *)dsig.senderpub); } else printf("couldnt find senderind.%d height.%d channel.%x\n",dsig.senderind,height,channel); //if ( 0 && bp != 0 ) - printf("%s SIG.%d sender.%d lastk.%d mask.%llx siglen.%d recv.%llx\n",coin->symbol,height,dsig.senderind,dsig.lastk,(long long)dsig.mask,dsig.siglen,(long long)bp->recvmask); + // printf("%s SIG.%d sender.%d lastk.%d mask.%llx siglen.%d recv.%llx\n",coin->symbol,height,dsig.senderind,dsig.lastk,(long long)dsig.mask,dsig.siglen,(long long)bp->recvmask); } else if ( channel == DPOW_TXIDCHANNEL || channel == DPOW_BTCTXIDCHANNEL ) { @@ -256,7 +312,8 @@ int32_t dpow_update(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo if ( bp->state < 1000 ) { src_or_dest = 1; - if ( (bp->bestk= dpow_bestk(bp,&bp->bestmask)) >= 0 ) + bp->bestmask = dpow_maskmin(bp->recvmask,bp,&bp->bestk); + if ( bp->bestk >= 0 ) { sendutxo = 0; for (i=0; inumnotaries; i++) @@ -273,33 +330,54 @@ int32_t dpow_update(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo } if ( ep->masks[src_or_dest][bp->bestk] == 0 ) dpow_signedtxgen(myinfo,dp,(src_or_dest != 0) ? bp->destcoin : bp->srccoin,bp,bp->bestk,bp->bestmask,myind,DPOW_SIGBTCCHANNEL,src_or_dest); - //else dpow_sigsend(myinfo,bp,myind,bp->bestk,bp->bestmask,srchash,sigchannel); + if ( bp->bestk >= 0 && (rand() % 10) == 0 ) + dpow_sigsend(myinfo,dp,bp,myind,bp->bestk,bp->bestmask,srchash,DPOW_SIGBTCCHANNEL); } else sendutxo = 1; if ( sendutxo != 0 ) { memset(&U,0,sizeof(U)); dpow_entry2utxo(&U,bp,&bp->notaries[myind]); if ( (len= dpow_rwutxobuf(1,data,&U,bp)) > 0 ) - dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,DPOW_UTXOCHANNEL,bp->height,data,len,bp->utxocrcs); + dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,DPOW_UTXOCHANNEL,bp->height,data,len); } if ( bp->bestk >= 0 && ep->masks[src_or_dest][bp->bestk] == 0 ) dpow_signedtxgen(myinfo,dp,(src_or_dest != 0) ? bp->destcoin : bp->srccoin,bp,bp->bestk,bp->bestmask,myind,DPOW_SIGBTCCHANNEL,src_or_dest); - //else dpow_sigsend(myinfo,bp,myind,bp->bestk,bp->bestmask,srchash,sigchannel); + if ( bp->bestk >= 0 && (rand() % 10) == 0 ) + { + dpow_sigsend(myinfo,dp,bp,myind,bp->bestk,bp->bestmask,srchash,DPOW_SIGBTCCHANNEL); + for (i=0; inumnotaries; i++) + if ( bp->notaries[i].bestk >= 0 && bp->notaries[i].bestk != bp->bestk && bitweight(bp->notaries[i].recvmask & bp->recvmask) >= 7 ) + dpow_sigsend(myinfo,dp,bp,myind,bp->notaries[i].bestk,bp->recvmask,srchash,DPOW_SIGBTCCHANNEL); + } } else if ( bp->state != 0xffffffff ) { src_or_dest = 0; if ( bp->bestk >= 0 && ep->masks[src_or_dest][bp->bestk] == 0 ) dpow_signedtxgen(myinfo,dp,(src_or_dest != 0) ? bp->destcoin : bp->srccoin,bp,bp->bestk,bp->bestmask,myind,DPOW_SIGCHANNEL,src_or_dest); - //else dpow_sigsend(myinfo,bp,myind,bp->bestk,bp->bestmask,srchash,sigchannel); + if ( bp->bestk >= 0 && (rand() % 10) == 0 ) + dpow_sigsend(myinfo,dp,bp,myind,bp->bestk,bp->bestmask,srchash,DPOW_SIGCHANNEL); } - if ( (rand() % 10) == 0 || bp->isratify != 0 ) + if ( (rand() % 10) == 0 ) { - uint64_t sigsmask,srcmask; - if ( bp->bestk < 0 ) - sigsmask = srcmask = 0; - else sigsmask = bp->destsigsmasks[bp->bestk], srcmask = bp->srcsigsmasks[bp->bestk]; - printf("[%d] %s isratify.%d ht.%d FSM.%08x masks.%llx best.(%d %llx) sigsmask.%llx %llx src.%llx\n",myind,src_or_dest != 0 ? bp->destcoin->symbol : bp->srccoin->symbol,bp->isratify,bp->height,bp->state,(long long)bp->recvmask,bp->bestk,(long long)bp->bestmask,(long long)sigsmask,(long long)(sigsmask & bp->bestmask),(long long)srcmask); + if ( bp->isratify != 0 ) + { + uint64_t sigsmask,srcmask; + if ( bp->bestk < 0 ) + sigsmask = srcmask = 0; + else sigsmask = bp->destsigsmasks[bp->bestk], srcmask = bp->srcsigsmasks[bp->bestk]; + printf("[%d] %s isratify.%d ht.%d FSM.%08x masks.%llx best.(%d %llx) sigsmask.%llx %llx src.%llx\n",myind,src_or_dest != 0 ? bp->destcoin->symbol : bp->srccoin->symbol,bp->isratify,bp->height,bp->state,(long long)bp->recvmask,bp->bestk,(long long)bp->bestmask,(long long)sigsmask,(long long)(sigsmask & bp->bestmask),(long long)srcmask); + } + if ( bp->isratify != 0 ) + { + bp->bestmask = dpow_maskmin(bp->recvmask,bp,&bp->bestk); + dpow_sendcoinentrys(myinfo,dp,bp); + if ( bp->bestk >= 0 ) + dpow_signedtxgen(myinfo,dp,(bp->state < 1000) ? bp->destcoin : bp->srccoin,bp,bp->bestk,bp->bestmask,myind,bp->state < 1000 ? DPOW_SIGBTCCHANNEL : DPOW_SIGCHANNEL,bp->state < 1000); + printf("ht.%d numnotaries.%d BEST.%llx from RECV.%llx bestk.%d sigsmask.%llx missing.%llx\n",bp->height,bp->numnotaries,(long long)bp->bestmask,(long long)bp->recvmask,bp->bestk,bp->bestk>=0?(long long)bp->destsigsmasks[bp->bestk]:0,bp->bestk>=0?(long long)(bp->bestmask & ~bp->destsigsmasks[bp->bestk]):0); + if ( bp->height < DPOW_FIRSTRATIFY ) + dp->blocks[bp->height] = bp; + } } if ( bp->state < 1000 && bp->bestk >= 0 && (bp->destsigsmasks[bp->bestk] & bp->bestmask) == bp->bestmask ) { @@ -334,7 +412,10 @@ uint32_t dpow_statemachineiterate(struct supernet_info *myinfo,struct dpow_info } bitcoin_address(coinaddr,coin->chain->pubtype,dp->minerkey33,33); if ( bits256_nonz(bp->hashmsg) == 0 && bp->height >= DPOW_FIRSTRATIFY ) + { + printf("null hashmsg\n"); return(0); + } for (j=0; jminerkey33[j+1]; bp->bestk = dpow_bestk(bp,&bp->bestmask); @@ -450,12 +531,12 @@ void dpow_statemachinestart(void *ptr) dp->blocks[checkpoint.blockhash.height] = bp; bp->beacon = rand256(0); vcalc_sha256(0,bp->commit.bytes,bp->beacon.bytes,sizeof(bp->beacon)); - if ( checkpoint.blockhash.height >= DPOW_FIRSTRATIFY && dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY] != 0 ) + /*if ( checkpoint.blockhash.height >= DPOW_FIRSTRATIFY && dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY] != 0 ) { printf("purge %s.%d\n",dp->dest,checkpoint.blockhash.height - DPOW_FIRSTRATIFY); free(dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY]); dp->blocks[checkpoint.blockhash.height - DPOW_FIRSTRATIFY] = 0; - } + }*/ } bitcoin_address(srcaddr,src->chain->pubtype,dp->minerkey33,33); bitcoin_address(destaddr,dest->chain->pubtype,dp->minerkey33,33); @@ -529,15 +610,17 @@ void dpow_statemachinestart(void *ptr) } sleep(1); } - if ( (starttime= checkpoint.timestamp) == 0 ) + if ( bp->isratify == 0 || (starttime= checkpoint.timestamp) == 0 ) starttime = (uint32_t)time(NULL); printf("isratify.%d DPOW.%s statemachine checkpoint.%d %s start.%u\n",bp->isratify,src->symbol,checkpoint.blockhash.height,bits256_str(str,checkpoint.blockhash.hash),checkpoint.timestamp); for (i=0; iminerkey33[i+1]; + //printf("start utxosync start.%u %u\n",starttime,(uint32_t)time(NULL)); dpow_utxosync(myinfo,dp,bp,0,myind,srchash); + //printf("done utxosync start.%u %u\n",starttime,(uint32_t)time(NULL)); while ( time(NULL) < starttime+bp->duration && src != 0 && dest != 0 && bp->state != 0xffffffff ) { - sleep(2); + sleep(1); if ( dp->checkpoint.blockhash.height > checkpoint.blockhash.height ) { if ( bp->isratify == 0 ) @@ -548,23 +631,33 @@ void dpow_statemachinestart(void *ptr) else { bp->bestk = -1; - bp->bestmask = 0; + bp->bestmask = bp->recvmask = 0; bp->height = ((dp->checkpoint.blockhash.height / 10) % (DPOW_FIRSTRATIFY/10)) * 10; printf("new rotation ht.%d\n",bp->height); + dp->blocks[checkpoint.blockhash.height] = 0; + checkpoint.blockhash.height = dp->checkpoint.blockhash.height; + dp->blocks[checkpoint.blockhash.height] = bp; + /*for (i=0; i<64; i++) + { + bp->notaries[i].recvmask = 0; + bp->notaries[i].bestk = -1; + } + memset(bp->destsigsmasks,0,sizeof(bp->destsigsmasks)); + memset(bp->notaries[myind].masks,0,sizeof(bp->notaries[myind].masks));*/ } } if ( bp->state != 0xffffffff ) { - //printf("dp->ht.%d ht.%d DEST.%08x %s\n",dp->checkpoint.blockhash.height,checkpoint.blockhash.height,deststate,bits256_str(str,srchash.hash)); + //printf("dp->ht.%d ht.%d DEST.%08x %s\n",dp->checkpoint.blockhash.height,checkpoint.blockhash.height,bp->state,bits256_str(str,srchash)); bp->state = dpow_statemachineiterate(myinfo,dp,dest,bp,myind,1); } - if ( dp->cancelratify != 0 && bp->isratify != 0 ) + if ( 0 && dp->cancelratify != 0 && bp->isratify != 0 ) { printf("abort pending ratify\n"); break; } } - printf("state machine ht.%d completed state.%x %s.%s %s.%s recvmask.%llx\n",bp->height,bp->state,dp->dest,bits256_str(str,bp->desttxid),dp->symbol,bits256_str(str2,bp->srctxid),(long long)bp->recvmask); + printf("bestk.%d %llx sigs.%llx state machine ht.%d completed state.%x %s.%s %s.%s recvmask.%llx\n",bp->bestk,(long long)bp->bestmask,(long long)(bp->bestk>=0?bp->destsigsmasks[bp->bestk]:0),bp->height,bp->state,dp->dest,bits256_str(str,bp->desttxid),dp->symbol,bits256_str(str2,bp->srctxid),(long long)bp->recvmask); dp->lastrecvmask = bp->recvmask; free(ptr); } diff --git a/iguana/dpow/dpow_network.c b/iguana/dpow/dpow_network.c index c9b83b24e..67c12f613 100755 --- a/iguana/dpow/dpow_network.c +++ b/iguana/dpow/dpow_network.c @@ -75,7 +75,7 @@ int32_t dpow_crc32find(struct supernet_info *myinfo,struct dpow_info *dp,uint32_ return(firstz); } -void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen,uint32_t crcs[2]) +void dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen) { struct dpow_nanomsghdr *np; int32_t size,sentbytes = 0; uint32_t crc32; crc32 = calc_crc32(0,data,datalen); @@ -125,7 +125,7 @@ void dpow_nanomsg_update(struct supernet_info *myinfo) } if ( dp != 0 && crc32 == np->crc32 && (firstz= dpow_crc32find(myinfo,dp,crc32,np->channel)) >= 0 ) { - //printf("NANORECV ht.%d channel.%08x (%d) crc32.%08x:%08x datalen.%d:%d firstz.%d\n",np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)),firstz); + //char str[65]; printf("%s RECV ht.%d ch.%08x (%d) crc32.%08x:%08x datalen.%d:%d firstz.%d\n",bits256_str(str,np->srchash),np->height,np->channel,size,np->crc32,crc32,np->datalen,(int32_t)(size - sizeof(*np)),firstz); if ( i == myinfo->numdpows ) printf("received nnpacket for (%s)\n",np->symbol); else if ( dpow_datahandler(myinfo,dp,np->channel,np->height,np->packet,np->datalen) >= 0 ) @@ -146,7 +146,7 @@ void dpow_nanomsg_update(struct supernet_info *myinfo) void dpow_nanomsginit(struct supernet_info *myinfo,char *ipaddr) { } -uint32_t dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen,uint32_t crcs[2]) +uint32_t dpow_send(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,bits256 srchash,bits256 desthash,uint32_t channel,uint32_t msgbits,uint8_t *data,int32_t datalen) { return(0); } @@ -155,6 +155,56 @@ void dpow_nanomsg_update(struct supernet_info *myinfo) { } #endif +int32_t dpow_rwcoinentry(int32_t rwflag,uint8_t *serialized,struct dpow_coinentry *src,struct dpow_coinentry *dest,int8_t *bestkp) +{ + int8_t bestk; struct dpow_coinentry *ptr; int32_t siglen,iter,len = 0; + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(src->prev_hash),src->prev_hash.bytes); + len += iguana_rwnum(rwflag,&serialized[len],sizeof(src->prev_vout),(uint32_t *)&src->prev_vout); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(dest->prev_hash),dest->prev_hash.bytes); + len += iguana_rwnum(rwflag,&serialized[len],sizeof(dest->prev_vout),(uint32_t *)&dest->prev_vout); + len += iguana_rwnum(rwflag,&serialized[len],sizeof(*bestkp),(uint32_t *)bestkp); + if ( (bestk= *bestkp) >= 0 ) + { + for (iter=0; iter<2; iter++) + { + ptr = (iter == 0) ? src : dest; + len += iguana_rwnum(rwflag,&serialized[len],sizeof(ptr->siglens[bestk]),(uint32_t *)&ptr->siglens[bestk]); + if ( (siglen= ptr->siglens[bestk]) > 0 ) + { + if ( rwflag != 0 ) + memcpy(&serialized[len],ptr->sigs[bestk],siglen); + else memcpy(ptr->sigs[bestk],&serialized[len],siglen); + len += siglen; + } + } + } + return(len); +} + +int32_t dpow_rwcoinentrys(int32_t rwflag,uint8_t *serialized,struct dpow_entry notaries[DPOW_MAXRELAYS],uint8_t numnotaries,int8_t bestk) +{ + int32_t i,len = 0; + for (i=0; i>>>>>>>>>>>> dpow_sendcoinentrys (%d %llx) <- %llx\n",bp->height,bp->bestk,(long long)bp->bestmask,(long long)bp->recvmask); + data[len++] = bp->bestk; + data[len++] = bp->numnotaries; + len += iguana_rwbignum(1,&data[len],sizeof(bp->hashmsg),bp->hashmsg.bytes); + len += dpow_rwcoinentrys(1,&data[len],bp->notaries,bp->numnotaries,bp->bestk); + dpow_send(myinfo,dp,bp,zero,bp->hashmsg,DPOW_ENTRIESCHANNEL,bp->height,data,len); + return(len); +} int32_t dpow_opreturnscript(uint8_t *script,uint8_t *opret,int32_t opretlen) { @@ -301,8 +351,16 @@ int32_t dpow_rwsigentry(int32_t rwflag,uint8_t *data,struct dpow_sigentry *dsig) void dpow_sigsend(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_block *bp,int32_t myind,int8_t bestk,uint64_t bestmask,bits256 srchash,uint32_t sigchannel) { struct dpow_sigentry dsig; int32_t i,len; uint8_t data[4096]; struct dpow_entry *ep; + if ( ((1LL << myind) & bestmask) == 0 ) + return; ep = &bp->notaries[myind]; - printf("sigsend.%s: myind.%d bestk.%d %llx >>>>>> broadcast channel.%x\n",sigchannel == DPOW_SIGCHANNEL ? bp->srccoin->symbol : bp->destcoin->symbol,myind,bestk,(long long)bestmask,sigchannel); + if ( bestk >= 0 ) + { + if ( sigchannel == DPOW_SIGCHANNEL ) + bp->srcsigsmasks[bestk] |= (1LL << myind); + else bp->destsigsmasks[bestk] |= (1LL << myind); + } + //printf("ht.%d sigsend.%s: myind.%d bestk.%d %llx >>>>>> best.(%d %llx) recv.%llx sigs.%llx\n",bp->height,sigchannel == DPOW_SIGCHANNEL ? bp->srccoin->symbol : bp->destcoin->symbol,myind,bestk,(long long)bestmask,bestk,(long long)(bestk>=0?bestmask:0),(long long)bp->recvmask,(long long)(bestk>=0?bp->destsigsmasks[bestk]:0)); memset(&dsig,0,sizeof(dsig)); for (i=0; i<33; i++) dsig.senderpub[i] = dp->minerkey33[i]; @@ -322,7 +380,7 @@ void dpow_sigsend(struct supernet_info *myinfo,struct dpow_info *dp,struct dpow_ } memcpy(dsig.senderpub,dp->minerkey33,33); len = dpow_rwsigentry(1,data,&dsig); - dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,sigchannel,bp->height,data,len,bp->sigcrcs); + dpow_send(myinfo,dp,bp,srchash,bp->hashmsg,sigchannel,bp->height,data,len); } uint32_t komodo_assetmagic(char *symbol,uint64_t supply) diff --git a/iguana/dpow/dpow_prices.c b/iguana/dpow/dpow_prices.c index 472dac4f2..8f563f6aa 100755 --- a/iguana/dpow/dpow_prices.c +++ b/iguana/dpow/dpow_prices.c @@ -1913,11 +1913,15 @@ int32_t PAX_idle(struct supernet_info *myinfo)//struct PAX_data *argdp,int32_t i void PAX_init() { - double commission = 0.; - init_Currencymasks(); - //calc_smooth_code(127,7); - tradebot_monitorall(0,0,0,0,"fxcm",commission); - tradebot_monitorall(0,0,0,0,"truefx",commission); - //tradebot_monitorall(0,0,0,0,"instaforex",commission); - exchange_create("PAX",0); + static int32_t didinit; //double commission = 0.; + if ( didinit == 0 ) + { + init_Currencymasks(); + //calc_smooth_code(127,7); + //tradebot_monitorall(0,0,0,0,"fxcm",commission); + //tradebot_monitorall(0,0,0,0,"truefx",commission); + //tradebot_monitorall(0,0,0,0,"instaforex",commission); + exchange_create("PAX",0); + didinit = 1; + } } diff --git a/iguana/dpow/dpow_rpc.c b/iguana/dpow/dpow_rpc.c index e314af3fb..10fbcabdc 100755 --- a/iguana/dpow/dpow_rpc.c +++ b/iguana/dpow/dpow_rpc.c @@ -13,6 +13,8 @@ * * ******************************************************************************/ +#define issue_curl(cmdstr) bitcoind_RPC(0,"curl",cmdstr,0,0,0) + int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t kmdheight) { int32_t i,num=-1; struct iguana_info *coin; char params[256],*retstr,*pubkeystr; cJSON *retjson,*item,*array; @@ -53,14 +55,14 @@ int32_t komodo_notaries(uint8_t pubkeys[64][33],int32_t kmdheight) bits256 dpow_getbestblockhash(struct supernet_info *myinfo,struct iguana_info *coin) { char *retstr; bits256 blockhash; - if ( 0 && strcmp(coin->symbol,"USD") == 0 ) - printf("dpow_getbestblockhash %s FULLNODE.%d\n",coin->symbol,coin->FULLNODE); memset(blockhash.bytes,0,sizeof(blockhash)); if ( coin->FULLNODE < 0 ) { + if ( coin->lastbesthashtime+20 > time(NULL) && bits256_nonz(coin->lastbesthash) != 0 ) + return(coin->lastbesthash); if ( (retstr= bitcoind_passthru(coin->symbol,coin->chain->serverport,coin->chain->userpass,"getbestblockhash","")) != 0 ) { - if ( 0 && strcmp(coin->symbol,"USD") == 0 ) + if ( strcmp(coin->symbol,"USD") == 0 ) printf("%s getbestblockhash.(%s)\n",coin->symbol,retstr); if ( is_hexstr(retstr,0) == sizeof(blockhash)*2 ) decode_hex(blockhash.bytes,sizeof(blockhash),retstr); @@ -74,6 +76,11 @@ bits256 dpow_getbestblockhash(struct supernet_info *myinfo,struct iguana_info *c else { + } + if ( bits256_nonz(blockhash) != 0 ) + { + coin->lastbesthash = blockhash; + coin->lastbesthashtime = (uint32_t)time(NULL); } return(blockhash); } @@ -263,22 +270,24 @@ char *dpow_sendrawtransaction(struct supernet_info *myinfo,struct iguana_info *c int32_t dpow_getchaintip(struct supernet_info *myinfo,bits256 *blockhashp,uint32_t *blocktimep,bits256 *txs,uint32_t *numtxp,struct iguana_info *coin) { - int32_t n,i,height = -1,maxtx = *numtxp; bits256 besthash; cJSON *array,*json; + int32_t n,i,height = -1,maxtx = *numtxp; bits256 besthash,oldhash; cJSON *array,*json; *numtxp = *blocktimep = 0; + oldhash = coin->lastbesthash; *blockhashp = besthash = dpow_getbestblockhash(myinfo,coin); - if ( bits256_nonz(besthash) != 0 ) + if ( bits256_nonz(besthash) != 0 && bits256_cmp(oldhash,besthash) != 0 ) { if ( (json= dpow_getblock(myinfo,coin,besthash)) != 0 ) { if ( (height= juint(json,"height")) != 0 && (*blocktimep= juint(json,"time")) != 0 ) { + coin->lastbestheight = height; if ( height > coin->longestchain ) coin->longestchain = height; if ( (array= jarray(&n,json,"tx")) != 0 ) { for (i=0; isymbol,"USD") == 0 ) + //if ( 0 && strcmp(coin->symbol,"USD") == 0 ) printf("dpow_getchaintip %s ht.%d time.%u numtx.%d\n",coin->symbol,height,*blocktimep,n); *numtxp = n; } @@ -286,7 +295,7 @@ int32_t dpow_getchaintip(struct supernet_info *myinfo,bits256 *blockhashp,uint32 free_json(json); } } - return(height); + return(coin->lastbestheight); } int32_t dpow_vini_ismine(struct supernet_info *myinfo,struct dpow_info *dp,cJSON *item) @@ -354,3 +363,459 @@ int32_t dpow_haveutxo(struct supernet_info *myinfo,struct iguana_info *coin,bits printf("%s haveutxo.%d\n",coin->symbol,haveutxo); return(haveutxo); } + +char *dpow_issuemethod(char *userpass,char *method,char *params,uint16_t port) +{ + char url[512],*retstr=0,*retstr2=0,postdata[8192]; + if ( params == 0 || params[0] == 0 ) + params = (char *)"[]"; + if ( strlen(params) < sizeof(postdata)-128 ) + { + sprintf(url,(char *)"http://127.0.0.1:%u",port); + sprintf(postdata,"{\"method\":\"%s\",\"params\":%s}",method,params); + //printf("postdata.(%s) USERPASS.(%s)\n",postdata,KMDUSERPASS); + retstr2 = bitcoind_RPC(&retstr,(char *)"debug",url,userpass,method,params); + } + return(retstr2); +} + +uint64_t dpow_paxprice(uint64_t *seedp,int32_t height,char *base,char *rel,uint64_t basevolume) +{ + char params[512],*retstr; uint64_t satoshis = 0; cJSON *retjson,*result; struct iguana_info *kmdcoin; + kmdcoin = iguana_coinfind("KMD"); + *seedp = 0; + sprintf(params,"[\"%s\", \"%s\", \"%d\", \"%.8f\"]",base,rel,height,(double)basevolume/SATOSHIDEN); + if ( kmdcoin != 0 && (retstr= dpow_issuemethod(kmdcoin->chain->userpass,"paxprice",params,kmdcoin->chain->rpcport)) != 0 ) + { + if ( (retjson= cJSON_Parse(retstr)) != 0 ) + { + if ( (result= jobj(retjson,"result")) != 0 ) + { + satoshis = jdouble(result,"relvolume") * SATOSHIDEN; + *seedp = j64bits(result,"seed"); + } + free_json(retjson); + } + printf("dpow_paxprice.(%s) -> %s %.8f\n",params,retstr,dstr(satoshis)); + } + return(satoshis); +} + +#define KOMODO_PUBTYPE 60 + +int32_t PAX_pubkey(int32_t rwflag,uint8_t *pubkey33,uint8_t *addrtypep,uint8_t rmd160[20],char fiat[4],uint8_t *shortflagp,int64_t *fiatoshisp) +{ + if ( rwflag != 0 ) + { + memset(pubkey33,0,33); + pubkey33[0] = 0x02 | (*shortflagp != 0); + memcpy(&pubkey33[1],fiat,3); + iguana_rwnum(rwflag,&pubkey33[4],sizeof(*fiatoshisp),(void *)fiatoshisp); + pubkey33[12] = *addrtypep; + memcpy(&pubkey33[13],rmd160,20); + } + else + { + *shortflagp = (pubkey33[0] == 0x03); + memcpy(fiat,&pubkey33[1],3); + fiat[3] = 0; + iguana_rwnum(rwflag,&pubkey33[4],sizeof(*fiatoshisp),(void *)fiatoshisp); + if ( *shortflagp != 0 ) + *fiatoshisp = -(*fiatoshisp); + *addrtypep = pubkey33[12]; + memcpy(rmd160,&pubkey33[13],20); + } + return(33); +} + +uint64_t PAX_fiatdest(uint64_t *seedp,int32_t tokomodo,char *destaddr,uint8_t pubkey33[33],char *coinaddr,int32_t kmdheight,char *origbase,int64_t fiatoshis) +{ + uint8_t shortflag=0; char base[4]; int32_t i; uint8_t addrtype,rmd160[20]; int64_t komodoshis=0; + for (i=0; i<3; i++) + base[i] = toupper(origbase[i]); + base[i] = 0; + if ( strcmp(base,"KMD") == 0 ) + return(0); + if ( fiatoshis < 0 ) + shortflag = 1, fiatoshis = -fiatoshis; + komodoshis = dpow_paxprice(seedp,kmdheight,base,(char *)"KMD",(uint64_t)fiatoshis); + if ( bitcoin_addr2rmd160(&addrtype,rmd160,coinaddr) == 20 ) + { + PAX_pubkey(1,pubkey33,&addrtype,rmd160,base,&shortflag,tokomodo != 0 ? &komodoshis : &fiatoshis); + bitcoin_address(destaddr,KOMODO_PUBTYPE,pubkey33,33); + } + return(komodoshis); +} + +int32_t dpow_scriptitemlen(int32_t *opretlenp,uint8_t *script) +{ + int32_t opretlen,len = 0; + if ( (opretlen= script[len++]) >= 0x4c ) + { + if ( opretlen == 0x4c ) + opretlen = script[len++]; + else if ( opretlen == 0x4d ) + { + opretlen = script[len++]; + opretlen = (opretlen << 8) | script[len++]; + } + } + *opretlenp = opretlen; + return(len); +} + +cJSON *dpow_paxjson(struct pax_transaction *pax) +{ + uint8_t addrtype,rmd160[20]; int32_t i; char rmdstr[41]; cJSON *item = cJSON_CreateObject(); + if ( pax != 0 ) + { + jaddbits256(item,"prev_hash",pax->txid); + jaddnum(item,"prev_vout",pax->vout); + if ( pax->shortflag != 0 ) + jaddnum(item,"short",pax->shortflag); + jaddnum(item,pax->symbol,dstr(pax->fiatoshis)); + jaddstr(item,"fiat",pax->symbol); + jaddnum(item,"kmdheight",pax->kmdheight); + jaddnum(item,"height",pax->height); + jaddnum(item,"KMD",dstr(pax->komodoshis)); + jaddstr(item,"address",pax->coinaddr); + bitcoin_addr2rmd160(&addrtype,rmd160,pax->coinaddr); + for (i=0; i<20; i++) + sprintf(&rmdstr[i<<1],"%02x",rmd160[i]); + rmdstr[40] = 0; + jaddstr(item,"rmd160",rmdstr); + } + return(item); +} + +uint64_t dpow_paxtotal(struct dpow_info *dp) +{ + struct pax_transaction *pax,*tmp; uint64_t total = 0; + pthread_mutex_lock(&dp->mutex); + /*if ( dp->PAX != 0 ) + { + tmp = 0; + pax= dp->PAX->hh.next; + while ( pax != 0 && pax != tmp ) + { + if ( pax->marked == 0 ) + total += pax->komodoshis; + tmp = pax; + pax = pax->hh.next; + } + }*/ + HASH_ITER(hh,dp->PAX,pax,tmp) + { + if ( pax->marked == 0 ) + total += pax->komodoshis; + } + pthread_mutex_unlock(&dp->mutex); + return(total); +} + +struct pax_transaction *dpow_paxfind(struct dpow_info *dp,struct pax_transaction *space,bits256 txid,uint16_t vout) +{ + struct pax_transaction *pax; + pthread_mutex_lock(&dp->mutex); + HASH_FIND(hh,dp->PAX,&txid,sizeof(txid),pax); + if ( pax != 0 ) + memcpy(space,pax,sizeof(*pax)); + pthread_mutex_unlock(&dp->mutex); + return(pax); +} + +struct pax_transaction *dpow_paxmark(struct dpow_info *dp,struct pax_transaction *space,bits256 txid,uint16_t vout,int32_t mark) +{ + struct pax_transaction *pax; + pthread_mutex_lock(&dp->mutex); + HASH_FIND(hh,dp->PAX,&txid,sizeof(txid),pax); + if ( pax == 0 ) + { + pax = (struct pax_transaction *)calloc(1,sizeof(*pax)); + pax->txid = txid; + pax->vout = vout; + HASH_ADD_KEYPTR(hh,dp->PAX,&pax->txid,sizeof(pax->txid),pax); + } + if ( pax != 0 ) + { + pax->marked = mark; + int32_t i; for (i=0; i<32; i++) + printf("%02x",((uint8_t *)&txid)[i]); + printf(" paxmark.ht %d vout%d\n",mark,vout); + memcpy(space,pax,sizeof(*pax)); + } + pthread_mutex_unlock(&dp->mutex); + return(pax); +} + +cJSON *dpow_withdraws_pending(struct dpow_info *dp) +{ + struct pax_transaction *pax,*tmp; cJSON *retjson = cJSON_CreateArray(); + pthread_mutex_lock(&dp->mutex); + /*if ( dp->PAX != 0 ) + { + tmp = 0; + pax = dp->PAX->hh.next; + while ( pax != 0 && pax != tmp ) + { + if ( pax->marked == 0 ) + jaddi(retjson,dpow_paxjson(pax)); + tmp = pax; + pax = pax->hh.next; + } + }*/ + HASH_ITER(hh,dp->PAX,pax,tmp) + { + if ( pax->marked == 0 ) + jaddi(retjson,dpow_paxjson(pax)); + } + pthread_mutex_unlock(&dp->mutex); + return(retjson); +} + +void dpow_issuer_withdraw(struct dpow_info *dp,char *coinaddr,uint64_t fiatoshis,int32_t shortflag,char *symbol,uint64_t komodoshis,uint8_t *rmd160,bits256 txid,uint16_t vout,int32_t kmdheight,int32_t height) // assetchain context +{ + struct pax_transaction *pax; + pthread_mutex_lock(&dp->mutex); + HASH_FIND(hh,dp->PAX,&txid,sizeof(txid),pax); + if ( pax == 0 ) + { + pax = (struct pax_transaction *)calloc(1,sizeof(*pax)); + pax->txid = txid; + pax->vout = vout; + HASH_ADD_KEYPTR(hh,dp->PAX,&pax->txid,sizeof(pax->txid),pax); + } + pthread_mutex_unlock(&dp->mutex); + if ( coinaddr != 0 ) + { + strcpy(pax->coinaddr,coinaddr); + pax->komodoshis = komodoshis; + pax->shortflag = shortflag; + strcpy(pax->symbol,symbol); + pax->fiatoshis = fiatoshis; + memcpy(pax->rmd160,rmd160,20); + pax->kmdheight = kmdheight; + pax->height = height; + if ( pax->marked == 0 ) + printf("ADD WITHDRAW %s %.8f -> %s %.8f TO PAX kht.%d ht.%d\n",symbol,dstr(pax->fiatoshis),coinaddr,dstr(pax->komodoshis),kmdheight,height); + else printf("MARKED WITHDRAW %s %.8f -> %s %.8f TO PAX kht.%d ht.%d\n",symbol,dstr(pax->fiatoshis),coinaddr,dstr(pax->komodoshis),kmdheight,height); + } + else + { + pax->marked = height; + printf("MARK WITHDRAW ht.%d\n",height); + } +} + +void dpow_issuer_voutupdate(struct dpow_info *dp,char *symbol,int32_t isspecial,int32_t height,int32_t txi,bits256 txid,int32_t vout,int32_t numvouts,int64_t fiatoshis,uint8_t *script,int32_t len) +{ + char base[16],destaddr[64],coinaddr[64]; uint8_t addrtype,shortflag,rmd160[20],pubkey33[33]; int64_t checktoshis,komodoshis; uint64_t seed; struct pax_transaction space; int32_t i,kmdheight,opretlen,offset = 0; + if ( script[offset++] == 0x6a ) + { + memset(base,0,sizeof(base)); + offset += dpow_scriptitemlen(&opretlen,&script[offset]); + if ( script[offset] == 'W' && strcmp(dp->symbol,"KMD") != 0 ) + { + // if valid add to pricefeed for issue + printf("WITHDRAW ht.%d txi.%d vout.%d %.8f opretlen.%d\n",height,txi,vout,dstr(fiatoshis),opretlen); + if ( opretlen == 38 ) // any KMD tx + { + offset++; + offset += PAX_pubkey(0,&script[offset],&addrtype,rmd160,base,&shortflag,&komodoshis); + iguana_rwnum(0,&script[offset],sizeof(kmdheight),&kmdheight); + if ( komodoshis < 0 ) + komodoshis = -komodoshis; + bitcoin_address(coinaddr,addrtype,rmd160,20); + checktoshis = PAX_fiatdest(&seed,1,destaddr,pubkey33,coinaddr,kmdheight,base,fiatoshis); + for (i=0; i<32; i++) + printf("%02x",((uint8_t *)&txid)[i]); + printf(" <- txid.v%u ",vout); + for (i=0; i<33; i++) + printf("%02x",pubkey33[i]); + printf(" checkpubkey fiat %.8f check %.8f vs komodoshis %.8f dest.(%s) kmdheight.%d ht.%d seed.%llu\n",dstr(fiatoshis),dstr(checktoshis),dstr(komodoshis),destaddr,kmdheight,height,(long long)seed); + if ( shortflag == dp->SHORTFLAG ) + { + if ( shortflag == 0 ) + { + if ( seed == 0 || checktoshis >= komodoshis ) + { + if ( dpow_paxfind(dp,&space,txid,vout) == 0 ) + dpow_issuer_withdraw(dp,coinaddr,fiatoshis,shortflag,base,komodoshis,rmd160,txid,vout,kmdheight,height); + } + } + else // short + { + for (i=0; isymbol,"KMD") == 0 ) + { + printf("WITHDRAW issued ht.%d txi.%d vout.%d %.8f\n",height,txi,vout,dstr(fiatoshis)); + if ( opretlen == 46 ) // any KMD tx + { + offset++; + offset += PAX_pubkey(0,&script[offset],&addrtype,rmd160,base,&shortflag,&fiatoshis); + iguana_rwnum(0,&script[offset],sizeof(kmdheight),&kmdheight); + iguana_rwnum(0,&script[offset],sizeof(height),&height); + if ( fiatoshis < 0 ) + fiatoshis = -fiatoshis; + bitcoin_address(coinaddr,addrtype,rmd160,20); + checktoshis = PAX_fiatdest(&seed,1,destaddr,pubkey33,coinaddr,kmdheight,base,fiatoshis); + for (i=0; i<32; i++) + printf("%02x",((uint8_t *)&txid)[i]); + printf(" <- txid.v%u ",vout); + for (i=0; i<33; i++) + printf("%02x",pubkey33[i]); + printf(" checkpubkey check %.8f v %.8f dest.(%s) height.%d\n",dstr(checktoshis),dstr(fiatoshis),destaddr,height); + if ( shortflag == 0 ) + { + if ( seed == 0 || checktoshis > fiatoshis ) + { + dpow_paxmark(dp,&space,txid,vout,height); + } + } + else + { + + } + } + } + } +} + +int32_t dpow_issuer_tx(struct dpow_info *dp,struct iguana_info *coin,int32_t height,int32_t txi,char *txidstr,uint32_t port) +{ + char *retstr,params[256],*hexstr; uint8_t script[10000]; cJSON *json,*oldpub,*newpub,*result,*vouts,*item,*sobj; int32_t vout,n,len,isspecial,retval = -1; uint64_t value; bits256 txid; + sprintf(params,"[\"%s\", 1]",txidstr); + if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getrawtransaction",params,port)) != 0 ) + { + if ( (json= cJSON_Parse(retstr)) != 0 ) + { + //printf("TX.(%s)\n",retstr); + if ( (result= jobj(json,(char *)"result")) != 0 ) + { + oldpub = jobj(result,(char *)"vpub_old"); + newpub = jobj(result,(char *)"vpub_new"); + retval = 0; + if ( oldpub == 0 && newpub == 0 && (vouts= jarray(&n,result,(char *)"vout")) != 0 ) + { + isspecial = 0; + txid = jbits256(result,(char *)"txid"); + for (vout=0; vout> 1; + if ( vout == 0 && ((memcmp(&hexstr[2],CRYPTO777_PUBSECPSTR,66) == 0 && len == 35) || (memcmp(&hexstr[6],CRYPTO777_RMD160STR,40) == 0 && len == 25)) ) + isspecial = 1; + else if ( len <= sizeof(script) ) + { + decode_hex(script,len,hexstr); + dpow_issuer_voutupdate(dp,coin->symbol,isspecial,height,txi,txid,vout,n,value,script,len); + } + } + } + } + } + } else printf("error getting txids.(%s)\n",retstr); + free_json(json); + } + free(retstr); + } + return(retval); +} + +int32_t dpow_issuer_block(struct dpow_info *dp,struct iguana_info *coin,int32_t height,uint16_t port) +{ + char *retstr,*retstr2,params[128],*txidstr; int32_t i,n,retval = -1; cJSON *json,*tx=0,*result=0,*result2; + sprintf(params,"[%d]",height); + if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getblockhash",params,port)) != 0 ) + { + if ( (result= cJSON_Parse(retstr)) != 0 ) + { + if ( (txidstr= jstr(result,(char *)"result")) != 0 && strlen(txidstr) == 64 ) + { + sprintf(params,"[\"%s\"]",txidstr); + if ( (retstr2= dpow_issuemethod(coin->chain->userpass,(char *)"getblock",params,port)) != 0 ) + { + //printf("getblock.(%s)\n",retstr2); + if ( (json= cJSON_Parse(retstr2)) != 0 ) + { + if ( (result2= jobj(json,(char *)"result")) != 0 && (tx= jarray(&n,result2,(char *)"tx")) != 0 ) + { + for (i=0; ichain->rpcport; + if ( height <= 0 ) + height = 1; + *isrealtimep = 0; + if ( (retstr= dpow_issuemethod(coin->chain->userpass,(char *)"getinfo",0,port)) != 0 ) + { + if ( (infoobj= cJSON_Parse(retstr)) != 0 ) + { + if ( (result= jobj(infoobj,(char *)"result")) != 0 && (kmdheight= jint(result,(char *)"blocks")) != 0 ) + { + for (i=0; i<1000 && height<=kmdheight; i++,height++) + { + /*fprintf(stderr,"%s.%d ",coin->symbol,height); + if ( (height % 10) == 0 ) + { + if ( (height % 100) == 0 ) + fprintf(stderr,"%s.%d ",coin->symbol,height); + memset(&zero,0,sizeof(zero)); + komodo_stateupdate(height,0,0,0,zero,0,0,0,0,height,0,0,0,0); + }*/ + if ( dpow_issuer_block(dp,coin,height,port) < 0 ) + { + printf("error height %d\n",height); + break; + } + usleep(10000); + } + if ( height >= kmdheight ) + *isrealtimep = (uint32_t)time(NULL); + } + free_json(infoobj); + } + //printf("GETINFO.(%s)\n",retstr); + free(retstr); + } + else + { + printf("error from %s\n",coin->symbol); + sleep(3); + } + return(height); +} + diff --git a/iguana/dpow/dpow_tx.c b/iguana/dpow/dpow_tx.c index 4dd02d2a5..905419af2 100755 --- a/iguana/dpow/dpow_tx.c +++ b/iguana/dpow/dpow_tx.c @@ -47,26 +47,43 @@ int32_t dpow_bestk(struct dpow_block *bp,uint64_t *maskp) uint64_t dpow_maskmin(uint64_t refmask,struct dpow_block *bp,int8_t *lastkp) { - int32_t j,m,k; uint64_t mask = 0; + int32_t j,m,k; uint64_t bestmask,mask; + bestmask = mask = 0; for (j=m=0; jnumnotaries; j++) { - k = DPOW_MODIND(bp,j);//((bp->height % bp->numnotaries) + j) % bp->numnotaries; + k = DPOW_MODIND(bp,j); if ( bits256_nonz(bp->notaries[k].src.prev_hash) != 0 && bits256_nonz(bp->notaries[k].dest.prev_hash) != 0 ) { mask |= (1LL << k); - if ( ++m >= DPOW_M(bp) ) + if ( ++m == DPOW_M(bp) ) { *lastkp = k; - break; + bestmask = mask; } } } - return(mask); + bp->recvmask |= mask; + if ( *lastkp >= 0 ) + { + for (mask=j=0; jnumnotaries; j++) + { + if ( bp->notaries[j].src.siglens[*lastkp] > 0 ) + mask |= (1LL << j); + } + bp->srcsigsmasks[*lastkp] |= mask; + for (mask=j=0; jnumnotaries; j++) + { + if ( bp->notaries[j].dest.siglens[*lastkp] > 0 ) + mask |= (1LL << j); + } + bp->destsigsmasks[*lastkp] |= mask; + } + return(bestmask); } struct dpow_block *dpow_heightfind(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height) { - int32_t incr = 100000; + int32_t r,h,incr = 100000; struct dpow_block *bp = 0; if ( height > dp->maxblocks ) { dp->blocks = realloc(dp->blocks,sizeof(*dp->blocks) * (dp->maxblocks + incr)); @@ -74,8 +91,18 @@ struct dpow_block *dpow_heightfind(struct supernet_info *myinfo,struct dpow_info dp->maxblocks += incr; } if ( height < dp->maxblocks ) - return(dp->blocks!=0?dp->blocks[height]:0); - else return(0); + bp = dp->blocks!=0 ? dp->blocks[height] : 0; + if ( bp == 0 && height < DPOW_FIRSTRATIFY ) + { + r = (rand() % DPOW_FIRSTRATIFY); + for (h=0; hblocks[height]) != 0 ) + return(bp); + } + } + return(bp); } int32_t dpow_voutratify(struct dpow_block *bp,uint8_t *serialized,int32_t m,uint8_t pubkeys[][33],int32_t numratified) @@ -151,7 +178,7 @@ bits256 dpow_notarytx(char *signedtx,int32_t *numsigsp,int32_t isPoS,struct dpow len += iguana_rwvarint32(1,&serialized[len],(uint32_t *)&m); for (j=m=0; jnumnotaries; j++) { - k = DPOW_MODIND(bp,j);//((bp->height % bp->numnotaries) + j) % bp->numnotaries; + k = DPOW_MODIND(bp,j); if ( ((1LL << k) & bestmask) != 0 ) { ep = &bp->notaries[k]; @@ -202,7 +229,7 @@ cJSON *dpow_vins(struct iguana_info *coin,struct dpow_block *bp,int8_t bestk,uin vins = cJSON_CreateArray(); for (j=0; jnumnotaries; j++) { - k = DPOW_MODIND(bp,j);//((bp->height % bp->numnotaries) + j) % bp->numnotaries; + k = DPOW_MODIND(bp,j); if ( ((1LL << k) & bestmask) != 0 ) { ep = &bp->notaries[k]; @@ -256,7 +283,7 @@ void dpow_rawtxsign(struct supernet_info *myinfo,struct dpow_info *dp,struct igu item = jitem(vin,j); if ( (sobj= jobj(item,"scriptSig")) != 0 && (sigstr= jstr(sobj,"hex")) != 0 && strlen(sigstr) > 32 ) { - printf("%s height.%d mod.%d VINI.%d myind.%d MINE.(%s) j.%d\n",(src_or_dest != 0) ? bp->destcoin->symbol : bp->srccoin->symbol,bp->height,DPOW_MODIND(bp,0),j,myind,jprint(item,0),j); + //printf("bestk.%d %llx %s height.%d mod.%d VINI.%d myind.%d MINE.(%s) j.%d\n",bestk,(long long)bestmask,(src_or_dest != 0) ? bp->destcoin->symbol : bp->srccoin->symbol,bp->height,DPOW_MODIND(bp,0),j,myind,jprint(item,0),j); cp->siglens[bestk] = (int32_t)strlen(sigstr) >> 1; if ( src_or_dest != 0 ) bp->destsigsmasks[bestk] |= (1LL << myind); @@ -282,11 +309,8 @@ void dpow_rawtxsign(struct supernet_info *myinfo,struct dpow_info *dp,struct igu int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struct iguana_info *coin,struct dpow_block *bp,int8_t bestk,uint64_t bestmask,int32_t myind,uint32_t sigchannel,int32_t src_or_dest) { - int32_t j,incr,numsigs,retval=-1; char rawtx[32768]; cJSON *vins; bits256 txid,srchash,zero; struct dpow_entry *ep; - if ( bp->numnotaries < 8 ) - incr = 1; - else incr = sqrt(bp->numnotaries) + 1; - bestmask = dpow_maskmin(bestmask,bp,&bestk); + int32_t j,numsigs,retval=-1; char rawtx[32768]; cJSON *vins; bits256 txid,srchash,zero; struct dpow_entry *ep; + //bestmask = dpow_maskmin(bestmask,bp,&bestk); ep = &bp->notaries[myind]; memset(&zero,0,sizeof(zero)); if ( bestk < 0 ) @@ -305,11 +329,13 @@ int32_t dpow_signedtxgen(struct supernet_info *myinfo,struct dpow_info *dp,struc decode_hex(txdata+32,len,rawtx); for (j=0; jhashmsg,(bits256_nonz(bp->btctxid) == 0) ? DPOW_BTCTXIDCHANNEL : DPOW_TXIDCHANNEL,bp->height,txdata,len+32,bp->txidcrcs);*/ + dpow_send(myinfo,bp,zero,bp->hashmsg,(bits256_nonz(bp->btctxid) == 0) ? DPOW_BTCTXIDCHANNEL : DPOW_TXIDCHANNEL,bp->height,txdata,len+32);*/ dpow_rawtxsign(myinfo,dp,coin,bp,rawtx,vins,bestk,bestmask,myind,src_or_dest); } else printf("signedtxgen zero txid or null rawtx\n"); free_json(vins); - } else printf("signedtxgen error generating vins\n"); + } + else if ( (bestmask & bp->recvmask) != bestmask ) + printf("signedtxgen error generating vins bestk.%d %llx recv.%llx need to recv %llx\n",bestk,(long long)bestmask,(long long)bp->recvmask,(long long)(bestmask & ~bp->recvmask)); return(retval); } @@ -344,7 +370,7 @@ void dpow_sigscheck(struct supernet_info *myinfo,struct dpow_info *dp,struct dpo decode_hex(txdata+32,len,bp->signedtx); for (j=0; jhashmsg,(src_or_dest != 0) ? DPOW_BTCTXIDCHANNEL : DPOW_TXIDCHANNEL,bp->height,txdata,len+32,bp->txidcrcs); + dpow_send(myinfo,dp,bp,txid,bp->hashmsg,(src_or_dest != 0) ? DPOW_BTCTXIDCHANNEL : DPOW_TXIDCHANNEL,bp->height,txdata,len+32); printf("complete statemachine.%s ht.%d\n",coin->symbol,bp->height); bp->state = src_or_dest != 0 ? 1000 : 0xffffffff; } else printf("sendtxid mismatch got %s instead of %s\n",bits256_str(str,txid),bits256_str(str2,signedtxid)); diff --git a/iguana/exchanges/okcoin.c b/iguana/exchanges/okcoin.c index 2ab09f883..793fa38e6 100755 --- a/iguana/exchanges/okcoin.c +++ b/iguana/exchanges/okcoin.c @@ -44,7 +44,7 @@ double UPDATE(struct exchange_info *exchange,char *base,char *rel,struct exchang { fprintf(stderr,">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FATAL ERROR OKCOIN.(%s) only supports USD\n",url); printf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> FATAL ERROR OKCOIN.(%s) only supports USD\n",url); - exit(-1); + //exit(-1); return(0); } return(exchanges777_standardprices(exchange,commission,base,rel,url,quotes,0,0,maxdepth,0,invert)); diff --git a/iguana/iguana777.c b/iguana/iguana777.c index e1d886a3f..b54bfee21 100755 --- a/iguana/iguana777.c +++ b/iguana/iguana777.c @@ -266,7 +266,7 @@ void iguana_emitQ(struct iguana_info *coin,struct iguana_bundle *bp) ptr->type = 'E'; ptr->starttime = (uint32_t)time(NULL); //printf("%s EMIT.%d[%d] emitfinish.%u\n",coin->symbol,ptr->hdrsi,bp->n,bp->emitfinish); - queue_enqueue("emitQ",&emitQ,&ptr->DL,0); + queue_enqueue("emitQ",&emitQ,&ptr->DL); } void iguana_bundleQ(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_bundle *bp,int32_t timelimit) @@ -293,7 +293,7 @@ void iguana_bundleQ(struct supernet_info *myinfo,struct iguana_info *coin,struct ptr->timelimit = timelimit; coin->numbundlesQ++; // printf("%s.%d %p bundle.%d[%d] ht.%d emitfinish.%u\n",coin->symbol,n,bp,ptr->hdrsi,bp->n,bp->bundleheight,bp->emitfinish); - queue_enqueue("bundlesQ",&bundlesQ,&ptr->DL,0); + queue_enqueue("bundlesQ",&bundlesQ,&ptr->DL); } else { @@ -386,7 +386,7 @@ int32_t iguana_validated(struct iguana_info *coin) int32_t iguana_helperA(struct supernet_info *myinfo,struct iguana_info *coin,int32_t helperid,struct iguana_bundle *bp,int32_t convertflag) { - int32_t retval,num = 0; + int32_t retval,numXspends,num = 0; if ( bp == 0 ) { printf("iguana_helperA unexpected null bp\n"); @@ -400,7 +400,8 @@ int32_t iguana_helperA(struct supernet_info *myinfo,struct iguana_info *coin,int { if ( retval > 0 ) { - printf("GENERATED UTXO.%d for ht.%d duration %d seconds\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo); + numXspends = iguana_Xspendmap(coin,&bp->ramchain,bp); + printf("GENERATED UTXO.%d for ht.%d duration %d seconds numXspends.%d\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo,numXspends); num++; } bp->utxofinish = (uint32_t)time(NULL); @@ -435,9 +436,11 @@ int32_t iguana_helperB(struct iguana_info *coin,int32_t helperid,struct iguana_b return(0); } +int32_t iguana_utxogen(struct supernet_info *myinfo,struct iguana_info *coin,int32_t helperid,int32_t convertflag); + void iguana_update_balances(struct supernet_info *myinfo,struct iguana_info *coin) { - int32_t i,hdrsi,max; struct iguana_bundle *bp; char fname[1024]; + int32_t i,hdrsi,max,retval,numXspends,convertflag = 1; struct iguana_bundle *bp; char fname[1024]; if ( coin->RTheight > 0 ) { printf("Need to restart iguana to generate new balances files\n"); @@ -447,7 +450,27 @@ void iguana_update_balances(struct supernet_info *myinfo,struct iguana_info *coi max = coin->bundlescount; if ( coin->bundles[max-1] == coin->current || coin->bundles[max-1] == 0 || (coin->bundles[max-1] != 0 && coin->bundles[max-1]->utxofinish <= 1) ) max--; - //coin->spendvectorsaved = 0; + if ( coin->chain->zcash != 0 ) + { + coin->spendvectorsaved = 0; + for (i=0; ibundlescount-1; i++) + { + if ( (bp= coin->bundles[i]) == 0 ) + continue; + if ( (retval= iguana_spendvectors(myinfo,coin,bp,&bp->ramchain,0,bp->n,convertflag,0)) >= 0 ) //bp->utxofinish > 1 || + { + if ( retval > 0 ) + { + numXspends = iguana_Xspendmap(coin,&bp->ramchain,bp); + printf("GENERATED UTXO.%d for ht.%d duration %d seconds numX.%d\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo,numXspends); + } + bp->utxofinish = (uint32_t)time(NULL); + } + } + } + coin->spendvectorsaved = (uint32_t)time(NULL); + //if ( coin->chain->zcash != 0 ) + // iguana_utxogen(myinfo,coin,0,1); if ( iguana_balancefinished(coin) < max && iguana_spendvectorsaves(coin) == 0 ) // { if ( coin->origbalanceswritten <= 1 ) @@ -462,6 +485,7 @@ void iguana_update_balances(struct supernet_info *myinfo,struct iguana_info *coi sprintf(fname,"%s/%s/accounts/lastspends.%d",GLOBAL_DBDIR,coin->symbol,bp->bundleheight); OS_removefile(fname,0); iguana_volatilesalloc(coin,&bp->ramchain,0);//i < hdrsi); + //iguana_Xspendmap(coin,&bp->ramchain,bp); } printf("accounts files purged\n"); sleep(3); @@ -511,11 +535,14 @@ int32_t iguana_utxogen(struct supernet_info *myinfo,struct iguana_info *coin,int max = coin->bundlescount; if ( coin->bundles[max-1] == coin->current || coin->bundles[max-1] == 0 || (coin->bundles[max-1] != 0 && coin->bundles[max-1]->utxofinish <= 1) ) max--; - printf("helperid.%d start %s utxogen bundlescount.%d max.%d\n",helperid,coin->symbol,coin->bundlescount,max); + //printf("helperid.%d start %s utxogen bundlescount.%d max.%d\n",helperid,coin->symbol,coin->bundlescount,max); if ( helperid < incr ) { for (hdrsi=helperid; hdrsibundles[hdrsi]->utxofinish = 1; num += iguana_helperA(myinfo,coin,helperid,coin->bundles[hdrsi],convertflag); + } } while ( (n= iguana_utxofinished(coin)) < max ) { @@ -708,7 +735,7 @@ void iguana_helper(void *arg) { if ( coin->firstRTheight == 0 ) { - if ( coin->spendvectorsaved == 1 ) + if ( coin->spendvectorsaved == 1 )//&& coin->chain->zcash == 0 ) iguana_utxogen(myinfo,coin,helperid,1); else if ( coin->spendvectorsaved > 1 && (coin->spendvalidated & (1 << helperid)) == 0 ) { @@ -737,18 +764,22 @@ void iguana_helper(void *arg) if ( i == j ) { iguana_bundlevalidate(myinfo,coin,bp,0); - if ( bp->validated > 1 ) + if ( bp->validated > 1 )//&& coin->chain->zcash == 0 ) { for (i=0; ibundles[i] == 0 || coin->bundles[i]->utxofinish <= 1 ) break; retval = 1; - if ( bp->utxofinish == 0 || (retval= iguana_spendvectors(myinfo,coin,bp,&bp->ramchain,0,bp->n,1,0)) >= 0 ) + if ( bp->utxofinish == 0 ) { - if ( retval > 0 ) + bp->startutxo = (uint32_t)time(NULL); + if ( (retval= iguana_spendvectors(myinfo,coin,bp,&bp->ramchain,0,bp->n,1,0)) >= 0 ) { - printf("GENERATED UTXO.%d for ht.%d duration %d seconds\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo); - bp->utxofinish = (uint32_t)time(NULL); + if ( retval > 0 ) + { + printf(" GENERATED UTXO.%d for ht.%d duration %d seconds\n",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - bp->startutxo); + bp->utxofinish = (uint32_t)time(NULL); + } } } } @@ -766,7 +797,7 @@ void iguana_helper(void *arg) n = queue_size(&bundlesQ); for (iter=0; itercoin; @@ -808,7 +839,7 @@ void iguana_helper(void *arg) void iguana_callcoinstart(struct supernet_info *myinfo,struct iguana_info *coin) { - struct iguana_bundle *bp; int32_t bundlei; bits256 zero; char dirname[512],*symbol; + struct iguana_bundle *bp; struct iguana_peer *addr; int32_t bundlei; bits256 zero; char dirname[512],*symbol; iguana_rwiAddrind(coin,0,0,0); //for (i=0; ichain); i++) // printf("%02x",((uint8_t *)coin->chain)[i]); @@ -838,6 +869,10 @@ void iguana_callcoinstart(struct supernet_info *myinfo,struct iguana_info *coin) memset(zero.bytes,0,sizeof(zero)); if ( (bp= iguana_bundlecreate(coin,&bundlei,0,*(bits256 *)coin->chain->genesis_hashdata,zero,1)) != 0 ) bp->bundleheight = 0; + addr = &coin->peers->active[IGUANA_MAXPEERS-2]; + iguana_initpeer(coin,addr,(uint32_t)calc_ipbits(coin->seedipaddr)); + printf("SEED_IPADDR initpeer.(%s)\n",addr->ipaddr); + iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD); } void iguana_coinloop(void *arg) @@ -1030,6 +1065,7 @@ void iguana_nameset(char name[64],char *symbol,cJSON *json) struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers,int64_t maxrecvcache,uint64_t services,int32_t initialheight,int32_t maphash,int32_t minconfirms,int32_t maxrequests,int32_t maxbundles,cJSON *json,int32_t virtcoin) { struct iguana_chain *iguana_createchain(cJSON *json); + struct supernet_info *myinfo = SuperNET_MYINFO(0); struct iguana_info *coin; int32_t j,m,mult,maxval,mapflags; char name[64]; cJSON *peers; mapflags = IGUANA_MAPRECVDATA | maphash*IGUANA_MAPTXIDITEMS | maphash*IGUANA_MAPPKITEMS | maphash*IGUANA_MAPBLOCKITEMS | maphash*IGUANA_MAPPEERITEMS; iguana_nameset(name,symbol,json); @@ -1053,6 +1089,8 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers, else coin->PREFETCHLAG = -1; if ( (coin->MAXSTUCKTIME= juint(json,"maxstuck")) == 0 ) coin->MAXSTUCKTIME = _IGUANA_MAXSTUCKTIME; + if ( myinfo != 0 && myinfo->seedipaddr[0] != 0 ) + safecopy(coin->seedipaddr,myinfo->seedipaddr,sizeof(coin->seedipaddr)); if ( (coin->startPEND= juint(json,"startpend")) == 0 ) { if ( strcmp("BTCD",coin->symbol) == 0 ) @@ -1090,7 +1128,7 @@ struct iguana_info *iguana_setcoin(char *symbol,void *launched,int32_t maxpeers, if ( coin->MAXMEM == 0 ) coin->MAXMEM = IGUANA_DEFAULTRAM; coin->MAXMEM *= (1024L * 1024 * 1024); - coin->enableCACHE = (strcmp("BTCD",coin->symbol) == 0); + coin->enableCACHE = 0;//(strcmp("BTC",coin->symbol) != 0); if ( jobj(json,"cache") != 0 ) coin->enableCACHE = juint(json,"cache"); if ( (coin->polltimeout= juint(json,"poll")) <= 0 ) diff --git a/iguana/iguana777.h b/iguana/iguana777.h index 826c58077..77d5556a0 100755 --- a/iguana/iguana777.h +++ b/iguana/iguana777.h @@ -103,6 +103,7 @@ struct supernet_info void *PAXDATA; struct liquidity_info linfos[64]; struct komodo_notaries NOTARY; + char seedipaddr[64]; // compatibility bits256 pangea_category,instantdex_category; uint8_t logs[256],exps[510]; diff --git a/iguana/iguana_accept.c b/iguana/iguana_accept.c index b4e18435b..835e68828 100755 --- a/iguana/iguana_accept.c +++ b/iguana/iguana_accept.c @@ -134,7 +134,7 @@ void iguana_acceptloop(void *args) ptr->sock = sock; ptr->port = cli_addr.sin_port; printf("queue PENDING ACCEPTS\n"); - queue_enqueue("acceptQ",&coin->acceptQ,&ptr->DL,0); + queue_enqueue("acceptQ",&coin->acceptQ,&ptr->DL); } else { @@ -152,7 +152,7 @@ void iguana_acceptloop(void *args) int32_t iguana_pendingaccept(struct iguana_info *coin) { struct iguana_accept *ptr; char ipaddr[64]; struct iguana_peer *addr; - if ( (ptr= queue_dequeue(&coin->acceptQ,0)) != 0 ) + if ( (ptr= queue_dequeue(&coin->acceptQ)) != 0 ) { if ( (addr= iguana_peerslot(coin,ptr->ipbits,0)) != 0 ) { @@ -163,7 +163,7 @@ int32_t iguana_pendingaccept(struct iguana_info *coin) iguana_launch(coin,"accept",iguana_dedicatedglue,addr,IGUANA_CONNTHREAD); myfree(ptr,sizeof(*ptr)); return(1); - } else queue_enqueue("requeue_acceptQ",&coin->acceptQ,&ptr->DL,0); + } else queue_enqueue("requeue_acceptQ",&coin->acceptQ,&ptr->DL); } return(0); } @@ -185,13 +185,13 @@ void iguana_msgrequestQ(struct iguana_info *coin,struct iguana_peer *addr,int32_ msg->addr = addr; msg->hash2 = hash2; msg->type = type; - queue_enqueue("msgrequest",&coin->msgrequestQ,&msg->DL,0); + queue_enqueue("msgrequest",&coin->msgrequestQ,&msg->DL); } int32_t iguana_process_msgrequestQ(struct supernet_info *myinfo,struct iguana_info *coin) { struct iguana_peermsgrequest *msg; int32_t height,len,flag = 0; bits256 checktxid; struct iguana_txid *tx,T; struct iguana_peer *addr; - if ( (msg= queue_dequeue(&coin->msgrequestQ,0)) != 0 ) + if ( (msg= queue_dequeue(&coin->msgrequestQ)) != 0 ) { flag = 1; if ( msg->addr != 0 ) diff --git a/iguana/iguana_blocks.c b/iguana/iguana_blocks.c index b25f4bca9..6a5974613 100755 --- a/iguana/iguana_blocks.c +++ b/iguana/iguana_blocks.c @@ -203,14 +203,8 @@ void _iguana_blocklink(struct iguana_info *coin,struct iguana_block *prev,struct struct iguana_block *iguana_blockhashset(char *debugstr,struct iguana_info *coin,int32_t height,bits256 hash2,int32_t createflag) { struct iguana_block *block,*prev; int32_t size; - /*while ( coin->blockdepth > 0 ) - { - usleep(100000); - if ( coin->blockdepth > 0 ) - printf("A %s >>>>>>>>>> OK only if rare %s blockhashset.%d depth.%d\n",coin->symbol,debugstr,height,coin->blockdepth); - //fprintf(stderr,">>>>>>>>>> OK only if rare %s blockhashset.%d depth.%d\n",debugstr,height,depth); - //printf("%d\n",1/(1 - depth/depth)); - }*/ +#ifndef __APPLE__ +#endif portable_mutex_lock(&coin->blocks_mutex); coin->blockdepth++; HASH_FIND(hh,coin->blocks.hash,&hash2,sizeof(hash2),block); @@ -218,20 +212,11 @@ struct iguana_block *iguana_blockhashset(char *debugstr,struct iguana_info *coin { if ( coin->blockdepth > 0 ) coin->blockdepth--; - /*while ( coin->blockdepth > 0 ) - { - usleep(100000); - if ( coin->blockdepth > 0 ) - printf("B %s >>>>>>>>>> OK only if rare %s match blockhashset.%d depth.%d\n",coin->symbol,debugstr,height,coin->blockdepth); - //fprintf(stderr,">>>>>>>>>> OK only if rare%s match blockhashset.%d depth.%d\n",debugstr,height,depth); - //printf("%d\n",1/(1 - depth/depth)); - }*/ portable_mutex_unlock(&coin->blocks_mutex); return(block); } if ( createflag > 0 ) { - //portable_mutex_lock(&coin->blocks_mutex); size = (int32_t)((coin->chain->zcash != 0) ? sizeof(struct iguana_zblock) : sizeof(struct iguana_block)); block = calloc(1,size); block->RO.hash2 = hash2; @@ -257,7 +242,6 @@ struct iguana_block *iguana_blockhashset(char *debugstr,struct iguana_info *coin if ( tmp != block ) printf("%s height.%d search error %p != %p\n",str,height,block,tmp); } - //portable_mutex_unlock(&coin->blocks_mutex); } if ( coin->blockdepth > 0 ) coin->blockdepth--; @@ -353,7 +337,7 @@ void iguana_blockzcopy(uint8_t zcash,struct iguana_block *dest,struct iguana_blo int32_t iguana_blockvalidate(struct supernet_info *myinfo,struct iguana_info *coin,int32_t *validp,struct iguana_block *block,int32_t dispflag) { bits256 hash2; uint8_t serialized[sizeof(struct iguana_msgblock) + 4096]; - if ( coin->chain->debug != 0 ) + if ( coin->chain->debug != 0 || coin->chain->zcash != 0 ) { *validp = 1; return(0); diff --git a/iguana/iguana_bundles.c b/iguana/iguana_bundles.c index 1dd027813..4f3486559 100755 --- a/iguana/iguana_bundles.c +++ b/iguana/iguana_bundles.c @@ -685,7 +685,7 @@ int32_t iguana_bundleissuemissing(struct supernet_info *myinfo,struct iguana_inf req->bp = bp; req->height = bp->bundleheight + i; req->bundlei = i; - queue_enqueue("missing",&coin->priorityQ,&req->DL,0); + queue_enqueue("missing",&coin->priorityQ,&req->DL); bp->issued[i] = 1; n++; if ( 0 && bp == coin->current ) @@ -749,7 +749,7 @@ int32_t iguana_blast(struct iguana_info *coin,struct iguana_peer *addr) req->bp = bp; req->height = bp->bundleheight + i; req->bundlei = i; - queue_enqueue("blast",&coin->priorityQ,&req->DL,0); + queue_enqueue("blast",&coin->priorityQ,&req->DL); } } if ( n > m ) @@ -881,7 +881,7 @@ int32_t iguana_bundlehdr(struct supernet_info *myinfo,struct iguana_info *coin,s if ( time(NULL) > bp->hdrtime+dist && (bp == coin->current || bp->hdrsi >= coin->bundlescount-2 || (strcmp("BTC",coin->symbol) != 0 && bp->numhashes < bp->n && (bp->speculative == 0 || bp->hdrsi >= coin->longestchain/bp->n))) ) { bp->hdrtime = (uint32_t)time(NULL); - queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1); + queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0]))); } if ( time(NULL) > bp->hdrtime+dist && strcmp("BTC",coin->symbol) != 0 && (bp == coin->current || bp->hdrsi == coin->bundlescount-1) && bits256_nonz(bp->nextbundlehash2) == 0 ) { @@ -892,7 +892,7 @@ int32_t iguana_bundlehdr(struct supernet_info *myinfo,struct iguana_info *coin,s if ( GETBIT(bp->haveblock,i) == 0 ) bp->issued[i] = 0; bp->hdrtime = (uint32_t)time(NULL); - queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1); + queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0]))); } iguana_bundleissuemissing(myinfo,coin,bp,3,3.); /*if ( bp == coin->current ) @@ -1035,16 +1035,16 @@ int64_t iguana_bundlecalcs(struct supernet_info *myinfo,struct iguana_info *coin int32_t iguana_bundlefinalize(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_bundle *bp,struct OS_memspace *mem,struct OS_memspace *memB) { - int32_t i; struct iguana_bundle *tmpbp; struct iguana_blockreq *breq; + int32_t i; struct iguana_bundle *tmpbp; //struct iguana_blockreq *breq; if ( coin->firstRTheight == 0 && iguana_bundleready(myinfo,coin,bp,0) == bp->n ) { printf(">>>>>>>>>>>>>> EMIT.[%3d] %s | 1st.%-3d h.%-3d c.%-3d s.[%3d] maxB.%d NET.(h%d b%d) %u:%02u\n",bp->hdrsi,coin->symbol,coin->current!=0?coin->current->hdrsi:-1,coin->current!=0?coin->current->numhashes:-1,coin->current!=0?coin->current->numcached:-1,coin->current!=0?coin->current->numsaved:-1,coin->MAXBUNDLES,HDRnet,queue_size(&coin->priorityQ),(uint32_t)(time(NULL)-coin->startutc)/60,(uint32_t)(time(NULL)-coin->startutc)%60); - if ( queue_size(&coin->priorityQ) > 10000 ) + /*if ( queue_size(&coin->priorityQ) > 10000 ) { - while ( (breq= queue_dequeue(&coin->priorityQ,0)) != 0 ) + while ( (breq= queue_dequeue(&coin->priorityQ)) != 0 ) myfree(breq,sizeof(*breq)); //printf("cleared priorityQ\n"); - } + }*/ if ( bp->emitfinish != 0 ) { printf("already EMIT for bundle.%d\n",bp->hdrsi); @@ -1486,9 +1486,9 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch coin->stuckiters = (int32_t)(lag/coin->MAXSTUCKTIME); if ( coin->stuckiters > 2 ) { - while ( (breq= queue_dequeue(&coin->blocksQ,0)) != 0 ) + while ( (breq= queue_dequeue(&coin->blocksQ)) != 0 ) myfree(breq,sizeof(*breq)); - while ( (breq= queue_dequeue(&coin->priorityQ,0)) != 0 ) + while ( (breq= queue_dequeue(&coin->priorityQ)) != 0 ) myfree(breq,sizeof(*breq)); for (i=0; in; i++) { @@ -1560,11 +1560,11 @@ void iguana_bundlestats(struct supernet_info *myinfo,struct iguana_info *coin,ch iguana_setmaxbundles(coin); strcpy(coin->statusstr,str); coin->estsize = estsize; - if ( queue_size(&coin->priorityQ) > 10000 ) + /*if ( queue_size(&coin->priorityQ) > 10000 ) { - while ( (breq= queue_dequeue(&coin->priorityQ,0)) != 0 ) + while ( (breq= queue_dequeue(&coin->priorityQ)) != 0 ) myfree(breq,sizeof(*breq)); //printf("cleared priorityQ\n"); - } + }*/ } diff --git a/iguana/iguana_chains.c b/iguana/iguana_chains.c index 49b298b8e..230aa9ff6 100755 --- a/iguana/iguana_chains.c +++ b/iguana/iguana_chains.c @@ -321,7 +321,12 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c if ( juint(argjson,"p2p") != 0 ) chain->portp2p = juint(argjson,"p2p"); else chain->portp2p = juint(argjson,"portp2p"); - if ( (chain->rpcport= juint(argjson,"rpc")) == 0 && strcmp(chain->symbol,"RELAY") != 0 ) + if ( jstr(argjson,"rpchost") != 0 ) + safecopy(chain->serverport,jstr(argjson,"rpchost"),sizeof(chain->serverport)); + if ( jstr(argjson,"userpass") != 0 ) + safecopy(chain->userpass,jstr(argjson,"userpass"),sizeof(chain->userpass)); + chain->rpcport = juint(argjson,"rpcport"); + if ( chain->rpcport == 0 && (chain->rpcport= juint(argjson,"rpc")) == 0 && strcmp(chain->symbol,"RELAY") != 0 ) { if ( chain->portp2p != 0 ) chain->rpcport = chain->portp2p-1; @@ -340,6 +345,8 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c else if ( strcmp("BTCD",chain->symbol) == 0 ) chain->rpcport = 14632; } + if ( chain->serverport[0] == 0 && (port= extract_userpass(chain->serverport,chain->userpass,chain->symbol,chain->userhome,path,conf)) != 0 ) + chain->rpcport = port; chain->zcash = juint(argjson,"zcash"); chain->debug = juint(argjson,"debug"); chain->fixit = juint(argjson,"fixit"); @@ -359,8 +366,6 @@ void iguana_chainparms(struct supernet_info *myinfo,struct iguana_chain *chain,c chain->targetspacing = NTARGETSPACING; if ( (chain->targettimespan= jint(argjson,"targettimespan")) == 0 ) chain->targettimespan = NTARGETSPACING * 60; - if ( (port= extract_userpass(chain->serverport,chain->userpass,chain->symbol,chain->userhome,path,conf)) != 0 ) - chain->rpcport = port; if ( jobj(argjson,"halving") != 0 ) chain->halvingduration = juint(argjson,"halving"); else chain->halvingduration = 210000; @@ -500,7 +505,7 @@ void iguana_chaininit(struct supernet_info *myinfo,struct iguana_chain *chain,in chain->bundlesize = _IGUANA_BLOCKHASHES; } if ( chain->zcash != 0 ) - chain->bundlesize = 1000; + chain->bundlesize = 160; if ( strcmp(chain->symbol,"BTC") == 0 ) chain->bundlesize = 100; decode_hex((uint8_t *)chain->genesis_hashdata,32,(char *)chain->genesis_hash); diff --git a/iguana/iguana_exchanges.c b/iguana/iguana_exchanges.c index bf897c94f..dadfd3b59 100755 --- a/iguana/iguana_exchanges.c +++ b/iguana/iguana_exchanges.c @@ -754,7 +754,7 @@ void exchanges777_loop(void *ptr) PAX_idle(myinfo); flag = retval = 0; retstr = 0; - if ( (req= queue_dequeue(&exchange->requestQ,0)) != 0 ) + if ( (req= queue_dequeue(&exchange->requestQ)) != 0 ) { //printf("dequeued %s.%c\n",exchange->name,req->func); if ( req->dead == 0 ) @@ -782,7 +782,7 @@ void exchanges777_loop(void *ptr) // queue_enqueue("Xpending",&exchange->pendingQ,&req->DL,0), flag++; //else if ( retval == EXCHANGE777_REQUEUE ) - queue_enqueue("requeue",&exchange->requestQ,&req->DL,0); + queue_enqueue("requeue",&exchange->requestQ,&req->DL); else { printf("exchanges777_process: illegal retval.%d\n",retval); @@ -805,7 +805,7 @@ void exchanges777_loop(void *ptr) iguana_statemachineupdate(myinfo,exchange); //printf("InstantDEX call update\n"); }*/ - if ( (req= queue_dequeue(&exchange->pricesQ,0)) != 0 ) + if ( (req= queue_dequeue(&exchange->pricesQ)) != 0 ) { //printf("check %s pricesQ (%s %s)\n",exchange->name,req->base,req->rel); if ( req->dead == 0 ) @@ -824,7 +824,7 @@ void exchanges777_loop(void *ptr) //printf("%-10s %s/%s numbids.%d numasks.%d\n",exchange->name,req->base,req->rel,req->numbids,req->numasks); prices777_processprice(exchange,req->base,req->rel,req->bidasks,req->depth); } - queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL,0); + queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL); } else { @@ -843,12 +843,12 @@ struct exchange_request *exchanges777_baserelfind(struct exchange_info *exchange { struct exchange_request PAD,*req,*retreq=0; memset(&PAD,0,sizeof(PAD)); - queue_enqueue("pricesQ",&exchange->pricesQ,&PAD.DL,0); - while ( (req= queue_dequeue(&exchange->pricesQ,0)) != 0 && req != &PAD ) + queue_enqueue("pricesQ",&exchange->pricesQ,&PAD.DL); + while ( (req= queue_dequeue(&exchange->pricesQ)) != 0 && req != &PAD ) { if ( ((req->invert == 0 && strcmp(base,req->base) == 0 && strcmp(rel,req->rel) == 0) || (req->invert != 0 && strcmp(rel,req->base) == 0 && strcmp(base,req->rel) == 0)) && (func < 0 || req->func == func) ) retreq = req; - queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL,0); + queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL); } return(retreq); } @@ -875,7 +875,7 @@ char *exchanges777_submit(struct exchange_info *exchange,struct exchange_request maxseconds = EXCHANGES777_DEFAULT_TIMEOUT; retstrp = req->retstrp; //printf("submit to %p\n",&exchange->requestQ); - queue_enqueue("exchangeQ",&exchange->requestQ,&req->DL,0); + queue_enqueue("exchangeQ",&exchange->requestQ,&req->DL); for (i=0; ifunc = 'M'; //printf("Monitor.%s (%s %s) invert.%d\n",exchange->name,base,rel,req->invert); - queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL,0); + queue_enqueue("pricesQ",&exchange->pricesQ,&req->DL); return(clonestr("{\"result\":\"start monitoring\"}")); } } @@ -1009,7 +1009,7 @@ void iguana_gotquotesM(struct iguana_info *coin,struct iguana_peer *addr,bits256 //printf("got %d quotes from %s\n",n,addr->ipaddr); req = iguana_bundlereq(coin,addr,'Q',0,0); req->hashes = quotes, req->n = n; - queue_enqueue("recvQ",&exchange->recvQ,&req->DL,0); + queue_enqueue("recvQ",&exchange->recvQ,&req->DL); } struct exchange_info *exchange_create(char *exchangestr,cJSON *argjson) @@ -1124,7 +1124,7 @@ void exchanges777_init(struct supernet_info *myinfo,cJSON *exchanges,int32_t sle { if ( strcmp(Exchange_funcs[i]->name,"PAX") == 0 || strcmp(Exchange_funcs[i]->name,"truefx") == 0 || strcmp(Exchange_funcs[i]->name,"fxcm") == 0 || strcmp(Exchange_funcs[i]->name,"instaforex") == 0 ) { - exchange->pollgap = 10; + exchange->pollgap = 60; continue; } if ( ((exchange= exchanges777_find(Exchange_funcs[i]->name)) == 0 && (exchange= exchange_create(Exchange_funcs[i]->name,0)) != 0) || (exchange= exchanges777_info(Exchange_funcs[i]->name,sleepflag,argjson,0)) != 0 ) diff --git a/iguana/iguana_init.c b/iguana/iguana_init.c index 2c7abc699..8623626d6 100755 --- a/iguana/iguana_init.c +++ b/iguana/iguana_init.c @@ -17,12 +17,14 @@ void iguana_initQ(queue_t *Q,char *name) { - char *tst,*str = "need to init each Q when single threaded"; + struct stritem *tst,*item; memset(Q,0,sizeof(*Q)); + item = calloc(1,sizeof(*item)+100); + strcpy(item->str,"hello, world"); strcpy(Q->name,name); - queue_enqueue(name,Q,queueitem(str),1); - if ( (tst= queue_dequeue(Q,1)) != 0 ) - free_queueitem(tst); + queue_enqueue(name,Q,&item->DL); + if ( (tst= queue_dequeue(Q)) != 0 ) + free(tst); } void iguana_initQs(struct iguana_info *coin) @@ -151,7 +153,7 @@ bits256 iguana_genesis(struct supernet_info *myinfo,struct iguana_info *coin,str int32_t iguana_savehdrs(struct iguana_info *coin) { char fname[512],shastr[65],tmpfname[512],tmpfname2[512],str2[65],str[65],oldfname[512]; - bits256 sha256all; FILE *fp,*fp2; struct iguana_bundle *bp; int32_t hdrsi,n,retval = 0; + bits256 sha256all; FILE *fp=0,*fp2=0; struct iguana_bundle *bp; int32_t hdrsi,n,retval = 0; n = coin->blocks.hwmchain.height + 1; sprintf(tmpfname,"%s/%s/hdrs.txt",GLOBAL_TMPDIR,coin->symbol), OS_compatible_path(tmpfname); sprintf(tmpfname2,"%s/%s/hdrs.h",GLOBAL_TMPDIR,coin->symbol), OS_compatible_path(tmpfname); @@ -303,11 +305,11 @@ void iguana_parseline(struct supernet_info *myinfo,struct iguana_info *coin,int3 { if ( m < coin->MAXPEERS/2 ) { - if ( 0 && m == 0 ) + if ( 0 && m == 0 && coin->seedipaddr[0] != 0 ) { addr = &coin->peers->active[m++]; - iguana_initpeer(coin,addr,(uint32_t)calc_ipbits("127.0.0.1")); - //printf("call initpeer.(%s)\n",addr->ipaddr); + iguana_initpeer(coin,addr,(uint32_t)calc_ipbits(coin->seedipaddr)); + printf("SEED_IPADDR initpeer.(%s)\n",addr->ipaddr); iguana_launch(coin,"connection",iguana_startconnection,addr,IGUANA_CONNTHREAD); } #ifndef IGUANA_DISABLEPEERS @@ -470,7 +472,7 @@ void iguana_blockspurge(struct iguana_info *coin) void iguana_coinpurge(struct iguana_info *coin) { - int32_t i,saved; struct iguana_bundle *bp; char *hashstr; struct iguana_bundlereq *req; struct iguana_blockreq *breq; struct iguana_helper *ptr; + int32_t i,saved; struct iguana_bundle *bp; struct iguana_bundlereq *req; struct iguana_blockreq *breq; struct iguana_helper *ptr; struct stritem *hashitem; saved = coin->active, coin->active = 0; coin->started = 0; while ( coin->idletime == 0 && coin->emitbusy > 0 ) @@ -479,19 +481,19 @@ void iguana_coinpurge(struct iguana_info *coin) sleep(1); } coin->RTgenesis = 0; - while ( (ptr= queue_dequeue(&bundlesQ,0)) != 0 ) + while ( (ptr= queue_dequeue(&bundlesQ)) != 0 ) myfree(ptr,ptr->allocsize); if ( 1 ) { - while ( (hashstr= queue_dequeue(&coin->hdrsQ,1)) != 0 ) - free_queueitem(hashstr); - while ( (breq= queue_dequeue(&coin->blocksQ,0)) != 0 ) + while ( (hashitem= queue_dequeue(&coin->hdrsQ)) != 0 ) + free(hashitem); + while ( (breq= queue_dequeue(&coin->blocksQ)) != 0 ) myfree(breq,sizeof(*breq)); - while ( (breq= queue_dequeue(&coin->priorityQ,0)) != 0 ) + while ( (breq= queue_dequeue(&coin->priorityQ)) != 0 ) myfree(breq,sizeof(*breq)); - while ( (req= queue_dequeue(&coin->cacheQ,0)) != 0 ) + while ( (req= queue_dequeue(&coin->cacheQ)) != 0 ) myfree(req,req->allocsize); - while ( (req= queue_dequeue(&coin->recvQ,0)) != 0 ) + while ( (req= queue_dequeue(&coin->recvQ)) != 0 ) { if ( req->blocks != 0 ) myfree(req->blocks,sizeof(*req->blocks) * req->n), req->blocks = 0; diff --git a/iguana/iguana_json.c b/iguana/iguana_json.c index 59e93d0b8..431e1954f 100755 --- a/iguana/iguana_json.c +++ b/iguana/iguana_json.c @@ -594,12 +594,14 @@ ZERO_ARGS(bitcoinrpc,getdifficulty) STRING_ARG(iguana,addcoin,newcoin) { - char *symbol; int32_t retval; + char *symbol,*seedip; int32_t retval; if ( (symbol= newcoin) == 0 && coin != 0 ) symbol = coin->symbol; if ( symbol != 0 ) { - printf(">> addcoin.%s\n",symbol); + if ( (seedip= jstr(json,"seedipaddr")) != 0 ) + safecopy(myinfo->seedipaddr,seedip,sizeof(myinfo->seedipaddr)); + printf(">> addcoin.%s seedipaddr.%s\n",symbol,myinfo->seedipaddr); #ifdef __PNACL__ // if ( strcmp(symbol,"BTC") == 0 ) // return(clonestr("{\"result\":\"BTC for chrome app is not yet\"}")); diff --git a/iguana/iguana_msg.c b/iguana/iguana_msg.c index ba6c641e4..420de999d 100755 --- a/iguana/iguana_msg.c +++ b/iguana/iguana_msg.c @@ -101,7 +101,7 @@ int32_t iguana_rwzsolution(int32_t rwflag,uint8_t *serialized,uint8_t *solution, int32_t iguana_rwblockhdr(int32_t rwflag,uint8_t zcash,uint8_t *serialized,struct iguana_msgzblock *zmsg) { - uint32_t tmp; struct iguana_msgblock *msg = (void *)zmsg; int32_t len = 0; + struct iguana_msgzblockhdr zH; uint32_t tmp; struct iguana_msgblock *msg = (void *)zmsg; int32_t len = 0; if ( zcash == 0 ) { len += iguana_rwnum(rwflag,&serialized[len],sizeof(msg->H.version),&msg->H.version); @@ -113,29 +113,33 @@ int32_t iguana_rwblockhdr(int32_t rwflag,uint8_t zcash,uint8_t *serialized,struc } else { - len += iguana_rwnum(rwflag,&serialized[len],sizeof(zmsg->zH.version),&zmsg->zH.version); - len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zmsg->zH.prev_block),zmsg->zH.prev_block.bytes); - len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zmsg->zH.merkle_root),zmsg->zH.merkle_root.bytes); - len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zmsg->zH.reserved),zmsg->zH.reserved.bytes); - len += iguana_rwnum(rwflag,&serialized[len],sizeof(zmsg->zH.timestamp),&zmsg->zH.timestamp); - len += iguana_rwnum(rwflag,&serialized[len],sizeof(zmsg->zH.bits),&zmsg->zH.bits); - len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zmsg->zH.bignonce),zmsg->zH.bignonce.bytes); + if ( rwflag != 0 ) + zH = zmsg->zH; + len += iguana_rwnum(rwflag,&serialized[len],sizeof(zH.version),&zH.version); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zH.prev_block),zH.prev_block.bytes); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zH.merkle_root),zH.merkle_root.bytes); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zH.reserved),zH.reserved.bytes); + len += iguana_rwnum(rwflag,&serialized[len],sizeof(zH.timestamp),&zH.timestamp); + len += iguana_rwnum(rwflag,&serialized[len],sizeof(zH.bits),&zH.bits); + len += iguana_rwbignum(rwflag,&serialized[len],sizeof(zH.bignonce),zH.bignonce.bytes); //char str[65]; printf("prev.(%s) len.%d [%d %d %d]\n",bits256_str(str,msg->H.prev_block),len,serialized[len],serialized[len+1],serialized[len+2]); if ( rwflag != 0 ) - memcpy(&serialized[len],zmsg->zH.var_numelements,sizeof(zmsg->zH.var_numelements)); - else memcpy(zmsg->zH.var_numelements,&serialized[len],sizeof(zmsg->zH.var_numelements)); + memcpy(&serialized[len],zH.var_numelements,sizeof(zH.var_numelements)); + else memcpy(zH.var_numelements,&serialized[len],sizeof(zH.var_numelements)); //printf("numelements: (%02x %02x %02x)\n",serialized[len],serialized[len+1],serialized[len+2]); - len += sizeof(zmsg->zH.var_numelements); - if ( iguana_rwvarint32(0,zmsg->zH.var_numelements,(uint32_t *)&tmp) != sizeof(zmsg->zH.var_numelements) ) - printf("rw.%d unexpected varint size for zmsg.zH.numelements <- %d %d %d\n",rwflag,zmsg->zH.var_numelements[0],zmsg->zH.var_numelements[1],zmsg->zH.var_numelements[2]); + len += sizeof(zH.var_numelements); + if ( iguana_rwvarint32(0,zH.var_numelements,(uint32_t *)&tmp) != sizeof(zH.var_numelements) ) + printf("rw.%d unexpected varint size for zmsg.zH.numelements <- %d %d %d\n",rwflag,zH.var_numelements[0],zH.var_numelements[1],zH.var_numelements[2]); if ( tmp != ZCASH_SOLUTION_ELEMENTS ) { int32_t i; for (i=0; i<157; i++) printf("%02x",serialized[i]); - printf(" rw.%d unexpected ZCASH_SOLUTION_ELEMENTS, (%02x %02x %02x) expected %d tmp.%d len.%d\n",rwflag,zmsg->zH.var_numelements[0],zmsg->zH.var_numelements[1],zmsg->zH.var_numelements[2],ZCASH_SOLUTION_ELEMENTS,tmp,len); + printf(" rw.%d unexpected ZCASH_SOLUTION_ELEMENTS, (%02x %02x %02x) expected %d tmp.%d len.%d\n",rwflag,zH.var_numelements[0],zH.var_numelements[1],zH.var_numelements[2],ZCASH_SOLUTION_ELEMENTS,tmp,len); return(-1); } - len += iguana_rwzsolution(rwflag,&serialized[len],zmsg->zH.solution,tmp); + len += iguana_rwzsolution(rwflag,&serialized[len],zH.solution,tmp); + if ( rwflag == 0 ) + zmsg->zH = zH; } return(len); } @@ -972,7 +976,7 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s if ( (n= iguana_gentxarray(myinfo,coin,rawmem,&txdata,&len,data,recvlen)) == recvlen || n == recvlen-1 ) { len = n; - iguana_gotblockM(myinfo,coin,addr,&txdata,rawmem->ptr,H,data,recvlen,fromcache); + iguana_gotblockM(myinfo,coin,addr,&txdata,rawmem->ptr,H,data,recvlen,fromcache,0*coin->chain->zcash); } else { @@ -1019,7 +1023,7 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s { bits256 auxhash2,prevhash2; struct iguana_msgtx *tx; struct iguana_msgmerkle *coinbase_branch=0,*blockchain_branch=0; struct iguana_msgblock parentblock; if ( rawmem->totalsize == 0 ) - iguana_meminit(rawmem,"bighdrs",0,IGUANA_MAXPACKETSIZE * 2,0); + iguana_meminit(rawmem,"bighdrs",0,IGUANA_MAXPACKETSIZE * 3,0); memset(prevhash2.bytes,0,sizeof(prevhash2)); zblocks = mycalloc('z',1,(int32_t)(sizeof(struct iguana_zblock) * n)); //printf("%s got %d headers len.%d\n",coin->symbol,n,recvlen); @@ -1059,7 +1063,6 @@ int32_t iguana_msgparser(struct supernet_info *myinfo,struct iguana_info *coin,s free(blockchain_branch); if ( iguana_gotheadersM(coin,addr,zblocks,n) < 0 ) myfree(zblocks,(int32_t)(sizeof(struct iguana_zblock) * n)); - //myfree(blocks,sizeof(*blocks) * n); if ( len == recvlen && addr != 0 ) addr->msgcounts.headers++; } else printf("got unexpected n.%d for headers\n",n); diff --git a/iguana/iguana_notary.c b/iguana/iguana_notary.c index 7c6c0ff91..4e6a27b83 100755 --- a/iguana/iguana_notary.c +++ b/iguana/iguana_notary.c @@ -32,20 +32,20 @@ int32_t dpow_datahandler(struct supernet_info *myinfo,struct dpow_info *dp,uint3 void dpow_fifoupdate(struct supernet_info *myinfo,struct dpow_checkpoint *fifo,struct dpow_checkpoint tip) { - int32_t i,ind; struct dpow_checkpoint newfifo[DPOW_FIFOSIZE]; char str[65]; + int32_t i,ind; struct dpow_checkpoint newfifo[DPOW_FIFOSIZE]; memset(newfifo,0,sizeof(newfifo)); for (i=DPOW_FIFOSIZE-1; i>0; i--) { - if ( bits256_nonz(fifo[i-1].blockhash.hash) != 0 && (tip.blockhash.height - fifo[i-1].blockhash.height) != i ) + if ( 0 && bits256_nonz(fifo[i-1].blockhash.hash) != 0 && (tip.blockhash.height - fifo[i-1].blockhash.height) != i ) printf("(%d != %d) ",(tip.blockhash.height - fifo[i-1].blockhash.height),i); if ( (ind= (tip.blockhash.height - fifo[i-1].blockhash.height)) >= 0 && ind < DPOW_FIFOSIZE ) newfifo[ind] = fifo[i-1]; } newfifo[0] = tip; memcpy(fifo,newfifo,sizeof(newfifo)); - for (i=0; ilast,height,hash,timestamp,blocktime); checkpoint = dp->srcfifo[dp->srcconfirms]; - printf("%s srcupdate ht.%d destupdated.%u nonz.%d %s\n",dp->symbol,height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash)); + if ( strcmp("BTC",dp->dest) == 0 ) + { + freq = DPOW_CHECKPOINTFREQ; + minsigs = DPOW_MINSIGS; + } + else + { + freq = 1; + minsigs = 2; + } + printf("%s src ht.%d dest.%u nonz.%d %s\n",dp->symbol,height,dp->destupdated,bits256_nonz(checkpoint.blockhash.hash),bits256_str(str,dp->last.blockhash.hash)); dpow_fifoupdate(myinfo,dp->srcfifo,dp->last); - if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % DPOW_CHECKPOINTFREQ) == 0 ) + if ( bits256_nonz(checkpoint.blockhash.hash) != 0 && (checkpoint.blockhash.height % freq) == 0 ) { ptrs = calloc(1,sizeof(void *)*5 + sizeof(struct dpow_checkpoint)); ptrs[0] = (void *)myinfo; ptrs[1] = (void *)dp; - ptrs[2] = (void *)DPOW_MINSIGS; + ptrs[2] = (void *)(uint64_t)minsigs; ptrs[3] = (void *)DPOW_DURATION; ptrs[4] = 0; memcpy(&ptrs[5],&checkpoint,sizeof(checkpoint)); @@ -114,32 +124,31 @@ void dpow_destconfirm(struct supernet_info *myinfo,struct dpow_info *dp,struct d void dpow_destupdate(struct supernet_info *myinfo,struct dpow_info *dp,int32_t height,bits256 hash,uint32_t timestamp,uint32_t blocktime) { - printf("%s destupdate ht.%d\n",dp->dest,height); dp->destupdated = timestamp; dpow_checkpointset(myinfo,&dp->destchaintip,height,hash,timestamp,blocktime); dpow_approvedset(myinfo,dp,&dp->destchaintip,dp->desttx,dp->numdesttx); dpow_fifoupdate(myinfo,dp->destfifo,dp->destchaintip); if ( strcmp(dp->dest,"BTC") == 0 ) - dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_BTCCONFIRMS]); - else { - dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_KOMODOCONFIRMS * 2]); // todo: change to notarized KMD depth + printf("%s destupdate ht.%d\n",dp->dest,height); + dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_BTCCONFIRMS]); } + else dpow_destconfirm(myinfo,dp,&dp->destfifo[DPOW_KOMODOCONFIRMS*2]); // todo: change to notarized KMD depth } void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) { - int32_t height; char str[65]; uint32_t blocktime; bits256 blockhash; struct iguana_info *src,*dest; + int32_t height; uint32_t blocktime; bits256 blockhash; struct iguana_info *src,*dest; dpow_nanomsg_update(myinfo); src = iguana_coinfind(dp->symbol); dest = iguana_coinfind(dp->dest); - //printf("dp.%p dPoWupdate (%s -> %s)\n",dp,dp!=0?dp->symbol:"",dp!=0?dp->dest:""); + //fprintf(stderr,"dp.%p dPoWupdate (%s -> %s)\n",dp,dp!=0?dp->symbol:"",dp!=0?dp->dest:""); if ( src != 0 && dest != 0 ) { dp->numdesttx = sizeof(dp->desttx)/sizeof(*dp->desttx); if ( (height= dpow_getchaintip(myinfo,&blockhash,&blocktime,dp->desttx,&dp->numdesttx,dest)) != dp->destchaintip.blockhash.height && height >= 0 ) { - printf("%s %s height.%d vs last.%d\n",dp->dest,bits256_str(str,blockhash),height,dp->destchaintip.blockhash.height); + //printf("%s %s height.%d vs last.%d\n",dp->dest,bits256_str(str,blockhash),height,dp->destchaintip.blockhash.height); if ( height <= dp->destchaintip.blockhash.height ) { printf("iguana_dPoWupdate dest.%s reorg detected %d vs %d\n",dp->dest,height,dp->destchaintip.blockhash.height); @@ -150,7 +159,9 @@ void iguana_dPoWupdate(struct supernet_info *myinfo,struct dpow_info *dp) dp->numsrctx = sizeof(dp->srctx)/sizeof(*dp->srctx); if ( (height= dpow_getchaintip(myinfo,&blockhash,&blocktime,dp->srctx,&dp->numsrctx,src)) != dp->last.blockhash.height && height >= 0 ) { - printf("%s %s height.%d vs last.%d\n",dp->symbol,bits256_str(str,blockhash),height,dp->last.blockhash.height); + if ( strcmp(dp->dest,"KMD") == 0 ) + dp->SRCHEIGHT = dpow_issuer_iteration(dp,src,dp->SRCHEIGHT,&dp->SRCREALTIME); + //printf("%s %s height.%d vs last.%d\n",dp->symbol,bits256_str(str,blockhash),height,dp->last.blockhash.height); if ( height < dp->last.blockhash.height ) { printf("iguana_dPoWupdate src.%s reorg detected %d vs %d approved.%d notarized.%d\n",dp->symbol,height,dp->last.blockhash.height,dp->approved[0].height,dp->notarized[0].height); @@ -213,7 +224,12 @@ TWO_STRINGS(iguana,dpow,symbol,pubkey) if ( strcmp(symbol,myinfo->DPOWS[i].symbol) == 0 ) return(clonestr("{\"error\":\"cant dPoW same coin again\"}")); } - decode_hex(dp->minerkey33,33,pubkey); + char tmp[67]; + safecopy(tmp,pubkey,sizeof(tmp)); + decode_hex(dp->minerkey33,33,tmp); + for (i=0; i<33; i++) + printf("%02x",dp->minerkey33[i]); + printf(" DPOW with pubkey.(%s)\n",tmp); if ( bitcoin_pubkeylen(dp->minerkey33) <= 0 ) return(clonestr("{\"error\":\"illegal pubkey\"}")); strcpy(dp->symbol,symbol); @@ -236,6 +252,7 @@ TWO_STRINGS(iguana,dpow,symbol,pubkey) } myinfo->numdpows++; PAX_init(); + portable_mutex_init(&dp->mutex); return(clonestr("{\"result\":\"success\"}")); } @@ -267,6 +284,31 @@ TWO_STRINGS(komodo,passthru,function,hex) else return(clonestr("{\"error\":\"KMD not active, start in bitcoind mode\"}")); } +THREE_STRINGS(iguana,passthru,asset,function,hex) +{ + if ( asset != 0 && (coin= iguana_coinfind(asset)) != 0 ) + return(dpow_passthru(coin,function,hex)); + else return(clonestr("{\"error\":\"assetchain not active, start in bitcoind mode\"}")); +} + +STRING_ARG(dpow,pending,fiat) +{ + struct dpow_info *dp; char base[64]; int32_t i; + if ( fiat != 0 && fiat[0] != 0 ) + { + for (i=0; fiat[i]!=0; i++) + base[i] = toupper(fiat[i]); + base[i] = 0; + for (i=0; inumdpows; i++) + { + dp = &myinfo->DPOWS[i]; + if ( strcmp(dp->symbol,base) == 0 ) + return(jprint(dpow_withdraws_pending(dp),1)); + } + } + return(clonestr("[]")); +} + STRING_ARG(iguana,addnotary,ipaddr) { static int32_t didinit; diff --git a/iguana/iguana_peers.c b/iguana/iguana_peers.c index a1bcead84..e5f1e9f15 100755 --- a/iguana/iguana_peers.c +++ b/iguana/iguana_peers.c @@ -367,14 +367,14 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) } saddr.sin_family = AF_INET; saddr.sin_port = htons(port); -//#ifdef WIN32 -// saddr.sin_addr.s_addr = (uint32_t)calc_ipbits("127.0.0.1"); -//#else + //#ifdef WIN32 + // saddr.sin_addr.s_addr = (uint32_t)calc_ipbits("127.0.0.1"); + //#else memcpy(&saddr.sin_addr.s_addr,hostent->h_addr_list[0],hostent->h_length); expand_ipbits(checkipaddr,saddr.sin_addr.s_addr); if ( strcmp(ipaddr,checkipaddr) != 0 ) printf("bindflag.%d iguana_socket mismatch (%s) -> (%s)?\n",bindflag,checkipaddr,ipaddr); -//#endif + //#endif if ( (sock= socket(AF_INET,SOCK_STREAM,0)) < 0 ) { if ( errno != ETIMEDOUT ) @@ -434,7 +434,7 @@ int32_t iguana_socket(int32_t bindflag,char *hostname,uint16_t port) } sleep(13); //continue; - } + } if ( errno != ECONNRESET && errno != ENOTCONN && errno != ECONNREFUSED && errno != ETIMEDOUT && errno != EHOSTUNREACH ) { printf("%s(%s) port.%d failed: %s sock.%d. errno.%d\n",bindflag!=0?"bind":"connect",hostname,port,strerror(errno),sock,errno); @@ -505,30 +505,30 @@ int32_t iguana_send(struct iguana_info *coin,struct iguana_peer *addr,uint8_t *s #ifdef _WIN32 if ( (numsent= (int32_t)send(usock,serialized,remains,0)) < 0 ) #else - if ( (numsent= (int32_t)send(usock,serialized,remains,MSG_NOSIGNAL)) < 0 ) + if ( (numsent= (int32_t)send(usock,serialized,remains,MSG_NOSIGNAL)) < 0 ) #endif - { - if ( errno == EAGAIN || errno == EWOULDBLOCK ) { - //addr->persistent_peer = 1; - sleep(1); - continue; + if ( errno == EAGAIN || errno == EWOULDBLOCK ) + { + //addr->persistent_peer = 1; + sleep(1); + continue; + } + //if ( errno != EAGAIN && errno != EWOULDBLOCK ) + { + printf("%s: %s numsent.%d vs remains.%d len.%d errno.%d (%s) usock.%d\n",serialized+4,addr->ipaddr,numsent,remains,len,errno,strerror(errno),addr->usock); + printf("bad errno.%d %s zombify.%p\n",errno,strerror(errno),&addr->dead); + addr->dead = (uint32_t)time(NULL); + return(-errno); + } } - //if ( errno != EAGAIN && errno != EWOULDBLOCK ) + else if ( remains > 0 ) { - printf("%s: %s numsent.%d vs remains.%d len.%d errno.%d (%s) usock.%d\n",serialized+4,addr->ipaddr,numsent,remains,len,errno,strerror(errno),addr->usock); - printf("bad errno.%d %s zombify.%p\n",errno,strerror(errno),&addr->dead); - addr->dead = (uint32_t)time(NULL); - return(-errno); + remains -= numsent; + serialized += numsent; + if ( remains > 0 ) + printf("%s iguana sent.%d remains.%d of len.%d\n",addr->ipaddr,numsent,remains,len); } - } - else if ( remains > 0 ) - { - remains -= numsent; - serialized += numsent; - if ( remains > 0 ) - printf("%s iguana sent.%d remains.%d of len.%d\n",addr->ipaddr,numsent,remains,len); - } } addr->totalsent += len; if ( 0 && addr->basilisk != 0 ) @@ -562,7 +562,7 @@ int32_t iguana_queue_send(struct iguana_peer *addr,int32_t delay,uint8_t *serial memcpy(packet->serialized,serialized,datalen); if ( 0 && addr->supernet != 0 ) printf("%p queue send.(%s) %d to (%s)\n",packet,serialized+4,datalen,addr->ipaddr); - queue_enqueue("sendQ",&addr->sendQ,&packet->DL,0); + queue_enqueue("sendQ",&addr->sendQ,&packet->DL); return(datalen); } @@ -598,9 +598,9 @@ int32_t iguana_recv(char *ipaddr,int32_t usock,uint8_t *recvbuf,int32_t len) void iguana_peer_meminit(struct iguana_info *coin,struct iguana_peer *addr) { if ( addr->RAWMEM.ptr == 0 ) - iguana_meminit(&addr->RAWMEM,addr->ipaddr,0,IGUANA_MAXPACKETSIZE * 2,0); + iguana_meminit(&addr->RAWMEM,addr->ipaddr,0,IGUANA_MAXPACKETSIZE * 3,0); if ( addr->TXDATA.ptr == 0 ) - iguana_meminit(&addr->TXDATA,"txdata",0,IGUANA_MAXPACKETSIZE * 2,0); + iguana_meminit(&addr->TXDATA,"txdata",0,IGUANA_MAXPACKETSIZE * 3,0); if ( addr->HASHMEM.ptr == 0 ) iguana_meminit(&addr->HASHMEM,"HASHPTRS",0,256,0);//IGUANA_MAXPACKETSIZE*16,0); //printf("Init %s memory %p %p %p\n",addr->ipaddr,addr->RAWMEM.ptr,addr->TXDATA.ptr,addr->HASHMEM.ptr); @@ -691,7 +691,7 @@ void _iguana_processmsg(struct supernet_info *myinfo,struct iguana_info *coin,in } //addr->dead = 1; } - // printf("%s recv error on hdr errno.%d (%s) -> zombify\n",addr->ipaddr,-recvlen,strerror(-recvlen)); + // printf("%s recv error on hdr errno.%d (%s) -> zombify\n",addr->ipaddr,-recvlen,strerror(-recvlen)); #ifndef IGUANA_DEDICATED_THREADS addr->dead = 1; #endif @@ -892,10 +892,10 @@ void *iguana_iAddriterator(struct iguana_info *coin,struct iguana_iAddr *iA,stru //else printf("connector null iA\n"); return(0); } - + uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr) { - char checkaddr[64],_ipaddr[64]; uint64_t ipbits; uint32_t now = (uint32_t)time(NULL); int32_t i,n; struct iguana_iAddr *iA; struct iguana_peer *addr; + char checkaddr[64],_ipaddr[64]; uint64_t ipbits; uint32_t now = (uint32_t)time(NULL); int32_t i,n; struct iguana_iAddr *iA; struct iguana_peer *addr; struct stritem *sitem; if ( coin->virtualchain != 0 || coin->peers == 0 ) return(0); if ( ipaddr != 0 && ipaddr[0] != 0 && coin->peers != 0 ) @@ -909,15 +909,15 @@ uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr) return(0); } //printf("%s Q possible.(%s)\n",coin->symbol,ipaddr); - queue_enqueue("possibleQ",&coin->possibleQ,queueitem(ipaddr),1); + queue_enqueue("possibleQ",&coin->possibleQ,queueitem(ipaddr)); return((uint32_t)time(NULL)); } else if ( iguana_pendingaccept(coin) != 0 ) return((uint32_t)time(NULL)); - else if ( (ipaddr= queue_dequeue(&coin->possibleQ,1)) == 0 ) + else if ( (sitem= queue_dequeue(&coin->possibleQ)) == 0 ) return((uint32_t)time(NULL)); - safecopy(_ipaddr,ipaddr,sizeof(_ipaddr)); - free_queueitem(ipaddr); + safecopy(_ipaddr,sitem->str,sizeof(_ipaddr)); + free(sitem); ipaddr = _ipaddr; #ifdef IGUANA_DISABLEPEERS if ( strcmp(ipaddr,"127.0.0.1") != 0 ) @@ -927,12 +927,12 @@ uint32_t iguana_possible_peer(struct iguana_info *coin,char *ipaddr) if ( (addr= iguana_peerslot(coin,(uint32_t)ipbits,0)) == 0 ) return((uint32_t)time(NULL)); /*for (i=n=0; ipeers->active[i].ipaddr) == 0 ) - return((uint32_t)time(NULL)); - else if ( coin->peers->active[i].ipaddr[0] != 0 ) - n++; - }*/ + { + if ( strcmp(ipaddr,coin->peers->active[i].ipaddr) == 0 ) + return((uint32_t)time(NULL)); + else if ( coin->peers->active[i].ipaddr[0] != 0 ) + n++; + }*/ n = coin->peers->numranked; if ( n >= coin->MAXPEERS-(coin->MAXPEERS>>3)-1 || coin->peers->numranked >= coin->MAXPEERS ) return((uint32_t)time(NULL)); @@ -985,7 +985,7 @@ void iguana_processmsg(void *ptr) int32_t iguana_pollsendQ(struct iguana_info *coin,struct iguana_peer *addr) { struct iguana_packet *packet; - if ( (packet= queue_dequeue(&addr->sendQ,0)) != 0 ) + if ( (packet= queue_dequeue(&addr->sendQ)) != 0 ) { if ( 0 && (addr->supernet != 0 || strcmp((char *)&packet->serialized[4],"SuperNET") == 0) ) printf("%s: send.(%s).%d usock.%d dead.%u ready.%u supernet.%d\n",addr->ipaddr,packet->serialized+4,packet->datalen,addr->usock,addr->dead,addr->ready,addr->supernet); @@ -1003,7 +1003,7 @@ int32_t iguana_pollsendQ(struct iguana_info *coin,struct iguana_peer *addr) else { //printf("embargo.x %llu %f\n",(long long)packet->embargo.x,tai_diff(packet->embargo,tai_now())); - queue_enqueue("embargo",&addr->sendQ,&packet->DL,0); + queue_enqueue("embargo",&addr->sendQ,&packet->DL); } } return(0); @@ -1144,6 +1144,7 @@ int32_t iguana_vinsfname(struct iguana_info *coin,int32_t roflag,char *fname,int if ( roflag != 0 ) sprintf(fname,"%s/ro/%s/purgeable/%04d.vins",coin->VALIDATEDIR,coin->symbol,slotid); else sprintf(fname,"%s/%s/%04d.vins",coin->VALIDATEDIR,coin->symbol,slotid); + OS_compatible_path(fname); return((int32_t)strlen(fname)); } @@ -1202,12 +1203,12 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin, iguana_memreset(mem[i]); } #endif - //addr->pubkey = GENESIS_PUBKEY; + //addr->pubkey = GENESIS_PUBKEY; ipbits = (uint32_t)addr->ipbits; vcalc_sha256(0,addr->iphash.bytes,(uint8_t *)&ipbits,sizeof(ipbits)); //char str[65]; printf("start dedicatedloop.%s addrind.%d %s\n",addr->ipaddr,addr->addrind,bits256_str(str,addr->iphash)); //addr->maxfilehash2 = IGUANA_MAXFILEITEMS; - bufsize = IGUANA_MAXPACKETSIZE; + bufsize = IGUANA_MAXPACKETSIZE * 2; if ( addr->blockspace == 0 ) addr->blockspace = mycalloc('r',1,bufsize + 8192); buf = mycalloc('r',1,bufsize); @@ -1226,7 +1227,7 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin, run = 0; while ( addr->usock >= 0 && addr->dead == 0 && coin->peers->shuttingdown == 0 ) { - if ( (req= queue_dequeue(&coin->cacheQ,0)) != 0 ) + if ( (req= queue_dequeue(&coin->cacheQ)) != 0 ) { if ( req->datalen != 0 ) { @@ -1292,10 +1293,10 @@ void iguana_dedicatedloop(struct supernet_info *myinfo,struct iguana_info *coin, if ( flag != 0 ) run = 0; /*else if ( 0 && addr->supernet != 0 && time(NULL) > lastping+SUPERNET_PINGGAP ) - { - iguana_send_supernet(addr,SUPERNET_GETPEERSTR,0); - lastping = (uint32_t)time(NULL); - }*/ + { + iguana_send_supernet(addr,SUPERNET_GETPEERSTR,0); + lastping = (uint32_t)time(NULL); + }*/ if ( addr->persistent_peer != 0 ) { if ( addr->usock < 0 || addr->dead != 0 ) diff --git a/iguana/iguana_ramchain.c b/iguana/iguana_ramchain.c index 16ed68bd5..39d2d741d 100755 --- a/iguana/iguana_ramchain.c +++ b/iguana/iguana_ramchain.c @@ -1030,10 +1030,13 @@ long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits return(-1); } OS_compatible_path(fname); -#ifdef __PNACL__ - //static portable_mutex_t mutex; - //portable_mutex_lock(&mutex); -#endif + /*static portable_mutex_t mutex; static int didinit; + if ( didinit == 0 ) + { + portable_mutex_init(&mutex); + didinit = 1; + } + portable_mutex_lock(&mutex);*/ if ( (fp= fopen(fname,"wb")) == 0 ) printf("iguana_ramchain_save: couldnt create.(%s) errno.%d\n",fname,errno); else if ( coin->peers != 0 ) @@ -1057,9 +1060,7 @@ long iguana_ramchain_save(struct iguana_info *coin,RAMCHAIN_FUNC,uint32_t ipbits fclose(fp); //sleep(3); } -#ifdef __PNACL__ //portable_mutex_unlock(&mutex); -#endif return(fpos); } @@ -1321,6 +1322,8 @@ int32_t iguana_ramchain_extras(struct supernet_info *myinfo,struct iguana_info * int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramchain,struct iguana_bundle *bp) { int32_t iter; bits256 sha256; char str[65],fname[1024]; void *ptr; long filesize; + if ( ramchain->Xspendinds != 0 ) + return(ramchain->numXspends); for (iter=0; iter<2; iter++) { sprintf(fname,"%s/%s%s/spends/%s.%d",GLOBAL_DBDIR,iter==0?"ro/":"",coin->symbol,bits256_str(str,bp->hashes[0]),bp->bundleheight); @@ -1341,10 +1344,10 @@ int32_t iguana_Xspendmap(struct iguana_info *coin,struct iguana_ramchain *ramcha printf("[%d] filesize %ld Xspendptr.%p %p num.%d\n",bp->hdrsi,filesize,ramchain->Xspendptr,ramchain->Xspendinds,ramchain->numXspends); bp->Xvalid = 1; } + //printf("mapped utxo vector[%d] from (%s)\n",ramchain->numXspends,fname); return(ramchain->numXspends); //int32_t i; for (i=0; inumXspends; i++) // printf("(%d u%d) ",ramchain->Xspendinds[i].hdrsi,ramchain->Xspendinds[i].ind); - //printf("mapped utxo vector[%d] from (%s)\n",ramchain->numXspends,fname); } else { @@ -1495,7 +1498,7 @@ struct iguana_ramchain *_iguana_ramchain_map(struct supernet_info *myinfo,struct return(0); } -struct iguana_ramchain *iguana_ramchain_map(struct supernet_info *myinfo,struct iguana_info *coin,char *fname,struct iguana_bundle *bp,int32_t numblocks,struct iguana_ramchain *ramchain,struct OS_memspace *hashmem,uint32_t ipbits,bits256 hash2,bits256 prevhash2,int32_t bundlei,long fpos,int32_t allocextras,int32_t expanded) +struct iguana_ramchain *iguana_ramchain_map(struct supernet_info *myinfo,struct iguana_info *coin,char *fname,struct iguana_bundle *bp,int32_t numblocks,struct iguana_ramchain *ramchain,struct OS_memspace *hashmem,uint32_t ipbits,bits256 hash2,bits256 prevhash2,int32_t bundlei,long fpos,int32_t allocextras,int32_t expanded,uint8_t zcash) { struct iguana_ramchain *retptr; #ifdef __PNACL__ @@ -1503,7 +1506,7 @@ struct iguana_ramchain *iguana_ramchain_map(struct supernet_info *myinfo,struct //portable_mutex_lock(&mutex); #endif ramchain->height = bp->bundleheight; - retptr = _iguana_ramchain_map(myinfo,coin,fname,bp,numblocks,ramchain,hashmem,ipbits,hash2,prevhash2,bundlei,fpos,allocextras,expanded,coin->chain->zcash); + retptr = _iguana_ramchain_map(myinfo,coin,fname,bp,numblocks,ramchain,hashmem,ipbits,hash2,prevhash2,bundlei,fpos,allocextras,expanded,zcash); #ifdef __PNACL__ //portable_mutex_unlock(&mutex); #endif @@ -1817,23 +1820,24 @@ int32_t iguana_ramchain_iterate(struct supernet_info *myinfo,struct iguana_info return(0); } -long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *origtxdata,struct iguana_msgtx *txarray,int32_t txn_count,uint8_t *data,int32_t recvlen,struct iguana_bundle *bp,struct iguana_block *block) +long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *origtxdata,struct iguana_msgtx *txarray,int32_t txn_count,uint8_t *data,int32_t recvlen,struct iguana_bundle *bp,struct iguana_block *block,uint8_t zcash) { int32_t verifyflag = 0; - RAMCHAIN_DECLARE; struct iguana_ramchain R,*mapchain,*ramchain = &addr->ramchain; struct iguana_msgtx *tx; char fname[1024]; uint8_t rmd160[20]; struct iguana_ramchaindata *rdata; int32_t i,j,fpos,pubkeysize,sigsize,subdir,firsti=1,err,flag,bundlei; uint32_t scriptspace,stackspace; struct iguana_blockRO RO; + RAMCHAIN_DECLARE; struct iguana_ramchain R,*mapchain,*ramchain = &addr->ramchain; struct iguana_msgtx *tx; char fname[1024]; uint8_t rmd160[20]; struct iguana_ramchaindata *rdata; int32_t i,j,fpos,pubkeysize,sigsize,hdrsi,subdir,firsti=1,err,flag,bundlei=-1; uint32_t scriptspace,stackspace; struct iguana_blockRO RO; if ( block == 0 || bp == 0 || addr == 0 || (block != 0 && (bundlei= block->bundlei) < 0) ) { - //printf("iguana_ramchain_data: null ptr %p %p %p\n",block,bp,addr); + //printf("iguana_ramchain_data: null ptr %p %p %p bundlei.%d\n",block,bp,addr,bundlei); return(-1); } #ifdef __PNACL__ //verifyflag = 1; #endif + iguana_peerfname(coin,&hdrsi,GLOBAL_TMPDIR,fname,0,origtxdata->zblock.RO.hash2,origtxdata->zblock.RO.prev_block,1,0); sigsize = pubkeysize = 0; scriptspace = 1;//iguana_scriptspaceraw(coin,&scriptsize,&sigsize,&pubkeysize,txarray,txn_count); for (i=0; idirty)/sizeof(*addr->dirty); i++) addr->dirty[i] = 0; - if ( iguana_ramchain_init(fname,ramchain,&addr->TXDATA,&addr->HASHMEM,1,txn_count,origtxdata->numunspents,origtxdata->numspends,0,0,(scriptspace+sigsize+pubkeysize)*1.1,0,1,coin->chain->zcash) == 0 ) + if ( iguana_ramchain_init(fname,ramchain,&addr->TXDATA,&addr->HASHMEM,1,txn_count,origtxdata->numunspents,origtxdata->numspends,0,0,(scriptspace+sigsize+pubkeysize)*1.1,0,1,zcash) == 0 ) { if ( block != 0 && block->fpipbits == 0 ) block->issued = block->RO.recvlen = 0, block->fpos = -1; @@ -1901,7 +1905,7 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin, rdata->prevhash2 = origtxdata->zblock.RO.prev_block; rdata->scriptspace = scriptspace = ramchain->H.scriptoffset; rdata->stackspace = stackspace = ramchain->H.stacksize; - iguana_ramchain_setsize(fname,ramchain,rdata,1,coin->chain->zcash); + iguana_ramchain_setsize(fname,ramchain,rdata,1,zcash); flag = 0; if ( ramchain->H.txidind != rdata->numtxids || ramchain->H.unspentind != rdata->numunspents || ramchain->H.spendind != rdata->numspends ) { @@ -1917,21 +1921,17 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin, { if ( (err= iguana_ramchain_verify(coin,ramchain)) == 0 ) { - iguana_blockzcopyRO(coin->chain->zcash,B,0,&RO,0); + *B = RO; rdata->scriptspace = ramchain->H.scriptoffset = scriptspace; rdata->stackspace = ramchain->H.stacksize = stackspace; - if ( (fpos= (int32_t)iguana_ramchain_save(coin,RAMCHAIN_ARG,(uint32_t)addr->ipbits,RO.hash2,RO.prev_block,bundlei,0,coin->chain->zcash)) >= 0 ) + if ( (fpos= (int32_t)iguana_ramchain_save(coin,RAMCHAIN_ARG,(uint32_t)addr->ipbits,RO.hash2,RO.prev_block,bundlei,0,zcash)) >= 0 ) { origtxdata->datalen = (int32_t)rdata->allocsize; //char str[65]; printf("saved.%s [%d:%d] fpos.%d datalen.%d\n",bits256_str(str,block->RO.hash2),bp->hdrsi,bundlei,fpos,origtxdata->datalen); ramchain->H.ROflag = 0; flag = 1; - if ( addr->dirty[0] != 0 && addr->voutsfp != 0 ) - fflush(addr->voutsfp); - if ( addr->dirty[1] != 0 && addr->vinsfp != 0 ) - fflush(addr->vinsfp); memset(&R,0,sizeof(R)); - if ( verifyflag != 0 && (mapchain= iguana_ramchain_map(myinfo,coin,fname,0,1,&R,0,(uint32_t)addr->ipbits,RO.hash2,RO.prev_block,bundlei,fpos,1,0)) == 0 ) + if ( verifyflag != 0 && (mapchain= iguana_ramchain_map(myinfo,coin,fname,0,1,&R,&addr->HASHMEM,(uint32_t)addr->ipbits,RO.hash2,RO.prev_block,bundlei,fpos,0,0,zcash)) == 0 ) { printf("delete unverified [%d:%d]\n",bp->hdrsi,bundlei); iguana_ramchain_free(coin,&R,1); @@ -1946,7 +1946,7 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin, } if ( block != 0 && fpos >= 0 ) block->fpos = fpos, block->fpipbits = (uint32_t)addr->ipbits; - } else printf("save error\n"); + } //else printf("save error\n"); } else { @@ -1955,6 +1955,13 @@ long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin, } } } + if ( addr != 0 ) + { + if ( addr->dirty[0] != 0 && addr->voutsfp != 0 ) + fflush(addr->voutsfp); + if ( addr->dirty[1] != 0 && addr->vinsfp != 0 ) + fflush(addr->vinsfp); + } if ( fpos < 0 && block != 0 ) iguana_blockunmark(coin,block,bp,bundlei,1); //fprintf(stderr,"finished with hdrsi.%d ht.%d scripts.%u:%u\n",bp->hdrsi,bp->bundleheight,ramchain->H.scriptoffset,rdata->scriptspace); @@ -2008,7 +2015,7 @@ void iguana_blockdelete(struct iguana_info *coin,bits256 hash2,int32_t i) void iguana_blockunmark(struct iguana_info *coin,struct iguana_block *block,struct iguana_bundle *bp,int32_t i,int32_t deletefile) { - void *ptr; int32_t recvlen,height = -1; + void *ptr; int32_t recvlen,height = -1; uint8_t zcash = 0; if ( 0 && bp != 0 ) printf("UNMARK.[%d:%d]\n",bp->hdrsi,i); if ( block != 0 ) @@ -2041,7 +2048,7 @@ void iguana_blockunmark(struct iguana_info *coin,struct iguana_block *block,stru { printf("reduce %s HWM height from %d to %d\n",coin->symbol,coin->blocks.hwmchain.height,height); if ( (block= iguana_blockfind("unmark",coin,iguana_blockhash(coin,height))) != 0 ) - iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,(struct iguana_block *)&coin->blocks.hwmchain,block); + iguana_blockcopy(zcash,coin->chain->auxpow,coin,(struct iguana_block *)&coin->blocks.hwmchain,block); } } @@ -2184,7 +2191,7 @@ void iguana_bundlemapfree(struct iguana_info *coin,struct OS_memspace *mem,struc int32_t iguana_ramchain_expandedsave(struct supernet_info *myinfo,struct iguana_info *coin,RAMCHAIN_FUNC,struct iguana_ramchain *newchain,struct OS_memspace *hashmem,int32_t cmpflag,struct iguana_bundle *bp) { - static const bits256 zero; + static const bits256 zero; uint8_t zcash = 0; bits256 firsthash2; int32_t err,bundlei,hdrsi,numblocks,firsti,height,retval= -1; struct iguana_ramchain checkR,*mapchain; char fname[1024]; struct iguana_block *block; uint32_t scriptspace,scriptoffset,stacksize; uint8_t *destoffset,*srcoffset; struct iguana_ramchaindata *rdata; if ( (rdata= ramchain->H.data) == 0 ) return(-1); @@ -2206,7 +2213,7 @@ int32_t iguana_ramchain_expandedsave(struct supernet_info *myinfo,struct iguana_ rdata->prevhash2 = block->RO.prev_block; rdata->scriptspace = scriptoffset; ramchain->H.stacksize = rdata->stackspace = stacksize; - iguana_ramchain_setsize(fname,ramchain,rdata,bp->n,coin->chain->zcash); + iguana_ramchain_setsize(fname,ramchain,rdata,bp->n,zcash); //printf("Apresave T.%d U.%d S.%d P.%d X.%d -> size.%ld firsti.%d scriptoffset.%d stacksize.%d\n",rdata->numtxids,rdata->numunspents,rdata->numspends,rdata->numpkinds,rdata->numexternaltxids,(long)rdata->allocsize,firsti,ramchain->H.scriptoffset,ramchain->H.stacksize); *newchain = *ramchain; //memcpy(ramchain->roU2,ramchain->U2,sizeof(*ramchain->U2) * rdata->numunspents); @@ -2230,7 +2237,7 @@ int32_t iguana_ramchain_expandedsave(struct supernet_info *myinfo,struct iguana_ ramchain->H.scriptoffset = scriptoffset; rdata->scriptspace = scriptoffset; ramchain->H.stacksize = rdata->stackspace = stacksize; - if ( iguana_ramchain_save(coin,RAMCHAIN_ARG,0,firsthash2,zero,0,bp,coin->chain->zcash) < 0 ) + if ( iguana_ramchain_save(coin,RAMCHAIN_ARG,0,firsthash2,zero,0,bp,zcash) < 0 ) { printf("ERROR saving ramchain hdrsi.%d, deleting and will regenerate\n",hdrsi); iguana_mempurge(hashmem); @@ -2245,7 +2252,7 @@ int32_t iguana_ramchain_expandedsave(struct supernet_info *myinfo,struct iguana_ bundlei = 0; if ( cmpflag == 0 ) iguana_memreset(hashmem); - if ( (mapchain= iguana_ramchain_map(myinfo,coin,fname,bp,numblocks,&checkR,cmpflag==0?hashmem:0,0,firsthash2,zero,bundlei,0,0,1)) != 0 ) + if ( (mapchain= iguana_ramchain_map(myinfo,coin,fname,bp,numblocks,&checkR,cmpflag==0?hashmem:0,0,firsthash2,zero,bundlei,0,0,1,zcash)) != 0 ) { iguana_ramchain_link(mapchain,firsthash2,hdrsi,height,0,numblocks,firsti,1); iguana_ramchain_extras(myinfo,coin,mapchain,hashmem,0); @@ -2277,13 +2284,13 @@ int32_t iguana_ramchain_expandedsave(struct supernet_info *myinfo,struct iguana_ struct iguana_ramchain *iguana_bundleload(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_ramchain *ramchain,struct iguana_bundle *bp,int32_t extraflag) { - static const bits256 zero; + static const bits256 zero; uint8_t zcash = 0; struct iguana_blockRO *B; struct iguana_txid *T; int32_t i,firsti = 1; char fname[512]; struct iguana_block *block,*prev,*prev2; struct iguana_ramchain *mapchain; struct iguana_ramchaindata *rdata; uint32_t firsttxidind; if ( bp->emitfinish > 1 ) return(ramchain); memset(ramchain,0,sizeof(*ramchain)); - if ( (mapchain= iguana_ramchain_map(myinfo,coin,fname,bp,bp->n,ramchain,0,0,bp->hashes[0],zero,0,0,extraflag,1)) != 0 ) + if ( (mapchain= iguana_ramchain_map(myinfo,coin,fname,bp,bp->n,ramchain,0,0,bp->hashes[0],zero,0,0,extraflag,1,zcash)) != 0 ) { iguana_ramchain_link(mapchain,bp->hashes[0],bp->hdrsi,bp->bundleheight,0,bp->n,firsti,1); //char str[65]; printf("%s bp.%d: T.%d U.%d S.%d P%d X.%d MAPPED %s %p\n",coin->symbol,bp->hdrsi,mapchain->H.data->numtxids,mapchain->H.data->numunspents,mapchain->H.data->numspends,mapchain->H.data->numpkinds,mapchain->H.data->numexternaltxids,mbstr(str,mapchain->H.data->allocsize),mapchain->H.data); @@ -2310,7 +2317,7 @@ struct iguana_ramchain *iguana_bundleload(struct supernet_info *myinfo,struct ig block->hdrsi = bp->hdrsi; block->bundlei = i; block->fpipbits = (uint32_t)calc_ipbits("127.0.0.1"); - iguana_blockzcopyRO(coin->chain->zcash,&block->RO,0,B,i); + iguana_blockzcopyRO(zcash,&block->RO,0,B,i); //printf("%x ",(int32_t)B[i].hash2.ulongs[3]); bp->blocks[i] = block; bp->hashes[i] = block->RO.hash2; @@ -2356,7 +2363,7 @@ struct iguana_ramchain *iguana_bundleload(struct supernet_info *myinfo,struct ig int64_t iguana_ramchainopen(struct supernet_info *myinfo,char *fname,struct iguana_info *coin,struct iguana_ramchain *ramchain,struct OS_memspace *mem,struct OS_memspace *hashmem,int32_t bundleheight,bits256 hash2) { - RAMCHAIN_DECLARE; RAMCHAIN_ZEROES; int32_t i,numblocks = coin->chain->bundlesize; uint32_t numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata=0; int64_t hashsize,allocsize; + RAMCHAIN_DECLARE; RAMCHAIN_ZEROES; uint8_t zcash = 0; int32_t i,numblocks = coin->chain->bundlesize; uint32_t numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace; struct iguana_bundle *bp; struct iguana_ramchaindata *rdata=0; int64_t hashsize,allocsize; //B = 0, Ux = 0, Sx = 0, P = 0, A = 0, X = 0, Kspace = TXbits = PKbits = 0, U = 0, S = 0, T = 0; mem->alignflag = sizeof(uint32_t); hashmem->alignflag = sizeof(uint32_t); @@ -2384,7 +2391,7 @@ int64_t iguana_ramchainopen(struct supernet_info *myinfo,char *fname,struct igua //#endif if ( mem->ptr == 0 ) { - while ( (allocsize= _iguana_rdata_action(fname,0,0,0,0,1,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace,0,0,0,0,0,RAMCHAIN_ARG,numblocks,coin->chain->zcash)) > 2*1024LL*1024L*1024L ) + while ( (allocsize= _iguana_rdata_action(fname,0,0,0,0,1,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace,0,0,0,0,0,RAMCHAIN_ARG,numblocks,zcash)) > 2*1024LL*1024L*1024L ) { numtxids *= .9; numunspents *= .9; @@ -2401,7 +2408,7 @@ int64_t iguana_ramchainopen(struct supernet_info *myinfo,char *fname,struct igua iguana_meminit(hashmem,coin->symbol,0,hashsize + 65536*3,0); printf("%s hash meminit %lld\n",coin->symbol,(long long)hashmem->totalsize); } - if ( iguana_ramchain_init(fname,ramchain,mem,hashmem,1,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace,1,numblocks,coin->chain->zcash) > 0 ) + if ( iguana_ramchain_init(fname,ramchain,mem,hashmem,1,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace,1,numblocks,zcash) > 0 ) { iguana_ramchain_link(ramchain,hash2,bundleheight/coin->chain->bundlesize,bundleheight,0,0,1,0); ramchain->expanded = 1; @@ -2417,7 +2424,7 @@ int64_t iguana_ramchainopen(struct supernet_info *myinfo,char *fname,struct igua int32_t iguana_mapchaininit(char *fname,struct iguana_info *coin,struct iguana_ramchain *mapchain,struct iguana_bundle *bp,int32_t bundlei,struct iguana_block *block,void *ptr,long filesize) { - int32_t firsti = 1; RAMCHAIN_DECLARE; + int32_t firsti = 1; RAMCHAIN_DECLARE; uint8_t zcash = 0; memset(mapchain,0,sizeof(*mapchain)); mapchain->fileptr = ptr; mapchain->filesize = filesize; @@ -2429,9 +2436,9 @@ int32_t iguana_mapchaininit(char *fname,struct iguana_info *coin,struct iguana_r return(-1); } _iguana_ramchain_setptrs(MAPCHAIN_PTRS,mapchain->H.data); - if ( block->fpos+mapchain->H.data->allocsize > filesize || iguana_ramchain_size(fname,MAPCHAIN_ARG,1,mapchain->H.data->scriptspace,coin->chain->zcash) != mapchain->H.data->allocsize ) + if ( block->fpos+mapchain->H.data->allocsize > filesize || iguana_ramchain_size(fname,MAPCHAIN_ARG,1,mapchain->H.data->scriptspace,zcash) != mapchain->H.data->allocsize ) { - printf("iguana_mapchaininit.%d ipbits.%x size mismatch %ld vs %ld vs filesize.%ld fpos.%ld bundlei.%d expanded.%d soff.%d\n",bp->bundleheight,block->fpipbits,(long)iguana_ramchain_size(fname,MAPCHAIN_ARG,1,mapchain->H.data->scriptspace,coin->chain->zcash),(long)mapchain->H.data->allocsize,(long)filesize,(long)block->fpos,bundlei,mapchain->expanded,mapchain->H.data->scriptspace); + printf("iguana_mapchaininit.%d ipbits.%x size mismatch %ld vs %ld vs filesize.%ld fpos.%ld bundlei.%d expanded.%d soff.%d\n",bp->bundleheight,block->fpipbits,(long)iguana_ramchain_size(fname,MAPCHAIN_ARG,1,mapchain->H.data->scriptspace,zcash),(long)mapchain->H.data->allocsize,(long)filesize,(long)block->fpos,bundlei,mapchain->expanded,mapchain->H.data->scriptspace); //getchar(); return(-1); } @@ -2449,7 +2456,7 @@ int32_t iguana_mapchaininit(char *fname,struct iguana_info *coin,struct iguana_r // helper threads: NUM_HELPERS int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coin,struct OS_memspace *mem,struct OS_memspace *memB,struct iguana_bundle *bp,uint32_t starttime) // helper thread { - static int depth; + static int depth; uint8_t zcash = 0; RAMCHAIN_DESTDECLARE; RAMCHAIN_DECLARE; RAMCHAIN_ZEROES; void **ptrs; long *filesizes; uint32_t *ipbits; char fname[1024]; struct iguana_ramchain *R,*mapchain,*dest,newchain; uint32_t fpipbits; bits256 prevhash2; @@ -2532,7 +2539,7 @@ int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coi numexternaltxids = numspends; //printf("E.%d depth.%d start bundle ramchain %d at %u started.%u lag.%d\n",coin->numemitted,depth,bp->bundleheight,now,starttime,now-starttime); depth++; - if ( iguana_ramchain_alloc(fname,coin,dest,mem,&HASHMEM,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace+sigspace,bp->bundleheight+starti,bp_n,coin->chain->zcash) < 0 ) + if ( iguana_ramchain_alloc(fname,coin,dest,mem,&HASHMEM,numtxids,numunspents,numspends,numpkinds,numexternaltxids,scriptspace+sigspace,bp->bundleheight+starti,bp_n,zcash) < 0 ) { printf("error iguana_ramchain_alloc for bundleheight.%d\n",bp->bundleheight); iguana_bundlemapfree(coin,mem,&HASHMEM,ipbits,ptrs,filesizes,num,R,starti,endi); @@ -2561,7 +2568,7 @@ int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coi iguana_blockunmark(coin,block,bp,i,1); return(-1); } - iguana_blockzcopyRO(coin->chain->zcash,destB,i,&block->RO,0); + iguana_blockzcopyRO(zcash,destB,i,&block->RO,0); //destB[i] = block->RO; } else printf("bundlesave error getting block (%d:%d) %p vs %p\n",bp->hdrsi,i,block,bp->blocks[i]); } @@ -2576,9 +2583,9 @@ int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coi { iguana_blocksetcounters(coin,block,dest); //coin->blocks.RO[bp->bundleheight+bundlei] = block->RO; - iguana_blockzcopyRO(coin->chain->zcash,destB,bundlei,&block->RO,0); + iguana_blockzcopyRO(zcash,destB,bundlei,&block->RO,0); //destB[bundlei] = block->RO; - //fprintf(stderr,"(%d %d).%d ",R[bundlei].H.data->numtxids,dest->H.txidind,bundlei); + //fprintf(stderr,"T.(%d %d u%d).%d ",R[bundlei].H.data->numtxids,dest->H.txidind,R[bundlei].H.data->numunspents,bundlei); if ( (err= iguana_ramchain_iterate(myinfo,coin,dest,&R[bundlei],bp,bundlei)) != 0 ) { if ( (block= bp->blocks[bundlei]) != 0 ) @@ -2608,7 +2615,7 @@ int32_t iguana_bundlesaveHT(struct supernet_info *myinfo,struct iguana_info *coi memset(&newchain,0,sizeof(newchain)); if ( bundlei == endi+1 && iguana_ramchain_expandedsave(myinfo,coin,RAMCHAIN_DESTARG,&newchain,&HASHMEM,0,bp) == 0 ) { - //char str[65]; printf("d.%d ht.%d %s saved lag.%d elapsed.%ld\n",depth,dest->height,mbstr(str,dest->H.data->allocsize),now-starttime,time(NULL)-now); + //char str[65]; printf("d.%d ht.%d %s saved\n",depth,dest->height,mbstr(str,dest->H.data->allocsize)); retval = 0; } else bp->generrs++; iguana_bundlemapfree(coin,mem,&HASHMEM,ipbits,ptrs,filesizes,num,R,starti,endi); @@ -2657,7 +2664,7 @@ void iguana_mergefree(struct iguana_info *coin,struct OS_memspace *mem,struct ig int32_t iguana_bundlemergeHT(struct supernet_info *myinfo,char *fname,struct iguana_info *coin,struct OS_memspace *mem,struct OS_memspace *memB,struct iguana_bundle *bp,struct iguana_bundle *nextbp,uint32_t starttime) { - static int32_t depth; static const bits256 zero; + static int32_t depth; static const bits256 zero; uint8_t zcash = 0; RAMCHAIN_DESTDECLARE; struct OS_memspace HASHMEM,HASHMEMA,HASHMEMB; uint32_t now = (uint32_t)time(NULL); char str[65],fnameA[1024],fnameB[1024]; struct iguana_ramchain _Achain,_Bchain,*A,*B,R,newchain,*dest = &R; int32_t err,retval = -1,firsti = 1; @@ -2668,11 +2675,11 @@ int32_t iguana_bundlemergeHT(struct supernet_info *myinfo,char *fname,struct igu iguana_meminit(&HASHMEMB,"hashmemB",0,iguana_hashmemsize(nextbp->ramchain.H.txidind,nextbp->ramchain.H.unspentind,nextbp->ramchain.H.spendind,nextbp->ramchain.pkind,nextbp->ramchain.externalind,nextbp->ramchain.H.data->scriptspace) + IGUANA_MAXSCRIPTSIZE,0); memset(&_Achain,0,sizeof(_Achain)); A = &_Achain; memset(&_Bchain,0,sizeof(_Bchain)); B = &_Bchain; - if ( (A= iguana_ramchain_map(myinfo,coin,fnameA,bp,bp->ramchain.numblocks,A,&HASHMEMA,0,bp->hashes[0],zero,0,0,1,1)) != 0 ) + if ( (A= iguana_ramchain_map(myinfo,coin,fnameA,bp,bp->ramchain.numblocks,A,&HASHMEMA,0,bp->hashes[0],zero,0,0,1,1,zcash)) != 0 ) { iguana_ramchain_link(A,bp->hashes[0],bp->hdrsi,bp->bundleheight,0,bp->ramchain.numblocks,firsti,1); } - if ( (B= iguana_ramchain_map(myinfo,coin,fnameB,bp,nextbp->ramchain.numblocks,B,&HASHMEMB,0,nextbp->hashes[0],zero,0,0,1,1)) != 0 ) + if ( (B= iguana_ramchain_map(myinfo,coin,fnameB,bp,nextbp->ramchain.numblocks,B,&HASHMEMB,0,nextbp->hashes[0],zero,0,0,1,1,zcash)) != 0 ) { iguana_ramchain_link(B,bp->hashes[0],nextbp->hdrsi,nextbp->bundleheight,0,nextbp->ramchain.numblocks,firsti,1); } @@ -2684,7 +2691,7 @@ int32_t iguana_bundlemergeHT(struct supernet_info *myinfo,char *fname,struct igu } if ( A->H.data != 0 && B->H.data != 0 && B->height == A->height+A->numblocks ) { - if ( iguana_ramchain_alloc(fname,coin,dest,mem,&HASHMEM,(A->H.data->numtxids+B->H.data->numtxids),(A->H.data->numunspents+B->H.data->numunspents),(A->H.data->numspends+B->H.data->numspends),(A->H.data->numpkinds+B->H.data->numpkinds),(A->H.data->numexternaltxids+B->H.data->numexternaltxids),A->H.data->scriptspace,A->height,A->numblocks + B->numblocks,coin->chain->zcash) < 0 ) + if ( iguana_ramchain_alloc(fname,coin,dest,mem,&HASHMEM,(A->H.data->numtxids+B->H.data->numtxids),(A->H.data->numunspents+B->H.data->numunspents),(A->H.data->numspends+B->H.data->numspends),(A->H.data->numpkinds+B->H.data->numpkinds),(A->H.data->numexternaltxids+B->H.data->numexternaltxids),A->H.data->scriptspace,A->height,A->numblocks + B->numblocks,zcash) < 0 ) { printf("depth.%d ht.%d fsize.%s ERROR alloc lag.%d elapsed.%d\n",depth,dest->height,mbstr(str,dest->H.data->allocsize),now-starttime,(int32_t)(time(NULL)-now)); iguana_mergefree(coin,mem,A,B,&HASHMEM,&HASHMEMA,&HASHMEMB); diff --git a/iguana/iguana_recv.c b/iguana/iguana_recv.c index 9126f6708..4e3c9f7a2 100755 --- a/iguana/iguana_recv.c +++ b/iguana/iguana_recv.c @@ -25,7 +25,7 @@ struct iguana_bundlereq *iguana_bundlereq(struct iguana_info *coin,struct iguana struct iguana_bundlereq *req; int32_t allocsize; if ( data == 0 ) datalen = 0; - allocsize = (uint32_t)sizeof(*req) + datalen; + allocsize = (uint32_t)sizeof(*req) + datalen + 64; req = mycalloc(type,1,allocsize); req->allocsize = allocsize; req->datalen = datalen; @@ -185,7 +185,7 @@ void iguana_gotunconfirmedM(struct iguana_info *coin,struct iguana_peer *addr,st req->datalen = datalen; req->txid = tx->txid; memcpy(req->serializeddata,data,datalen); - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); } #ifdef later @@ -421,7 +421,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s else { iguana_bundletime(coin,bp,bundlei,block,1); - iguana_blockzcopyRO(coin->chain->zcash,&block->RO,0,&origtxdata->zblock.RO,0); + iguana_blockzcopyRO(0*coin->chain->zcash,&block->RO,0,&origtxdata->zblock.RO,0); block->txvalid = 1; } //if ( block->mainchain != 0 ) @@ -493,7 +493,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s addr->recvblocks += 1.; addr->recvtotal += recvlen; } - if ( speculative == 0 && iguana_ramchain_data(myinfo,coin,addr,origtxdata,txarray,origtxdata->zblock.RO.txn_count,data,recvlen,bp,block) >= 0 ) + if ( speculative == 0 && iguana_ramchain_data(myinfo,coin,addr,origtxdata,txarray,origtxdata->zblock.RO.txn_count,data,recvlen,bp,block,0) >= 0 ) { txdata->zblock.fpipbits = (uint32_t)addr->ipbits; txdata->zblock.RO.recvlen = recvlen; @@ -526,7 +526,7 @@ void iguana_oldgotblockM(struct supernet_info *myinfo,struct iguana_info *coin,s } req->addr = addr; //if ( (bits256_cmp(origtxdata->zblock.RO.hash2,coin->blocks.hwmchain.RO.hash2) == 0 || req->zblock.mainchain == 0 || req->zblock.valid == 0 || req->zblock.txvalid == 0) && iguana_RTrawdata(coin,origtxdata->zblock.RO.hash2,0,&len,&numtx,1) == 0 ) - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); if ( 0 && strcmp("BTCD",coin->symbol) == 0 ) printf("%s Q.(%s)\n",coin->symbol,bits256_str(str,origtxdata->zblock.RO.hash2)); } else printf("nonz fpos.%d %s\n",txdata->zblock.fpos,bits256_str(str,origtxdata->zblock.RO.hash2)); @@ -602,7 +602,7 @@ int32_t iguana_bundlestats_update(struct iguana_info *coin,struct iguana_block * else { iguana_bundletime(coin,bp,bundlei,block,1); - iguana_blockzcopyRO(coin->chain->zcash,&block->RO,0,&origtxdata->zblock.RO,0); + iguana_blockzcopyRO(0*coin->chain->zcash,&block->RO,0,&origtxdata->zblock.RO,0); return(0); } } @@ -718,7 +718,7 @@ int32_t iguana_txmerkle(struct iguana_info *coin,bits256 *tree,int32_t treesize, return(-1); } -void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *origtxdata,struct iguana_msgtx *txarray,struct iguana_msghdr *H,uint8_t *data,int32_t recvlen,int32_t fromcache) +void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *origtxdata,struct iguana_msgtx *txarray,struct iguana_msghdr *H,uint8_t *data,int32_t recvlen,int32_t fromcache,uint8_t zcash) { static uint64_t totalrecv; struct iguana_bundlereq *req; struct iguana_txblock *txdata = 0; int32_t incr,i,numsaved,valid,speculative=0,bundlei,copyflag,numtx; struct iguana_bundle *bp; struct iguana_block *block; char str[65]; @@ -755,7 +755,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru numtx = origtxdata->zblock.RO.txn_count; iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx); req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); return; } else if ( bundlei < coin->chain->bundlesize-1 ) @@ -780,7 +780,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru { printf("gotblockM no bp %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); return; } for (i=numsaved=0; ichain->bundlesize; i++) @@ -791,7 +791,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru if ( (speculative= iguana_bundlestats_update(coin,&block,bp,bundlei,origtxdata,data,recvlen)) < 0 ) { req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); //printf("negative speculative return %s\n",bits256_str(str,origtxdata->zblock.RO.hash2)); return; } @@ -799,7 +799,7 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru { if ( block == 0 ) block = iguana_blockhashset("noblock",coin,bp->bundleheight+bundlei,origtxdata->zblock.RO.hash2,1); - if ( block->hdrsi != bp->hdrsi || block->bundlei != bundlei ) + if ( block != 0 && (block->hdrsi != bp->hdrsi || block->bundlei != bundlei) ) { block->hdrsi = bp->hdrsi; block->bundlei = bundlei; @@ -819,9 +819,10 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru iguana_RTgotblock(coin,origtxdata->zblock.RO.hash2,data,&recvlen,&numtx); if ( block != 0 ) { - if ( block->height < 0 ) - block->bundlei = -1; - block->txvalid = 1; + block->hdrsi = bp->hdrsi; + block->bundlei = bundlei; + block->height = bp->hdrsi*coin->chain->bundlesize + bundlei; + block->txvalid = block->valid = 1; block->RO.txn_count = origtxdata->zblock.RO.txn_count; if ( block->fpipbits != 0 && block->fpos >= 0 ) { @@ -838,19 +839,26 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru // printf("DUP s.%d [%d:%d].(%s) %s n%d\n",numsaved,bp!=0?bp->hdrsi:-1,bundlei,bits256_str(str,origtxdata->zblock.RO.hash2),addr->ipaddr,addr->pendblocks); } req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); return; } } txdata = origtxdata; - if ( iguana_ramchain_data(myinfo,coin,addr,origtxdata,txarray,origtxdata->zblock.RO.txn_count,data,recvlen,bp,block) >= 0 ) + /*static portable_mutex_t mutex; static int32_t didinit; + if ( didinit == 0 ) + { + portable_mutex_init(&mutex); + didinit = 1; + } + portable_mutex_lock(&mutex);*/ + if ( iguana_ramchain_data(myinfo,coin,addr,origtxdata,txarray,origtxdata->zblock.RO.txn_count,data,recvlen,bp,block,zcash) >= 0 ) { txdata->zblock.fpipbits = (uint32_t)addr->ipbits; txdata->zblock.RO.recvlen = recvlen; txdata->zblock.fpos = 0; copyflag = (coin->enableCACHE != 0) && (strcmp(coin->symbol,"BTC") != 0); req = iguana_recv_bundlereq(coin,addr,copyflag,H,data,recvlen,bp,bundlei,txdata); - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); if ( 0 && bp->hdrsi == 0 && strcmp("SYS",coin->symbol) == 0 ) printf("[%d:%d].s%d %s Q.(%s) %s\n",bp->hdrsi,bundlei,numsaved,coin->symbol,bits256_str(str,origtxdata->zblock.RO.hash2),addr->ipaddr); if ( numsaved < coin->chain->bundlesize ) @@ -886,8 +894,9 @@ void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,stru else { req = iguana_recv_bundlereq(coin,addr,0,H,data,recvlen,0,-1,origtxdata); - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); } + //portable_mutex_unlock(&mutex); } void iguana_gottxidsM(struct iguana_info *coin,struct iguana_peer *addr,bits256 *txids,int32_t n) @@ -896,7 +905,7 @@ void iguana_gottxidsM(struct iguana_info *coin,struct iguana_peer *addr,bits256 //printf("got %d txids from %s\n",n,addr->ipaddr); req = iguana_bundlereq(coin,addr,'T',0,0); req->hashes = txids, req->n = n; - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); } int32_t iguana_gotheadersM(struct iguana_info *coin,struct iguana_peer *addr,struct iguana_zblock *zblocks,int32_t n) @@ -948,7 +957,7 @@ int32_t iguana_gotheadersM(struct iguana_info *coin,struct iguana_peer *addr,str memcpy(req->blocks,&zblocks[i++ * coin->chain->bundlesize],coin->chain->bundlesize * sizeof(*zblocks)); req->n = coin->chain->bundlesize; HDRnet++; - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); } } else @@ -956,7 +965,7 @@ int32_t iguana_gotheadersM(struct iguana_info *coin,struct iguana_peer *addr,str req = iguana_bundlereq(coin,addr,'H',0,0); req->blocks = zblocks, req->n = n; HDRnet++; - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); zblocks = 0; } if ( zblocks != 0 ) @@ -984,7 +993,7 @@ void iguana_gotblockhashesM(struct iguana_info *coin,struct iguana_peer *addr,bi char str[65]; if ( 0 && n > 2 && addr != 0 ) printf("addr.%d %s [%d]\n",addr->rank,bits256_str(str,blockhashes[1]),n); - queue_enqueue("recvQ",&coin->recvQ,&req->DL,0); + queue_enqueue("recvQ",&coin->recvQ,&req->DL); if ( strcmp("BTC",coin->symbol) != 0 ) { if ( n > coin->chain->bundlesize ) @@ -1061,7 +1070,7 @@ void iguana_bundlespeculate(struct iguana_info *coin,struct iguana_bundle *bp,in char str[65]; bits256_str(str,bp->hashes[0]); //fprintf(stderr,"Afound block -> %d %d hdr.%s\n",bp->bundleheight,coin->longestchain-coin->chain->bundlesize,str); bp->hdrtime = (uint32_t)time(NULL); - queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(str),1); + queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(str)); } } @@ -1150,7 +1159,7 @@ void iguana_hwmchain_set(struct iguana_info *coin,struct iguana_block *block,int { if ( block->height == height ) { - iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,(struct iguana_block *)&coin->blocks.hwmchain,block); + iguana_blockcopy(0*coin->chain->zcash,coin->chain->auxpow,coin,(struct iguana_block *)&coin->blocks.hwmchain,block); char str[65]; printf("SET %s HWM.%s ht.%d\n",coin->symbol,bits256_str(str,block->RO.hash2),height); } else printf("iguana_hwmchain_set: mismatched ht.%d vs %d\n",block->height,height); } @@ -1225,7 +1234,7 @@ struct iguana_bundle *iguana_bundleset(struct supernet_info *myinfo,struct iguan prevhash2 = origblock->RO.prev_block; if ( block != origblock ) { - iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,block,origblock); + iguana_blockcopy(0*coin->chain->zcash,coin->chain->auxpow,coin,block,origblock); //fprintf(stderr,"bundleset block.%p vs origblock.%p prev.%d bits.%x fpos.%d\n",block,origblock,bits256_nonz(prevhash2),block->fpipbits,block->fpos); } *blockp = block; @@ -1376,7 +1385,7 @@ struct iguana_bundlereq *iguana_recvblockhdrs(struct supernet_info *myinfo,struc if ( (bp= iguana_bundleset(myinfo,coin,&block,&bundlei,(struct iguana_block *)&zblocks[i])) == 0 ) { bp = 0, bundlei = -2; - if ( (bp= iguana_bundleset(myinfo,coin,&block,&bundlei,(struct iguana_block *)&zblocks[i].RO.prev_block)) != 0 ) + if ( (bp= iguana_bundlefind(coin,&bp,&bundlei,zblocks[i].RO.prev_block)) != 0 ) { if ( bundlei < coin->chain->bundlesize-1 ) bundlei++; @@ -1451,7 +1460,7 @@ void iguana_autoextend(struct supernet_info *myinfo,struct iguana_info *coin,str if ( time(NULL) > bp->hdrtime+3 && newbp->speculative == 0 ) { bp->hdrtime = (uint32_t)time(NULL); - queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1); + queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr)); } //char str[65],str2[65]; printf("EXTEND last bundle %s/%s ht.%d\n",bits256_str(str,newbp->hashes[0]),bits256_str(str2,bp->nextbundlehash2),newbp->bundleheight); if ( newbp->queued == 0 ) @@ -1627,12 +1636,13 @@ struct iguana_bundlereq *iguana_recvblock(struct supernet_info *myinfo,struct ig { struct iguana_bundle *bp=0,*prev; int32_t n,bundlei = -2; struct iguana_block *block,*next,*prevblock; char str[65]; bits256 hash2; if ( (block= iguana_blockfind("recv",coin,origblock->RO.hash2)) != 0 ) - iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock); + iguana_blockcopy(0*coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock); else if ( (block= iguana_blockhashset("recvblock",coin,-1,origblock->RO.hash2,1)) == 0 ) { printf("error adding %s\n",bits256_str(str,origblock->RO.hash2)); return(req); } + else block->txvalid = block->valid = 1; if ( bits256_nonz(origblock->RO.prev_block) != 0 ) { if ( (prevblock= iguana_blockfind("prev",coin,origblock->RO.prev_block)) != 0 ) @@ -1641,7 +1651,8 @@ struct iguana_bundlereq *iguana_recvblock(struct supernet_info *myinfo,struct ig coin->longestchain = prevblock->height+1; } else iguana_blockQ("prev",coin,0,-1,origblock->RO.prev_block,1); } - //printf("%s received.(%s) %s\n",coin->symbol,bits256_str(str,origblock->RO.hash2),addr->ipaddr); + if ( 0 && block != 0 ) + printf("%s received.(%s) [%d:%d]\n",coin->symbol,bits256_str(str,origblock->RO.hash2),block->hdrsi,block->bundlei); if ( (bp= iguana_bundleset(myinfo,coin,&block,&bundlei,(struct iguana_block *)origblock)) != 0 && bp == coin->current && block != 0 && bp->speculative != 0 && bundlei >= 0 ) { if ( 0 && strcmp("BTCD",coin->symbol) == 0 ) @@ -1678,7 +1689,7 @@ struct iguana_bundlereq *iguana_recvblock(struct supernet_info *myinfo,struct ig coin->numcached++; if ( block != 0 ) block->queued = 1; - queue_enqueue("cacheQ",&coin->cacheQ,&req->DL,0); + queue_enqueue("cacheQ",&coin->cacheQ,&req->DL); return(0); } else if ( block != 0 && block->req == 0 ) @@ -1719,12 +1730,12 @@ struct iguana_bundlereq *iguana_recvblock(struct supernet_info *myinfo,struct ig { printf("reissue hdrs request for [%d]\n",bp->hdrsi); bp->hdrtime = (uint32_t)time(NULL); - queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0])),1); + queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(bits256_str(str,bp->hashes[0]))); } if ( (block= iguana_blockhashset("recvblock",coin,-1,origblock->RO.hash2,1)) != 0 ) { if ( block != (struct iguana_block *)origblock ) - iguana_blockcopy(coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock); + iguana_blockcopy(0*coin->chain->zcash,coin->chain->auxpow,coin,block,(struct iguana_block *)origblock); if ( block->lag != 0 && block->issued != 0 ) block->lag = (uint32_t)time(NULL) - block->issued; //printf("datalen.%d ipbits.%x\n",datalen,req->ipbits); @@ -1780,7 +1791,7 @@ int32_t iguana_reqblocks(struct supernet_info *myinfo,struct iguana_info *coin) { if ( (block= iguana_blockfind("hwmcheckb",coin,coin->blocks.hwmchain.RO.prev_block)) != 0 ) { - iguana_blockzcopy(coin->chain->zcash,(struct iguana_block *)&coin->blocks.hwmchain,block); + iguana_blockzcopy(0*coin->chain->zcash,(struct iguana_block *)&coin->blocks.hwmchain,block); return(0); } } @@ -1929,7 +1940,7 @@ int32_t iguana_processrecvQ(struct supernet_info *myinfo,struct iguana_info *coi { int32_t flag = 0; struct iguana_bundlereq *req; *newhwmp = 0; - while ( flag < IGUANA_MAXITERATIONS && coin->active != 0 && (req= queue_dequeue(&coin->recvQ,0)) != 0 ) + while ( flag < IGUANA_MAXITERATIONS && coin->active != 0 && (req= queue_dequeue(&coin->recvQ)) != 0 ) { if ( req->type != 'H' ) flag++; @@ -2004,18 +2015,18 @@ int32_t iguana_reqhdrs(struct iguana_info *coin) if ( bp->issuetime == 0 ) coin->numpendings++; init_hexbytes_noT(hashstr,bp->hashes[0].bytes,sizeof(bits256)); - queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1); + queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr)); if ( bp == coin->current ) { init_hexbytes_noT(hashstr,bp->hashes[0].bytes,sizeof(bits256)); - queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1); + queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr)); //printf("%s issue HWM HDRS [%d] %s\n",coin->symbol,bp->hdrsi,hashstr); if ( coin->blocks.hwmchain.height > 10 ) { bits256 hash2 = iguana_blockhash(coin,coin->blocks.hwmchain.height-10); init_hexbytes_noT(hashstr,hash2.bytes,sizeof(bits256)); //printf("%s issue HWM HDRS %d-10 %s\n",coin->symbol,coin->blocks.hwmchain.height,hashstr); - queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1); + queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr)); } } //printf("hdrsi.%d reqHDR.(%s) numhashes.%d\n",bp->hdrsi,hashstr,bp->numhashes); @@ -2087,7 +2098,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle if ( block->fpipbits == 0 && block->queued == 0 && block->req != 0 ) { block->queued = 1; - queue_enqueue("cacheQ",&coin->cacheQ,&block->req->DL,0); + queue_enqueue("cacheQ",&coin->cacheQ,&block->req->DL); block->req = 0; //char str2[65]; printf("already have.(%s)\n",bits256_str(str2,block->RO.hash2)); } @@ -2124,7 +2135,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle { if ( 1 && n > 200000 ) printf("%s %s %s [%d:%d] %d %s %d numranked.%d qsize.%d\n",coin->symbol,argstr,str,bp!=0?bp->hdrsi:-1,bundlei,req->height,bits256_str(str2,hash2),coin->blocks.recvblocks,coin->peers != 0 ? coin->peers->numranked : -1,queue_size(Q)); - while ( (ptr= queue_dequeue(Q,0)) != 0 ) + while ( (ptr= queue_dequeue(Q)) != 0 ) myfree(ptr,sizeof(*ptr)); coin->backlog = n*10 + 1000000; } else coin->backlog >>= 1; @@ -2133,7 +2144,7 @@ int32_t iguana_blockQ(char *argstr,struct iguana_info *coin,struct iguana_bundle //block->numrequests++; block->issued = now; } - queue_enqueue(str,Q,&req->DL,0); + queue_enqueue(str,Q,&req->DL); return(1); } else printf("null Q\n"); } //else printf("queueblock skip priority.%d bundlei.%d\n",bundlei,priority); @@ -2144,7 +2155,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) { uint8_t serialized[sizeof(struct iguana_msghdr) + sizeof(uint32_t)*32 + sizeof(bits256)]; struct iguana_block *block; struct iguana_blockreq *req=0; char *hashstr=0; bits256 hash2; - int32_t bundlei,priority,i,m,z,pend,limit,height=-1,datalen,flag = 0; + int32_t bundlei,priority,i,m,z,pend,limit,height=-1,datalen,flag = 0; struct stritem *hashitem; uint32_t now; struct iguana_bundle *bp; struct iguana_peer *ptr; if ( addr->msgcounts.verack == 0 ) return(0); @@ -2154,8 +2165,9 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) if ( iguana_needhdrs(coin) != 0 && addr->pendhdrs < IGUANA_MAXPENDHDRS ) { //printf("%s check hdrsQ\n",addr->ipaddr); - if ( (hashstr= queue_dequeue(&coin->hdrsQ,1)) != 0 ) + if ( (hashitem= queue_dequeue(&coin->hdrsQ)) != 0 ) { + hashstr = hashitem->str; if ( (datalen= iguana_gethdrs(coin,serialized,coin->chain->gethdrsmsg,hashstr)) > 0 ) { decode_hex(hash2.bytes,sizeof(hash2),hashstr); @@ -2187,8 +2199,9 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) //free_queueitem(hashstr); //return(flag); } else printf("datalen.%d from gethdrs\n",datalen); - free_queueitem(hashstr); + free(hashitem); hashstr = 0; + hashitem = 0; } } //if ( netBLOCKS > coin->MAXPEERS*coin->MAXPENDING ) @@ -2204,7 +2217,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) } priority = 1; pend = 0; - req = queue_dequeue(&coin->priorityQ,0); + req = queue_dequeue(&coin->priorityQ); if ( flag == 0 && req == 0 && addr->pendblocks < limit ) { priority = 0; @@ -2217,7 +2230,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) } } if ( pend < coin->MAXPENDINGREQUESTS*m ) - req = queue_dequeue(&coin->blocksQ,0); + req = queue_dequeue(&coin->blocksQ); } if ( req != 0 ) { @@ -2228,6 +2241,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) if ( bp->emitfinish != 0 ) { //printf("skip emitting bundle [%d:%d]\n",bp->hdrsi,req->bundlei); + //free(req); return(0); } block = bp->blocks[req->bundlei]; @@ -2244,7 +2258,7 @@ int32_t iguana_pollQsPT(struct iguana_info *coin,struct iguana_peer *addr) iguana_sendblockreqPT(coin,addr,bp,req->bundlei,hash2,0); } flag++; - myfree(req,sizeof(*req)); + free(req); } return(flag); } diff --git a/iguana/iguana_secp.c b/iguana/iguana_secp.c index 7b98ec25c..d5ab64786 100755 --- a/iguana/iguana_secp.c +++ b/iguana/iguana_secp.c @@ -37,7 +37,11 @@ int32_t bitcoin_pubkeylen(const uint8_t *pubkey) return(33); else if ( pubkey[0] == 4 ) return(65); - else return(-1); + else + { + printf("illegal pubkey.[%02x] %llx\n",pubkey[0],*(long long *)pubkey); + return(-1); + } } bits256 bitcoin_randkey(secp256k1_context *ctx) diff --git a/iguana/iguana_spendvectors.c b/iguana/iguana_spendvectors.c index 660cb55b3..8f78f663a 100755 --- a/iguana/iguana_spendvectors.c +++ b/iguana/iguana_spendvectors.c @@ -266,6 +266,7 @@ int32_t iguana_spendvectors(struct supernet_info *myinfo,struct iguana_info *coi //printf("iguana_spendvectors.[%d]: already have Xspendinds[%d]\n",bp->hdrsi,ramchain->numXspends); return(0); } + bp->startutxo = (uint32_t)time(NULL); ptr = mycalloc('x',sizeof(*ptr),n); total += n; startmillis = OS_milliseconds(); @@ -474,6 +475,9 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig if ( (Xspendinds= bp->tmpspends) == 0 ) { //printf("iguana_balancegen.%d: no Xspendinds[%d]\n",bp->hdrsi,numXspends); + numXspends = iguana_Xspendmap(coin,ramchain,bp); + numXspends = ramchain->numXspends; + //printf("Xspendinds.%p[%d]\n",Xspendinds,numXspends); //return(-1); } } @@ -571,7 +575,7 @@ int32_t iguana_balancegen(struct iguana_info *coin,int32_t incremental,struct ig else //if ( Xspendinds != 0 ) { errs++; - printf("iguana_balancegen: spendind.%u external.%d error spentbp.%p with unspentind.%d pkind.%u [%d] (%d %d %d)\n",spendind,s->external,spentbp,spent_unspentind,spent_pkind,spent_hdrsi,i,j,k); + printf("iguana_balancegen: X%p[%d] spendind.%u external.%d error spentbp.%p with unspentind.%d pkind.%u [%d] (%d %d %d)\n",Xspendinds,numXspends,spendind,s->external,spentbp,spent_unspentind,spent_pkind,spent_hdrsi,i,j,k); } } } @@ -772,7 +776,7 @@ void iguana_initfinal(struct supernet_info *myinfo,struct iguana_info *coin,bits if ( bits256_nonz(lastbundle) > 0 ) { init_hexbytes_noT(hashstr,lastbundle.bytes,sizeof(bits256)); - queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr),1); + queue_enqueue("hdrsQ",&coin->hdrsQ,queueitem(hashstr)); } for (i=0; ibundlescount-1; i++) { @@ -1004,7 +1008,7 @@ int32_t iguana_spendvectorsaves(struct iguana_info *coin) return(0); coin->spendvectorsaved = 1; n = coin->bundlescount - 1; - //printf("SAVE SPEND VECTORS %d of %d\n",n,coin->bundlescount); + printf("SAVE SPEND VECTORS %d of %d\n",n,coin->bundlescount); for (iter=0; iter<2; iter++) { for (i=0; ichain->zcash != 0 ) { - printf("need to process joinsplits before can validate.%s\n",coin->symbol); + static uint32_t counter; + if ( counter++ < 3 ) + printf("need to process joinsplits before can validate.%s\n",coin->symbol); bp->validated = (uint32_t)time(NULL); - return(bp->n); + forceflag = 1; + //return(bp->n); } if ( (coin->MAXPEERS > 1 && coin->VALIDATENODE == 0 && coin->FULLNODE == 0) || bp->ramchain.from_ro != 0 )//|| bp == coin->current ) { @@ -1158,31 +1165,34 @@ int32_t iguana_bundlevalidate(struct supernet_info *myinfo,struct iguana_info *c } if ( forceflag != 0 || bp->validated <= 1 ) { - max = coin->blockspacesize; - blockspace = calloc(1,max); - iguana_volatilespurge(coin,&bp->ramchain); - iguana_volatilesmap(myinfo,coin,&bp->ramchain); - for (i=0; in; i++) + if ( coin->chain->zcash == 0 ) { - char str[65]; - if ( coin->chain->fixit != 0 ) - printf("validate %s.[%d:%d] %s\n",coin->symbol,bp->hdrsi,i,bits256_str(str,bp->hashes[i])); - if ( (len= iguana_peerblockrequest(myinfo,coin,blockspace,max,0,bp->hashes[i],1)) < 0 ) - { - errs++; - //fprintf(stderr,"-%s.[%d:%d] ",coin->symbol,bp->hdrsi,i); - //printf("bundlevalidate: %s delete [%d:%d]\n",coin->symbol,bp->hdrsi,i); - iguana_blockunmark(coin,bp->blocks[i],bp,i,1); - totalerrs++; - } - else + max = coin->blockspacesize; + blockspace = calloc(1,max); + iguana_volatilespurge(coin,&bp->ramchain); + iguana_volatilesmap(myinfo,coin,&bp->ramchain); + for (i=0; in; i++) { - vupdate_sha256(validatehash.bytes,&vstate,bp->hashes[i].bytes,sizeof(bp->hashes[i])); - total += len, totalvalidated++; + char str[65]; + if ( coin->chain->fixit != 0 ) + printf("validate %s.[%d:%d] %s\n",coin->symbol,bp->hdrsi,i,bits256_str(str,bp->hashes[i])); + if ( (len= iguana_peerblockrequest(myinfo,coin,blockspace,max,0,bp->hashes[i],1)) < 0 ) + { + errs++; + //fprintf(stderr,"-%s.[%d:%d] ",coin->symbol,bp->hdrsi,i); + //printf("bundlevalidate: %s delete [%d:%d]\n",coin->symbol,bp->hdrsi,i); + iguana_blockunmark(coin,bp->blocks[i],bp,i,1); + totalerrs++; + } + else + { + vupdate_sha256(validatehash.bytes,&vstate,bp->hashes[i].bytes,sizeof(bp->hashes[i])); + total += len, totalvalidated++; + } } + free(blockspace); + printf("%s %s VALIDATED.[%d] ht.%d duration.%d errs.%d total.%lld %u | total errs.%d validated.%d %llx\n",coin->symbol,errs!=0?"NOT":"",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - now,errs,(long long)total,bp->validated,totalerrs,totalvalidated,(long long)validatehash.txid); } - free(blockspace); - printf("%s %s VALIDATED.[%d] ht.%d duration.%d errs.%d total.%lld %u | total errs.%d validated.%d %llx\n",coin->symbol,errs!=0?"NOT":"",bp->hdrsi,bp->bundleheight,(uint32_t)time(NULL) - now,errs,(long long)total,bp->validated,totalerrs,totalvalidated,(long long)validatehash.txid); if ( errs == 0 ) bp->validated = (uint32_t)time(NULL); else bp->validated = bp->startutxo = bp->utxofinish = 0; diff --git a/iguana/iguana_wallet.c b/iguana/iguana_wallet.c index 06a6dde5c..86a7cc5ab 100755 --- a/iguana/iguana_wallet.c +++ b/iguana/iguana_wallet.c @@ -1359,6 +1359,10 @@ THREE_STRINGS(bitcoinrpc,encryptwallet,passphrase,password,permanentfile) password = passphrase; if ( passphrase == 0 || passphrase[0] == 0 ) passphrase = password; + if ( passphrase == 0 ) + passphrase = ""; + if ( password == 0 ) + password = ""; strcpy(myinfo->secret,passphrase); strcpy(myinfo->password,password); if ( permanentfile != 0 ) @@ -1801,8 +1805,8 @@ THREE_INTS(bitcoinrpc,listreceivedbyaddress,minconf,includeempty,flag) cJSON *retjson,*item,*array,*txids,*vouts; struct iguana_waccount *wacct,*tmp; struct iguana_waddress *waddr,*tmp2; uint8_t addrtype; char coinaddr[64]; if ( remoteaddr != 0 ) return(clonestr("{\"error\":\"no remote\"}")); - if ( myinfo->expiration == 0 ) - return(clonestr("{\"error\":\"need to unlock wallet\"}")); + //if ( myinfo->expiration == 0 ) + // return(clonestr("{\"error\":\"need to unlock wallet\"}")); array = cJSON_CreateArray(); HASH_ITER(hh,myinfo->wallet,wacct,tmp) { diff --git a/iguana/m_LP b/iguana/m_LP index efcf9f5c0..4294e99ac 100755 --- a/iguana/m_LP +++ b/iguana/m_LP @@ -1,3 +1,4 @@ +#!/bin/bash #./configure --enable-endomorphism --enable-module-ecdh --enable-module-schnorr --enable-module-rangeproof --enable-experimental --enable-module_recovery rm -f ../agents/iguana *.o git pull diff --git a/iguana/m_clean b/iguana/m_clean index 368561008..2cf084c74 100755 --- a/iguana/m_clean +++ b/iguana/m_clean @@ -1 +1,2 @@ +#!/bin/bash rm *.o ../agents/iguana diff --git a/iguana/m_js b/iguana/m_js index 712f6b993..3bc0187f8 100755 --- a/iguana/m_js +++ b/iguana/m_js @@ -1,3 +1,4 @@ +#!/bin/bash rm ../agents/iguana *.o git pull emcc -s ALLOW_MEMORY_GROWTH=1 -s PTHREAD_POOL_SIZE=40 -s USE_PTHREADS=2 -o iguana.html -O3 -I. -Isecp256k1./src -Isecp256k1/include -Isecp256k1/src -Wno-unused-parameter -Wnested-externs -Wstrict-prototypes -Wno-unused-function -Wno-long-long -Wno-overlength-strings -fvisibility=hidden -DHAVE_CONFIG_H *.c ../crypto777/*.c ../crypto777/jpeg/*.c ../crypto777/jpeg/unix/*.c secp256k1/src/secp256k1.c -lm diff --git a/iguana/m_notary b/iguana/m_notary index 030994a84..5da316684 100755 --- a/iguana/m_notary +++ b/iguana/m_notary @@ -1,3 +1,4 @@ +#!/bin/bash pkill iguana rm -f ../agents/iguana *.o git pull @@ -10,6 +11,7 @@ gcc -g -o ../agents/iguana *.o ../agents/libcrypto777.a -lnanomsg -lcurl -lssl - ../agents/iguana notary & #> iguana.log 2> error.log & myip=`curl -s4 checkip.amazonaws.com` +source pubkey.txt sleep 4 curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"SuperNET\",\"method\":\"myipaddr\",\"ipaddr\":\"$myip\"}" @@ -18,7 +20,41 @@ tests/addnotarys_7776 ./btc_7776 ./kmd_7776 curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"$myip\"}" -./dpow_7776 -sleep 3 +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}" +sleep 7 ./wp_7776 - +sleep 3 +curl --url "http://127.0.0.1:7776" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"USD\",\"pubkey\":\"$pubkey\"}" +sleep 6 +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"EUR\",\"pubkey\":\"$pubkey\"}" + +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"JPY\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"GBP\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"AUD\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CAD\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CHF\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NZD\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CNY\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"RUB\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MXN\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BRL\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"INR\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HKD\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"TRY\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"ZAR\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"PLN\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"NOK\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SEK\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"DKK\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"CZK\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HUF\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"ILS\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KRW\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"MYR\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"PHP\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"RON\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"SGD\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"THB\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"BGN\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"IDR\",\"pubkey\":\"$pubkey\"}" +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"HRK\",\"pubkey\":\"$pubkey\"}" diff --git a/iguana/m_osx b/iguana/m_osx index 222dccae4..82539229a 100755 --- a/iguana/m_osx +++ b/iguana/m_osx @@ -1,3 +1,4 @@ +#!/bin/bash #./configure --enable-endomorphism --enable-module-ecdh --enable-module-schnorr --enable-module-rangeproof --enable-experimental --enable-module_recovery rm ../agents/iguana *.o git pull diff --git a/iguana/m_pnacl b/iguana/m_pnacl index 8f58e6df9..c5089bede 100755 --- a/iguana/m_pnacl +++ b/iguana/m_pnacl @@ -1 +1,2 @@ +#!/bin/bash make diff --git a/iguana/m_win32 b/iguana/m_win32 index b587ba2b0..2f0e718a4 100755 --- a/iguana/m_win32 +++ b/iguana/m_win32 @@ -1,2 +1,3 @@ +#!/bin/bash make -f mingw32 diff --git a/iguana/m_win64 b/iguana/m_win64 index cbe067a7f..ea05be2af 100755 --- a/iguana/m_win64 +++ b/iguana/m_win64 @@ -1 +1,2 @@ +#!/bin/bash make -f mingw64 diff --git a/iguana/main.c b/iguana/main.c index 3ea2ccc12..c200878fd 100755 --- a/iguana/main.c +++ b/iguana/main.c @@ -190,10 +190,10 @@ int32_t iguana_jsonQ(struct supernet_info *myinfo,struct iguana_info *coin) if ( (ptr->retjsonstr= SuperNET_jsonstr(ptr->myinfo,ptr->jsonstr,ptr->remoteaddr,ptr->port)) == 0 ) ptr->retjsonstr = clonestr("{\"error\":\"null return from iguana_jsonstr\"}"); printf("COMMANDLINE_ARGFILE.(%s) -> (%s) %.0f\n",ptr->jsonstr,ptr->retjsonstr!=0?ptr->retjsonstr:"null return",OS_milliseconds()); - queue_enqueue("finishedQ",finishedQ,&ptr->DL,0); + queue_enqueue("finishedQ",finishedQ,&ptr->DL); return(1); } - if ( (ptr= queue_dequeue(finishedQ,0)) != 0 ) + if ( (ptr= queue_dequeue(finishedQ)) != 0 ) { if ( ptr->expired != 0 ) { @@ -204,14 +204,14 @@ int32_t iguana_jsonQ(struct supernet_info *myinfo,struct iguana_info *coin) } printf("garbage collection: expired.(%s)\n",ptr->jsonstr); myfree(ptr,ptr->allocsize); - } else queue_enqueue("finishedQ",finishedQ,&ptr->DL,0); + } else queue_enqueue("finishedQ",finishedQ,&ptr->DL); } - if ( (ptr= queue_dequeue(jsonQ,0)) != 0 ) + if ( (ptr= queue_dequeue(jsonQ)) != 0 ) { if ( (ptr->retjsonstr= SuperNET_jsonstr(ptr->myinfo,ptr->jsonstr,ptr->remoteaddr,ptr->port)) == 0 ) ptr->retjsonstr = clonestr("{\"error\":\"null return from iguana_jsonstr\"}"); //printf("finished.(%s) -> (%s) %.0f\n",ptr->jsonstr,ptr->retjsonstr!=0?ptr->retjsonstr:"null return",OS_milliseconds()); - queue_enqueue("finishedQ",finishedQ,&ptr->DL,0); + queue_enqueue("finishedQ",finishedQ,&ptr->DL); return(1); } return(0); @@ -234,7 +234,7 @@ char *iguana_blockingjsonstr(struct supernet_info *myinfo,struct iguana_info *co if ( coin == 0 || coin->FULLNODE < 0 || (coin->FULLNODE == 0 && coin->VALIDATENODE == 0) ) Q = &JSON_Q; else Q = &coin->jsonQ; - queue_enqueue("jsonQ",Q,&ptr->DL,0); + queue_enqueue("jsonQ",Q,&ptr->DL); while ( OS_milliseconds() < expiration ) { usleep(100); diff --git a/iguana/notaries.h b/iguana/notaries.h index c2206069c..f6c05a227 100755 --- a/iguana/notaries.h +++ b/iguana/notaries.h @@ -28,6 +28,7 @@ char *Notaries[][2] = { "movecrypto_EU", "021ab53bc6cf2c46b8a5456759f9d608966eff87384c2b52c0ac4cc8dd51e9cc42" }, { "badass_EU", "0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e" }, { "crackers_NA", "029e1c01131974f4cd3f564cc0c00eb87a0f9721043fbc1ca60f9bd0a1f73f64a1" }, + { "proto_EU", "03681ffdf17c8f4f0008cefb7fa0779c5e888339cdf932f0974483787a4d6747c1" }, { "jeezy_EU", "023cb3e593fb85c5659688528e9a4f1c4c7f19206edc7e517d20f794ba686fd6d6" }, { "farl4web_EU", "035caa40684ace968677dca3f09098aa02b70e533da32390a7654c626e0cf908e1" }, @@ -38,6 +39,7 @@ char *Notaries[][2] = { "supernet_AE", "029d93ef78197dc93892d2a30e5a54865f41e0ca3ab7eb8e3dcbc59c8756b6e355" }, { "supernet_EU", "02061c6278b91fd4ac5cab4401100ffa3b2d5a277e8f71db23401cc071b3665546" }, { "supernet_NA", "033c073366152b6b01535e15dd966a3a8039169584d06e27d92a69889b720d44e1" }, + { "yassin_EU", "033fb7231bb66484081952890d9a03f91164fb27d392d9152ec41336b71b15fbd0" }, { "durerus_EU", "02bcbd287670bdca2c31e5d50130adb5dea1b53198f18abeec7211825f47485d57" }, { "badass_SH", "026b49dd3923b78a592c1b475f208e23698d3f085c4c3b4906a59faf659fd9530b" }, @@ -48,6 +50,7 @@ char *Notaries[][2] = { "grewal_SH", "03212a73f5d38a675ee3cdc6e82542a96c38c3d1c79d25a1ed2e42fcf6a8be4e68" }, { "polycryptoblock_NA", "02708dcda7c45fb54b78469673c2587bfdd126e381654819c4c23df0e00b679622" }, { "titomane_NA", "0387046d9745414fb58a0fa3599078af5073e10347e4657ef7259a99cb4f10ad47" }, + { "titomane_AE", "03cda6ca5c2d02db201488a54a548dbfc10533bdc275d5ea11928e8d6ab33c2185" }, { "kolo_EU", "03f5c08dadffa0ffcafb8dd7ffc38c22887bd02702a6c9ac3440deddcf2837692b" }, { "artik_NA", "0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842" }, diff --git a/iguana/pangea_hand.c b/iguana/pangea_hand.c index 9cd6a671b..88fec043f 100755 --- a/iguana/pangea_hand.c +++ b/iguana/pangea_hand.c @@ -24,11 +24,11 @@ struct pangea_queueitem *pangea_queuefind(struct table_info *tp,int32_t waiteven int32_t iter; struct pangea_queueitem *ptr; for (iter=0; iter<2; iter++) { - while ( (ptr= queue_dequeue(&tp->stateQ[iter],0)) != 0 ) + while ( (ptr= queue_dequeue(&tp->stateQ[iter])) != 0 ) { if ( ptr->waitevent == waitevent ) return(ptr); - queue_enqueue("stateQ",&tp->stateQ[iter ^ 1],&ptr->DL,0); + queue_enqueue("stateQ",&tp->stateQ[iter ^ 1],&ptr->DL); } } return(0); @@ -42,7 +42,7 @@ void pangea_queuestate(struct table_info *tp,int32_t currentstate,int32_t waitev ptr->last = ptr->start = tai_now(); ptr->waitevent = waitevent; char str[65]; printf("table.%s current.%d -> wait.%d\n",bits256_str(str,tp->G.tablehash),currentstate,waitevent); - queue_enqueue("stateQ",&tp->stateQ[0],&ptr->DL,0); + queue_enqueue("stateQ",&tp->stateQ[0],&ptr->DL); } int32_t pangea_slotA(struct table_info *tp) { return(0); } @@ -383,7 +383,7 @@ int32_t pangea_queueprocess(struct supernet_info *myinfo,struct table_info *tp) //char str[65]; printf("queueprocess.(%s)\n",bits256_str(str,tp->G.tablehash)); for (iter=0; iter<2; iter++) { - while ( (ptr= queue_dequeue(&tp->stateQ[iter],0)) != 0 ) + while ( (ptr= queue_dequeue(&tp->stateQ[iter])) != 0 ) { retval = 0; diff = tai_diff(ptr->last,tai_now()); @@ -409,7 +409,7 @@ int32_t pangea_queueprocess(struct supernet_info *myinfo,struct table_info *tp) else { ptr->last = tai_now(); - queue_enqueue("stateQ",&tp->stateQ[iter ^ 1],&ptr->DL,0); + queue_enqueue("stateQ",&tp->stateQ[iter ^ 1],&ptr->DL); } } } diff --git a/iguana/tests/DEX b/iguana/tests/DEX index 1a807d6d7..ee9dc0fb5 100755 --- a/iguana/tests/DEX +++ b/iguana/tests/DEX @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"genesis_opreturn\",\"vals\":{\"issuer\":\"RXL3YXG2ceaB6C5hfJcN4fvmLH2C34knhA\",\"stake\":1000000,\"blocktime\":1,\"name\":\"InstantDEX\",\"symbol\":\"DEX\",\"p2sh\":5,\"wif\":128,\"nBits\":\"1effffff\"}}" diff --git a/iguana/tests/DEXtx b/iguana/tests/DEXtx index 302997a86..644812e7c 100755 --- a/iguana/tests/DEXtx +++ b/iguana/tests/DEXtx @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"sendtoaddress\",\"params\":[\"RXL3YXG2ceaB6C5hfJcN4fvmLH2C34knhA\", 0.0001, \"4e4557444558000000496e7374616e74444558000000000000407a10f35a0000dffc6993a2216d57ffffff1e1f4e010001000cba013c0580f1dce4182fce875748c4986b240ff7d7bc3fffb0\", \"sendcomment\"]}" diff --git a/iguana/tests/HOT b/iguana/tests/HOT index 261ef44ce..6820d3d21 100755 --- a/iguana/tests/HOT +++ b/iguana/tests/HOT @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"genesis_opreturn\",\"vals\":{\"issuer\":\"RXL3YXG2ceaB6C5hfJcN4fvmLH2C34knhA\",\"stake\":1000000,\"blocktime\":1,\"name\":\"HOT ICO\",\"symbol\":\"HOT\",\"p2sh\":5,\"wif\":128,\"nBits\":\"1effffff\"}}" diff --git a/iguana/tests/HOTtx b/iguana/tests/HOTtx index f84d2d4b9..209088bf0 100755 --- a/iguana/tests/HOTtx +++ b/iguana/tests/HOTtx @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"sendtoaddress\",\"params\":[\"RXL3YXG2ceaB6C5hfJcN4fvmLH2C34knhA\", 0.0001, \"4e4557484f54000000484f542049434f000000000000000000407a10f35a00007f53009145d46b57ffffff1e0000000001009577013c0580f1dce4182fce875748c4986b240ff7d7bc3fffb0\", \"sendcomment\"]}" diff --git a/iguana/tests/LPinit b/iguana/tests/LPinit index c1cb7ce95..513f39a9a 100755 --- a/iguana/tests/LPinit +++ b/iguana/tests/LPinit @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"liquidity\",\"targetcoin\":\"BTCD\",\"vals\":{\"profit\":0.01}}" diff --git a/iguana/tests/PAX b/iguana/tests/PAX index f4d6950e8..01f66b80b 100755 --- a/iguana/tests/PAX +++ b/iguana/tests/PAX @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"pax\",\"method\":\"start\"}" diff --git a/iguana/tests/PoS b/iguana/tests/PoS index f3ee99728..8e1ab12dc 100755 --- a/iguana/tests/PoS +++ b/iguana/tests/PoS @@ -1,3 +1,4 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"PoSweights\",\"activecoin\":\"BTCD\",\"height\":1192000}" curl --url "http://127.0.0.1:7778" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"PoSweights\",\"activecoin\":\"BTCD\",\"height\":1192500}" curl --url "http://127.0.0.1:7778" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"PoSweights\",\"activecoin\":\"BTCD\",\"height\":1193000}" diff --git a/iguana/tests/accept b/iguana/tests/accept index bdf736e9a..4c165c5bc 100755 --- a/iguana/tests/accept +++ b/iguana/tests/accept @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"accept\",\"requestid\":1728286611,\"quoteid\":123456}" diff --git a/iguana/tests/activehandle b/iguana/tests/activehandle index 2d53b5b76..266c45dc7 100755 --- a/iguana/tests/activehandle +++ b/iguana/tests/activehandle @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"activehandle\"}" diff --git a/iguana/tests/addmultisig b/iguana/tests/addmultisig index 10891244b..ede3fc981 100755 --- a/iguana/tests/addmultisig +++ b/iguana/tests/addmultisig @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"addmultisig\",\"params\":[2, [\"1CHzgAakwGCvGX2BG1duWygDuVE6s7tzZ6\", \"d0296ed1364639c696c374730320480301f3194c86231f62f0409cd76467f87c\", \"d045925b3e6f648bca6ed0c65149ee445137f0ab14e88cf60013d88419bcdd60\"], \"msigs\"]}" diff --git a/iguana/tests/addnode b/iguana/tests/addnode index 924371c17..2840f3b51 100755 --- a/iguana/tests/addnode +++ b/iguana/tests/addnode @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"BTC\",\"ipaddr\":\"5.9.102.210\"}" curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"BTC\",\"ipaddr\":\"78.47.196.146\"}" diff --git a/iguana/tests/addnode2 b/iguana/tests/addnode2 index 924371c17..2840f3b51 100755 --- a/iguana/tests/addnode2 +++ b/iguana/tests/addnode2 @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"BTC\",\"ipaddr\":\"5.9.102.210\"}" curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"BTC\",\"ipaddr\":\"78.47.196.146\"}" diff --git a/iguana/tests/addnodeSYS b/iguana/tests/addnodeSYS index b4a548e1c..c55b1811f 100755 --- a/iguana/tests/addnodeSYS +++ b/iguana/tests/addnodeSYS @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"SYS\",\"ipaddr\":\"198.147.29.138\"}" curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"SYS\",\"ipaddr\":\"118.244.207.7\"}" diff --git a/iguana/tests/addnotarys b/iguana/tests/addnotarys index 093409766..a4945ed09 100755 --- a/iguana/tests/addnotarys +++ b/iguana/tests/addnotarys @@ -1,3 +1,4 @@ +#!/bin/bash ../coins/notary curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"5.9.102.210\"}" curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"addnode\",\"activecoin\":\"NOTARY\",\"ipaddr\":\"78.47.196.146\"}" diff --git a/iguana/tests/addnotarys_7776 b/iguana/tests/addnotarys_7776 index b586cf2bb..dd7404c85 100755 --- a/iguana/tests/addnotarys_7776 +++ b/iguana/tests/addnotarys_7776 @@ -1,3 +1,4 @@ +#!/bin/bash curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"5.9.102.210\"}" curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"78.47.196.146\"}" curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"addnotary\",\"ipaddr\":\"149.56.29.163\"}" diff --git a/iguana/tests/ahloop b/iguana/tests/ahloop index e9f287381..f91d78529 100755 --- a/iguana/tests/ahloop +++ b/iguana/tests/ahloop @@ -1,3 +1,4 @@ +#!/bin/bash ind=0 one=1 while true diff --git a/iguana/tests/allcoins b/iguana/tests/allcoins index 1454b39b7..bd1306015 100755 --- a/iguana/tests/allcoins +++ b/iguana/tests/allcoins @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"allcoins\"}" diff --git a/iguana/tests/amlp b/iguana/tests/amlp index 23a52e01c..7e156a8d6 100755 --- a/iguana/tests/amlp +++ b/iguana/tests/amlp @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"amlp\"}" diff --git a/iguana/tests/arraytest b/iguana/tests/arraytest index 4191fd1cf..3d811998b 100755 --- a/iguana/tests/arraytest +++ b/iguana/tests/arraytest @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "[{\"agent\":\"SuperNET\",\"method\":\"activehandle\"}, {\"agent\":\"bitcoinrpc\",\"activecoin\":\"BTCD\",\"method\":\"getdifficulty\"}]" diff --git a/iguana/tests/assetchains b/iguana/tests/assetchains index 978118a3b..3f52b6408 100755 --- a/iguana/tests/assetchains +++ b/iguana/tests/assetchains @@ -1,3 +1,4 @@ +#!/bin/bash ./assetchaind -ac_name=USD -addnode=78.47.196.146 & ./assetchaind -ac_name=EUR -addnode=78.47.196.146 & ./assetchaind -ac_name=JPY -addnode=78.47.196.146 & diff --git a/iguana/tests/automatched b/iguana/tests/automatched index 4475dce0b..75f49e123 100755 --- a/iguana/tests/automatched +++ b/iguana/tests/automatched @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"automatched\",\"requestid\":1728286611}" diff --git a/iguana/tests/available b/iguana/tests/available index fbe1a0e22..500a09946 100755 --- a/iguana/tests/available +++ b/iguana/tests/available @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"available\",\"source\":\"BTCD\"}" diff --git a/iguana/tests/aveprice b/iguana/tests/aveprice index cc176176e..279371992 100755 --- a/iguana/tests/aveprice +++ b/iguana/tests/aveprice @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"tradebot\",\"method\":\"aveprice\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"basevolume\":1.0}" diff --git a/iguana/tests/backupwallet b/iguana/tests/backupwallet index 32645108d..04de4dfb1 100755 --- a/iguana/tests/backupwallet +++ b/iguana/tests/backupwallet @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"backupwallet\",\"params\":[\"testwallet\"]}" diff --git a/iguana/tests/backupwallet2 b/iguana/tests/backupwallet2 index 32645108d..04de4dfb1 100755 --- a/iguana/tests/backupwallet2 +++ b/iguana/tests/backupwallet2 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"backupwallet\",\"params\":[\"testwallet\"]}" diff --git a/iguana/tests/balance b/iguana/tests/balance index 3e93f1434..5f29223dd 100755 --- a/iguana/tests/balance +++ b/iguana/tests/balance @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"activecoin\":\"BTCD\",\"timeout\":20000,\"agent\":\"iguana\",\"method\":\"balance\",\"address\":\"RDbGxL8QYdEp8sMULaVZS2E6XThcTKT9Jd\"}" diff --git a/iguana/tests/balance2 b/iguana/tests/balance2 index 53cd0bfd5..2299cae52 100755 --- a/iguana/tests/balance2 +++ b/iguana/tests/balance2 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"activecoin\":\"BTCD\",\"timeout\":20000,\"agent\":\"iguana\",\"method\":\"balance\",\"address\":\"RFMEYcxuBL8S7UPdUbzXunPtS4p82HRcKs\"}" diff --git a/iguana/tests/balances b/iguana/tests/balances index 237063efb..8c109cc1e 100755 --- a/iguana/tests/balances +++ b/iguana/tests/balances @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"timeout\":20000,\"agent\":\"basilisk\",\"method\":\"balances\",\"vals\":{\"minconf\":1,\"history\":3,\"addresses\":[\"RYNE2isKrRu5b7xxm1DtXcLxdmBEKatuJY\"]}}" diff --git a/iguana/tests/bitcoinrpc b/iguana/tests/bitcoinrpc index dba1bd3de..18fbef257 100755 --- a/iguana/tests/bitcoinrpc +++ b/iguana/tests/bitcoinrpc @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"bitcoinrpc\",\"setcoin\":\"$1\"}" diff --git a/iguana/tests/buy b/iguana/tests/buy index 67c07d1a0..749fc8603 100755 --- a/iguana/tests/buy +++ b/iguana/tests/buy @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"buy\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}" diff --git a/iguana/tests/buy2 b/iguana/tests/buy2 index 252ab3c60..b9044ba9e 100755 --- a/iguana/tests/buy2 +++ b/iguana/tests/buy2 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"buy\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0027,\"volume\":1.0}" diff --git a/iguana/tests/checkwallet b/iguana/tests/checkwallet index 7df59c569..7adafdc0d 100755 --- a/iguana/tests/checkwallet +++ b/iguana/tests/checkwallet @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"checkwallet\",\"params\":[]}" diff --git a/iguana/tests/clearassets b/iguana/tests/clearassets index 5176f7ab8..e58ac362e 100755 --- a/iguana/tests/clearassets +++ b/iguana/tests/clearassets @@ -1,3 +1,4 @@ +#!/bin/bash rm -rf ~/.USD rm -rf ~/.EUR rm -rf ~/.JPY diff --git a/iguana/tests/creategtx b/iguana/tests/creategtx index fedeb0764..5ddd50a8f 100755 --- a/iguana/tests/creategtx +++ b/iguana/tests/creategtx @@ -1,2 +1,4 @@ +#!/bin/bash +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"DEX\",\"method\":\"createrawtransaction\",\"params\":[[], {\"data\":\"deadbeef\"}] }" diff --git a/iguana/tests/createmultisig b/iguana/tests/createmultisig index 84f093b80..22476b715 100755 --- a/iguana/tests/createmultisig +++ b/iguana/tests/createmultisig @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"createmultisig\",\"params\":[2, [\"002629c77b81a4d338a339488aaff796a93aeec8c734b22dee865d0ff58ff64c\", \"d0296ed1364639c696c374730320480301f3194c86231f62f0409cd76467f87c\", \"d045925b3e6f648bca6ed0c65149ee445137f0ab14e88cf60013d88419bcdd60\"]]}" diff --git a/iguana/tests/createrawtransaction b/iguana/tests/createrawtransaction index 47fc3c1cd..3120e1520 100755 --- a/iguana/tests/createrawtransaction +++ b/iguana/tests/createrawtransaction @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"createrawtransaction\",\"params\":[[{\"txid\":\"e8a0cc971e769de1fcf9d4abb734acb9ab4ab7f44d9eb7d9cd96707b847dd1f6\",\"vout\":0}], {\"RAoMou7euzvDwa9dQwjrNB5A41hrAWgvBt\":0.01,\"RV37MfeBD1QTeoLHteab3j4mFVrsSaGMJx\":0.0093}] }" diff --git a/iguana/tests/createrawtransactionA b/iguana/tests/createrawtransactionA index 9673ce27e..6fd6d865a 100755 --- a/iguana/tests/createrawtransactionA +++ b/iguana/tests/createrawtransactionA @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"createrawtransaction\",\"params\":[[{\"txid\":\"e8a0cc971e769de1fcf9d4abb734acb9ab4ab7f44d9eb7d9cd96707b847dd1f6\",\"vout\":0}], [{\"RAoMou7euzvDwa9dQwjrNB5A41hrAWgvBt\":0.01,\"RV37MfeBD1QTeoLHteab3j4mFVrsSaGMJx\":0.0093}]] }" diff --git a/iguana/tests/createrawtransactionT b/iguana/tests/createrawtransactionT index 1e48c0e7f..7105c977c 100755 --- a/iguana/tests/createrawtransactionT +++ b/iguana/tests/createrawtransactionT @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"createrawtransaction\",\"params\":[[{\"txid\":\"2196c07f71f206728301b03ffbffb7fd383744d03c1a3e0a1e03b6fb9ffd4ece\",\"vout\":1}], {\"1E4EadLDvqRWgSPRLqTM5YXefdaxsPPZVs\":0.009}] }" diff --git a/iguana/tests/createrelay b/iguana/tests/createrelay index 1ed85c205..b613c3db8 100755 --- a/iguana/tests/createrelay +++ b/iguana/tests/createrelay @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:14632" --data "{\"method\":\"createrelay\",\"params\":[\"ipaddr\", \"secp\", \"curve25519\"] }" diff --git a/iguana/tests/d b/iguana/tests/d index feb7a8e97..972887308 100755 --- a/iguana/tests/d +++ b/iguana/tests/d @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"decoderawtransaction\",\"params\":[\"010000009049a757019cb804dc1c70059d45c8d135bd630b2be9fcd27dd6c9d5510aec0d25e43f734b01000000834730440220777a24cf3b508571eeb597c3c8055dbf84e5a2bd17ff574a6fab7b258c10a37902200241979f977098b6691572642251bdc8f5737ec2fe7c20e95871774fb0e675200121020ce8ffc263769bfa15579b2757873ea5690107acfafb6dc1b77cd7057ac3834900000000000000000000000000000000000000000000000000ffffffff028096980000000000475221021193f3676d50b15b51a386af7a93bac569a8a71536cb3f41775cc1906771e97121032991f9c5088fca3d839c1971889c2f671d98551af2386c89628ea49f7c0b0df552ae00947604000000001976a91421e112f4211cbc612bc5f3de86acf0017b88b67d88ac00000000\", 0]}" diff --git a/iguana/tests/decodegtx b/iguana/tests/decodegtx index 54f389941..cf0447e71 100755 --- a/iguana/tests/decodegtx +++ b/iguana/tests/decodegtx @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"DEX\",\"method\":\"decoderawtransaction\",\"params\":[\"01000000018efaaa9bdf615b126eb7c84aad2b2dfa3517cd885d35be4584cceec61f619d0a0000000001014c68630405c5a357b1752102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac67a914f0a979f6abfb2f9e2e76b96b9252307d3b873f5088210398a4cb9f6ea7c52a4e27455028a95e2e4e397a110fb75f072c2c58a8bdcbf4baac68510000000001db390000000000001976a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac05c5a357\"]}" diff --git a/iguana/tests/decoderawtransaction b/iguana/tests/decoderawtransaction index b2b304204..d4ec90c4c 100755 --- a/iguana/tests/decoderawtransaction +++ b/iguana/tests/decoderawtransaction @@ -1 +1,3 @@ +#!/bin/bash +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"decoderawtransaction\",\"params\":[\"01000000020a60dab7f3bffe78198e10c891eaf9f17f9f3d81c7e947460811af732d89c80e0000000000ffffffffee42e9d592854683f92af7fb89df560b0130320cdc6b30583f2b79bf51c898a90000000049483045022100c17c84276605d03c34428920a597e69b77ddfc9e9c605c3a3f65ecc6cd2adbff022024dee05b1c276ee592aa0645b1a70f187d7b2cbf59e9f8f99921f7e054f29c2101ffffffff01a0230000000000002321020e46e79a2a8d12b9b5d12c7a91adb4e454edfae43c0a0cb805427d2ac7613fd9ac00000000\", 1]}" diff --git a/iguana/tests/decoderawtransactionB b/iguana/tests/decoderawtransactionB index 88ff573ec..bf7176403 100755 --- a/iguana/tests/decoderawtransactionB +++ b/iguana/tests/decoderawtransactionB @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"decoderawtransaction\",\"params\":[\"01000000e54ce857013758a47167e70d79da65c98ea85153f5585201caef2941d035e9d46b4a4b2aba00000000db00483045022100e4f539cd49b9e7c69ce7a486a37671a7a8f3260a4801576fb086450342efd67102204157d8fa172c48abed5c33ed9228a77d42825d59901c06c0d2d4a778b92f1b82014830450221008f1a9aa8b0fdcad174f981c53ddd74f09d054a2ec9fe7328b4b7354cb83f3d7f02201fac19a9e0f2c32707f0e9fbc2a97540d225cdb8a1cb8ed06025f6b170035c400147522102b33efbc5046df029620fdc84f6b294a725ba66a585851f63400f3c10781f86bc2103ee87c99f4665df9a9958de06493498392bc1c977936c2b84a4461f9e593c145352aeffffffff01706f9800000000001976a9148ee61a3161993f4f7b7081259bf5f3322d65d3f888ac00000000\"]}" diff --git a/iguana/tests/dpow b/iguana/tests/dpow index b48b34107..b11b68ec3 100755 --- a/iguana/tests/dpow +++ b/iguana/tests/dpow @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"020e0f6fe6e0fcdcac541eb728d6fe538a12adff20412b3c8a7fa892b223a47c2f\"}" diff --git a/iguana/tests/dpow_7776 b/iguana/tests/dpow_7776 index 67b32f507..cdb0bf06e 100755 --- a/iguana/tests/dpow_7776 +++ b/iguana/tests/dpow_7776 @@ -1 +1,3 @@ -curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"020e0f6fe6e0fcdcac541eb728d6fe538a12adff20412b3c8a7fa892b223a47c2f\"}" +#!/bin/bash +source pubkey.txt +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"iguana\",\"method\":\"dpow\",\"symbol\":\"KMD\",\"pubkey\":\"$pubkey\"}" diff --git a/iguana/tests/dumpprivkey b/iguana/tests/dumpprivkey index 3c6151dc5..3bc231d35 100755 --- a/iguana/tests/dumpprivkey +++ b/iguana/tests/dumpprivkey @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"RLaBkgU3Y61VLXPNjBd2cW1RfkghXU8yHt\"]}" diff --git a/iguana/tests/dumpprivkeyB b/iguana/tests/dumpprivkeyB index 3c6151dc5..3bc231d35 100755 --- a/iguana/tests/dumpprivkeyB +++ b/iguana/tests/dumpprivkeyB @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"RLaBkgU3Y61VLXPNjBd2cW1RfkghXU8yHt\"]}" diff --git a/iguana/tests/dumpprivkeyC b/iguana/tests/dumpprivkeyC index f5e88c91a..a73e593cf 100755 --- a/iguana/tests/dumpprivkeyC +++ b/iguana/tests/dumpprivkeyC @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"RBNzdRUrY2iDsjucQVEtEF1jyohYLg1d7U\"]}" diff --git a/iguana/tests/dumpprivkeyP b/iguana/tests/dumpprivkeyP index a37d9682f..e41683795 100755 --- a/iguana/tests/dumpprivkeyP +++ b/iguana/tests/dumpprivkeyP @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"bGgDwtn375uarXH3AqNfNLBKFHF7YGcFhN\"]}" diff --git a/iguana/tests/dumpprivkeyR b/iguana/tests/dumpprivkeyR index 15572b565..02c9bc3e5 100755 --- a/iguana/tests/dumpprivkeyR +++ b/iguana/tests/dumpprivkeyR @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpprivkey\",\"params\":[\"522102c866c51b603e2d943774314b88aff1eb04aef3971fcf34503c8f07d27915bc1d2102e053cc9d98d9e157917ed74bcabeaf72006b1ecf019d148dd3eac06271b6bcf02102869ca05bf6b476bb8cb433e08846a67037b921062f49cd0f9f66087454e88abb53ae\"]}" diff --git a/iguana/tests/dumpwallet b/iguana/tests/dumpwallet index 5ec708ec9..f573697a2 100755 --- a/iguana/tests/dumpwallet +++ b/iguana/tests/dumpwallet @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"dumpwallet\",\"params\":[]}" diff --git a/iguana/tests/encryptwallet b/iguana/tests/encryptwallet index 1af7926be..2c42f88e6 100755 --- a/iguana/tests/encryptwallet +++ b/iguana/tests/encryptwallet @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"encryptwallet\",\"passphrase\":\"test\"}" diff --git a/iguana/tests/encryptwallet2 b/iguana/tests/encryptwallet2 index 36fd9d69e..ee4aac780 100755 --- a/iguana/tests/encryptwallet2 +++ b/iguana/tests/encryptwallet2 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"encryptwallet\",\"passphrase\":\"test2\"}" diff --git a/iguana/tests/events b/iguana/tests/events index a51fc4cf7..73718832b 100755 --- a/iguana/tests/events +++ b/iguana/tests/events @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"events\",\"base\":\"BTCD\",\"rel\":\"BTC\"}" diff --git a/iguana/tests/eventsV b/iguana/tests/eventsV index 975f88de8..16de7b1dc 100755 --- a/iguana/tests/eventsV +++ b/iguana/tests/eventsV @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"events\",\"base\":\"VPN\",\"rel\":\"BTC\"}" diff --git a/iguana/tests/firstheight b/iguana/tests/firstheight index d5b181d7c..60502c019 100755 --- a/iguana/tests/firstheight +++ b/iguana/tests/firstheight @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"timeout\":20000,\"agent\":\"basilisk\",\"method\":\"balances\",\"vals\":{\"minconf\":1,\"history\":3,\"firstheight\":1181452}}" diff --git a/iguana/tests/genesis b/iguana/tests/genesis index 01bcfd446..3b5136a58 100755 --- a/iguana/tests/genesis +++ b/iguana/tests/genesis @@ -1 +1,3 @@ +#!/bin/bash +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"geckogenesis\"}" diff --git a/iguana/tests/get b/iguana/tests/get index fa1f49360..72b3e9239 100755 --- a/iguana/tests/get +++ b/iguana/tests/get @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"getmessage\",\"vals\":{\"channel\":12345,\"msgid\":1}}" diff --git a/iguana/tests/getaccountaddress b/iguana/tests/getaccountaddress index c9acb6bbc..5cc0f75cc 100755 --- a/iguana/tests/getaccountaddress +++ b/iguana/tests/getaccountaddress @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccountaddress\",\"account\":\"test\"}" diff --git a/iguana/tests/getaddressesbyaccount b/iguana/tests/getaddressesbyaccount index 1ec011ea1..f85d8980b 100755 --- a/iguana/tests/getaddressesbyaccount +++ b/iguana/tests/getaddressesbyaccount @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"agent\":\"bitcoinrpc\",\"method\":\"getaddressesbyaccount\",\"account\":\"*\"}" diff --git a/iguana/tests/getbalance b/iguana/tests/getbalance index 5256439f2..d6ddcdf35 100755 --- a/iguana/tests/getbalance +++ b/iguana/tests/getbalance @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"getbalance\",\"params\":[\"RSyKVKNxrSDc1Vwvh4guYb9ZDEpvMFz2rm\"]}" diff --git a/iguana/tests/getbalanceall b/iguana/tests/getbalanceall index 86b6fe557..ddb992fe9 100755 --- a/iguana/tests/getbalanceall +++ b/iguana/tests/getbalanceall @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"getbalance\",\"params\":[\"*\"]}" diff --git a/iguana/tests/getblock b/iguana/tests/getblock index b051ba6a5..9030b51f4 100755 --- a/iguana/tests/getblock +++ b/iguana/tests/getblock @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:14632" --data "{\"method\":\"getblock\",\"params\":[\"0000044966f40703b516c5af180582d53f783bfd319bb045e2dc3e05ea695d46\"]}" diff --git a/iguana/tests/getblockcount b/iguana/tests/getblockcount index ca9ec4b9f..06002d20e 100755 --- a/iguana/tests/getblockcount +++ b/iguana/tests/getblockcount @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:14632" --data "{\"method\":\"getblockcount\",\"params\":[]}" diff --git a/iguana/tests/getblockhash b/iguana/tests/getblockhash index 9537a87d3..ab63fdeb6 100755 --- a/iguana/tests/getblockhash +++ b/iguana/tests/getblockhash @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:14632" --data "{\"method\":\"getblockhash\",\"params\":[0]}" diff --git a/iguana/tests/getconnectioncount b/iguana/tests/getconnectioncount index efcec901f..255d38bbb 100755 --- a/iguana/tests/getconnectioncount +++ b/iguana/tests/getconnectioncount @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:14632" --data "{\"method\":\"getconnectioncount\",\"params\":[]}" diff --git a/iguana/tests/getdifficulty b/iguana/tests/getdifficulty index 06f406304..476aef6ef 100755 --- a/iguana/tests/getdifficulty +++ b/iguana/tests/getdifficulty @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:14632" --data "{\"method\":\"getdifficulty\",\"params\":[]}" diff --git a/iguana/tests/getinfo b/iguana/tests/getinfo index 6f8a1f590..3c243baba 100755 --- a/iguana/tests/getinfo +++ b/iguana/tests/getinfo @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"getinfo\",\"params\":[]}" diff --git a/iguana/tests/getinfo2 b/iguana/tests/getinfo2 index 3198b2220..5da475d91 100755 --- a/iguana/tests/getinfo2 +++ b/iguana/tests/getinfo2 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:14632" --data "{\"coin\":\"BTCD\",\"method\":\"getinfo\",\"params\":[]}" diff --git a/iguana/tests/getinfoN b/iguana/tests/getinfoN index 951c98918..85851456d 100755 --- a/iguana/tests/getinfoN +++ b/iguana/tests/getinfoN @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"NOTARY\",\"method\":\"getinfo\",\"params\":[]}" diff --git a/iguana/tests/getinfoN_7776 b/iguana/tests/getinfoN_7776 index 4173e1830..3ca934d51 100755 --- a/iguana/tests/getinfoN_7776 +++ b/iguana/tests/getinfoN_7776 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7776" --data "{\"coin\":\"NOTARY\",\"method\":\"getinfo\",\"params\":[]}" diff --git a/iguana/tests/getmessage b/iguana/tests/getmessage index 571382e44..00696f32f 100755 --- a/iguana/tests/getmessage +++ b/iguana/tests/getmessage @@ -1 +1,3 @@ +#!/bin/bash +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"getmessage\",\"vals\":{\"channel\":5784900,\"width\":60}}" diff --git a/iguana/tests/getnewaddress b/iguana/tests/getnewaddress index 26c316dbf..2a8120821 100755 --- a/iguana/tests/getnewaddress +++ b/iguana/tests/getnewaddress @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getnewaddress\",\"account\":\"\"}" diff --git a/iguana/tests/getpeers b/iguana/tests/getpeers index d7cb39eb3..7b6aafe26 100755 --- a/iguana/tests/getpeers +++ b/iguana/tests/getpeers @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"getpeers\",\"activecoin\":\"BTCD\"}" diff --git a/iguana/tests/getrawtransaction b/iguana/tests/getrawtransaction index e541e19e8..54f3c7b09 100755 --- a/iguana/tests/getrawtransaction +++ b/iguana/tests/getrawtransaction @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"getrawtransaction\",\"params\":[\"fe9ba49c411ee7b3ae16f8de6f2e32b4ea469a8ff64766be113817646100bb56\"]}" diff --git a/iguana/tests/getreceivedbyaddress b/iguana/tests/getreceivedbyaddress index 6f652200a..97c832b0c 100755 --- a/iguana/tests/getreceivedbyaddress +++ b/iguana/tests/getreceivedbyaddress @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"getreceivedbyaddress\",\"params\":[\"RL1tyXPK5NzT1d4upgcHnujgG5v3xjLaYC\"]}" diff --git a/iguana/tests/gettransaction b/iguana/tests/gettransaction index 071a20a97..a7fcae75b 100755 --- a/iguana/tests/gettransaction +++ b/iguana/tests/gettransaction @@ -1,2 +1,4 @@ +#!/bin/bash +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"gettransaction\",\"coin\":\"BTCD\",\"params\":[\"8091ecac0b6796bac05fed2838c1951a25b86c4ced31f9f711b0711c839dbbea\"]}" diff --git a/iguana/tests/gettxout b/iguana/tests/gettxout index 107624225..db806313a 100755 --- a/iguana/tests/gettxout +++ b/iguana/tests/gettxout @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"gettxout\",\"params\":[\"091c99b7b7f9b83ad2385c45b342ed5dd57035d15ff812262a3ceb3f1b291a5a\", 1]}" diff --git a/iguana/tests/gtx b/iguana/tests/gtx index cc81e80df..7b0a8d050 100755 --- a/iguana/tests/gtx +++ b/iguana/tests/gtx @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"geckotx\",\"vals\":{\"chain\":\"InstantDEX\",\"symbol\":\"DEX\"},\"hexstr\":\"01000000c3e763570001000000000000000006056adeadbeef00000000\"}" diff --git a/iguana/tests/history b/iguana/tests/history index 0546e0f11..a34942339 100755 --- a/iguana/tests/history +++ b/iguana/tests/history @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"timeout\":20000,\"agent\":\"basilisk\",\"method\":\"history\",\"vals\":{\"coin\":\"BTCD\"}}" diff --git a/iguana/tests/history2 b/iguana/tests/history2 index 0546e0f11..a34942339 100755 --- a/iguana/tests/history2 +++ b/iguana/tests/history2 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"timeout\":20000,\"agent\":\"basilisk\",\"method\":\"history\",\"vals\":{\"coin\":\"BTCD\"}}" diff --git a/iguana/tests/historyB b/iguana/tests/historyB index 7b63b6ee7..54e0175db 100755 --- a/iguana/tests/historyB +++ b/iguana/tests/historyB @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"timeout\":20000,\"agent\":\"basilisk\",\"method\":\"history\",\"vals\":{\"coin\":\"BTC\"}}" diff --git a/iguana/tests/historyS b/iguana/tests/historyS index b4f745b8d..b210c6b5c 100755 --- a/iguana/tests/historyS +++ b/iguana/tests/historyS @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"timeout\":20000,\"agent\":\"basilisk\",\"method\":\"balances\",\"vals\":{\"minconf\":1,\"history\":2}}" diff --git a/iguana/tests/historyU b/iguana/tests/historyU index 9f2dbf278..43a112365 100755 --- a/iguana/tests/historyU +++ b/iguana/tests/historyU @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"timeout\":20000,\"agent\":\"basilisk\",\"method\":\"balances\",\"vals\":{\"minconf\":1,\"history\":1}}" diff --git a/iguana/tests/igget b/iguana/tests/igget index f92792b80..436b65cc1 100755 --- a/iguana/tests/igget +++ b/iguana/tests/igget @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"getaccount\",\"params\":[\"RMd1Ek7bG7UknByTjfdDvJSXNUTahQKKWG\"]}" diff --git a/iguana/tests/igphrase b/iguana/tests/igphrase index 6f008031f..815fa4a50 100755 --- a/iguana/tests/igphrase +++ b/iguana/tests/igphrase @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"walletpassphrase\",\"params\":[\"igtest\", 66600]}" diff --git a/iguana/tests/igset b/iguana/tests/igset index 529097447..e155047ae 100755 --- a/iguana/tests/igset +++ b/iguana/tests/igset @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"setaccount\",\"params\":[\"RMd1Ek7bG7UknByTjfdDvJSXNUTahQKKWG\", \"igacct\"]}" diff --git a/iguana/tests/importprivkey b/iguana/tests/importprivkey index 26a53c9df..04e7ded6c 100755 --- a/iguana/tests/importprivkey +++ b/iguana/tests/importprivkey @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"importprivkey\",\"params\":[\"UvBSu7PtUcGFeCd4fJdWSN6NKH4DPzmMoZtPn4Sb94Tj3CyXj9Fn\", \"testing\"]}" diff --git a/iguana/tests/importprivkeyB b/iguana/tests/importprivkeyB index daf596641..7d7a14da1 100755 --- a/iguana/tests/importprivkeyB +++ b/iguana/tests/importprivkeyB @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"importprivkey\",\"params\":[\"Kzw1ordPLaxDqgn2Uz8UyjszcjyPsSM8a16CpHQ4DJF2DiVtFSX1\"]}" diff --git a/iguana/tests/importprivkeyR b/iguana/tests/importprivkeyR index e8a2551a1..2f2e3edf8 100755 --- a/iguana/tests/importprivkeyR +++ b/iguana/tests/importprivkeyR @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"importprivkey\",\"params\":[\"522102c866c51b603e2d943774314b88aff1eb04aef3971fcf34503c8f07d27915bc1d2102e053cc9d98d9e157917ed74bcabeaf72006b1ecf019d148dd3eac06271b6bcf02102869ca05bf6b476bb8cb433e08846a67037b921062f49cd0f9f66087454e88abb53ae\"]}" diff --git a/iguana/tests/incoming b/iguana/tests/incoming index baceca9a8..0811301af 100755 --- a/iguana/tests/incoming +++ b/iguana/tests/incoming @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"incoming\",\"requestid\":1728286611}" diff --git a/iguana/tests/listreceivedbyaccount b/iguana/tests/listreceivedbyaccount index 3d9771fdf..275cd7d4e 100755 --- a/iguana/tests/listreceivedbyaccount +++ b/iguana/tests/listreceivedbyaccount @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listreceivedbyaccount\",\"params\":[1, 9999999, [\"RUXwXF37SMA63vL4bUPnytP3KUwp69PCVv\"]]}" diff --git a/iguana/tests/listtransactions b/iguana/tests/listtransactions index 0b719dc7f..430fee991 100755 --- a/iguana/tests/listtransactions +++ b/iguana/tests/listtransactions @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listtransactions\",\"params\":[1, 9999999, [\"RUXwXF37SMA63vL4bUPnytP3KUwp69PCVv\"]]}" diff --git a/iguana/tests/listunspent b/iguana/tests/listunspent index c2af7cd91..3f0142af8 100755 --- a/iguana/tests/listunspent +++ b/iguana/tests/listunspent @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"listunspent\",\"params\":[1, 9999999, []]}" diff --git a/iguana/tests/listunspent2 b/iguana/tests/listunspent2 index 4d650562d..5e66227ec 100755 --- a/iguana/tests/listunspent2 +++ b/iguana/tests/listunspent2 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"listunspent\",\"params\":[1, 9999999, []]}" diff --git a/iguana/tests/listunspentB b/iguana/tests/listunspentB index e7fbcc744..3debb1992 100755 --- a/iguana/tests/listunspentB +++ b/iguana/tests/listunspentB @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"listunspent\",\"params\":[1, 9999999, [\"RVQV5spiARDTqfwBCxstWnMbrT6Q8mhRYz\"]]}" diff --git a/iguana/tests/login b/iguana/tests/login index bd706185e..5d5c33f6a 100755 --- a/iguana/tests/login +++ b/iguana/tests/login @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"login\",\"passphrase\":\"test\"}" diff --git a/iguana/tests/loop b/iguana/tests/loop index cae5818c0..7f1a05445 100755 --- a/iguana/tests/loop +++ b/iguana/tests/loop @@ -1,3 +1,4 @@ +#!/bin/bash pkill iguana while true do diff --git a/iguana/tests/loop2 b/iguana/tests/loop2 index b23fc5b8d..da4ce4ef3 100755 --- a/iguana/tests/loop2 +++ b/iguana/tests/loop2 @@ -1,3 +1,4 @@ +#!/bin/bash cd .. pkill iguana ./m_LP diff --git a/iguana/tests/ltest b/iguana/tests/ltest index 76fd2fe8f..47b655806 100755 --- a/iguana/tests/ltest +++ b/iguana/tests/ltest @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"listunspent\",\"params\":[1, 9999999, [\"RDxggCVF42Ds19DLNSjC6e3BaFk4ScCb2T\"]]}" diff --git a/iguana/tests/make_jsoncmp b/iguana/tests/make_jsoncmp index 26548619e..a05cb2f18 100755 --- a/iguana/tests/make_jsoncmp +++ b/iguana/tests/make_jsoncmp @@ -1,3 +1,4 @@ +#!/bin/bash gcc -o jsoncmp jsoncmp.c ../../agents/libcrypto777.a -pthread -lm gcc -o json_extract json_extract.c ../../agents/libcrypto777.a -pthread -lm gcc -o json_extracti json_extracti.c ../../agents/libcrypto777.a -pthread -lm diff --git a/iguana/tests/myip2 b/iguana/tests/myip2 index b8a2f0f00..5dcd33fc6 100755 --- a/iguana/tests/myip2 +++ b/iguana/tests/myip2 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"myipaddr\",\"ipaddr\":\"5.9.102.210\"}" diff --git a/iguana/tests/myip4 b/iguana/tests/myip4 index 145bd98e7..9afdd680c 100755 --- a/iguana/tests/myip4 +++ b/iguana/tests/myip4 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"SuperNET\",\"method\":\"myipaddr\",\"ipaddr\":\"78.47.196.146\"}" diff --git a/iguana/tests/new b/iguana/tests/new index 59ff44b82..2a90d146b 100755 --- a/iguana/tests/new +++ b/iguana/tests/new @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"newgeckochain\",\"vals\":{\"RELAY\":1,\"blocktime\":10,\"chain\":\"InstantDEX\",\"symbol\":\"DEX\"}}" diff --git a/iguana/tests/newtest b/iguana/tests/newtest index ba46a7827..0707a1afe 100755 --- a/iguana/tests/newtest +++ b/iguana/tests/newtest @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"newgeckochain\",\"vals\":{\"RELAY\":1,\"blocktime\":10,\"chain\":\"testchain\",\"symbol\":\"test\"}}" diff --git a/iguana/tests/notaryinit b/iguana/tests/notaryinit index db45286ee..cca040ab6 100755 --- a/iguana/tests/notaryinit +++ b/iguana/tests/notaryinit @@ -1,3 +1,4 @@ +#!/bin/bash myip=`cat myip.txt` pkill iguana ../agents/iguana notary & diff --git a/iguana/tests/openorders b/iguana/tests/openorders index 8f3e4db9d..579b941a7 100755 --- a/iguana/tests/openorders +++ b/iguana/tests/openorders @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"openorders\",\"base\":\"BTCD\",\"rel\":\"BTC\"}" diff --git a/iguana/tests/orderbook b/iguana/tests/orderbook index b5799ba80..ab2a02698 100755 --- a/iguana/tests/orderbook +++ b/iguana/tests/orderbook @@ -1 +1,3 @@ +#!/bin/bash +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"allfields\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"orderbook\",\"base\":\"BTCD\",\"rel\":\"BTC\"}" diff --git a/iguana/tests/passthru b/iguana/tests/passthru index eea232dd3..eca311fd2 100755 --- a/iguana/tests/passthru +++ b/iguana/tests/passthru @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"komodo\",\"method\":\"passthru\",\"function\":\"getinfo\",\"hex\":\"\"}" diff --git a/iguana/tests/paxrates b/iguana/tests/paxrates index e37b7f985..4faf7b3f4 100755 --- a/iguana/tests/paxrates +++ b/iguana/tests/paxrates @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"rates\",\"quotes\":[\"USD\", \"EUR\", \"JPY\", \"GBP\", \"AUD\", \"CAD\", \"CHF\", \"NZD\", \"CNY\", \"RUB\", \"MXN\", \"BRL\", \"INR\", \"HKD\", \"TRY\", \"ZAR\", \"PLN\", \"NOK\", \"SEK\", \"DKK\", \"CZK\", \"HUF\", \"ILS\", \"KRW\", \"MYR\", \"PHP\", \"RON\", \"SGD\", \"THB\", \"BGN\", \"IDR\", \"HRK\"]}" diff --git a/iguana/tests/peers.txt b/iguana/tests/peers.txt index 76848e4b4..69de8e2c2 100755 --- a/iguana/tests/peers.txt +++ b/iguana/tests/peers.txt @@ -1,3 +1,4 @@ +#!/bin/bash [ { "addr" : "85.25.217.233:14631", diff --git a/iguana/tests/pending b/iguana/tests/pending new file mode 100755 index 000000000..510ddfc86 --- /dev/null +++ b/iguana/tests/pending @@ -0,0 +1,2 @@ +#!/bin/bash +curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"dpow\",\"method\":\"pending\",\"fiat\":\"eur\"}" diff --git a/iguana/tests/priv2wif b/iguana/tests/priv2wif index 99ce4f73a..18e4ca20a 100755 --- a/iguana/tests/priv2wif +++ b/iguana/tests/priv2wif @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"agent\":\"SuperNET\",\"method\":\"priv2wif\",\"priv\":\"59c56c68e3e4910385523d67fe174509da7ddb6f7f35189e0d691d3b5e98ea0a\"}" diff --git a/iguana/tests/pub b/iguana/tests/pub index fcea54b8e..1b9dc5160 100755 --- a/iguana/tests/pub +++ b/iguana/tests/pub @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"publish\",\"vals\":{\"testfield\":\"test\"},\"hexstr\":\"deadbeef\"}" diff --git a/iguana/tests/rate b/iguana/tests/rate index 4adef8cf3..8692a94cc 100755 --- a/iguana/tests/rate +++ b/iguana/tests/rate @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"rate\",\"base\":\"BTCD\",\"rel\":\"BTC\"}" diff --git a/iguana/tests/rates b/iguana/tests/rates index c076f231e..c225efec1 100755 --- a/iguana/tests/rates +++ b/iguana/tests/rates @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"iguana\",\"method\":\"rates\",\"quotes\":[\"BTCD/BTC\", \"BTC/USD\", \"EUR/USD\", \"THB/BRL\"]}" diff --git a/iguana/tests/ratesloop b/iguana/tests/ratesloop index 764f0f684..8cb24d519 100755 --- a/iguana/tests/ratesloop +++ b/iguana/tests/ratesloop @@ -1,3 +1,4 @@ +#!/bin/bash while true do ./rates diff --git a/iguana/tests/ratify b/iguana/tests/ratify new file mode 100755 index 000000000..d00e7bdcd --- /dev/null +++ b/iguana/tests/ratify @@ -0,0 +1,2 @@ +#!/bin/bash +curl -s "http://komodonotary.com/notary.json" | curl "http://127.0.0.1:7776" -d @- diff --git a/iguana/tests/ratifyC_7776 b/iguana/tests/ratifyC_7776 new file mode 100755 index 000000000..551cc5417 --- /dev/null +++ b/iguana/tests/ratifyC_7776 @@ -0,0 +1,3 @@ +#!/bin/bash +#!/bin/bash +curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"dpow\",\"method\":\"ratify\",\"minsigs\":14,\"start\":1478381719,\"ratified\":[{\"destprevtxid0\":\"3e9475fd4798b3b451fc3c85e5569f7a80650cae5787f705869b3a7e3b190dd7\",\"destprevvout0\":0,\"srcprevtxid0\":\"034b2505b15b7dbc320aab1697c2e2c9426c9aa9184219387a287eef2905f85b\",\"srcprevvout0\":1,\"handle\":\"testA\",\"pubkey\":\"03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828\"},{\"handle\":\"testB\",\"pubkey\":\"02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344\"},{\"handle\":\"artik_AE\",\"pubkey\":\"029acf1dcd9f5ff9c455f8bb717d4ae0c703e089d16cf8424619c491dff5994c90\"},{\"handle\":\"artik_EU\",\"pubkey\":\"03f54b2c24f82632e3cdebe4568ba0acf487a80f8a89779173cdb78f74514847ce\"},{\"handle\":\"artik_NA\",\"pubkey\":\"0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842\"},{\"handle\":\"artik_SH\",\"pubkey\":\"02bdd8840a34486f38305f311c0e2ae73e84046f6e9c3dd3571e32e58339d20937\"},{\"handle\":\"badass_EU\",\"pubkey\":\"0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e\"},{\"handle\":\"badass_NA\",\"pubkey\":\"02afa1a9f948e1634a29dc718d218e9d150c531cfa852843a1643a02184a63c1a7\"},{\"handle\":\"badass_SH\",\"pubkey\":\"026b49dd3923b78a592c1b475f208e23698d3f085c4c3b4906a59faf659fd9530b\"},{\"handle\":\"crackers_EU\",\"pubkey\":\"0340c66cf2c41c41efb420af57867baa765e8468c12aa996bfd816e1e07e410728\"},{\"handle\":\"crackers_NA\",\"pubkey\":\"029e1c01131974f4cd3f564cc0c00eb87a0f9721043fbc1ca60f9bd0a1f73f64a1\"},{\"handle\":\"crackers_SH\",\"pubkey\":\"02313d72f9a16055737e14cfc528dcd5d0ef094cfce23d0348fe974b6b1a32e5f0\"},{\"handle\":\"durerus_EU\",\"pubkey\":\"02bcbd287670bdca2c31e5d50130adb5dea1b53198f18abeec7211825f47485d57\"},{\"handle\":\"eclips_EU\",\"pubkey\":\"02f236c98c025fccf8b24e96d489ca03a4345d0ec18660c03c67a522bc827b614e\"},{\"handle\":\"etszombi_EU\",\"pubkey\":\"0281b1ad28d238a2b217e0af123ce020b79e91b9b10ad65a7917216eda6fe64bf7\"},{\"handle\":\"farl4web_EU\",\"pubkey\":\"0300ecf9121cccf14cf9423e2adb5d98ce0c4e251721fa345dec2e03abeffbab3f\"},{\"handle\":\"fullmoon_AE\",\"pubkey\":\"0204a908350b8142698fdb6fabefc97fe0e04f537adc7522ba7a1e8f3bec003d4a\"},{\"handle\":\"grewal_AE\",\"pubkey\":\"034e804867936874d2dcef56ab5696f5fba059db069eb4f5c2887c61e6c60638b1\"},{\"handle\":\"grewal_NA\",\"pubkey\":\"03834b13ebaa060ecda0f94ed570a8d2a31ade1d3e29c79db6eb66887cfd0b800a\"},{\"handle\":\"grewal_SH\",\"pubkey\":\"03212a73f5d38a675ee3cdc6e82542a96c38c3d1c79d25a1ed2e42fcf6a8be4e68\"},{\"handle\":\"jeezy_EU\",\"pubkey\":\"023cb3e593fb85c5659688528e9a4f1c4c7f19206edc7e517d20f794ba686fd6d6\"},{\"handle\":\"karasugoi_NA\",\"pubkey\":\"02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982\"},{\"handle\":\"kolo_AE\",\"pubkey\":\"02ffda5a0147e781308fe66a1774793eacd9b35829073746b217845cfe7577b7dc\"},{\"handle\":\"kolo_EU\",\"pubkey\":\"03f5c08dadffa0ffcafb8dd7ffc38c22887bd02702a6c9ac3440deddcf2837692b\"},{\"handle\":\"locomb_EU\",\"pubkey\":\"025c6d26649b9d397e63323d96db42a9d3caad82e1d6076970efe5056c00c0779b\"},{\"handle\":\"movecrypto_EU\",\"pubkey\":\"021ab53bc6cf2c46b8a5456759f9d608966eff87384c2b52c0ac4cc8dd51e9cc42\"},{\"handle\":\"nxtswe_EU\",\"pubkey\":\"032fb104e5eaa704a38a52c126af8f67e870d70f82977e5b2f093d5c1c21ae5899\"},{\"handle\":\"polycryptoblock_NA\",\"pubkey\":\"02708dcda7c45fb54b78469673c2587bfdd126e381654819c4c23df0e00b679622\"},{\"handle\":\"pondsea_AE\",\"pubkey\":\"032e1c213787312099158f2d74a89e8240a991d162d4ce8017d8504d1d7004f735\"},{\"handle\":\"pondsea_EU\",\"pubkey\":\"0225aa6f6f19e543180b31153d9e6d55d41bc7ec2ba191fd29f19a2f973544e29d\"},{\"handle\":\"pondsea_NA\",\"pubkey\":\"031bcfdbb62268e2ff8dfffeb9ddff7fe95fca46778c77eebff9c3829dfa1bb411\"},{\"handle\":\"pondsea_SH\",\"pubkey\":\"02209073bc0943451498de57f802650311b1f12aa6deffcd893da198a544c04f36\"},{\"handle\":\"proto_EU\",\"pubkey\":\"03681ffdf17c8f4f0008cefb7fa0779c5e888339cdf932f0974483787a4d6747c1\"},{\"handle\":\"rnr_EU\",\"pubkey\":\"0287aa4b73988ba26cf6565d815786caf0d2c4af704d7883d163ee89cd9977edec\"},{\"handle\":\"supernet_AE\",\"pubkey\":\"029d93ef78197dc93892d2a30e5a54865f41e0ca3ab7eb8e3dcbc59c8756b6e355\"},{\"handle\":\"supernet_EU\",\"pubkey\":\"02061c6278b91fd4ac5cab4401100ffa3b2d5a277e8f71db23401cc071b3665546\"},{\"handle\":\"supernet_NA\",\"pubkey\":\"033c073366152b6b01535e15dd966a3a8039169584d06e27d92a69889b720d44e1\"},{\"handle\":\"titomane_AE\",\"pubkey\":\"03cda6ca5c2d02db201488a54a548dbfc10533bdc275d5ea11928e8d6ab33c2185\"},{\"handle\":\"titomane_EU\",\"pubkey\":\"03517fcac101fed480ae4f2caf775560065957930d8c1facc83e30077e45bdd199\"},{\"handle\":\"titomane_NA\",\"pubkey\":\"0387046d9745414fb58a0fa3599078af5073e10347e4657ef7259a99cb4f10ad47\"},{\"handle\":\"titomane_SH\",\"pubkey\":\"035f49d7a308dd9a209e894321f010d21b7793461b0c89d6d9231a3fe5f68d9960\"},{\"handle\":\"vanbreuk_EU\",\"pubkey\":\"024f3cad7601d2399c131fd070e797d9cd8533868685ddbe515daa53c2e26004c3\"},{\"handle\":\"yassin_EU\",\"pubkey\":\"033fb7231bb66484081952890d9a03f91164fb27d392d9152ec41336b71b15fbd0\"}]}" diff --git a/iguana/tests/ratifyE b/iguana/tests/ratifyE new file mode 100644 index 000000000..0a8105f44 --- /dev/null +++ b/iguana/tests/ratifyE @@ -0,0 +1,265 @@ +{ + "agent": "dpow", + "method": "ratify", + "round": "E", + "minsigs": 10, + "start": 1478713787, + "ratified": [ + { + "handle": "testA", + "pubkey": "03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828", + "destprevtxid0": "3e9475fd4798b3b451fc3c85e5569f7a80650cae5787f705869b3a7e3b190dd7", + "destprevvout0": 0, + "srcprevtxid0": "034b2505b15b7dbc320aab1697c2e2c9426c9aa9184219387a287eef2905f85b", + "srcprevvout0": 1 + }, + { + "handle": "testB", + "pubkey": "02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344" + }, + { + "handle": "artik_AE", + "pubkey": "029acf1dcd9f5ff9c455f8bb717d4ae0c703e089d16cf8424619c491dff5994c90" + }, + { + "handle": "artik_EU", + "pubkey": "03f54b2c24f82632e3cdebe4568ba0acf487a80f8a89779173cdb78f74514847ce" + }, + { + "handle": "artik_NA", + "pubkey": "0224e31f93eff0cc30eaf0b2389fbc591085c0e122c4d11862c1729d090106c842" + }, + { + "handle": "artik_SH", + "pubkey": "02bdd8840a34486f38305f311c0e2ae73e84046f6e9c3dd3571e32e58339d20937" + }, + { + "handle": "badass_EU", + "pubkey": "0209d48554768dd8dada988b98aca23405057ac4b5b46838a9378b95c3e79b9b9e" + }, + { + "handle": "badass_NA", + "pubkey": "02afa1a9f948e1634a29dc718d218e9d150c531cfa852843a1643a02184a63c1a7" + }, + { + "handle": "badass_SH", + "pubkey": "026b49dd3923b78a592c1b475f208e23698d3f085c4c3b4906a59faf659fd9530b" + }, + { + "handle": "crackers_EU", + "pubkey": "0340c66cf2c41c41efb420af57867baa765e8468c12aa996bfd816e1e07e410728" + }, + { + "handle": "crackers_NA", + "pubkey": "029e1c01131974f4cd3f564cc0c00eb87a0f9721043fbc1ca60f9bd0a1f73f64a1" + }, + { + "handle": "crackers_SH", + "pubkey": "02313d72f9a16055737e14cfc528dcd5d0ef094cfce23d0348fe974b6b1a32e5f0" + }, + { + "handle": "durerus_EU", + "pubkey": "02bcbd287670bdca2c31e5d50130adb5dea1b53198f18abeec7211825f47485d57" + }, + { + "handle": "etszombi_EU", + "pubkey": "0281b1ad28d238a2b217e0af123ce020b79e91b9b10ad65a7917216eda6fe64bf7" + }, + { + "handle": "etszombi_NA", + "pubkey": "02757999e651200ac24ff808e5dc7762ba64da1b940c7b150980f636a3866d6de9" + }, + { + "handle": "etszombii_AE", + "pubkey": "0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974" + }, + { + "handle": "etszombii_SH", + "pubkey": "025d7a193c0757f7437fad3431f027e7b5ed6c925b77daba52a8755d24bf682dde" + }, + { + "handle": "farl4web_EU", + "pubkey": "0300ecf9121cccf14cf9423e2adb5d98ce0c4e251721fa345dec2e03abeffbab3f" + }, + { + "handle": "farl4web_SH", + "pubkey": "0396bb5ed3c57aa1221d7775ae0ff751e4c7dc9be220d0917fa8bbdf670586c030" + }, + { + "handle": "fullmoon_AE", + "pubkey": "0204a908350b8142698fdb6fabefc97fe0e04f537adc7522ba7a1e8f3bec003d4a" + }, + { + "handle": "fullmoon_NA", + "pubkey": "03e928cdb694cd3805a03e6f792ac0ba177c3261d98401e9a5450f512fdb89bd09" + }, + { + "handle": "fullmoon_SH", + "pubkey": "0396699a1792207b39cd20629a51e0825e075d3a80f0237a95d4385ad2a12d88fb" + }, + { + "handle": "grewal_AE", + "pubkey": "034e804867936874d2dcef56ab5696f5fba059db069eb4f5c2887c61e6c60638b1" + }, + { + "handle": "grewal_NA", + "pubkey": "03adc0834c203d172bce814df7c7a5e13dc603105e6b0adabc942d0421aefd2132" + }, + { + "handle": "grewal_SH", + "pubkey": "03212a73f5d38a675ee3cdc6e82542a96c38c3d1c79d25a1ed2e42fcf6a8be4e68" + }, + { + "handle": "indenode_EU", + "pubkey": "0221387ff95c44cb52b86552e3ec118a3c311ca65b75bf807c6c07eaeb1be8303c" + }, + { + "handle": "jeezy_EU", + "pubkey": "023cb3e593fb85c5659688528e9a4f1c4c7f19206edc7e517d20f794ba686fd6d6" + }, + { + "handle": "karasugoi_NA", + "pubkey": "02a348b03b9c1a8eac1b56f85c402b041c9bce918833f2ea16d13452309052a982" + }, + { + "handle": "kashifali_EU", + "pubkey": "02b74e712998ca1e9580c8c0851f20f79563afd65a22d47d47e184d951bcc1e135" + }, + { + "handle": "kolo_AE", + "pubkey": "03016d19344c45341e023b72f9fb6e6152fdcfe105f3b4f50b82a4790ff54e9dc6" + }, + { + "handle": "kolo_EU", + "pubkey": "03f5c08dadffa0ffcafb8dd7ffc38c22887bd02702a6c9ac3440deddcf2837692b" + }, + { + "handle": "kolo_NA", + "pubkey": "02e17c5f8c3c80f584ed343b8dcfa6d710dfef0889ec1e7728ce45ce559347c58c" + }, + { + "handle": "kolo_SH", + "pubkey": "02aa24064500756d9b0959b44d5325f2391d8e95c6127e109184937152c384e185" + }, + { + "handle": "locomb_EU", + "pubkey": "02ea030819f09586aa33fa57c1daf80782880e509c9bae87ef8fde1a08acf78599" + }, + { + "handle": "metaphilibert_NA", + "pubkey": "02b714aa5833d7a76700c429d5542cea409826d3668ba9d75ec3407a607450563c" + }, + { + "handle": "movecrypto_AE", + "pubkey": "022783d94518e4dc77cbdf1a97915b29f427d7bc15ea867900a76665d3112be6f3" + }, + { + "handle": "movecrypto_EU", + "pubkey": "021ab53bc6cf2c46b8a5456759f9d608966eff87384c2b52c0ac4cc8dd51e9cc42" + }, + { + "handle": "movecrypto_NA", + "pubkey": "02efb12f4d78f44b0542d1c60146738e4d5506d27ec98a469142c5c84b29de0a80" + }, + { + "handle": "movecrypto_SH", + "pubkey": "031f9739a3ebd6037a967ce1582cde66e79ea9a0551c54731c59c6b80f635bc859" + }, + { + "handle": "muros_NA", + "pubkey": "0252b6185bf8ea7efe8bbc345ddc8da87329149f30233088387abd716d4aa9e974" + }, + { + "handle": "nxtswe_EU", + "pubkey": "032fb104e5eaa704a38a52c126af8f67e870d70f82977e5b2f093d5c1c21ae5899" + }, + { + "handle": "polycryptoblock_NA", + "pubkey": "02708dcda7c45fb54b78469673c2587bfdd126e381654819c4c23df0e00b679622" + }, + { + "handle": "pondsea_AE", + "pubkey": "032e1c213787312099158f2d74a89e8240a991d162d4ce8017d8504d1d7004f735" + }, + { + "handle": "pondsea_EU", + "pubkey": "0225aa6f6f19e543180b31153d9e6d55d41bc7ec2ba191fd29f19a2f973544e29d" + }, + { + "handle": "pondsea_NA", + "pubkey": "031bcfdbb62268e2ff8dfffeb9ddff7fe95fca46778c77eebff9c3829dfa1bb411" + }, + { + "handle": "pondsea_SH", + "pubkey": "02209073bc0943451498de57f802650311b1f12aa6deffcd893da198a544c04f36" + }, + { + "handle": "proto_EU", + "pubkey": "03681ffdf17c8f4f0008cefb7fa0779c5e888339cdf932f0974483787a4d6747c1" + }, + { + "handle": "rnr_AE", + "pubkey": "02ffda5a0147e781308fe66a1774793eacd9b35829073746b217845cfe7577b7dc" + }, + { + "handle": "rnr_EU", + "pubkey": "0287aa4b73988ba26cf6565d815786caf0d2c4af704d7883d163ee89cd9977edec" + }, + { + "handle": "rnr_NA", + "pubkey": "03f381ba12b70fb3c5c790ca0131a200534d608c301ff8ccca93abe4cc3444ae5b" + }, + { + "handle": "rnr_SH", + "pubkey": "037536fb9bdfed10251f71543fb42679e7c52308bcd12146b2568b9a818d8b8377" + }, + { + "handle": "siggurd_NA", + "pubkey": "03f2a02e212604afeff85bedd15703a3e47a13650013e04609140a7b3109d08f77" + }, + { + "handle": "supernet_AE", + "pubkey": "029d93ef78197dc93892d2a30e5a54865f41e0ca3ab7eb8e3dcbc59c8756b6e355" + }, + { + "handle": "supernet_EU", + "pubkey": "02061c6278b91fd4ac5cab4401100ffa3b2d5a277e8f71db23401cc071b3665546" + }, + { + "handle": "supernet_NA", + "pubkey": "033c073366152b6b01535e15dd966a3a8039169584d06e27d92a69889b720d44e1" + }, + { + "handle": "titomane_AE", + "pubkey": "03cda6ca5c2d02db201488a54a548dbfc10533bdc275d5ea11928e8d6ab33c2185" + }, + { + "handle": "titomane_EU", + "pubkey": "03517fcac101fed480ae4f2caf775560065957930d8c1facc83e30077e45bdd199" + }, + { + "handle": "titomane_NA", + "pubkey": "0387046d9745414fb58a0fa3599078af5073e10347e4657ef7259a99cb4f10ad47" + }, + { + "handle": "titomane_SH", + "pubkey": "035f49d7a308dd9a209e894321f010d21b7793461b0c89d6d9231a3fe5f68d9960" + }, + { + "handle": "vanbreuk_EU", + "pubkey": "024f3cad7601d2399c131fd070e797d9cd8533868685ddbe515daa53c2e26004c3" + }, + { + "handle": "xrobesx_NA", + "pubkey": "03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" + }, + { + "handle": "yassin_EU", + "pubkey": "033fb7231bb66484081952890d9a03f91164fb27d392d9152ec41336b71b15fbd0" + }, + { + "handle": "yassin_SH", + "pubkey": "0334e6e1ec8285c4b85bd6dae67e17d67d1f20e7328efad17ce6fd24ae97cdd65e" + } + ] +} diff --git a/iguana/tests/ratify_7776 b/iguana/tests/ratify_7776 index d2889aed4..695ec523c 100755 --- a/iguana/tests/ratify_7776 +++ b/iguana/tests/ratify_7776 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7776" --data "{\"agent\":\"dpow\",\"method\":\"ratify\",\"minsigs\":2,\"timestamp\":1476711523,\"ratified\":[{\"handle\":\"testA\",\"pubkey\":\"03b7621b44118017a16043f19b30cc8a4cfe068ac4e42417bae16ba460c80f3828\"}, {\"handle\":\"testB\",\"pubkey\":\"02ebfc784a4ba768aad88d44d1045d240d47b26e248cafaf1c5169a42d7a61d344\"}]}" diff --git a/iguana/tests/rawtx b/iguana/tests/rawtx index 84b5b8ab6..282d2ec20 100755 --- a/iguana/tests/rawtx +++ b/iguana/tests/rawtx @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"agent\":\"basilisk\",\"method\":\"rawtx\",\"vals\":{\"changeaddr\":\"1FNhoaBYzf7safMBjoCsJYgxtah3K95sep\",\"addresses\":[\"1Hgzt5xsnbfc8UTWqWKSTLRm5bEYHYBoCE\"],\"timeout\":15000,\"satoshis\":\"20000\",\"spendscript\":\"76a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac\"}}" diff --git a/iguana/tests/rawtx2 b/iguana/tests/rawtx2 index ba62c9402..391f42c58 100755 --- a/iguana/tests/rawtx2 +++ b/iguana/tests/rawtx2 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"agent\":\"basilisk\",\"method\":\"rawtx\",\"vals\":{\"changeaddr\":\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\",\"addresses\":[\"RFMEYcxuBL8S7UPdUbzXunPtS4p82HRcKs\", \"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\", \"RDBjpRUqV1AXzVJCBbbXNskgxGRj711qSc\", \"RL4aMgTBzkM1kX7d8QtE2oYXuAj2ZKabmW\", \"RDE9LBKqMaKgQgnsZM3hFCNeWfoXkHWMLs\", \"RDBjpRUqV1AXzVJCBbbXNskgxGRj711qSc\"],\"timeout\":15000,\"satoshis\":\"128700\",\"spendscript\":\"76a9142b4cf64627268ac24effd9aad5895e8ca862114288ac\",\"txfee\":\"10000\",\"burn\":0.00000000}}" diff --git a/iguana/tests/rawtx3 b/iguana/tests/rawtx3 index 2b9a967ee..7c0479903 100755 --- a/iguana/tests/rawtx3 +++ b/iguana/tests/rawtx3 @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"agent\":\"basilisk\",\"method\":\"rawtx\",\"vals\":{\"changeaddr\":\"RD1rFucYCMhCGeEqdztivP3DFdJwVAzXn7\",\"addresses\":[\"RD1rFucYCMhCGeEqdztivP3DFdJwVAzXn7\"],\"timeout\":15000,\"satoshis\":\"130000\",\"spendscript\":\"76a9145da2ae69885741a6946e01ad8aa8b5312eed856088ac\"}}" diff --git a/iguana/tests/rawtx4 b/iguana/tests/rawtx4 index ce5f72611..92cabd7f4 100755 --- a/iguana/tests/rawtx4 +++ b/iguana/tests/rawtx4 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"agent\":\"basilisk\",\"method\":\"rawtx\",\"vals\":{\"changeaddr\":\"RD1rFucYCMhCGeEqdztivP3DFdJwVAzXn7\",\"addresses\":[\"RD1rFucYCMhCGeEqdztivP3DFdJwVAzXn7\"],\"timeout\":15000,\"satoshis\":\"130000\",\"spendscript\":\"76a9145da2ae69885741a6946e01ad8aa8b5312eed856088ac\"}}" diff --git a/iguana/tests/rawtx5 b/iguana/tests/rawtx5 index ce5f72611..92cabd7f4 100755 --- a/iguana/tests/rawtx5 +++ b/iguana/tests/rawtx5 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"agent\":\"basilisk\",\"method\":\"rawtx\",\"vals\":{\"changeaddr\":\"RD1rFucYCMhCGeEqdztivP3DFdJwVAzXn7\",\"addresses\":[\"RD1rFucYCMhCGeEqdztivP3DFdJwVAzXn7\"],\"timeout\":15000,\"satoshis\":\"130000\",\"spendscript\":\"76a9145da2ae69885741a6946e01ad8aa8b5312eed856088ac\"}}" diff --git a/iguana/tests/rawtx6 b/iguana/tests/rawtx6 index e2350f361..b1e724046 100755 --- a/iguana/tests/rawtx6 +++ b/iguana/tests/rawtx6 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"rawtx\",\"agent\":\"basilisk\",\"vals\":{\"addresses\":[\"19pE1sb6hPbV5644Fud6u7voNeKPfmfP3Y\", \"17SuJzHEuLzBtyHe83sYDjQFq2HeczRA1b\", \"1DyCyE5f4wCT9vBNUrCshg3ZkF7C9hT5wK\", \"15K5spF7woSF4rzGsQWSLVttmCF1nGGDXe\", \"1APJX58afkt2A25SmPQb9TrzGHbYYHLiVu\", \"12KFXEJ9C6VmvFabj4uqKeLYLm4XMsATU1\", \"12qDPNmMXez9r8CiHaww9dJooUk8AZSueF\", \"1DM9PDaBkYU27fB9ZQipZtGJtfBakpuYDv\", \"1HiTUabo7ruYY3NbxiDZi9dpnb5t4K6AqD\", \"1Q1thfWmTTwkR1yWEUHytrKcU6uGU8gUTu\", \"187ozeW6E1pbsQYvw5yqU6kzros5uXKcZk\", \"1FtJpcQ7q9msxYwR8QpF92bZDmGzVNHpxo\", \"1KDeCZiFXuNtpARcwEwohKJJb3Yeyjy8Ui\"],\"coin\":\"SYS\",\"changeaddr\":\"15K5spF7woSF4rzGsQWSLVttmCF1nGGDXe\",\"spendscript\":\"76a914df3f034f9805301d881b0d8c24a106f8d4c7fc8c88ac\",\"satoshis\":\"10000\",\"txfee\":\"10000\",\"minconf\":2},\"basilisktag\":995811301,\"locktime\":0,\"timeout\":30000}" diff --git a/iguana/tests/rawtxB b/iguana/tests/rawtxB index a7ede91c9..9948d3c01 100755 --- a/iguana/tests/rawtxB +++ b/iguana/tests/rawtxB @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"timeout\":25000,\"agent\":\"basilisk\",\"method\":\"rawtx\",\"vals\":{\"changeaddr\":\"RRyBxbrAPRUBCUpiJgJZYrkxqrh8x5ta9Z\",\"coin\":\"BTCD\",\"satoshis\":\"20000\",\"spendscript\":\"76a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac\"}}" diff --git a/iguana/tests/repairwallet b/iguana/tests/repairwallet index c5f412816..9bd6553ff 100755 --- a/iguana/tests/repairwallet +++ b/iguana/tests/repairwallet @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"repairwallet\",\"params\":[]}" diff --git a/iguana/tests/request b/iguana/tests/request index 61a527d19..58ccace04 100755 --- a/iguana/tests/request +++ b/iguana/tests/request @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"request\",\"vals\":{\"source\":\"BTCD\",\"amount\":0.03,\"dest\":\"BTC\",\"minprice\":0.002}}" diff --git a/iguana/tests/request2 b/iguana/tests/request2 index c91583c23..772db43d0 100755 --- a/iguana/tests/request2 +++ b/iguana/tests/request2 @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"request\",\"vals\":{\"source\":\"BTC\",\"amount\":0.0001,\"dest\":\"BTCD\",\"minprice\":240}}" diff --git a/iguana/tests/sell b/iguana/tests/sell index c0eb0ae05..be338e54c 100755 --- a/iguana/tests/sell +++ b/iguana/tests/sell @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}" diff --git a/iguana/tests/sell2 b/iguana/tests/sell2 index 4db541c05..cbe94d0a2 100755 --- a/iguana/tests/sell2 +++ b/iguana/tests/sell2 @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"password\":\"test\",\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"BTCD\",\"rel\":\"BTC\",\"price\":0.0029,\"volume\":1.0}" diff --git a/iguana/tests/sellV b/iguana/tests/sellV index 86f12afc6..6be066f9f 100755 --- a/iguana/tests/sellV +++ b/iguana/tests/sellV @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"dotrade\":1,\"agent\":\"InstantDEX\",\"exchange\":\"bitcoin\",\"method\":\"sell\",\"base\":\"VPN\",\"rel\":\"BTC\",\"price\":0.000025,\"volume\":1.0}" diff --git a/iguana/tests/send b/iguana/tests/send index 309e1f3e1..26aaa893d 100755 --- a/iguana/tests/send +++ b/iguana/tests/send @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"sendmessage\",\"vals\":{\"channel\":12345,\"msgid\":1},\"hexstr\":\"deadbeef\"}" diff --git a/iguana/tests/sendmany b/iguana/tests/sendmany index 957b6866a..d94192464 100755 --- a/iguana/tests/sendmany +++ b/iguana/tests/sendmany @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"sendmany\", \"params\":[\"\", {\"1D1ZrZNe3JUo7ZycKEYQQiQAWd9y54F4XZ\":0.01, \"1353tsE8YMTA4EuV7dgUXGjNFf9KpVvKHz\":0.02}, 2]}" diff --git a/iguana/tests/sendrawtransaction b/iguana/tests/sendrawtransaction index 09d9dbfda..f256ee206 100755 --- a/iguana/tests/sendrawtransaction +++ b/iguana/tests/sendrawtransaction @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"sendrawtransaction\",\"params\":[\"010000002ec9a45701048f2f330b71f5cbef5d7b1cd161b1cf2dee06ddb15b670d46a41fca3a25beed00000000904730440220039cc97a4b266bef6802db4ae6219637842e97db025529240c01ea207cbd317502204d3796090624c86c43ee150cdc99e313483fe41c6d630d22d167e828688caaeb014730440220388f36c50854292d4a62d631d012b33d1f02fdd8623180151548947eacc06a4002207fe79c455ba5860b15e7b74fa31cf25c4a0f93c1e488f446d3322712067fb73d01ffffffff01706f9800000000001976a91454a752f0d71b89d7c014ed0be29ca231c9546f9f88ac00000000\"]}" diff --git a/iguana/tests/sendtoaddress b/iguana/tests/sendtoaddress index a7366aac7..fa108b11e 100755 --- a/iguana/tests/sendtoaddress +++ b/iguana/tests/sendtoaddress @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"sendtoaddress\",\"params\":[\"RVQV5spiARDTqfwBCxstWnMbrT6Q8mhRYz\", 0.15, \"testcomment\", \"sendcomment\"]}" diff --git a/iguana/tests/set b/iguana/tests/set index 1be121420..319676317 100755 --- a/iguana/tests/set +++ b/iguana/tests/set @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"basilisk\",\"method\":\"set\",\"vals\":{\"key\":\"testkey\",\"chain\":\"test\"},\"hexstr\":\"beefdead\"}" diff --git a/iguana/tests/setaccount b/iguana/tests/setaccount index 29d9bc622..c6e95dd9b 100755 --- a/iguana/tests/setaccount +++ b/iguana/tests/setaccount @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"setaccount\",\"params\":[\"RSM6HUAiQabjEzoXrtptdyMUrUsbYicTDE\", \"newaccount\"]}" diff --git a/iguana/tests/setaccountB b/iguana/tests/setaccountB index 7106166d7..387fc2020 100755 --- a/iguana/tests/setaccountB +++ b/iguana/tests/setaccountB @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"setaccount\",\"params\":[\"RSM6HUAiQabjEzoXrtptdyMUrUsbYicTDE\", \"newaccount2\"]}" diff --git a/iguana/tests/signmessage b/iguana/tests/signmessage index 9b97e5bca..f008a24a9 100755 --- a/iguana/tests/signmessage +++ b/iguana/tests/signmessage @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"signmessage\",\"params\":[\"1KHJ4zELwwwND4dytYp7tFyBvELMH1r7a7\", \"testmessage\"]}" diff --git a/iguana/tests/signmessageC b/iguana/tests/signmessageC index 62da5d054..49d1e7ad2 100755 --- a/iguana/tests/signmessageC +++ b/iguana/tests/signmessageC @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"signmessage\",\"params\":[\"RAoMou7euzvDwa9dQwjrNB5A41hrAWgvBt\", \"testmessage\"]}" diff --git a/iguana/tests/signrawtransaction b/iguana/tests/signrawtransaction index dabdc01b0..f37a5adfe 100755 --- a/iguana/tests/signrawtransaction +++ b/iguana/tests/signrawtransaction @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"signrawtransaction\",\"params\":[\"0100000083bbd75701007b32687744a8ec1cadeda58b7db9bc8b089484820fe010aaaaae42784be24e0000000000ffffffff02bcf60100000000001976a9142b4cf64627268ac24effd9aad5895e8ca862114288ac43123b00000000001976a914b7128d2ee837cf03e30a2c0e3e0181f7b9669bb688ac00000000\", [{\"txid\":\"4ee24b7842aeaaaa10e00f828494088bbcb97d8ba5edad1ceca8447768327bc4\",\"vout\":0,\"scriptPubKey\":\"76a91442947a6941767b71f61fd9fec6514d96fef700e988ac\"}], [], \"ALL\"] }" diff --git a/iguana/tests/signrawtransaction2 b/iguana/tests/signrawtransaction2 index a25bf319e..88f8844c2 100755 --- a/iguana/tests/signrawtransaction2 +++ b/iguana/tests/signrawtransaction2 @@ -1,2 +1,4 @@ +#!/bin/bash +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"signrawtransaction\",\"params\":[\"01000000dc4f24570156bb006164173811be6647f68f9a46eab4322e6fdef816aeb3e71e419ca49bfe1800000000ffffffff01588c0200000000001976a914d8b8c039206af6cec82bca950f592801e62808cb88ac00000000\", [{\"txid\":\"fe9ba49c411ee7b3ae16f8de6f2e32b4ea469a8ff64766be113817646100bb56\",\"vout\":24}], [\"UqvuZXEAVXDXJkL4j4Xq6qoMdeJfPF1aNsCzmzfZaQ1ZgBTwfmWn\"], \"ALL\"] }" diff --git a/iguana/tests/splitfunds b/iguana/tests/splitfunds index 8715b8780..da05ff6e5 100755 --- a/iguana/tests/splitfunds +++ b/iguana/tests/splitfunds @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"agent\":\"iguana\",\"method\":\"splitfunds\",\"satoshis\":\"1000\",\"sendflag\":1,\"duplicates\":10}" diff --git a/iguana/tests/stakers b/iguana/tests/stakers index bf6c5f5f9..71aae0a92 100755 --- a/iguana/tests/stakers +++ b/iguana/tests/stakers @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"timeout\":60000,\"agent\":\"iguana\",\"method\":\"stakers\",\"activecoin\":\"BTCD\"}" diff --git a/iguana/tests/swapstatus b/iguana/tests/swapstatus index 325a1f1ac..82d2e2cc4 100755 --- a/iguana/tests/swapstatus +++ b/iguana/tests/swapstatus @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"InstantDEX\",\"method\":\"swapstatus\",\"requestid\":1728286611,\"quoteid\":123456}" diff --git a/iguana/tests/test b/iguana/tests/test index 0804f2cdf..495928084 100755 --- a/iguana/tests/test +++ b/iguana/tests/test @@ -1,2 +1,3 @@ +#!/bin/bash echo "{\"field\":\"requiredvalue\"}" > /tmp/foo ./jsoncmp /tmp/foo {\"fields\":[{\"field\":\"requiredvalue\"}]} diff --git a/iguana/tests/txdata b/iguana/tests/txdata index 182bc5e38..df6e330f4 100755 --- a/iguana/tests/txdata +++ b/iguana/tests/txdata @@ -1 +1,2 @@ +#!/bin/bash 010000007cf5a0560129b801b4a171146128ff452388de7f79ef84dd6440c8338721f262a8723ce2b24e0000006b483045022100a0916f2f567430465491f013f5c5aaa8fc85f30ecd769b63e5138bb68d0397930220444fde47c6a164ebb60c2a886be68f7037225803c3f9fbf38521227ee9fcd8a3012102bed1c9ebabc5b7e1599f994535e23c30f8d16f06a16eca70e1b3023393b5d736ffffffff6561b80200000000001976a9142a9728ebe5238ee9c792a85c31f383258988638888aca70a1300000000001976a914f6a928f1d41edc531b58e1e74d9b5f42a2b172ce88ac84e10a00000000001976a914900b8c6fff5a412419f83159fb46ba9dd44c57ce88ac94673600000000001976a9143da598437a5fefc0258bc493189161a5de913b7688ac84e10a00000000001976a9141f4d437fedd4e8edde06ebe1f4f9722344669d3188ac61b80200000000001976a914fac8ed758c3674997910f3af15f724226da8c41d88aca70a1300000000001976a9140d8a2b6acbe8377f8b7a32579b720b38928d26fe88ac23290800000000001976a9146b40f6bcf074203f3290892e6c3e2ea636801b0c88ac23290800000000001976a914bebe555fc61384241c235264e321512e276ecd8488aca3596401000000001976a9149c8da3a872ff73018d0a5431a667ceab19e6701f88ac10862b00000000001976a914c39b6e8752c40291b06feeaf4dba2220c2142cf788ac61b80200000000001976a914409818ca21d824feb495364c72641bd64400df2f88aced5c2300000000001976a914059779da335857a73b6657f2633875abef964e4888ac61b80200000000001976a9148619a26459aae54f2183ca6885bfc66e31b0297788ac46521000000000001976a914a2bbb9b2789310dbc81386101f4ae62b35009ba888ac81c45900000000001976a914dbc9bfd3805e69f5060277a4de69ec9a91cee6fd88ac46521000000000001976a9149ae8c51664de7e4a37704104ff15eba6d537bad788ac61b80200000000001976a914ab3bd2c4aca00f81dfa2f7ad66e837ef0fcd91dd88aca4ed6100000000001976a914f244452d87a1fec4db49b84ee604698d7380f7d288ac61b80200000000001976a914f827410c13fdb549c3672c081a8eaf0769dd507588acc2700500000000001976a914cfdca8d112dc3de4b9fbe466e399da759a065a7088ac5e9b5100000000001976a9142b969f3592b9958691bf446b08f09c28e284669088ac84e10a00000000001976a914430795c0cd6b4f622c61a1edae56e50835edd94f88ac61b80200000000001976a914de61ec6a29c441f62be030537c72ce452118b8e688ac61b80200000000001976a91410acba3a841fae68aba4b5ff162714c493bcc04e88ac61b80200000000001976a91471e22c8137cb5f0d93d2ea3d4c984c283f8ea95a88ac4bf87400000000001976a9141875d3f6a95714245993caf23cefec1508a302f388ac866abe00000000001976a9143c1f4f93ec300bf85f06e6e23956a0325e81aff988ac23290800000000001976a914d82ac199053ab70059239dc4c0670a766318569e88acd2f63000000000001976a914d132d60a8cf311fe597e11fe71eb12f64c46bce088acc2700500000000001976a91441189216ec876e7be716fca7fe29149a95ef946488ac61b80200000000001976a9143addea52337ad7c672fe04b102f027fcf0a801af88ac23290800000000001976a914731a82df7e0db5bd60432a937ecab8cfc171259888acc2700500000000001976a914c2fd5ba321e6aee6d39c9347ce0089ad00b51f9588ac61b80200000000001976a91498f917fe1904ec2116dc78c2713605b5cc393b4788ac61b80200000000001976a914455e29e97f8ff02973a800c16d96e44b36e502c688ac200c5700000000001976a91439cfaf75df642ce2dd2a692a4be5d19371505ef788ac23290800000000001976a914fc03963b63886a4fcf0c1fb12fd1f5210103f89488ac23290800000000001976a91432d20902680d8c2a105685297d9e87092ee2184188ac61b80200000000001976a91486e576a5a8b711dabfc765591d4d5c764ad1eb1088aced5c2300000000001976a91406c56c1bc7af3ff3804822a3fff53c2a2f6d025c88ac61b80200000000001976a914837921b1254ced8af2640777da56fcfe9e48cac388ac61b80200000000001976a914c116620ae8747f40daa653c8eddf58cd6602ec0588ac23290800000000001976a914ca8fc7699dbe46694fe194d7e65be1b42e6866b988ac5e9b5100000000001976a914c26761dc6cd0c8d1782bddc1715ed04fa6711e6688ac61b80200000000001976a914f4e3b78842d745caf17eb64984bd8f9e4b75392888ac23290800000000001976a91431f6ff68e6ee2b574ce48d7cc6df79bb3d4f763a88ac713e2e00000000001976a9141401968d43c09efedbc381385127f84bc6c779ee88ac61b80200000000001976a914507288d95ddc1c30297ffbe75c6049ab52b2abc588ac18494100000000001976a914ca3eb7d89e5712838d37b7e6bae27ff8bd46adde88ac08c31500000000001976a914debe0477f71a4387a88e668893f64c1a8e85ff1288ac23290800000000001976a91421e2fb66e1ebf5e479a723002ea457d5d33c9b6f88acc2700500000000001976a91476167f22f8f4a11ad42e54d44c5158d041d3f35088ac23290800000000001976a914e5709beffa45123a17419832dda7116af048373588ac0d697a00000000001976a91469d5f122c4972a9be5eaa545519317dfa70626e388ace27c5c00000000001976a9148467a751755e86e969b27be8c0bacd571daed2bb88ac61b80200000000001976a914ec97ef5a68fc6be0e02ff496834454963e18223388ac84e10a00000000001976a9142904efeca777bbd02a48dbed0cfefdd445c5e92088ac697b1800000000001976a914670f40dc03c009098c1603eaf7810c9a1c05395a88ac61b80200000000001976a9142da73a5e01ef854d875013af642f040e05005c7588ac61b80200000000001976a91482000570d55e62d374d0c34c4dbac56240ef852d88acc2700500000000001976a914cf4aa579ba5b12c2f3072e15f9f13549d37e838588ac61b80200000000001976a91435404d3a1a72bfb8302bcc1e3ad04f59be57daba88acd2f63000000000001976a914464a4370b3076076894da53e65f4074786f5c2f388acc2700500000000001976a91400663898623384e2e13679dc0a42134b6f2f9fc488ac61b80200000000001976a9147ed7767129e8cedc6e683988a3c546cf3034ce0988ac61b80200000000001976a9148c85c32b5137173265b3a8908a8a079d35f2cad088aca3c33c1b000000001976a9149a5de522483fd5f33f565dda83340af225f17d5488aca70a1300000000001976a9148c0964bc35065d6d78355a5f4cbe5034b5f356a088ac10862b00000000001976a914e763aae64684afa07001435a54c55d61b5409f7188ac61b80200000000001976a914a9eda113dcb89ba0fc9984e356231928e4e1503788ac273b6f01000000001976a91400427207d45a817b74f20e935dd794a23d4256d088ac697b1800000000001976a91420db5c7cb9fc153069b3c33748f918892d5897b188ac5e9b5100000000001976a914a6293e41aa0d9df57b6c2279330cd54fb99a98f588ac120fdf00000000001976a9143e064e89f2292b215cfa35a1ca9924e55b3a154e88ac46521000000000001976a914e95fc45794f57d0241c6b0a0e90a17c29cace1f288acf51f3900000000001976a91422c69a323907ef4b9c17216350dc24769d87588488ac23290800000000001976a914d69d25fddb12c495f967cc930a6b1837a2f683c288acc2700500000000001976a914bbeff7dfa4383ae320cef44eaa44950f665f628e88ac3b724900000000001976a914a2a3367d75e4e5e399017e4138197407e6cfb93a88ac4e152600000000001976a914ce9781f7d5a39c3e1b1fead5e5da2f40747d6cab88ac46521000000000001976a91491732d8876aa026764dd332b9202aeac8927d36388ac61b80200000000001976a9148d1be008ddd3358e25e7110e88d4e09eb6400fa188ace5990d00000000001976a91488d231a12e880ec2f88bd2df9250102942f3258288ac61b80200000000001976a9148a53d0dab4a2a643cd5ef747c0e4786727c6bb2a88ac93d33801000000001976a9140aae0856c56aa515137d9cd45fe69f284b0cc84c88ac84e10a00000000001976a91449919b6f02d6669c3c2d26194fccf03b72a74f7e88ac84e10a00000000001976a91473753974a6cc712d8a6b47c1ae7068bda98cf0c488ace68ec301000000001976a914e8bf0dc66ac203127aadc49c06c2f1207ab54d5c88ace5990d00000000001976a914a3fbd9847729046af324b909eb700f5d5446680e88acc2700500000000001976a9146913ec42559f6ba0b0dd743a216fa8abb090198788ac61b80200000000001976a9144ad49bc80d99732b0286678c2cb232aa5d4b1fc288ac2bec1d00000000001976a9145014b273313506de7ab7bd9e22f4d7ae8c5b320d88ac30928200000000001976a91494b58e79a98398f5984043b676b2fc5b1d9d246c88acc2700500000000001976a914e6dce6b6ecff523f07b03013d81a8de494b4111d88ac84e10a00000000001976a914bb5d4ba61f34e27c21c3014897b236aeb78182dd88ac61b80200000000001976a91412aa0018548d83dde85257e2d9eeb83feb85403488acc2700500000000001976a91416ede9013dbdfc6658a122461f0ee87972a9255388aca70a1300000000001976a914a1ca84147d965f39fd45a7c3c2ca73aa59ce804888acb4738d00000000001976a91443aa9f60dfac7072f421c6a5aa1bfc9e68dbc44888acc2700500000000001976a914f9dd37f4373bab3e04d4c3f30c88707b2cffd20288ac00000000 diff --git a/iguana/tests/validateaddress b/iguana/tests/validateaddress index 1ea44c657..f3524101f 100755 --- a/iguana/tests/validateaddress +++ b/iguana/tests/validateaddress @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTCD\",\"method\":\"validateaddress\",\"params\":[\"RSyKVKNxrSDc1Vwvh4guYb9ZDEpvMFz2rm\"]}" diff --git a/iguana/tests/validaterawtransaction b/iguana/tests/validaterawtransaction index d28b172a2..0e8d109af 100755 --- a/iguana/tests/validaterawtransaction +++ b/iguana/tests/validaterawtransaction @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"coin\":\"BTC\",\"method\":\"validaterawtransaction\",\"params\":[\"0100000001d330b1a60b68272d1249a178605ef699e26772a642a68d2e0558a7a558dc420100000000b4483045022100c4de2343865be62552137fc594a5acbe8db036aa7fc811ed7819966f6b30a0400220522776e79aff3ec77947837c03c2a6a11a1c1953f551fc0b6e87350a10c86b6601514c676304b762a657b1752102a9669e63ef1ab04913615c2f3887ea3584f81e5f08feee9535b19ab3739d8afdac67a91418a616c8617d1bbae6369e5d41c2cd1e5d4c0f9c88210398a4cb9f6ea7c52a4e27455028a95e2e4e397a110fb75f072c2c58a8bdcbf4baac685100000000000001d441\", 1]}" diff --git a/iguana/tests/verifymessage b/iguana/tests/verifymessage index 1b7761603..54b7036d1 100755 --- a/iguana/tests/verifymessage +++ b/iguana/tests/verifymessage @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"verifymessage\",\"params\":[\"1H5iJUaopB8Zpu1sBTKAPXC2MqVM1DQgRz\", \"IDbLEkZFwjfPfXyEXVKr0x0e3GjiyY3W67/wATCUanqXcD96JlzzDEHfcPjr7YpEEWItqEkR6HC+kvBSFHVp6Jc=\", \"testmessage\"]}" diff --git a/iguana/tests/verifymessageB b/iguana/tests/verifymessageB index 0b81050d0..505dbc061 100755 --- a/iguana/tests/verifymessageB +++ b/iguana/tests/verifymessageB @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"verifymessage\",\"params\":[\"1KHJ4zELwwwND4dytYp7tFyBvELMH1r7a7\", \"H2dVkWTaunFi4g1W50hsXWQy/m/G0KjrjBujo/SMSxQ3GBFPHRU3F//lTkciFP9c53hBrAnqQGaecsov6Gter3I=\", \"testmessage\"]}" diff --git a/iguana/tests/verifymessageC b/iguana/tests/verifymessageC index 1d47c0413..53aa01a2c 100755 --- a/iguana/tests/verifymessageC +++ b/iguana/tests/verifymessageC @@ -1,2 +1,3 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"verifymessage\",\"params\":[\"RAoMou7euzvDwa9dQwjrNB5A41hrAWgvBt\", \"IGIYj77TqR1PnFs4oxY503NpBDJEMA8MB9H+/dF5Xm9xadgIDEDbWor6rbBaUYIxTvGzWDKOQ2z9tHvnPzcn47E=\", \"testmessage\"]}" diff --git a/iguana/tests/walletlock b/iguana/tests/walletlock index fb2012ea4..7f8487514 100755 --- a/iguana/tests/walletlock +++ b/iguana/tests/walletlock @@ -1 +1,2 @@ +#!/bin/bash curl --url "http://127.0.0.1:7778" --data "{\"method\":\"walletlock\",\"params\":[]}" diff --git a/iguana/tests/walletpassphrase b/iguana/tests/walletpassphrase index d5c8f0fcb..1416189c8 100755 --- a/iguana/tests/walletpassphrase +++ b/iguana/tests/walletpassphrase @@ -1,2 +1,3 @@ +#!/bin/bash #curl --url "http://127.0.0.1:7778" --data "{\"method\":\"walletpassphrase\",\"params\":[\"test\", 600]}" curl --url "http://127.0.0.1:7778" --data "{\"agent\":\"bitcoinrpc\",\"method\":\"walletpassphrase\",\"password\":\"test\",\"timeout\":86444}" diff --git a/includes/iguana_apideclares.h b/includes/iguana_apideclares.h index e33255cea..fe267a9d5 100755 --- a/includes/iguana_apideclares.h +++ b/includes/iguana_apideclares.h @@ -13,10 +13,12 @@ * * ******************************************************************************/ +STRING_ARG(dpow,pending,fiat); TWO_STRINGS(iguana,dpow,symbol,pubkey); STRING_ARG(dpow,active,maskhex); TWOINTS_AND_ARRAY(dpow,ratify,minsigs,timestamp,ratified); ZERO_ARGS(dpow,cancelratify); +THREE_STRINGS(iguana,passthru,asset,function,hex); TWO_STRINGS(zcash,passthru,function,hex); TWO_STRINGS(komodo,passthru,function,hex); diff --git a/includes/iguana_funcs.h b/includes/iguana_funcs.h index d7de8a102..57c9dd01b 100755 --- a/includes/iguana_funcs.h +++ b/includes/iguana_funcs.h @@ -64,7 +64,7 @@ void iguana_syncramchain(struct iguana_info *coin); //int32_t iguana_validateramchain(struct iguana_info *coin,int64_t *netp,uint64_t *creditsp,uint64_t *debitsp,int32_t height,struct iguana_block *block,int32_t hwmheight,struct iguana_prevdep *lp); int32_t iguana_calcrmd160(struct iguana_info *coin,char *asmstr,struct vin_info *vp,uint8_t *pk_script,int32_t pk_scriptlen,bits256 debugtxid,int32_t vout,uint32_t sequence); uint32_t iguana_updatescript(struct iguana_info *coin,uint32_t blocknum,uint32_t txidind,uint32_t spendind,uint32_t unspentind,uint64_t value,uint8_t *script,int32_t scriptlen,uint32_t sequence); -void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *txdata,struct iguana_msgtx *txarray,struct iguana_msghdr *H,uint8_t *data,int32_t datalen,int32_t fromcache); +void iguana_gotblockM(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *txdata,struct iguana_msgtx *txarray,struct iguana_msghdr *H,uint8_t *data,int32_t datalen,int32_t fromcache,uint8_t zcache); int32_t iguana_parseblock(struct iguana_info *coin,struct iguana_block *block,struct iguana_msgtx *tx,int32_t numtx); uint32_t iguana_txidind(struct iguana_info *coin,uint32_t *firstvoutp,uint32_t *firstvinp,bits256 txid); bits256 iguana_txidstr(struct iguana_info *coin,uint32_t *firstvoutp,uint32_t *firstvinp,char *txidstr,uint32_t txidind); @@ -193,7 +193,7 @@ struct iguana_txblock *iguana_peertxdata(struct iguana_info *coin,int32_t *bundl int32_t iguana_peerfile_exists(struct iguana_info *coin,struct iguana_peer *addr,char *dirname,char *fname,bits256 hash2,bits256 prevhash2,int32_t numblocks); struct iguana_ramchain *iguana_ramchainset(struct iguana_info *coin,struct iguana_ramchain *ramchain,struct iguana_txblock *txdata); void *iguana_iAddriterator(struct iguana_info *coin,struct iguana_iAddr *iA,struct iguana_peer *addr); -long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *origtxdata,struct iguana_msgtx *txarray,int32_t txn_count,uint8_t *data,int32_t recvlen,struct iguana_bundle *bp,struct iguana_block *block); +long iguana_ramchain_data(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_peer *addr,struct iguana_txblock *origtxdata,struct iguana_msgtx *txarray,int32_t txn_count,uint8_t *data,int32_t recvlen,struct iguana_bundle *bp,struct iguana_block *block,uint8_t zcash); int32_t iguana_bundlehash2add(struct iguana_info *coin,struct iguana_block **blockp,struct iguana_bundle *bp,int32_t bundlei,bits256 hash2); struct iguana_block *iguana_bundleblockadd(struct iguana_info *coin,struct iguana_bundle **bpp,int32_t *bundleip,struct iguana_block *origblock); int32_t iguana_chainextend(struct supernet_info *myinfo,struct iguana_info *coin,struct iguana_block *newblock); diff --git a/includes/iguana_structs.h b/includes/iguana_structs.h index b037439a3..5ac3a9ad3 100755 --- a/includes/iguana_structs.h +++ b/includes/iguana_structs.h @@ -248,7 +248,7 @@ struct iguana_counts uint32_t firsttxidind,firstunspentind,firstspendind,firstpkind; uint64_t credits,debits; struct iguana_block block; -}PACKEDSTRUCT; +} PACKEDSTRUCT; struct iguana_blocks { @@ -263,7 +263,7 @@ struct iguana_ledger { struct iguana_counts snapshot; //struct iguana_account accounts[]; -}PACKEDSTRUCT; +} PACKEDSTRUCT; // ramchain temp file structures struct iguana_unspent20 { uint64_t value; uint32_t scriptpos,txidind:28,type:4; uint16_t scriptlen,fileid; uint8_t rmd160[20]; }PACKEDSTRUCT; @@ -508,6 +508,8 @@ struct iguana_info uint32_t utxoaddrlastcount,*utxoaddroffsets,lastunspentsupdate; uint8_t *utxoaddrtable; bits256 utxoaddrhash; FILE *utxofp; bits256 markedunspents[1024]; + char seedipaddr[64]; + uint32_t lastbesthashtime; bits256 lastbesthash; int32_t lastbestheight; struct iguana_block *RTblocks[65536]; uint8_t *RTrawdata[65536]; int32_t RTrecvlens[65536],RTnumtx[65536]; struct iguana_RTtxid *RTdataset; struct iguana_RTaddr *RTaddrs; };