From a15ea398e32396e2a6e7bf0ef543a6e610e7e16d Mon Sep 17 00:00:00 2001 From: Jorian Date: Wed, 17 Oct 2018 21:31:28 +0200 Subject: [PATCH 01/13] kmdice addition --- src/assetchains.json | 14 +++++++++++++- src/assetchains.old | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/assetchains.json b/src/assetchains.json index fb20b2cba..ffc52373a 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -168,12 +168,24 @@ "142.93.27.180" ] }, -{ + { "ac_name": "PGT", "ac_supply": "10000000", "ac_end": "1", "addnode": [ "190.114.254.104" ] + }, + { + "ac_name": "KMDICE", + "ac_supply": "10500000", + "ac_reward": "2500000000", + "ac_halving": "210000", + "ac_cc": "2", + "addressindex": "1", + "spentindex": "1", + "addnode": [ + "144.76.217.232" + ] } ] diff --git a/src/assetchains.old b/src/assetchains.old index 12c743d1d..8c08f8143 100755 --- a/src/assetchains.old +++ b/src/assetchains.old @@ -42,3 +42,4 @@ echo $pubkey ./komodod -pubkey=$pubkey -ac_name=PIRATE -ac_supply=0 -ac_reward=25600000000 -ac_halving=77777 -ac_private=1 -addnode=136.243.102.225 & ./komodod -pubkey=$pubkey -ac_name=MGNX -ac_supply=12465003 -ac_staked=90 -ac_reward=2000000000 -ac_halving=525960 -ac_cc=2 -ac_end=2629800 -addnode=142.93.27.180 & ./komodod -pubkey=$pubkey -ac_name=PGT -ac_supply=10000000 -ac_end=1 -addnode=190.114.254.104 & +./komodod -pubkey=$pubkey -ac_name=KMDICE -ac_supply=10500000 -ac_reward=2500000000 -ac_halving=210000 -ac_cc=2 -addressindex=1 -spentindex=1 -addnode=144.76.217.232 & From d0d61ef2de3c92317f9034f038613699a20c09f8 Mon Sep 17 00:00:00 2001 From: Jorian Date: Wed, 17 Oct 2018 21:33:49 +0200 Subject: [PATCH 02/13] add kmdice files --- src/ac/kmdice | 2 ++ src/fiat/kmdice | 2 ++ 2 files changed, 4 insertions(+) create mode 100755 src/ac/kmdice create mode 100755 src/fiat/kmdice diff --git a/src/ac/kmdice b/src/ac/kmdice new file mode 100755 index 000000000..ca91bf9a5 --- /dev/null +++ b/src/ac/kmdice @@ -0,0 +1,2 @@ +#!/bin/bash +./komodo-cli -ac_name=KMDICE $1 $2 $3 $4 $5 $6 diff --git a/src/fiat/kmdice b/src/fiat/kmdice new file mode 100755 index 000000000..ca91bf9a5 --- /dev/null +++ b/src/fiat/kmdice @@ -0,0 +1,2 @@ +#!/bin/bash +./komodo-cli -ac_name=KMDICE $1 $2 $3 $4 $5 $6 From da9fbe90d248dfcf8c6697a7903139cbe8a424b7 Mon Sep 17 00:00:00 2001 From: webworker01 Date: Wed, 17 Oct 2018 16:13:56 -0400 Subject: [PATCH 03/13] add dion --- src/ac/dion | 2 ++ src/assetchains.json | 11 +++++++++++ src/assetchains.old | 1 + src/fiat/dion | 2 ++ 4 files changed, 16 insertions(+) create mode 100644 src/ac/dion create mode 100644 src/fiat/dion diff --git a/src/ac/dion b/src/ac/dion new file mode 100644 index 000000000..6a3567b68 --- /dev/null +++ b/src/ac/dion @@ -0,0 +1,2 @@ +#!/bin/bash +./komodo-cli -ac_name=DION $1 $2 $3 $4 $5 $6 diff --git a/src/assetchains.json b/src/assetchains.json index ffc52373a..dce126dce 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -187,5 +187,16 @@ "addnode": [ "144.76.217.232" ] + }, + { + "ac_name": "DION", + "ac_supply": "3900000000", + "ac_reward": "22260000000", + "ac_staked": "100", + "ac_cc": "1", + "ac_end": "4300000000", + "addnode": [ + "51.75.124.34" + ] } ] diff --git a/src/assetchains.old b/src/assetchains.old index 8c08f8143..c4b79ea78 100755 --- a/src/assetchains.old +++ b/src/assetchains.old @@ -43,3 +43,4 @@ echo $pubkey ./komodod -pubkey=$pubkey -ac_name=MGNX -ac_supply=12465003 -ac_staked=90 -ac_reward=2000000000 -ac_halving=525960 -ac_cc=2 -ac_end=2629800 -addnode=142.93.27.180 & ./komodod -pubkey=$pubkey -ac_name=PGT -ac_supply=10000000 -ac_end=1 -addnode=190.114.254.104 & ./komodod -pubkey=$pubkey -ac_name=KMDICE -ac_supply=10500000 -ac_reward=2500000000 -ac_halving=210000 -ac_cc=2 -addressindex=1 -spentindex=1 -addnode=144.76.217.232 & +./komodod -pubkey=$pubkey -ac_name=DION -ac_name=DION -ac_supply=3900000000 -ac_reward=22260000000 -ac_staked=100 -ac_cc=1 -ac_end=4300000000 -addnode=51.75.124.34 & diff --git a/src/fiat/dion b/src/fiat/dion new file mode 100644 index 000000000..6a3567b68 --- /dev/null +++ b/src/fiat/dion @@ -0,0 +1,2 @@ +#!/bin/bash +./komodo-cli -ac_name=DION $1 $2 $3 $4 $5 $6 From acd9f324a7fdd96a485c396e9a7742b3a615787b Mon Sep 17 00:00:00 2001 From: webworker01 Date: Thu, 18 Oct 2018 15:52:00 +0000 Subject: [PATCH 04/13] fix dion perms and assetchains.old --- src/ac/dion | 0 src/assetchains.old | 2 +- src/fiat/dion | 0 3 files changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 src/ac/dion mode change 100644 => 100755 src/fiat/dion diff --git a/src/ac/dion b/src/ac/dion old mode 100644 new mode 100755 diff --git a/src/assetchains.old b/src/assetchains.old index c4b79ea78..42a1effb6 100755 --- a/src/assetchains.old +++ b/src/assetchains.old @@ -43,4 +43,4 @@ echo $pubkey ./komodod -pubkey=$pubkey -ac_name=MGNX -ac_supply=12465003 -ac_staked=90 -ac_reward=2000000000 -ac_halving=525960 -ac_cc=2 -ac_end=2629800 -addnode=142.93.27.180 & ./komodod -pubkey=$pubkey -ac_name=PGT -ac_supply=10000000 -ac_end=1 -addnode=190.114.254.104 & ./komodod -pubkey=$pubkey -ac_name=KMDICE -ac_supply=10500000 -ac_reward=2500000000 -ac_halving=210000 -ac_cc=2 -addressindex=1 -spentindex=1 -addnode=144.76.217.232 & -./komodod -pubkey=$pubkey -ac_name=DION -ac_name=DION -ac_supply=3900000000 -ac_reward=22260000000 -ac_staked=100 -ac_cc=1 -ac_end=4300000000 -addnode=51.75.124.34 & +./komodod -pubkey=$pubkey -ac_name=DION -ac_supply=3900000000 -ac_reward=22260000000 -ac_staked=100 -ac_cc=1 -ac_end=4300000000 -addnode=51.75.124.34 & diff --git a/src/fiat/dion b/src/fiat/dion old mode 100644 new mode 100755 From 42bf3ac4d8cc54825416d7d67d8849beced692a7 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Sun, 28 Oct 2018 22:20:07 -0700 Subject: [PATCH 05/13] Add size_on_disk to getblockchaininfo from BTC master --- src/main.h | 2 ++ src/rpcblockchain.cpp | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/main.h b/src/main.h index fd418502a..5375e3827 100644 --- a/src/main.h +++ b/src/main.h @@ -916,6 +916,8 @@ extern CBlockTreeDB *pblocktree; */ int GetSpendHeight(const CCoinsViewCache& inputs); +uint64_t CalculateCurrentUsage(); + /** Return a CMutableTransaction with contextual default values based on set of consensus rules at height */ CMutableTransaction CreateNewContextualCMutableTransaction(const Consensus::Params& consensusParams, int nHeight); diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.cpp index e9cf54bb4..98291405c 100644 --- a/src/rpcblockchain.cpp +++ b/src/rpcblockchain.cpp @@ -1253,6 +1253,7 @@ void NetworkUpgradeDescPushBack( } } + UniValue getblockchaininfo(const UniValue& params, bool fHelp) { if (fHelp || params.size() != 0) @@ -1270,6 +1271,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp) " \"difficulty\": xxxxxx, (numeric) the current difficulty\n" " \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n" " \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n" + " \"size_on_disk\": xxxxxx, (numeric) the estimated size of the block and undo files on disk\n" " \"commitments\": xxxxxx, (numeric) the current number of note commitments in the commitment tree\n" " \"softforks\": [ (array) status of softforks in progress\n" " {\n" @@ -1319,6 +1321,7 @@ UniValue getblockchaininfo(const UniValue& params, bool fHelp) obj.push_back(Pair("verificationprogress", progress)); obj.push_back(Pair("chainwork", chainActive.LastTip()->nChainWork.GetHex())); obj.push_back(Pair("pruned", fPruneMode)); + obj.push_back(Pair("size_on_disk", CalculateCurrentUsage())); ZCIncrementalMerkleTree tree; pcoinsTip->GetAnchorAt(pcoinsTip->GetBestAnchor(), tree); From b40dfbd8a1b92bec2aad984fab723a74b4f40370 Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Sun, 4 Nov 2018 01:56:19 +0300 Subject: [PATCH 07/13] Fix dion \n typo, try 2 --- src/ac/dion | 4 ++-- src/fiat/dion | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ac/dion b/src/ac/dion index 6a3567b68..889f9e1ad 100755 --- a/src/ac/dion +++ b/src/ac/dion @@ -1,2 +1,2 @@ -#!/bin/bash -./komodo-cli -ac_name=DION $1 $2 $3 $4 $5 $6 +#!/bin/bash +./komodo-cli -ac_name=DION $1 $2 $3 $4 $5 $6 diff --git a/src/fiat/dion b/src/fiat/dion index 6a3567b68..889f9e1ad 100755 --- a/src/fiat/dion +++ b/src/fiat/dion @@ -1,2 +1,2 @@ -#!/bin/bash -./komodo-cli -ac_name=DION $1 $2 $3 $4 $5 $6 +#!/bin/bash +./komodo-cli -ac_name=DION $1 $2 $3 $4 $5 $6 From 3884ef2b904403271009a366744a93c2f2646eef Mon Sep 17 00:00:00 2001 From: Mihail Fedorov Date: Sat, 10 Nov 2018 02:30:08 +0300 Subject: [PATCH 08/13] Removed KMDICE --- src/assetchains.json | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/assetchains.json b/src/assetchains.json index dce126dce..d26f3a99a 100644 --- a/src/assetchains.json +++ b/src/assetchains.json @@ -176,18 +176,6 @@ "190.114.254.104" ] }, - { - "ac_name": "KMDICE", - "ac_supply": "10500000", - "ac_reward": "2500000000", - "ac_halving": "210000", - "ac_cc": "2", - "addressindex": "1", - "spentindex": "1", - "addnode": [ - "144.76.217.232" - ] - }, { "ac_name": "DION", "ac_supply": "3900000000", From 547998f53651c7b333cd5ce4d6f461560b927455 Mon Sep 17 00:00:00 2001 From: jl777 Date: Wed, 21 Nov 2018 01:37:36 -1100 Subject: [PATCH 09/13] maxinputs+1 --- src/cc/CCtx.cpp | 2 +- src/cc/faucet.cpp | 2 +- src/cc/gateways.cpp | 2 +- src/cc/rewards.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index d927119d6..df6c8e73c 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -348,7 +348,7 @@ int64_t AddNormalinputs(CMutableTransaction &mtx,CPubKey mypk,int64_t total,int3 LOCK2(cs_main, pwalletMain->cs_wallet); pwalletMain->AvailableCoins(vecOutputs, false, NULL, true); utxos = (struct CC_utxo *)calloc(maxutxos,sizeof(*utxos)); - threshold = total/maxinputs; + threshold = total/(maxinputs+1); if ( maxinputs > maxutxos ) maxutxos = maxinputs; sum = 0; diff --git a/src/cc/faucet.cpp b/src/cc/faucet.cpp index 3bf8a3476..6aab25326 100644 --- a/src/cc/faucet.cpp +++ b/src/cc/faucet.cpp @@ -146,7 +146,7 @@ int64_t AddFaucetInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CPub std::vector > unspentOutputs; GetCCaddress(cp,coinaddr,pk); SetCCunspents(unspentOutputs,coinaddr); - threshold = total/maxinputs; + threshold = total/(maxinputs+1); for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { txid = it->first.txhash; diff --git a/src/cc/gateways.cpp b/src/cc/gateways.cpp index a9fc6a4cd..19afb2ec7 100644 --- a/src/cc/gateways.cpp +++ b/src/cc/gateways.cpp @@ -336,7 +336,7 @@ int64_t AddGatewaysInputs(struct CCcontract_info *cp,CMutableTransaction &mtx,CP std::vector > unspentOutputs; GetCCaddress(cp,coinaddr,pk); SetCCunspents(unspentOutputs,coinaddr); - threshold = total/maxinputs; + threshold = total/(maxinputs+1); fprintf(stderr,"check %s for gateway inputs\n",coinaddr); for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { diff --git a/src/cc/rewards.cpp b/src/cc/rewards.cpp index 649a9a9e6..f41a84a27 100644 --- a/src/cc/rewards.cpp +++ b/src/cc/rewards.cpp @@ -333,7 +333,7 @@ int64_t AddRewardsInputs(CScript &scriptPubKey,uint64_t maxseconds,struct CCcont std::vector > unspentOutputs; GetCCaddress(cp,coinaddr,pk); SetCCunspents(unspentOutputs,coinaddr); - threshold = total/maxinputs; + threshold = total/(maxinputs+1); for (std::vector >::const_iterator it=unspentOutputs.begin(); it!=unspentOutputs.end(); it++) { txid = it->first.txhash; From b1925e47e07bd1bdb54bf908548445af500d222b Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Nov 2018 04:19:31 -1100 Subject: [PATCH 10/13] Rename rpcblockchain --- src/{rpcblockchain.cpp => rpcblockchain.old} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/{rpcblockchain.cpp => rpcblockchain.old} (100%) diff --git a/src/rpcblockchain.cpp b/src/rpcblockchain.old similarity index 100% rename from src/rpcblockchain.cpp rename to src/rpcblockchain.old From 2b8a2bc2e14536f4cbfdb9a95f06ad1e05120ef6 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Nov 2018 04:38:47 -1100 Subject: [PATCH 11/13] Description of migrate --- src/cc/dapps/zmigrate.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 276815363..643a16ca2 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -19,6 +19,20 @@ #include #include "cJSON.c" +/* +z_migrate: the purpose of z_migrate is to make converting of all sprout outputs into sapling. the usage would be for the user to specify a sapling address and call z_migrate zsaddr, until it returns that there is nothing left to be done. + +its main functionality is quite similar to a z_mergetoaddress ANY_ZADDR -> onetime_taddr followed by a z_sendmany onetime_taddr -> zsaddr + +since the z_mergetoaddress will take time, it would just queue up an async operation. When it starts, it should see if there are any onetime_taddr with 10000.0001 funds in it, that is a signal for it to do the sapling tx and it can just do that without async as it is fast enough, especially with a taddr input. Maybe it limits itself to one, or it does all possible taddr -> sapling as fast as it can. either is fine as it will be called over and over anyway. + +It might be that there is nothing to do, but some operations are pending. in that case it would return such a status. as soon as the operation finishes, there would be more work to do. + +the amount sent to the taddr, should be 10000.0001 + +The GUI or user would be expected to generate a sapling address and then call z_migrate saplingaddr in a loop, until it returns that it is all done. this loop should pause for 10 seconds or so, if z_migrate is just waiting for opid to complete. +*/ + bits256 zeroid; char hexbyte(int32_t c) From 2f385de2657026317464cedc4ae0a2ae34a8477a Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Nov 2018 05:13:56 -1100 Subject: [PATCH 12/13] -print and 10,000 limit for migrate --- src/cc/dapps/zmigrate.c | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 643a16ca2..941e18bbc 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -906,7 +906,7 @@ int32_t main(int32_t argc,char **argv) zsaddr = clonestr(argv[2]); printf("%s: %s %s\n",REFCOIN_CLI,coinstr,zsaddr); char coinaddr[64],zcaddr[128],opidstr[128]; int32_t alldone,finished; int64_t amount,stdamount,txfee; - stdamount = 1000 * SATOSHIDEN; + stdamount = 10000 * SATOSHIDEN; txfee = 10000; again: printf("start processing zmigrate\n"); diff --git a/src/main.cpp b/src/main.cpp index 0df44abf9..a663296e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3901,7 +3901,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock * pblock = █ } KOMODO_CONNECTING = (int32_t)pindexNew->GetHeight(); - fprintf(stderr,"%s connecting ht.%d maxsize.%d vs %d\n",ASSETCHAINS_SYMBOL,(int32_t)pindexNew->GetHeight(),MAX_BLOCK_SIZE(pindexNew->GetHeight()),(int32_t)::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION)); + //fprintf(stderr,"%s connecting ht.%d maxsize.%d vs %d\n",ASSETCHAINS_SYMBOL,(int32_t)pindexNew->GetHeight(),MAX_BLOCK_SIZE(pindexNew->GetHeight()),(int32_t)::GetSerializeSize(*pblock, SER_NETWORK, PROTOCOL_VERSION)); // Get the current commitment tree SproutMerkleTree oldSproutTree; SaplingMerkleTree oldSaplingTree; From 5d024a787ff1737a795ff8e3719ffb55e59daeb7 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sun, 25 Nov 2018 06:00:41 -1100 Subject: [PATCH 13/13] Bigger delay in migrate --- src/cc/dapps/zmigrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 941e18bbc..510c28823 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -906,7 +906,7 @@ int32_t main(int32_t argc,char **argv) zsaddr = clonestr(argv[2]); printf("%s: %s %s\n",REFCOIN_CLI,coinstr,zsaddr); char coinaddr[64],zcaddr[128],opidstr[128]; int32_t alldone,finished; int64_t amount,stdamount,txfee; - stdamount = 10000 * SATOSHIDEN; + stdamount = 1000 * SATOSHIDEN; txfee = 10000; again: printf("start processing zmigrate\n"); @@ -915,7 +915,7 @@ again: { if ( have_pending_opid(coinstr,0) != 0 ) { - sleep(3); + sleep(60); continue; } alldone = 1;