Merge pull request #34 from jl777/master

Monthly cap on active user reward
This commit is contained in:
pbca26
2018-05-04 19:16:45 +03:00
committed by GitHub
7 changed files with 66 additions and 26 deletions

View File

@@ -1,4 +1,6 @@
First off you need Apple's Xcode (at least version 7, preferably 8.x) and the Xcode Command Line Tools:
## Install for Mac OS X
First off you need Apple's Xcode (at least version 7, preferably 8.x or later) and the Xcode Command Line Tools:
https://itunes.apple.com/us/app/xcode/id497799835?mt=12
@@ -11,25 +13,51 @@ And this is the list of brew packages you'll need installed:
```shell
brew tap discoteq/discoteq; brew install flock
brew install autoconf autogen automake
brew tap homebrew/versions; brew install homebrew/versions/gcc5
brew install gcc5
brew install binutils
brew install protobuf
brew install coreutils
brew install wget
```
or
```shell
brew tap discoteq/discoteq; brew install flock autoconf autogen automake gcc5 binutils protobuf coreutils wget
```
Get all that installed, then run:
```shell
git clone https://github.com/j-cimb-barker/komodo.git
git clone https://github.com/jl777/komodo.git
cd komodo
git checkout dev
./zcutil/build-mac.sh
./zcutil/fetch-params.sh
```
To build a distributable version of komodo then run the makeDistrib.sh script after building.
When you are done building, you need to do a few things in the [Configuration](https://github.com/zcash/zcash/wiki/1.0-User-Guide#configuration) section of the Zcash User Guide differently because we are on the Mac. All instances of `~/.zcash` need to be replaced by `~/Library/Application\ Support/Zcash`
The fetch-params.sh script, however, has already been altered to fetch the proving keys into the correct directory to conform to Mac specific naming conventions.
When you are done building, you need to create `Komodo.conf` the Mac way.
```shell
mkdir ~/Library/Application\ Support/Komodo
touch ~/Library/Application\ Support/Komodo/Komodo.conf
nano ~/Library/Application\ Support/Komodo/Komodo.conf
```
Add the following lines to the Komodo.conf file:
```shell
rpcuser=dontuseweakusernameoryougetrobbed
rpcpassword=dontuseweakpasswordoryougetrobbed
txindex=1
addnode=5.9.102.210
addnode=78.47.196.146
addnode=178.63.69.164
addnode=88.198.65.74
addnode=5.9.122.241
addnode=144.76.94.38
addnode=89.248.166.91
```
Happy Building

View File

@@ -30,10 +30,10 @@ It downloads and stores the entire history of Komodo transactions; depending on
- Max Supply: 200 million KMD.
- Block Time: 1M 2s
- Block Reward: 3KMD
- Mining Algorithm: Equihash
- Mining Algorithm: Equihash
## About this Project
Komodo is based on Zcash and has been by our innovative consensus algorithm called dPoW which utilizes Bitcoin's hashrate to store Komodo blockchain information into the Bitcoin blockchain. Other new and native Komodo features are the privacy technology called JUMBLR or our assetchain capabilities (one click plug and play blockchain solutions). More details are available under https://komodoplatform.com/.
Komodo is based on Zcash and has been by our innovative consensus algorithm called dPoW which utilizes Bitcoin's hashrate to store Komodo blockchain information into the Bitcoin blockchain. Other new and native Komodo features are the privacy technology called JUMBLR or our assetchain capabilities (one click plug and play blockchain solutions). More details are available under https://komodoplatform.com/.
## Getting started
Dependencies
@@ -93,14 +93,16 @@ To reset the blockchain, from *~/.komodo* `rm -rf blocks chainstate debug.log ko
Create komodo.conf
------------------
Please use a secure rpcuser and rpcpassword to ensure your funds safety.
```
cd ~
mkdir .komodo
cd .komodo
pico komodo.conf
#Add the following lines to the komodo.conf file:
rpcuser=bitcoinrpc
rpcpassword=password
rpcuser=dontuseweakusernameoryougetrobbed
rpcpassword=dontuseweakpasswordoryougetrobbed
txindex=1
addnode=5.9.102.210
addnode=78.47.196.146
@@ -134,7 +136,7 @@ cd komodo
#To view the process:
ps -ef | grep komodod
#To stop the daemon:
./src/komodo-cli stop
./src/komodo-cli stop
#To view komodod output:
tail -f ~/.komodo/debug.log
@@ -174,7 +176,7 @@ There is a small chance that an outbound transaction will give an error due to m
**To change modes:**
a) backup all privkeys (launch komodod with `-exportdir=<path>` and `dumpwallet`)
b) start a totally new sync including `wallet.dat`, launch with same `exportdir`
c) stop it before it gets too far and import all the privkeys from a) using `komodo-cli importwallet filename`
@@ -201,7 +203,7 @@ JUMBLR implements t -> z, z -> z and z -> t transactions to maximize privacy of
Which of the three stages is done is randomly selected at each turn. Also when there is more than one possible transaction at the selected stage, a random one is selected. This randomization prevents analyzing incoming z ->t transactions by its size to correlate it to the originating address.
`jumblr_deposit <depositaddr>` designates the deposit address as the jumblr deposit address for that session. You can select an address that already has funds in it and it will immediately start jumblr process. If there are no funds, it will wait until you send funds to it.
There are three sizes of a jumblr transaction: 10 KMD, 100 KMD and 1000 KMD. There is also a fixed interval of blocks where all jumblr nodes are active. Currently it is set to be 10, but this is subject to change. Only during every 10*10 blocks are the largest 1000 KMD transactions processed, so this concentrates all the large transactions every N*N blocks.
`jumblr_secret <secretaddress>` notifies JUMBLR where to send the final z -> t transactions. In order to allow larger accounts to obtain privacy, up to 777 secret addresses are supported. Whenever a z -> t stage is activated, a random secret address from the list of the then active secret addresses is selected.

View File

@@ -1,5 +1,5 @@
rpcuser=minion
rpcpassword=1235baf8-3725-11e8-b9ec-1239db4ec123
rpcuser=dontuseweakusernameoryougetrobbed
rpcpassword=dontuseweakpasswordoryougetrobbed
txindex=1
server=1
rpcworkqueue=64
@@ -9,4 +9,4 @@ addnode=178.63.69.164
addnode=88.198.65.74
addnode=5.9.122.241
addnode=144.76.94.38
addnode=89.248.166.91
addnode=89.248.166.91

View File

@@ -45,7 +45,7 @@ struct komodo_state KOMODO_STATES[34];
int COINBASE_MATURITY = _COINBASE_MATURITY;//100;
int32_t IS_KOMODO_NOTARY,USE_EXTERNAL_PUBKEY,KOMODO_CHOSEN_ONE,ASSETCHAINS_SEED,KOMODO_ON_DEMAND,KOMODO_EXTERNAL_NOTARIES,KOMODO_PASSPORT_INITDONE,KOMODO_PAX,KOMODO_EXCHANGEWALLET,KOMODO_REWIND;
int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED,JUMBLR_PAUSE,ASSETCHAINS_CC;
int32_t KOMODO_LASTMINED,prevKOMODO_LASTMINED,JUMBLR_PAUSE=1,ASSETCHAINS_CC;
std::string NOTARY_PUBKEY,ASSETCHAINS_NOTARIES,ASSETCHAINS_OVERRIDE_PUBKEY;
uint8_t NOTARY_PUBKEY33[33],ASSETCHAINS_OVERRIDE_PUBKEY33[33];

View File

@@ -80,13 +80,15 @@ uint64_t komodo_moneysupply(int32_t height)
}
#endif
uint64_t _komodo_interestnew(uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
uint64_t _komodo_interestnew(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uint32_t tiptime)
{
int32_t minutes; uint64_t interest = 0;
if ( nLockTime >= LOCKTIME_THRESHOLD && tiptime > nLockTime && (minutes= (tiptime - nLockTime) / 60) >= 60 )
{
if ( minutes > 365 * 24 * 60 )
minutes = 365 * 24 * 60;
if ( txheight >= 1000000 && minutes > 31 * 24 * 60 )
minutes = 31 * 24 * 60;
minutes -= 59;
interest = ((nValue / 10512000) * minutes);
}
@@ -97,7 +99,7 @@ uint64_t komodo_interestnew(int32_t txheight,uint64_t nValue,uint32_t nLockTime,
{
uint64_t interest = 0;
if ( txheight < KOMODO_ENDOFERA && nLockTime >= LOCKTIME_THRESHOLD && tiptime != 0 && nLockTime < tiptime && nValue >= 10*COIN ) //komodo_moneysupply(txheight) < MAX_MONEY &&
interest = _komodo_interestnew(nValue,nLockTime,tiptime);
interest = _komodo_interestnew(txheight,nValue,nLockTime,tiptime);
return(interest);
}
@@ -151,21 +153,21 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
else if ( txheight < 1000000 )
{
interest = (numerator * minutes) / ((uint64_t)365 * 24 * 60);
interestnew = _komodo_interestnew(nValue,nLockTime,tiptime);
interestnew = _komodo_interestnew(txheight,nValue,nLockTime,tiptime);
if ( interest < interestnew )
printf("pathA current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime);
}
else interest = _komodo_interestnew(nValue,nLockTime,tiptime);
else interest = _komodo_interestnew(txheight,nValue,nLockTime,tiptime);
}
else if ( txheight < 1000000 )
{
numerator = (nValue * KOMODO_INTEREST);
interest = (numerator / denominator) / COIN;
interestnew = _komodo_interestnew(nValue,nLockTime,tiptime);
interestnew = _komodo_interestnew(txheight,nValue,nLockTime,tiptime);
if ( interest < interestnew )
printf("pathB current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime);
}
else interest = _komodo_interestnew(nValue,nLockTime,tiptime);
else interest = _komodo_interestnew(txheight,nValue,nLockTime,tiptime);
}
else
{
@@ -187,11 +189,11 @@ uint64_t komodo_interest(int32_t txheight,uint64_t nValue,uint32_t nLockTime,uin
numerator = (nValue / 20); // assumes 5%!
interest = ((numerator * minutes) / ((uint64_t)365 * 24 * 60));
//fprintf(stderr,"interest %llu %.8f <- numerator.%llu minutes.%d\n",(long long)interest,(double)interest/COIN,(long long)numerator,(int32_t)minutes);
interestnew = _komodo_interestnew(nValue,nLockTime,tiptime);
interestnew = _komodo_interestnew(txheight,nValue,nLockTime,tiptime);
if ( interest < interestnew )
fprintf(stderr,"pathC current interest %.8f vs new %.8f for ht.%d %.8f locktime.%u tiptime.%u\n",dstr(interest),dstr(interestnew),txheight,dstr(nValue),nLockTime,tiptime);
}
else interest = _komodo_interestnew(nValue,nLockTime,tiptime);
else interest = _komodo_interestnew(txheight,nValue,nLockTime,tiptime);
}
if ( 0 && numerator == (nValue * KOMODO_INTEREST) )
fprintf(stderr,"komodo_interest.%d %lld %.8f nLockTime.%u tiptime.%u minutes.%d interest %lld %.8f (%llu / %llu) prod.%llu\n",txheight,(long long)nValue,(double)nValue/COIN,nLockTime,tiptime,minutes,(long long)interest,(double)interest/COIN,(long long)numerator,(long long)denominator,(long long)(numerator * minutes));

View File

@@ -203,7 +203,10 @@ UniValue jumblr_deposit(const UniValue& params, bool fHelp)
{
string addr = params[0].get_str();
if ( (retval= Jumblr_depositaddradd((char *)addr.c_str())) >= 0 )
{
result.push_back(Pair("result", retval));
JUMBLR_PAUSE = 0;
}
else result.push_back(Pair("error", retval));
} else result.push_back(Pair("error", "invalid address"));
return(result);
@@ -222,6 +225,7 @@ UniValue jumblr_secret(const UniValue& params, bool fHelp)
retval = Jumblr_secretaddradd((char *)addr.c_str());
result.push_back(Pair("result", "success"));
result.push_back(Pair("num", retval));
JUMBLR_PAUSE = 0;
} else result.push_back(Pair("error", "invalid address"));
return(result);
}

View File

@@ -2,7 +2,11 @@
set -eu
PARAMS_DIR="$HOME/.zcash-params"
if [[ "$OSTYPE" == "darwin"* ]]; then
PARAMS_DIR="$HOME/Library/Application Support/ZcashParams"
else
PARAMS_DIR="$HOME/.zcash-params"
fi
SPROUT_PKEY_NAME='sprout-proving.key'
SPROUT_VKEY_NAME='sprout-verifying.key'