├── .gitignore ├── README.md ├── change-checker.sh ├── compile.sh ├── config_example.json ├── configs ├── bytecoin-v2 │ ├── crossnote.json │ ├── dashcoin.json │ ├── forknote-messages.json │ ├── forknote-webwallet.json │ └── forknote.json ├── bytecoin │ └── dashcoin.json └── monero │ ├── aeon.json │ ├── dashcoin.json │ ├── monero-block-explorer.json │ └── wownero.json ├── cores ├── bytecoin-v2.json ├── bytecoin.json └── monero.json ├── docs └── windows-requirements-install.md ├── extensions ├── bytecoin-v2 │ ├── block-hosts.json │ ├── blockchain-explorer.json │ ├── bug-fixes.json │ ├── bugged-zawy-difficulty-algorithm.json │ ├── core │ │ └── bytecoin.json │ ├── cryptonight-v7.json │ ├── cryptonote-coin-clones-support.json │ ├── daemon-getrandom_outs-json.json │ ├── enable-cors.json │ ├── fee-address.json │ ├── genesis-block-reward.json │ ├── get-blockchain-settings.json │ ├── input-keys-output-key.json │ ├── kill-height.json │ ├── mandatory-transaction-in-block.json │ ├── max-transaction-size-limit.json │ ├── min-mixin.json │ ├── mixin-start-height.json │ ├── mnemonics.json │ ├── mnemonics │ │ ├── chinese_simplified.h │ │ ├── dutch.h │ │ ├── electrum-words.cpp │ │ ├── electrum-words.h │ │ ├── english.h │ │ ├── english_old.h │ │ ├── esperanto.h │ │ ├── french.h │ │ ├── german.h │ │ ├── italian.h │ │ ├── japanese.h │ │ ├── language_base.h │ │ ├── lojban.h │ │ ├── portuguese.h │ │ ├── russian.h │ │ ├── singleton.h │ │ └── spanish.h │ ├── multiply.json │ ├── multiply │ │ ├── bugged-zawy-difficulty-algorithm.json │ │ ├── cryptonight-v7.json │ │ ├── cryptonote-coin-clones-support.json │ │ ├── files │ │ │ ├── CoinBaseConfiguration.cpp │ │ │ ├── CoinBaseConfiguration.h │ │ │ └── README.md │ │ ├── genesis-block-reward.json │ │ ├── kill-height.json │ │ ├── mandatory-transaction-in-block.json │ │ ├── max-transaction-size-limit.json │ │ ├── min-mixin.json │ │ ├── mixin-start-height.json │ │ ├── tail-emission-reward.json │ │ ├── versionized-parameters.json │ │ ├── zawy-difficulty-algorithm.json │ │ ├── zawy-lwma-difficulty-algorithm.json │ │ └── zawy-lwma2-difficulty-algorithm.json │ ├── print-genesis-tx.json │ ├── simplewallet-default-fee.json │ ├── simplewallet-export-keys.json │ ├── simplewallet-import-keys.json │ ├── speed-up-wallet-sync.json │ ├── tail-emission-reward.json │ ├── transaction-extra-message-tag.json │ ├── versionized-parameters.json │ ├── walletd-extension.json │ ├── walletd-spent-transfers-tracking-mode.json │ ├── zawy-difficulty-algorithm.json │ ├── zawy-lwma-difficulty-algorithm.json │ └── zawy-lwma2-difficulty-algorithm.json ├── bytecoin │ └── core │ │ ├── bytecoin.json │ │ └── files │ │ └── Makefile └── monero │ ├── aeon.json │ ├── aeon │ └── files │ │ ├── blocks.dat │ │ └── tests │ │ ├── hash │ │ └── tests-slow-with-multiplier.txt │ │ └── performance_tests │ │ └── cn_slow_hash_with_multiplier_test.h │ ├── blockchain-explorer.json │ ├── bytecoin-clone.json │ ├── core │ ├── monero.json │ └── monero │ │ └── files │ │ ├── blocks.dat │ │ ├── checkpoints.dat │ │ └── testnet_blocks.dat │ ├── donations.json │ ├── enable-cors.json │ └── versionized-parameters.json ├── generator.sh ├── install_dependencies.sh ├── lib ├── environment_variables.py └── file-modification.py └── vars.cfg /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /generated_files 3 | config.json 4 | /extensions/core/cryptonotecoin.py 5 | /test/core/cryptonotecoin-test.sh -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | cryptonote-generator 2 | ================== 3 | 4 | A python / bash Cryptonote source creator. Generate and compile new or maintain old code with a single command. 5 | 6 | #### Table of Contents 7 | 8 | * [Features](#features) 9 | * [Usage](#usage) 10 | * [Downloading & Installing](#1-downloading--installing) 11 | * [Configuration](#2-configuration) 12 | * [Generate coin](#3-generate-coin) 13 | * [Print genesis tx hex](#4-print-genesis-tx-hex) 14 | * [Examples (real life)](#examples_real_life) 15 | * [Dashcoin](#1-dashcoin) 16 | * [Forknote](#2-forknote) 17 | * [Coins Using This Software](#coins-using-this-software) 18 | * [Community / Support](#community--support) 19 | * [Contributing](#contributing) 20 | 21 | #### Features 22 | 23 | * Cryptonote source code creation, based on: 24 | * Bytecoin code (latest version) 25 | * Single command code and binaries update 26 | * Simple update for existing code 27 | * Compile for 28 | * Windows (tested on 8.1) 29 | * Ubuntu (tested on 14.04) 30 | * Mac OS X (tested on Yosemite) 31 | 32 | Usage 33 | === 34 | 35 | #### 1) Downloading & Installing 36 | 37 | Clone the repository: 38 | 39 | ```bash 40 | git clone https://github.com/forknote/cryptonote-generator.git generator 41 | cd generator 42 | ``` 43 | 44 | Install dependencies: 45 | 46 | * Windows - [follow this instructions](https://github.com/dashcoin/cryptonote-generator/blob/master/docs/windows-requirements-install.md) 47 | * Linux / Mac OS X 48 | ``` 49 | bash install_dependencies.sh 50 | ``` 51 | 52 | #### 2) Configuration 53 | 54 | 55 | *Warning for existing Cryptonote coins other than Dashcoin:* this software may or may not work with any given cryptonote coin. 56 | 57 | Create your configuration here and export as JSON: 58 | http://forknote.net/create 59 | 60 | Copy the `config_example.json` file to `config.json` then overview each options and change any to match your preferred setup. 61 | 62 | 63 | Explanation for each field: 64 | 65 | 66 | ``` 67 | { 68 | 69 | /* Extensions to load */ 70 | "extensions": [ "core/bytecoin.json", "print-genesis-tx.json" ], 71 | 72 | /* Source coin. Bytecoin example. See the available base coins here: https://github.com/forknote/cryptonote-generator/tree/master/cores */ 73 | "base_coin": "bytecoin-v2", 74 | 75 | "core":{ 76 | /* Check uniqueness with Google and Map of Coins. */ 77 | "CRYPTONOTE_NAME":"dashcoin", 78 | 79 | /* Address prefix. Generate here: https://cryptonotestarter.org/inner.html */ 80 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX":72, 81 | 82 | "P2P_DEFAULT_PORT":29080, 83 | "RPC_DEFAULT_PORT":29081, 84 | 85 | /* Seed nodes. Use at least 2 */ 86 | "SEED_NODES":["162.243.247.45:29080", "146.185.191.90:29080", "104.131.132.129:29080", "128.199.146.243:29080"], 87 | 88 | /* Array with checkpoints. */ 89 | "CHECKPOINTS":["28000:70d2531151529ac00bf875281e15f51324934bc85e5733dcd92e1ccb1a665ff8", "40000:c181ec9223a91fef8658c7aa364c093c41c28d250870ca1ed829bf74f0abf038", "55000:5289fe9f2dce8f51441019b9fbc85c70ad85ff49a666ef0109f3269890c6af6d", "70000:193e335f34b8b8f1fab3857111cb668c2720340e80176a25155071e573481acb", "87500:cce8a035f34457ec1098ab41e5949cac3db00ebff3503e26f36bfa057543095a", "91453:ad46d069bb2726a9bc5962cda6b2108376c0b95c157da0f09ee32458f486d87f"], 90 | 91 | /* Created with connectivity_tool. Leave empty if not needed */ 92 | "P2P_STAT_TRUSTED_PUB_KEY":"4d26c4df7f4ca7037950ad026f9ab36dd05d881952662992f2e4dcfcafbe57eb", 93 | 94 | /* Genesis! Leave empty for new coins */ 95 | "GENESIS_COINBASE_TX_HEX":"010a01ff0001ffffffffffff0f029b2e4c0271c0b42e7c53291a94d1c0cbff8883f8024f5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a", 96 | 97 | /* Random hex, identifier for your network */ 98 | "BYTECOIN_NETWORK":"0x12, 0x11, 0x21, 0x11, 0x11, 0x10, 0x41, 0x01, 0x13, 0x11, 0x00, 0x12, 0x12, 0x11, 0x01, 0x10", 99 | 100 | /* Visualize here https://cryptonotestarter.org/inner.html */ 101 | /* Total amount of coins to be emitted. Most of CryptoNote-based coins use (uint64_t)(-1) (equals to 18446744073709551616). 102 | You can define number explicitly (for example UINT64_C(858986905600000000)). */ 103 | "MONEY_SUPPLY":"static_cast(-1)", 104 | "EMISSION_SPEED_FACTOR":18, 105 | "GENESIS_BLOCK_REWARD":0, 106 | "DIFFICULTY_TARGET":120, // In seconds 107 | 108 | "MINIMUM_FEE":1000000, // 10^6. Equals to 0.01 in Dashcoin 109 | "DEFAULT_DUST_THRESHOLD":1000000, 110 | "COIN":100000000, // Number of atom units in a coin. 10^8 in Dashcoin 111 | "CRYPTONOTE_DISPLAY_DECIMAL_POINT":8, // The pow from the previews value 112 | 113 | "CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW":10, // in blocks 114 | "CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE":20000, // in bytes 115 | 116 | "DIFFICULTY_CUT":60, // timestamps to cut after sorting 117 | "DIFFICULTY_LAG":15, 118 | 119 | /* USED ONLY IN OLD COINS. IF YOU UPDATE CHANGE THIS TO YOUR OLD CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE */ 120 | "CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1":10000, 121 | 122 | /* ONLY USED IN OLD COINS. IT WILL HARDFORK YOUR COIN AT THIS BLOCK */ 123 | "UPGRADE_HEIGHT":91452, 124 | 125 | /* Max initial block size */ 126 | "MAX_BLOCK_SIZE_INITIAL":"25 * 1024" 127 | 128 | /* Max initial block size */ 129 | "EXPECTED_NUMBER_OF_BLOCKS_PER_DAY":"24 * 60 * 60 / 120" 130 | } 131 | } 132 | 133 | ``` 134 | 135 | #### 3) Generate coin 136 | 137 | The file `config.json` is used by default but a file can be specified using the `-f file` command argument, for example: 138 | 139 | ```bash 140 | bash generator.sh -f [CONFIG_FILE] [-c COMPILE_OPTIONS] 141 | ``` 142 | 143 | By default, the cryptonote generator is not using multithread. I strongly recommend to use this arguments, if you are not building on a on VPS with no swap defined 144 | 145 | ###### Windows: 146 | ```bash 147 | bash generator.sh -f config_example.json -c '/maxcpucount:3' 148 | ``` 149 | 150 | ###### Linux / Mac OS X (Cmake 2.8.x): 151 | ```bash 152 | bash generator.sh -f config_example.json -c '-j3' 153 | ``` 154 | 155 | #### 4) Print genesis tx hex 156 | 157 | If you are creating a new coin, you need to create the genesis tx hex: 158 | 159 | ``` 160 | cd generated_files/binaries/yourcoin # yourcoin-linux for Linux, yourcoin-mac for Mac 161 | ./yourcoind --print-genesis-tx 162 | ``` 163 | Change the _GENESIS_COINBASE_TX_HEX_ in your configuration file, then [3) Generate coin](#3-generate-coin) again. 164 | 165 | 166 | ### Examples (real life) 167 | 168 | #### 1) Dashcoin - http://dashcoin.info 169 | 170 | To generate Dashcoin: 171 | ``` 172 | git clone https://github.com/forknote/cryptonote-generator.git generator && cd generator 173 | bash install_dependencies.sh && bash generator.sh -f configs/bytecoin-v2/dashcoin.json 174 | ``` 175 | 176 | #### 2) Forknote - http://forknote.net 177 | 178 | To generate Forknote: 179 | ``` 180 | git clone https://github.com/forknote/cryptonote-generator.git generator && cd generator 181 | bash install_dependencies.sh && bash generator.sh -f configs/bytecoin-v2/forknote.json 182 | ``` 183 | 184 | 185 | ### Community / Support 186 | 187 | * IRC (freenode) 188 | * Support / general / development discussion join #dashcoin: [https://webchat.freenode.net/?channels=#dashcoin](https://webchat.freenode.net/?channels=#dashcoin) 189 | * [CryptoNote Forum](https://forum.cryptonote.org/) 190 | 191 | 192 | #### Projects Using This Software 193 | 194 | * [Dashcoin](https://bitcointalk.org/index.php?topic=1020627.0) 195 | * [Forknote](https://bitcointalk.org/index.php?topic=1079306.0) 196 | 197 | 198 | #### Contributing 199 | 200 | 1. Fork it 201 | 2. Create your feature branch (`git checkout -b my-new-feature`) 202 | 3. Commit your changes (`git commit -am 'Add some feature'`) 203 | 4. Push to the branch (`git push origin my-new-feature`) 204 | 5. Create new Pull Request 205 | 206 | Extensions must be located in *extensions* folder. 207 | 208 | 209 | Donations 210 | --------- 211 | * BTC: `1EYiA8o1KsDZxMHXvptxXyaVwuhTVNBMFp` 212 | * DSH: `D3z2DDWygoZU4NniCNa4oMjjKi45dC2KHUWUyD1RZ1pfgnRgcHdfLVQgh5gmRv4jwEjCX5LoLERAf5PbjLS43Rkd8vFUM1m` 213 | * BCN: `21YR5mw5BF2ah3yVE3kbhkjDwvuv21VR6D7hnpm4zHveDsvq5WEwyTxXLXNwtU5K4Pen89ZZzJ81fB3vxHABEUJCAhxXz2v` 214 | * XMR: `47LEJyhCgNFcoz6U8x7tUk6LEHe38NobAfn4ou8d588jY5nddvgEANLMMcwxsbfbkJRw4xPwcG583Gq189hjusShEyk9FXz` 215 | 216 | *Donate XMR if you want to XMR version to be developed* 217 | 218 | Additional credits 219 | ------------------ 220 | * [piotaak](https://github.com/piotaak) (tests for cryptonotecoin-core extension) 221 | 222 | License 223 | ------- 224 | Released under the GNU General Public License v2 225 | 226 | http://www.gnu.org/licenses/gpl-2.0.html 227 | -------------------------------------------------------------------------------- /change-checker.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | # Starts deployment if change is detected 4 | # Cron cycles this script 5 | 6 | # Exit immediately if an error occurs, or if an undeclared variable is used 7 | set -o errexit 8 | set -o nounset 9 | 10 | [ "$OSTYPE" != "win"* ] || die "Install Cygwin to use on Windows" 11 | 12 | # Set directory vars 13 | . "vars.cfg" 14 | GENERATOR_FILE_PATH="${PROJECT_DIR}/generator.sh" 15 | 16 | # Cron cycle period in minutes 17 | CRON_CYCLE='30' 18 | START_DEPLOY="" 19 | 20 | # Pull request 21 | echo "git pull base coin" 22 | cd $BASE_COIN_PATH 23 | git reset --hard origin/master 24 | git pull 25 | cd $PROJECT_DIR 26 | 27 | # Check if file is changed in _posts folder in the cron cycle 28 | CURRENT_TIMESTAMP="$( date +%s )" 29 | if [[ "$OSTYPE" == "darwin"* ]]; then 30 | LAST_EDITED_TIMESTAMP="$( stat -f "%m" ${BASE_COIN_PATH} )" 31 | else 32 | LAST_EDITED_TIMESTAMP="$( stat -c "%Y" ${BASE_COIN_PATH} )" 33 | fi 34 | let TARGET_TIME=${LAST_EDITED_TIMESTAMP}+${CRON_CYCLE}*60 35 | 36 | if [[ ${TARGET_TIME} -ge ${CURRENT_TIMESTAMP} ]]; then 37 | echo "Freshly edited" 38 | ${START_GENERATOR}="$( exec bash "${GENERATOR_FILE_PATH}" )" 39 | fi 40 | 41 | echo ${START_GENERATOR} 42 | -------------------------------------------------------------------------------- /compile.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | 4 | # Bash script for change coin files 5 | 6 | # Exit immediately if an error occurs, or if an undeclared variable is used 7 | set -o errexit 8 | 9 | 10 | [ "$OSTYPE" != "win"* ] || die "Windows is not supported" 11 | 12 | 13 | # A POSIX variable 14 | OPTIND=1 # Reset in case getopts has been used previously in the shell. 15 | 16 | 17 | while getopts "c:z" opt; do 18 | case "$opt" in 19 | c) COMPILE_ARGS=${OPTARG} 20 | ;; 21 | z) archive=1 22 | esac 23 | done 24 | archive=${archive:-0} 25 | 26 | shift $((OPTIND-1)) 27 | 28 | cd ${NEW_COIN_PATH} 29 | 30 | # Compile! 31 | if [[ "$OSTYPE" == "msys" ]]; then 32 | cmake -G "Visual Studio 12 Win64" "..\.." 33 | msbuild.exe Bytecoin.sln /property:Configuration=Release ${COMPILE_ARGS} 34 | else 35 | echo "make ${COMPILE_ARGS}" 36 | PORTABLE=1 make ${COMPILE_ARGS} 37 | fi 38 | 39 | if [[ $? == "0" ]]; then 40 | echo "Compilation successful" 41 | fi 42 | 43 | # Move and zip binaries 44 | if [[ $archive == "1" ]]; then 45 | BUILD_PATH="${WORK_FOLDERS_PATH}/builds" 46 | MAC_BUILD_NAME="${__CONFIG_core_CRYPTONOTE_NAME}-mac" 47 | LINUX_BUILD_NAME="${__CONFIG_core_CRYPTONOTE_NAME}-linux" 48 | WINDOWS_BUILD_NAME="${__CONFIG_core_CRYPTONOTE_NAME}-windows" 49 | ALL_BUILD_FILES="${__CONFIG_core_CRYPTONOTE_NAME}-all-files" 50 | 51 | case "$OSTYPE" in 52 | msys*) rm -f ${BUILD_PATH}/${WINDOWS_BUILD_NAME}.zip 53 | rm -rf ${BUILD_PATH}/${WINDOWS_BUILD_NAME} 54 | mkdir -p ${BUILD_PATH}/${WINDOWS_BUILD_NAME} 55 | cp ${NEW_COIN_PATH}/build/release/src/Release/${__CONFIG_core_CRYPTONOTE_NAME}d.exe ${BUILD_PATH}/${WINDOWS_BUILD_NAME} 56 | cp ${NEW_COIN_PATH}/build/release/src/Release/simplewallet.exe ${BUILD_PATH}/${WINDOWS_BUILD_NAME} 57 | cp ${NEW_COIN_PATH}/build/release/src/Release/walletd.exe ${BUILD_PATH}/${WINDOWS_BUILD_NAME} 58 | cp ${NEW_COIN_PATH}/build/release/src/Release/miner.exe ${BUILD_PATH}/${WINDOWS_BUILD_NAME} 59 | cd ${BUILD_PATH} 60 | zip -r ${WINDOWS_BUILD_NAME}.zip ${WINDOWS_BUILD_NAME}/ 61 | ;; 62 | darwin*) rm -f ${BUILD_PATH}/${MAC_BUILD_NAME}.zip 63 | rm -rf ${BUILD_PATH}/${MAC_BUILD_NAME} 64 | mkdir -p ${BUILD_PATH}/${MAC_BUILD_NAME} 65 | cp ${NEW_COIN_PATH}/build/release/src/${__CONFIG_core_CRYPTONOTE_NAME}d ${BUILD_PATH}/${MAC_BUILD_NAME} 66 | cp ${NEW_COIN_PATH}/build/release/src/simplewallet ${BUILD_PATH}/${MAC_BUILD_NAME} 67 | cp ${NEW_COIN_PATH}/build/release/src/walletd ${BUILD_PATH}/${MAC_BUILD_NAME} 68 | cp ${NEW_COIN_PATH}/build/release/src/miner ${BUILD_PATH}/${MAC_BUILD_NAME} 69 | cd ${BUILD_PATH} 70 | zip -r ${MAC_BUILD_NAME}.zip ${MAC_BUILD_NAME}/ 71 | ;; 72 | *) rm -f ${BUILD_PATH}/${LINUX_BUILD_NAME}.tar.gz 73 | rm -rf ${BUILD_PATH}/${LINUX_BUILD_NAME} 74 | mkdir -p ${BUILD_PATH}/${LINUX_BUILD_NAME} 75 | cp ${NEW_COIN_PATH}/build/release/src/${__CONFIG_core_CRYPTONOTE_NAME}d ${BUILD_PATH}/${LINUX_BUILD_NAME} 76 | cp ${NEW_COIN_PATH}/build/release/src/simplewallet ${BUILD_PATH}/${LINUX_BUILD_NAME} 77 | cp ${NEW_COIN_PATH}/build/release/src/walletd ${BUILD_PATH}/${LINUX_BUILD_NAME} 78 | cp ${NEW_COIN_PATH}/build/release/src/miner ${BUILD_PATH}/${LINUX_BUILD_NAME} 79 | cd ${BUILD_PATH} 80 | tar -zcvf ${LINUX_BUILD_NAME}.tar.gz ${LINUX_BUILD_NAME} 81 | ;; 82 | esac 83 | 84 | rm -rf ${BUILD_PATH}/${ALL_BUILD_FILES} 85 | mkdir -p ${BUILD_PATH}/${ALL_BUILD_FILES} 86 | cp -R ${NEW_COIN_PATH}/build/release/src/ ${BUILD_PATH}/${ALL_BUILD_FILES}/ 87 | 88 | rm -rf "${NEW_COIN_PATH}/build" 89 | fi 90 | -------------------------------------------------------------------------------- /config_example.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ "core/bytecoin.json", "print-genesis-tx.json" ], 3 | "base_coin":{ 4 | "name":"bytecoin", 5 | "git":"https://github.com/amjuarez/bytecoin.git" 6 | }, 7 | "core":{ 8 | "CRYPTONOTE_NAME":"examplecoin", 9 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX":72, 10 | "P2P_DEFAULT_PORT":29090, 11 | "RPC_DEFAULT_PORT":29091, 12 | "SEED_NODES":["127.0.0.1:29090"], 13 | "CHECKPOINTS":[], 14 | "P2P_STAT_TRUSTED_PUB_KEY":"4d26c4df7f4ca7037950ad026f9ab36dd05d881952662992f2e4dcfcafbe57eb", 15 | "GENESIS_COINBASE_TX_HEX":"010a01ff0001ffffffffffff0f029b2e4c0271c0b42e7c53291a94d1c0cbff8883f8024f5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a", 16 | "BYTECOIN_NETWORK":"12345678-1100-0101-1011-001210110110", 17 | "MONEY_SUPPLY":"18446744073709551615", 18 | "EMISSION_SPEED_FACTOR":18, 19 | "DIFFICULTY_TARGET":120, 20 | "MINIMUM_FEE":1000000, 21 | "DEFAULT_DUST_THRESHOLD":1000000, 22 | "CRYPTONOTE_DISPLAY_DECIMAL_POINT":12, 23 | "CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW":10, 24 | "CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE":20000, 25 | "UPGRADE_HEIGHT":1 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /configs/bytecoin-v2/crossnote.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ 3 | "core/bytecoin.json", 4 | "bug-fixes.json", 5 | "print-genesis-tx.json", 6 | "mandatory-transaction-in-block.json", 7 | "genesis-block-reward.json" 8 | ], 9 | "base_coin": "bytecoin-v2", 10 | "core": { 11 | "CRYPTONOTE_NAME": "crossnote.testnet", 12 | "DIFFICULTY_TARGET": 20, 13 | "DIFFICULTY_WINDOW": 5, 14 | "DIFFICULTY_CUT": 1, 15 | "DIFFICULTY_LAG": 1, 16 | "CRYPTONOTE_DISPLAY_DECIMAL_POINT": 12, 17 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 503261011, 18 | "MONEY_SUPPLY": 18446744073709551615, 19 | "GENESIS_BLOCK_REWARD": 18446744073709551615, 20 | "CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW": 5, 21 | "P2P_DEFAULT_PORT": 8080, 22 | "RPC_DEFAULT_PORT": 8081, 23 | "MANDATORY_TRANSACTION": 1, 24 | "SEED_NODES": [ 25 | "108.61.188.93:8080" 26 | ], 27 | "CHECKPOINTS": [], 28 | "P2P_STAT_TRUSTED_PUB_KEY": "", 29 | "GENESIS_COINBASE_TX_HEX": "010501ff000482808080808080804002b904097d17607436dabf446a2a54e970bc4538620c2d10ba0e67cc83ff9d88a6ffffffffffffffff3f025f4616b4f5848c9eae3aa644355e79b616f3936048892db4ef87e2c45545953effffffffffffffff3f02cbd0341b31f3ebc92eb83fab24a1e2b7550d29b3b7a5c14bd86acdd5f92f1962ffffffffffffffff3f02069b6304ee0195e93ccf4771102d49d17a8c8fb2329155aa64397fb668cd3887210195af41342d7156aa0857a79574309c47102d7efb55476cb123f0e7b56048ecbf", 30 | "BYTECOIN_NETWORK": "12112111-1110-4101-1311-221212111120", 31 | "UPGRADE_HEIGHT_V2": 1, 32 | "UPGRADE_HEIGHT_V3": 2 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /configs/bytecoin-v2/dashcoin.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ 3 | "core/bytecoin.json", 4 | "bug-fixes.json", 5 | "simplewallet-default-fee.json", 6 | "max-transaction-size-limit.json", 7 | "simplewallet-import-keys.json", 8 | "simplewallet-export-keys.json" 9 | ], 10 | "base_coin": "bytecoin-v2", 11 | "core": { 12 | "CRYPTONOTE_NAME": "dashcoin", 13 | "CRYPTONOTE_DISPLAY_DECIMAL_POINT": 12, 14 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 72, 15 | "P2P_DEFAULT_PORT": 29080, 16 | "RPC_DEFAULT_PORT": 29081, 17 | "SEED_NODES": [ 18 | "108.61.188.93:7610", 19 | "128.199.146.243:29080", 20 | "195.154.181.121:7280", 21 | "93.77.229.33:29080", 22 | "144.76.59.211:29080", 23 | "176.9.147.178:7280", 24 | "176.9.47.243:7280", 25 | "84.200.76.33:29080", 26 | "98.115.76.178:29080", 27 | "195.154.181.121:7280" 28 | ], 29 | "CHECKPOINTS": [ 30 | "28000:70d2531151529ac00bf875281e15f51324934bc85e5733dcd92e1ccb1a665ff8", 31 | "40000:c181ec9223a91fef8658c7aa364c093c41c28d250870ca1ed829bf74f0abf038", 32 | "55000:5289fe9f2dce8f51441019b9fbc85c70ad85ff49a666ef0109f3269890c6af6d", 33 | "70000:193e335f34b8b8f1fab3857111cb668c2720340e80176a25155071e573481acb", 34 | "87500:cce8a035f34457ec1098ab41e5949cac3db00ebff3503e26f36bfa057543095a", 35 | "150000:118989862ef4903df981501aae6f5178aee794bdbceb8e01fe76ee15ab960d52", 36 | "200000:bb5b339991347c3b06431b233d3dbf9201e9176ddf4349ee46c60473725d5c98", 37 | "250000:c5b6064258237e911300cdcb6f937b37a6c17932e2bfdcba0ff12a48694709e0", 38 | "298000:5b1f21234c911eb755abce6fa66358558b380526f606222d042eb8b7ce993ae8", 39 | "360000:d9426fcdaa95a8dd2f1d151c2088a0dac2143963b8088d0de02f9c08ec8429f5", 40 | "423000:7e2c45f1a546290a7f7f28cb83c1bdc21f531f410ad0e65a12a5c86b95e194b5", 41 | "529000:b0bbedbd3e8d8051b273a8a7c8e875e1ad4184c37e6cedfb68d930e8235153dd", 42 | "600000:1f265d7710dc8b28478c62d48ef533e462008068cd7a5912b861c350ce82fbae", 43 | "636000:436f4ed7684698160120f25f1bad8aa92c38c93fbedd2b0c74671adf4d4fb191", 44 | "738000:8202b5dc2b070bd7743c44763e6eb5546ea7699f3829dc29594f046f21199b08" 45 | ], 46 | "P2P_STAT_TRUSTED_PUB_KEY": "4d26c4df7f4ca7037950ad026f9ab36dd05d881952662992f2e4dcfcafbe57eb", 47 | "GENESIS_COINBASE_TX_HEX": "010a01ff0001ffffffffffff0f029b2e4c0271c0b42e7c53291a94d1c0cbff8883f8024f5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a", 48 | "BYTECOIN_NETWORK": "12112111-1110-4101-1311-001212110110", 49 | "UPGRADE_HEIGHT_V2": 91452, 50 | "UPGRADE_HEIGHT_V3": "static_cast(-1)", 51 | "MAX_BLOCK_SIZE_INITIAL": "25 * 1024", 52 | "MAX_TRANSACTION_SIZE_LIMIT": 19400, 53 | "DEFAULT_FEE": 1000000000 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /configs/bytecoin-v2/forknote-messages.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ 3 | "core/bytecoin.json", 4 | "bug-fixes.json", 5 | "print-genesis-tx.json", 6 | "simplewallet-default-fee.json", 7 | "max-transaction-size-limit.json", 8 | "min-mixin.json", 9 | "mixin-start-height.json", 10 | "mandatory-transaction-in-block.json", 11 | "kill-height.json", 12 | "tail-emission-reward.json", 13 | "cryptonote-coin-clones-support.json", 14 | "genesis-block-reward.json", 15 | "versionized-parameters.json", 16 | "zawy-difficulty-algorithm.json", 17 | "bugged-zawy-difficulty-algorithm.json", 18 | "transaction-extra-message-tag.json", 19 | "blockchain-explorer.json", 20 | "enable-cors.json", 21 | "fee-address.json", 22 | "multiply.json", 23 | "get-blockchain-settings.json", 24 | "multiply/max-transaction-size-limit.json", 25 | "multiply/min-mixin.json", 26 | "multiply/mixin-start-height.json", 27 | "multiply/mandatory-transaction-in-block.json", 28 | "multiply/kill-height.json", 29 | "multiply/tail-emission-reward.json", 30 | "multiply/cryptonote-coin-clones-support.json", 31 | "multiply/genesis-block-reward.json", 32 | "multiply/versionized-parameters.json", 33 | "multiply/zawy-difficulty-algorithm.json", 34 | "multiply/bugged-zawy-difficulty-algorithm.json", 35 | "daemon-getrandom_outs-json.json", 36 | "simplewallet-import-keys.json", 37 | "simplewallet-export-keys.json", 38 | "walletd-extension.json" 39 | ], 40 | "base_coin": "bytecoin-v2", 41 | "core": { 42 | "CRYPTONOTE_NAME": "forknote", 43 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 6, 44 | "P2P_DEFAULT_PORT": 8080, 45 | "RPC_DEFAULT_PORT": 8081, 46 | "SEED_NODES": [ 47 | "seed.bytecoin.org:8080", 48 | "85.25.201.95:8080", 49 | "85.25.196.145:8080", 50 | "85.25.196.146:8080", 51 | "85.25.196.144:8080", 52 | "5.199.168.138:8080", 53 | "62.75.236.152:8080", 54 | "85.25.194.245:8080", 55 | "95.211.224.160:8080", 56 | "144.76.200.44:8080" 57 | ], 58 | "GENESIS_COINBASE_TX_HEX": "010a01ff0001ffffffffffff0f029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a", 59 | "BYTECOIN_NETWORK": "11100111-1100-0101-1011-001210110110", 60 | "UPGRADE_HEIGHT_V2": 546602, 61 | "UPGRADE_HEIGHT_V3": 985548 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /configs/bytecoin-v2/forknote-webwallet.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ 3 | "core/bytecoin.json", 4 | "bug-fixes.json", 5 | "print-genesis-tx.json", 6 | "simplewallet-default-fee.json", 7 | "max-transaction-size-limit.json", 8 | "min-mixin.json", 9 | "mixin-start-height.json", 10 | "mandatory-transaction-in-block.json", 11 | "kill-height.json", 12 | "tail-emission-reward.json", 13 | "cryptonote-coin-clones-support.json", 14 | "genesis-block-reward.json", 15 | "versionized-parameters.json", 16 | "zawy-difficulty-algorithm.json", 17 | "bugged-zawy-difficulty-algorithm.json", 18 | "blockchain-explorer.json", 19 | "enable-cors.json", 20 | "fee-address.json", 21 | "speed-up-wallet-sync.json", 22 | "walletd-spent-transfers-tracking-mode.json", 23 | "multiply.json", 24 | "get-blockchain-settings.json", 25 | "multiply/max-transaction-size-limit.json", 26 | "multiply/min-mixin.json", 27 | "multiply/mixin-start-height.json", 28 | "multiply/mandatory-transaction-in-block.json", 29 | "multiply/kill-height.json", 30 | "multiply/tail-emission-reward.json", 31 | "multiply/cryptonote-coin-clones-support.json", 32 | "multiply/genesis-block-reward.json", 33 | "multiply/versionized-parameters.json", 34 | "multiply/zawy-difficulty-algorithm.json", 35 | "multiply/bugged-zawy-difficulty-algorithm.json", 36 | "daemon-getrandom_outs-json.json", 37 | "simplewallet-import-keys.json", 38 | "simplewallet-export-keys.json", 39 | "walletd-extension.json" 40 | ], 41 | "base_coin": "bytecoin-v2", 42 | "core": { 43 | "CRYPTONOTE_NAME": "forknote", 44 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 6, 45 | "P2P_DEFAULT_PORT": 8080, 46 | "RPC_DEFAULT_PORT": 8081, 47 | "SEED_NODES": [ 48 | "seed.bytecoin.org:8080", 49 | "85.25.201.95:8080", 50 | "85.25.196.145:8080", 51 | "85.25.196.146:8080", 52 | "85.25.196.144:8080", 53 | "5.199.168.138:8080", 54 | "62.75.236.152:8080", 55 | "85.25.194.245:8080", 56 | "95.211.224.160:8080", 57 | "144.76.200.44:8080" 58 | ], 59 | "GENESIS_COINBASE_TX_HEX": "010a01ff0001ffffffffffff0f029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a", 60 | "BYTECOIN_NETWORK": "11100111-1100-0101-1011-001210110110", 61 | "UPGRADE_HEIGHT_V2": 546602, 62 | "UPGRADE_HEIGHT_V3": 985548 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /configs/bytecoin-v2/forknote.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ 3 | "core/bytecoin.json", 4 | "bug-fixes.json", 5 | "print-genesis-tx.json", 6 | "simplewallet-default-fee.json", 7 | "max-transaction-size-limit.json", 8 | "min-mixin.json", 9 | "mixin-start-height.json", 10 | "mandatory-transaction-in-block.json", 11 | "kill-height.json", 12 | "tail-emission-reward.json", 13 | "cryptonote-coin-clones-support.json", 14 | "genesis-block-reward.json", 15 | "versionized-parameters.json", 16 | "zawy-difficulty-algorithm.json", 17 | "zawy-lwma-difficulty-algorithm.json", 18 | "zawy-lwma2-difficulty-algorithm.json", 19 | "bugged-zawy-difficulty-algorithm.json", 20 | "cryptonight-v7.json", 21 | "block-hosts.json", 22 | "blockchain-explorer.json", 23 | "enable-cors.json", 24 | "fee-address.json", 25 | "multiply.json", 26 | "get-blockchain-settings.json", 27 | "multiply/max-transaction-size-limit.json", 28 | "multiply/min-mixin.json", 29 | "multiply/mixin-start-height.json", 30 | "multiply/mandatory-transaction-in-block.json", 31 | "multiply/kill-height.json", 32 | "multiply/tail-emission-reward.json", 33 | "multiply/cryptonote-coin-clones-support.json", 34 | "multiply/genesis-block-reward.json", 35 | "multiply/versionized-parameters.json", 36 | "multiply/zawy-difficulty-algorithm.json", 37 | "multiply/zawy-lwma-difficulty-algorithm.json", 38 | "multiply/zawy-lwma2-difficulty-algorithm.json", 39 | "multiply/bugged-zawy-difficulty-algorithm.json", 40 | "multiply/cryptonight-v7.json", 41 | "daemon-getrandom_outs-json.json", 42 | "simplewallet-import-keys.json", 43 | "simplewallet-export-keys.json", 44 | "mnemonics.json" 45 | ], 46 | "base_coin": "bytecoin-v2", 47 | "core": { 48 | "CRYPTONOTE_NAME": "forknote", 49 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 6, 50 | "P2P_DEFAULT_PORT": 8080, 51 | "RPC_DEFAULT_PORT": 8081, 52 | "SEED_NODES": [ 53 | "seed.bytecoin.org:8080", 54 | "85.25.201.95:8080", 55 | "85.25.196.145:8080", 56 | "85.25.196.146:8080", 57 | "85.25.196.144:8080", 58 | "5.199.168.138:8080", 59 | "62.75.236.152:8080", 60 | "85.25.194.245:8080", 61 | "95.211.224.160:8080", 62 | "144.76.200.44:8080" 63 | ], 64 | "GENESIS_COINBASE_TX_HEX": "010a01ff0001ffffffffffff0f029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a", 65 | "BYTECOIN_NETWORK": "11100111-1100-0101-1011-001210110110", 66 | "UPGRADE_HEIGHT_V2": 546602, 67 | "UPGRADE_HEIGHT_V3": 985548 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /configs/bytecoin/dashcoin.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ 3 | "core/bytecoin.json" 4 | ], 5 | "base_coin": "bytecoin", 6 | "core": { 7 | "CRYPTONOTE_NAME": "dashcoin.new", 8 | "CRYPTONOTE_DISPLAY_DECIMAL_POINT": 12, 9 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 72, 10 | "P2P_DEFAULT_PORT": 29080, 11 | "RPC_DEFAULT_PORT": 29081, 12 | "SEED_NODES": [ 13 | "108.61.188.93:7610", 14 | "128.199.146.243:29080", 15 | "195.154.181.121:7280", 16 | "93.77.229.33:29080", 17 | "144.76.59.211:29080", 18 | "176.9.147.178:7280", 19 | "176.9.47.243:7280", 20 | "84.200.76.33:29080", 21 | "98.115.76.178:29080", 22 | "195.154.181.121:7280" 23 | ], 24 | "CHECKPOINTS": [ 25 | "28000:70d2531151529ac00bf875281e15f51324934bc85e5733dcd92e1ccb1a665ff8", 26 | "40000:c181ec9223a91fef8658c7aa364c093c41c28d250870ca1ed829bf74f0abf038", 27 | "55000:5289fe9f2dce8f51441019b9fbc85c70ad85ff49a666ef0109f3269890c6af6d", 28 | "70000:193e335f34b8b8f1fab3857111cb668c2720340e80176a25155071e573481acb", 29 | "87500:cce8a035f34457ec1098ab41e5949cac3db00ebff3503e26f36bfa057543095a", 30 | "150000:118989862ef4903df981501aae6f5178aee794bdbceb8e01fe76ee15ab960d52", 31 | "200000:bb5b339991347c3b06431b233d3dbf9201e9176ddf4349ee46c60473725d5c98", 32 | "250000:c5b6064258237e911300cdcb6f937b37a6c17932e2bfdcba0ff12a48694709e0", 33 | "298000:5b1f21234c911eb755abce6fa66358558b380526f606222d042eb8b7ce993ae8", 34 | "360000:d9426fcdaa95a8dd2f1d151c2088a0dac2143963b8088d0de02f9c08ec8429f5", 35 | "423000:7e2c45f1a546290a7f7f28cb83c1bdc21f531f410ad0e65a12a5c86b95e194b5", 36 | "529000:b0bbedbd3e8d8051b273a8a7c8e875e1ad4184c37e6cedfb68d930e8235153dd", 37 | "600000:1f265d7710dc8b28478c62d48ef533e462008068cd7a5912b861c350ce82fbae", 38 | "636000:436f4ed7684698160120f25f1bad8aa92c38c93fbedd2b0c74671adf4d4fb191", 39 | "738000:8202b5dc2b070bd7743c44763e6eb5546ea7699f3829dc29594f046f21199b08", 40 | "748549:b11a3b78379745e448b189866144c0a8c53f23ad1a9cb53697b96e1067496697", 41 | "748550:55cc70a8e1f26fc605d04bceb03f08bfeeebb5d0a171bc35b6f2d6f85ca8333d", 42 | "961300:e751da577d92e0032ed4b300efa47c18bb5d4eaaea9880aff1fd40dc9d6f914d" 43 | ], 44 | "P2P_STAT_TRUSTED_PUB_KEY": "4d26c4df7f4ca7037950ad026f9ab36dd05d881952662992f2e4dcfcafbe57eb", 45 | "GENESIS_COINBASE_TX_HEX": [ 46 | "010a01ff0001ffffffffffff0f029b2e4c0271c0b42e7c53291a94d1c0cbff8883f8024f5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a" 47 | ], 48 | "BYTECOIN_NETWORK": "12112111-1110-4101-1311-001212110110", 49 | "UPGRADE_HEIGHT_V2": 91452, 50 | "UPGRADE_HEIGHT_V3": "static_cast(-1)", 51 | "MAX_BLOCK_SIZE_INITIAL": "25 * 1024", 52 | "MAX_TRANSACTION_SIZE_LIMIT": 19400, 53 | "DEFAULT_FEE": 1000000000 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /configs/monero/aeon.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ 3 | "core/monero.json", 4 | "donations.json", 5 | "aeon.json" 6 | ], 7 | "base_coin": "monero", 8 | "core": { 9 | "COIN_NAME": "Aeon", 10 | "CRYPTONOTE_NAME": "aeon", 11 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 178, 12 | "CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX": 179, 13 | "CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX": 42, 14 | "MAINNET_P2P_DEFAULT_PORT": 11180, 15 | "MAINNET_RPC_DEFAULT_PORT": 11181, 16 | "MAINNET_ZMQ_RPC_DEFAULT_PORT": 11182, 17 | "TESTNET_P2P_DEFAULT_PORT": 22280, 18 | "TESTNET_RPC_DEFAULT_PORT": 22281, 19 | "TESTNET_ZMQ_RPC_DEFAULT_PORT": 22282, 20 | "MAINNET_SEED_NODES":"full_addrs.insert(\"74.91.23.186:11180\");\nfull_addrs.insert(\"192.187.114.114:11180\");\nfull_addrs.insert(\"34.200.218.170:11180\");\nfull_addrs.insert(\"144.76.104.208:11180\");\n", 21 | "TESTNET_SEED_NODES":"full_addrs.insert(\"165.227.238.211\");\n", 22 | "MAINNET_CHECKPOINTS":" ADD_CHECKPOINT(1, \"1440a20f078bf3264822234b347f8382606577d73d4e9d3cb7296d73889bc421\");\n ADD_CHECKPOINT(100, \"6dd13aaab16679f49ee6b2b75c7dc99b1fd09ab2282b18cb4b55b73110655742\");\n ADD_CHECKPOINT(1000, \"bc6458452fd0575a314089bf302f6fd68ebaa2d689c42f3365293b96bbdf1f25\");\n ADD_CHECKPOINT(10000, \"1ac1ebd25baf0d6ec593daa3389f1aa7e860ff2cc29f3cf1be586d245b379da4\");\n ADD_CHECKPOINT(15000, \"15567af42afc1ed00538f53b5e3822d421e3ed6372ca79f4ea4e3e3bab709a87\");\n ADD_CHECKPOINT(175500, \"3f7dd748b3b863b04654d87a387f2b65a365f467188971f3192eab2368e64a35\");\n ADD_CHECKPOINT(450000, \"f69a6e57c4dd5df2f492c9d31c50f11aad2c25a64d540ce5f5d11b572aec8ab7\");\n ADD_CHECKPOINT(540000, \"94e19cf9d5a16ae90f67c321f8376b87da21d6d6c2cb0957b9ab558dca66c1dc\");\n ADD_CHECKPOINT(592001, \"e8bc936b287a9c426a15cf127624b064c88e6d37655cc87f9a62cf1623c62385\");\n ADD_CHECKPOINT(798358, \"804c7fe07511d9387e7cda534c9e8b644d406d8d0ff299799a8177850d4e75a0\");\n ADD_CHECKPOINT(871000, \"99f7e5460da3fb4e2b15214017b0a17ff0294823ad852259ff837f0ffeeb90f0\");\n", 23 | "MAINNET_HARDFORKS":"{ 1, 1, 0, 1341378000 }", 24 | "TESTNET_HARDFORKS":"{ 1, 1, 0, 1341378000 }", 25 | "MAINNET_HARDFORK_V1_LAST_BLOCK": -1, 26 | "TESTNET_HARDFORK_V1_LAST_BLOCK": -1, 27 | "MAINNET_HARDFORK_V1HF":592000, 28 | 29 | "P2P_STAT_TRUSTED_PUB_KEY": "", 30 | 31 | "MAINNET_GENESIS_TX": "013c01ff0001ffffffffffff03029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd08807121012bf2d282da90cee9c7a28c16e81418101ee28607d9e50f706594ee144a453b68", 32 | "TESTNET_GENESIS_TX": "013c01ff0001ffffffffffff03029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd08807121017c18fb180e05e89625b8324cd22ceeb3d4925ebaa5c274c9e927b2cf5669ffd6", 33 | "MAINNET_NETWORK_ID": "0x32 ,0x32, 0xF3, 0x91 , 0x81, 0x18 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x10", 34 | "TESTNET_NETWORK_ID": "0x32 ,0x32, 0xF3, 0x91 , 0x81, 0x18 , 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x11", 35 | "MONEY_SUPPLY": -1, 36 | "FINAL_SUBSIDY_PER_MINUTE": 0, 37 | "MINIMUM_RELAY_FEE": 1000000, 38 | "DEFAULT_FEE": 10000000000, 39 | "NO_FEE_PER_KB_FEE_MAX_HEIGHT": -1, 40 | "EMISSION_SPEED_FACTOR_PER_MINUTE_V1": 20, 41 | "EMISSION_SPEED_FACTOR_PER_MINUTE_V1HF":18, 42 | "DIFFICULTY_WINDOW_V1": 720, 43 | "DIFFICULTY_WINDOW_V1HF": 360, 44 | "DIFFICULTY_WINDOW_V2": 360, 45 | "DIFFICULTY_TARGET_V1": 60, 46 | "DIFFICULTY_TARGET_V1HF": 240, 47 | "DIFFICULTY_TARGET_V2": 240, 48 | 49 | "POW_SPEED_MULTIPLIER_V1HF": 2, 50 | "MEMORY_MULTIPLIER_V1HF": 0.5, 51 | "CONFIG_DONATION_ADDRESS": "WmsSWgtT1JPg5e3cK41hKXSHVpKW7e47bjgiKmWZkYrhSS5LhRemNyqayaSBtAQ6517eo5PtH9wxHVmM78JDZSUu2W8PqRiNs" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /configs/monero/dashcoin.json: -------------------------------------------------------------------------------- 1 | { 2 | "description": "Not working. See https://github.com/forknote/monero-generator/issues/1", 3 | "extensions": [ 4 | "core/monero.json", 5 | "bytecoin-clone.json" 6 | ], 7 | "base_coin": "monero", 8 | "core": { 9 | "COIN_NAME": "Dashcoin", 10 | "CRYPTONOTE_NAME": "dashcoin.monero", 11 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 72, 12 | "CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX": 73, 13 | "CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX": 42, 14 | "MAINNET_P2P_DEFAULT_PORT": 29080, 15 | "MAINNET_RPC_DEFAULT_PORT": 29081, 16 | "MAINNET_ZMQ_RPC_DEFAULT_PORT": 29082, 17 | "MAINNET_SEED_NODES":"full_addrs.insert(\"108.61.188.93:7610\");\nfull_addrs.insert(\"104.238.188.213:7610\");\n", 18 | "MAINNET_CHECKPOINTS":" ADD_CHECKPOINT(28000, \"70d2531151529ac00bf875281e15f51324934bc85e5733dcd92e1ccb1a665ff8\");\nADD_CHECKPOINT(87500, \"cce8a035f34457ec1098ab41e5949cac3db00ebff3503e26f36bfa057543095a\");\nADD_CHECKPOINT(738000, \"8202b5dc2b070bd7743c44763e6eb5546ea7699f3829dc29594f046f21199b08\");\n", 19 | "MAINNET_HARDFORKS":"{ 1, 1, 0, 1341378000 },\n { 2, 91453, 0, 1415599000 },", 20 | "MAINNET_HARDFORK_V1_LAST_BLOCK": 91452, 21 | 22 | "CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1": 10000, 23 | "CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2": 20000, 24 | "CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5": 200000, 25 | "CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW": 10, 26 | "CRYPTONOTE_DEFAULT_TX_SPENDABLE_AGE": 0, 27 | 28 | "BYTECOIN_CLONE": 1, 29 | 30 | "P2P_STAT_TRUSTED_PUB_KEY": "", 31 | 32 | "MAINNET_GENESIS_TX": "010a01ff0001ffffffffffff0f029b2e4c0271c0b42e7c53291a94d1c0cbff8883f8024f5142ee494ffbbd08807121013c086a48c15fb637a96991bc6d53caf77068b5ba6eeb3c82357228c49790584a", 33 | "MAINNET_GENESIS_NONCE": 70, 34 | "MAINNET_NETWORK_ID": "0x12, 0x11, 0x21, 0x11, 0x11, 0x10, 0x41, 0x01, 0x13, 0x11, 0x00, 0x12, 0x12, 0x11, 0x01, 0x10", 35 | 36 | "MONEY_SUPPLY": -1, 37 | "FINAL_SUBSIDY_PER_MINUTE": 0, 38 | "MINIMUM_RELAY_FEE": 1000000, 39 | "DEFAULT_FEE": 1000000000, 40 | "NO_FEE_PER_KB_FEE_MAX_HEIGHT": -1, 41 | "EMISSION_SPEED_FACTOR_PER_MINUTE": 19, 42 | "DIFFICULTY_WINDOW_V1": 720, 43 | "DIFFICULTY_WINDOW_V2": 720, 44 | "DIFFICULTY_TARGET_V1": 120, 45 | "DIFFICULTY_TARGET_V2": 120 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /configs/monero/monero-block-explorer.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ 3 | "core/monero.json", 4 | "blockchain-explorer.json", 5 | "enable-cors.json" 6 | ], 7 | "base_coin": "monero", 8 | "core": { 9 | "CRYPTONOTE_NAME": "monero-block-explorer" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /configs/monero/wownero.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": [ 3 | "core/monero.json" 4 | ], 5 | "base_coin": "monero", 6 | "core": { 7 | "COIN_NAME": "Wownero", 8 | "CRYPTONOTE_NAME": "wownero", 9 | 10 | "CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX": 4146, 11 | "CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX": 6810, 12 | "CRYPTONOTE_PUBLIC_SUBADDRESS_BASE58_PREFIX": 12208, 13 | "MAINNET_P2P_DEFAULT_PORT": 34567, 14 | "MAINNET_RPC_DEFAULT_PORT": 34568, 15 | "MAINNET_ZMQ_RPC_DEFAULT_PORT": 34569, 16 | "TESTNET_P2P_DEFAULT_PORT": 11180, 17 | "TESTNET_RPC_DEFAULT_PORT": 11181, 18 | "TESTNET_ZMQ_RPC_DEFAULT_PORT": 11182, 19 | "MAINNET_SEED_NODES":"full_addrs.insert(\"127.0.0.1:34567\");\n", 20 | "TESTNET_SEED_NODES":"full_addrs.insert(\"127.0.0.1:11180\");\n", 21 | "MAINNET_CHECKPOINTS":" \n", 22 | "MAINNET_HARDFORKS":"{ 1, 1, 0, 1341378000 },\n { 6, 1, 0, 1519605000 }", 23 | "TESTNET_HARDFORKS":"{ 1, 1, 0, 1341378000 },\n { 6, 1, 0, 1519605000 }", 24 | "MAINNET_HARDFORK_V1_LAST_BLOCK": 1, 25 | "TESTNET_HARDFORK_V1_LAST_BLOCK": 1, 26 | 27 | "P2P_STAT_TRUSTED_PUB_KEY": "0000000000000000000000000000000000000000000000000000000000000000", 28 | 29 | "MAINNET_GENESIS_TX": "013c01ff0001ffffffffffff7f029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd0880712101e5e22882a5b0b01516ff6716104699e4081eb5e570ebe5b93c370ea879245941", 30 | "MAINNET_GENESIS_NONCE": 70, 31 | "TESTNET_GENESIS_TX": "013c01ff0001ffffffffffff7f029b2e4c0281c0b02e7c53291a94d1d0cbff8883f8024f5142ee494ffbbd08807121011fb442f1ba0f9882128e6a43dcf2a5bd2c9ad17df2df0b4f5d38d863a7bfe859", 32 | "TESTNET_GENESIS_NONCE": 70, 33 | 34 | "MAINNET_NETWORK_ID": "0x11, 0x33, 0xFF, 0x77, 0x61, 0x04, 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x10", 35 | "TESTNET_NETWORK_ID": "0x11, 0x33, 0xFF, 0x77, 0x61, 0x04, 0x41, 0x61, 0x17, 0x31, 0x00, 0x82, 0x16, 0xA1, 0xA1, 0x11", 36 | "MONEY_SUPPLY": -1, 37 | "FINAL_SUBSIDY_PER_MINUTE": 0, 38 | "EMISSION_SPEED_FACTOR_PER_MINUTE": 19, 39 | "CRYPTONOTE_DISPLAY_DECIMAL_POINT": 11, 40 | "COIN": 100000000000, 41 | "DIFFICULTY_WINDOW_V1": 720, 42 | "DIFFICULTY_WINDOW_V2": 720, 43 | "DIFFICULTY_TARGET_V1": 300, 44 | "DIFFICULTY_TARGET_V2": 300 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /cores/bytecoin-v2.json: -------------------------------------------------------------------------------- 1 | { 2 | "extension_folder":"bytecoin-v2", 3 | "name": "bytecoin-v2", 4 | "git": "https://github.com/amjuarez/bytecoin.git", 5 | "branch":"frozen-master" 6 | } 7 | -------------------------------------------------------------------------------- /cores/bytecoin.json: -------------------------------------------------------------------------------- 1 | { 2 | "extension_folder":"bytecoin", 3 | "name": "bytecoin", 4 | "git": "https://github.com/bcndev/bytecoin.git", 5 | "branch":"master", 6 | "dependencies": [ 7 | "https://github.com/LMDB/lmdb" 8 | ] 9 | } 10 | -------------------------------------------------------------------------------- /cores/monero.json: -------------------------------------------------------------------------------- 1 | { 2 | "extension_folder":"monero", 3 | "name": "monero", 4 | "git": "https://github.com/monero-project/monero.git", 5 | "branch":"master" 6 | } 7 | -------------------------------------------------------------------------------- /docs/windows-requirements-install.md: -------------------------------------------------------------------------------- 1 | ### Windows requirements install instructions 2 | 3 | 1. Install MinGW (default install)
4 | http://sourceforge.net/projects/mingw/files/Installer/mingw-get-setup.exe/download 5 | * Select 'msys-base' from the install options 6 | * Select 'msys-patch (bin)' and 'msys-zip' from All Packages 7 | * Select 'Apply changes' from Installation menu 8 | 2. Add msys to path by executing the following in command prompt (you must run it as admin): 9 | ``` 10 | SETX PATH "%PATH%;C:\MinGW\msys\1.0\bin" /M 11 | ``` 12 | 3. Install git
13 | http://git-scm.com/download/win 14 | 4. Download and install Microsoft Visual Studio Community 2013 for Windows Desktop:
15 | https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx 16 | 5. Add path to .NET framework by executing the following in command prompt (you must run it as admin): 17 | ``` 18 | SETX PATH "%PATH%;C:\Program Files (x86)\MSBuild\12.0\bin\amd64" /M 19 | ``` 20 | 6. Download and install boost binaries boost_1_57_0-msvc-12.0-64.exe from http://sourceforge.net/projects/boost/files/boost-binaries into c:\local\boost_1_57_0
21 | http://sourceforge.net/projects/boost/files/boost-binaries/1.57.0/boost_1_57_0-msvc-12.0-64.exe/download 22 | 7. Set environmental variables for boost by executing the following in command prompt (you must run it as admin): 23 | ``` 24 | SETX BOOST_ROOT "C:\local\boost_1_57_0" /M 25 | 26 | SETX BOOST_LIBRARYDIR "C:\local\boost_1_57_0\lib64-msvc-12.0" /M 27 | ``` 28 | 8. Install the latest version of Cmake (http://www.cmake.org):
29 | Version in the time of writing: 30 | http://www.cmake.org/files/v3.1.2/cmake-3.2.1-win32-x86.exe 31 | 9. Install Python 2.7 (http://python.org):
32 | https://www.python.org/ftp/python/2.7.9/python-2.7.9.amd64.msi -------------------------------------------------------------------------------- /extensions/bytecoin-v2/block-hosts.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "block-hosts.json", 3 | "description": "Block failing hosts", 4 | "status": "In development", 5 | "required": [ 6 | "core/bytecoin.json" 7 | ], 8 | "files": [ 9 | { 10 | "path": "/src/CryptoNoteConfig.h", 11 | "changes": [ 12 | { 13 | "action": "add_below", 14 | "marker": "const size_t P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT", 15 | "parameters": { 16 | "text": [ 17 | "", 18 | "const uint32_t P2P_FAILED_ADDR_FORGET_SECONDS = (60*60); //1 hour", 19 | "const uint32_t P2P_IP_BLOCKTIME = (60*60*24); //24 hour", 20 | "const uint32_t P2P_IP_FAILS_BEFORE_BLOCK = 10;", 21 | "const uint32_t P2P_IDLE_CONNECTION_KILL_INTERVAL = (5*60); //5 minutes", 22 | "" 23 | ] 24 | } 25 | } 26 | ] 27 | }, 28 | { 29 | "path": "/src/P2p/NetNodeCommon.h", 30 | "changes": [ 31 | { 32 | "action": "add_above", 33 | "marker": "virtual void for_each_connection(std::function f) = 0;", 34 | "parameters": { 35 | "text": [ 36 | " virtual void drop_connection(CryptoNoteConnectionContext& context, bool add_fail) = 0;" 37 | ] 38 | } 39 | }, 40 | { 41 | "action": "add_above", 42 | "marker": "virtual void for_each_connection(std::function f) override {}", 43 | "parameters": { 44 | "text": [ 45 | " virtual void drop_connection(CryptoNoteConnectionContext& context, bool add_fail) override {}" 46 | ] 47 | } 48 | } 49 | ] 50 | }, 51 | { 52 | "path": "/src/P2p/NetNode.h", 53 | "changes": [ 54 | { 55 | "action": "add_above", 56 | "marker": "virtual void for_each_connection(std::function f) override;", 57 | "parameters": { 58 | "text": [ 59 | " virtual void drop_connection(CryptoNoteConnectionContext& context, bool add_fail) override;" 60 | ] 61 | } 62 | }, 63 | { 64 | "action": "add_above", 65 | "marker": "bool handle_command_line(const boost::program_options::variables_map& vm);", 66 | "parameters": { 67 | "text": [ 68 | "bool block_host(const uint32_t address_ip, time_t seconds = P2P_IP_BLOCKTIME);", 69 | "bool unblock_host(const uint32_t address_ip);", 70 | "bool add_host_fail(const uint32_t address_ip);" 71 | ] 72 | } 73 | }, 74 | { 75 | "action": "add_below", 76 | "marker": "boost::uuids::uuid m_network_id;", 77 | "parameters": { 78 | "text": [ 79 | " std::map m_blocked_hosts;", 80 | " std::map m_host_fails_score;", 81 | "", 82 | " mutable std::mutex mutex;" 83 | ] 84 | } 85 | } 86 | ] 87 | }, 88 | { 89 | "path": "/src/P2p/NetNode.cpp", 90 | "changes": [ 91 | { 92 | "action": "add_above", 93 | "marker": "bool NodeServer::handle_command_line(const boost::program_options::variables_map& vm)", 94 | "parameters": { 95 | "text": [ 96 | "bool NodeServer::block_host(const uint32_t address_ip, time_t seconds)", 97 | "{", 98 | " std::unique_lock lock(mutex);", 99 | " m_blocked_hosts[address_ip] = time(nullptr) + seconds;", 100 | "", 101 | " // drop any connection to that IP", 102 | " std::list conns;", 103 | " forEachConnection([&](P2pConnectionContext& cntxt) {", 104 | " if (cntxt.m_remote_ip == address_ip)", 105 | " {", 106 | " conns.push_back(cntxt.m_connection_id);", 107 | " }", 108 | " return true;", 109 | " });", 110 | " for (const auto &c_id: conns) {", 111 | " auto c = m_connections.find(c_id);", 112 | " if (c != m_connections.end())", 113 | " c->second.m_state = CryptoNoteConnectionContext::state_shutdown;", 114 | " }", 115 | "", 116 | " logger(INFO) << \"Host \" << Common::ipAddressToString(address_ip) << \" blocked.\";", 117 | " return true;", 118 | "}", 119 | "//-----------------------------------------------------------------------------------", 120 | "bool NodeServer::unblock_host(const uint32_t address_ip)", 121 | "{", 122 | " std::unique_lock lock(mutex);", 123 | " auto i = m_blocked_hosts.find(address_ip);", 124 | " if (i == m_blocked_hosts.end())", 125 | " return false;", 126 | " m_blocked_hosts.erase(i);", 127 | " logger(INFO) << \"Host \" << Common::ipAddressToString(address_ip) << \" unblocked.\";", 128 | " return true;", 129 | "}", 130 | "//-----------------------------------------------------------------------------------", 131 | "bool NodeServer::add_host_fail(const uint32_t address_ip)", 132 | "{", 133 | " std::unique_lock lock(mutex);", 134 | " uint64_t fails = ++m_host_fails_score[address_ip];", 135 | " logger(DEBUGGING) << \"Host \" << Common::ipAddressToString(address_ip) << \" fail score=\" << fails;", 136 | " if(fails > P2P_IP_FAILS_BEFORE_BLOCK)", 137 | " {", 138 | " auto it = m_host_fails_score.find(address_ip);", 139 | " if (it == m_host_fails_score.end()) {", 140 | " logger(DEBUGGING) << \"Internal error (add_host_fail)\" << fails;", 141 | " return false;", 142 | " }", 143 | " it->second = P2P_IP_FAILS_BEFORE_BLOCK/2;", 144 | " block_host(address_ip);", 145 | " }", 146 | " return true;", 147 | "}", 148 | "", 149 | "//-----------------------------------------------------------------------------------", 150 | "void NodeServer::drop_connection(CryptoNoteConnectionContext& context, bool add_fail)", 151 | "{", 152 | " if (add_fail)", 153 | " add_host_fail(context.m_remote_ip);", 154 | "", 155 | " context.m_state = CryptoNoteConnectionContext::state_shutdown;", 156 | "}", 157 | "", 158 | "//-----------------------------------------------------------------------------------" 159 | ] 160 | } 161 | }, 162 | { 163 | "action": "add_below", 164 | "marker": "if (!handle_remote_peerlist(rsp.local_peerlist, rsp.node_data.local_time, context)) {", 165 | "parameters": { 166 | "text": [ 167 | " add_host_fail(context.m_remote_ip);" 168 | ] 169 | } 170 | }, 171 | { 172 | "action": "add_below", 173 | "marker": "if (arg.node_data.network_id != m_network_id) {", 174 | "parameters": { 175 | "text": [ 176 | " add_host_fail(context.m_remote_ip);" 177 | ] 178 | } 179 | }, 180 | { 181 | "action": "add_below", 182 | "marker": "if(!context.m_is_income) {", 183 | "parameters": { 184 | "text": [ 185 | " add_host_fail(context.m_remote_ip);" 186 | ] 187 | } 188 | } 189 | ] 190 | }, 191 | { 192 | "path": "/src/CryptoNoteProtocol/CryptoNoteProtocolHandler.cpp", 193 | "changes": [ 194 | { 195 | "action": "add_below", 196 | "marker": " } else if (result == error::AddBlockErrorCondition::BLOCK_REJECTED) {", 197 | "parameters": { 198 | "text": [ 199 | " m_p2p->drop_connection(context, true);" 200 | ] 201 | } 202 | }, 203 | { 204 | "action": "add_below", 205 | "marker": " } else if (result == error::AddBlockErrorCondition::BLOCK_REJECTED) {", 206 | "parameters": { 207 | "text": [ 208 | " m_p2p->drop_connection(context, true);" 209 | ] 210 | } 211 | } 212 | ] 213 | } 214 | ] 215 | } 216 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/bugged-zawy-difficulty-algorithm.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "bugged-zawy-difficulty-algorithm.json", 3 | "description": "Used only by coins, addopted early version of ZAWY_DIFFICULTY_BLOCK_INDEX. Major bug in this implementation. Affected coins: Dinastycoin", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "versionized-parameters.json", 7 | "zawy-difficulty-algorithm.json" 8 | ], 9 | "files": [ 10 | { 11 | "path": "/src/CryptoNoteCore/Currency.h", 12 | "changes": [ 13 | { 14 | "action": "add_above", 15 | "marker": "size_t m_blockGrantedFullRewardZone;", 16 | "parameters": { 17 | "text": [ 18 | " uint32_t m_buggedZawyDifficultyBlockIndex;" 19 | ] 20 | } 21 | }, 22 | { 23 | "action": "add_above", 24 | "marker": "CurrencyBuilder& blockGrantedFullRewardZone(size_t val)", 25 | "parameters": { 26 | "text": [ 27 | " CurrencyBuilder& buggedZawyDifficultyBlockIndex(uint32_t val) { m_currency.m_buggedZawyDifficultyBlockIndex = val; return *this; }" 28 | ] 29 | } 30 | }, 31 | { 32 | "action": "add_above", 33 | "marker": "size_t blockGrantedFullRewardZone()", 34 | "parameters": { 35 | "text": [ 36 | " uint32_t buggedZawyDifficultyBlockIndex() const { return m_buggedZawyDifficultyBlockIndex; }" 37 | ] 38 | } 39 | } 40 | ] 41 | }, 42 | { 43 | "path": "/src/CryptoNoteCore/Currency.cpp", 44 | "changes": [ 45 | { 46 | "action": "add_above", 47 | "marker": "blockGrantedFullRewardZone(parameters::CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE);", 48 | "parameters": { 49 | "text": [ 50 | "buggedZawyDifficultyBlockIndex(parameters::BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX);" 51 | ] 52 | } 53 | }, 54 | { 55 | "action": "add_above", 56 | "marker": "m_testnet(currency.m_testnet),", 57 | "parameters": { 58 | "text": [ 59 | "m_buggedZawyDifficultyBlockIndex(currency.m_buggedZawyDifficultyBlockIndex)," 60 | ] 61 | } 62 | } 63 | ] 64 | }, 65 | { 66 | "path": "/src/CryptoNoteConfig.h", 67 | "changes": [ 68 | { 69 | "action": "add_above", 70 | "marker": "const unsigned EMISSION_SPEED_FACTOR", 71 | "parameters": { 72 | "text": [ 73 | "const uint32_t BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX = %s;" 74 | ], 75 | "replace_text_alt": [ 76 | "const uint32_t BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX = 0;" 77 | ], 78 | "var": "BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX" 79 | } 80 | } 81 | ] 82 | }, 83 | { 84 | "path": "/src/CryptoNoteCore/Currency.cpp", 85 | "changes": [ 86 | { 87 | "action": "add_above", 88 | "marker": "return (low + timeSpan - 1) / timeSpan; // with version", 89 | "parameters": { 90 | "text": [ 91 | "", 92 | " if (m_buggedZawyDifficultyBlockIndex && m_buggedZawyDifficultyBlockIndex <= blockIndex) {", 93 | " if (high != 0) {", 94 | " return 0;", 95 | " }", 96 | "/*", 97 | " Recalculating 'low' and 'timespan' with hardcoded values:", 98 | " DIFFICULTY_CUT=0", 99 | " DIFFICULTY_LAG=0", 100 | " DIFFICULTY_WINDOW=17", 101 | "*/", 102 | " c_difficultyWindow = 17;", 103 | " c_difficultyCut = 0;", 104 | "", 105 | " assert(c_difficultyWindow >= 2);", 106 | "", 107 | " if (timestamps.size() > c_difficultyWindow) {", 108 | " timestamps.resize(c_difficultyWindow);", 109 | " cumulativeDifficulties.resize(c_difficultyWindow);", 110 | " }", 111 | "", 112 | " length = timestamps.size();", 113 | " assert(length == cumulativeDifficulties.size());", 114 | " assert(length <= c_difficultyWindow);", 115 | " if (length <= 1) {", 116 | " return 1;", 117 | " }", 118 | "", 119 | " sort(timestamps.begin(), timestamps.end());", 120 | "", 121 | " assert(2 * c_difficultyCut <= c_difficultyWindow - 2);", 122 | " if (length <= c_difficultyWindow - 2 * c_difficultyCut) {", 123 | " cutBegin = 0;", 124 | " cutEnd = length;", 125 | " } else {", 126 | " cutBegin = (length - (c_difficultyWindow - 2 * c_difficultyCut) + 1) / 2;", 127 | " cutEnd = cutBegin + (c_difficultyWindow - 2 * c_difficultyCut);", 128 | " }", 129 | " assert(/*cut_begin >= 0 &&*/ cutBegin + 2 <= cutEnd && cutEnd <= length);", 130 | " timeSpan = timestamps[cutEnd - 1] - timestamps[cutBegin];", 131 | " if (timeSpan == 0) {", 132 | " timeSpan = 1;", 133 | " }", 134 | "", 135 | " totalWork = cumulativeDifficulties[cutEnd - 1] - cumulativeDifficulties[cutBegin];", 136 | " assert(totalWork > 0);", 137 | "", 138 | " low = mul128(totalWork, m_difficultyTarget, &high);", 139 | " if (high != 0 || std::numeric_limits::max() - low < (timeSpan - 1)) {", 140 | " return 0;", 141 | " }", 142 | 143 | " uint64_t nextDiffZ = low / timeSpan;", 144 | "", 145 | " return nextDiffZ;", 146 | " }", 147 | "" 148 | ] 149 | } 150 | } 151 | ] 152 | } 153 | ] 154 | } 155 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/cryptonote-coin-clones-support.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "cryptonote-coin-clones-support.json", 3 | "description": "Adding support for the second generation clones of Cryptonote coin", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/CryptoNoteConfig.h", 10 | "changes": [ 11 | { 12 | "action": "add_above", 13 | "marker": "const unsigned EMISSION_SPEED_FACTOR", 14 | "parameters": { 15 | "text": [ 16 | "const size_t CRYPTONOTE_COIN_VERSION = %s;" 17 | ], 18 | "replace_text_alt": [ 19 | "const size_t CRYPTONOTE_COIN_VERSION = 0;" 20 | ], 21 | "var": "CRYPTONOTE_COIN_VERSION" 22 | } 23 | } 24 | ] 25 | }, 26 | { 27 | "path": "/src/CryptoNoteCore/Currency.h", 28 | "changes": [ 29 | { 30 | "action": "add_below", 31 | "marker": "unsigned int m_emissionSpeedFactor;", 32 | "parameters": { 33 | "text": [ 34 | " size_t m_cryptonoteCoinVersion;" 35 | ] 36 | } 37 | }, 38 | { 39 | "action": "add_below", 40 | "marker": "CurrencyBuilder& emissionSpeedFactor(unsigned int val);", 41 | "parameters": { 42 | "text": [ 43 | " CurrencyBuilder& cryptonoteCoinVersion(size_t val) { m_currency.m_cryptonoteCoinVersion = val; return *this; }" 44 | ] 45 | } 46 | }, 47 | { 48 | "action": "add_below", 49 | "marker": "unsigned int emissionSpeedFactor()", 50 | "parameters": { 51 | "text": [ 52 | " size_t cryptonoteCoinVersion() const { return m_cryptonoteCoinVersion; }" 53 | ] 54 | } 55 | } 56 | ] 57 | }, 58 | { 59 | "path": "/src/CryptoNoteCore/Currency.cpp", 60 | "changes": [ 61 | { 62 | "action": "add_below", 63 | "marker": "emissionSpeedFactor(parameters::EMISSION_SPEED_FACTOR);", 64 | "parameters": { 65 | "text": [ 66 | "cryptonoteCoinVersion(parameters::CRYPTONOTE_COIN_VERSION);" 67 | ] 68 | } 69 | }, 70 | { 71 | "action": "add_below", 72 | "marker": "uint64_t penalizedFee = blockMajorVersion >= BLOCK_MAJOR_VERSION_2", 73 | "parameters": { 74 | "text": [ 75 | "if (cryptonoteCoinVersion() == 1) {", 76 | " penalizedFee = getPenalizedAmount(fee, medianSize, currentBlockSize);", 77 | "}" 78 | ] 79 | } 80 | }, 81 | { 82 | "action": "add_above", 83 | "marker": "m_testnet(currency.m_testnet),", 84 | "parameters": { 85 | "text": [ 86 | "m_cryptonoteCoinVersion(currency.m_cryptonoteCoinVersion)," 87 | ] 88 | } 89 | } 90 | ] 91 | } 92 | ] 93 | } 94 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/daemon-getrandom_outs-json.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "daemon-getrandom_outs-json.json", 3 | "description": "Adds getrandom_outs as json to the daemon.", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 10 | "changes": [ 11 | { 12 | "action": "add_above", 13 | "marker": "struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_request {", 14 | "parameters": { 15 | "text": [ 16 | "struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON_request {", 17 | " std::vector amounts;", 18 | " uint16_t outs_count;", 19 | "", 20 | " void serialize(ISerializer &s) {", 21 | " KV_MEMBER(amounts)", 22 | " KV_MEMBER(outs_count)", 23 | " }", 24 | "};", 25 | "", 26 | "struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON_out_entry {", 27 | " uint32_t global_amount_index;", 28 | " Crypto::PublicKey out_key;", 29 | " void serialize(ISerializer &s) {", 30 | " KV_MEMBER(global_amount_index)", 31 | " KV_MEMBER(out_key)", 32 | " }", 33 | "};", 34 | "", 35 | "struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON_outs_for_amount {", 36 | " uint64_t amount;", 37 | " std::vector outs;", 38 | "", 39 | " void serialize(ISerializer &s) {", 40 | " KV_MEMBER(amount)", 41 | " KV_MEMBER(outs)", 42 | " }", 43 | "};", 44 | "", 45 | "struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON_response {", 46 | " std::vector outs;", 47 | " std::string status;", 48 | "", 49 | " void serialize(ISerializer &s) {", 50 | " KV_MEMBER(outs)", 51 | " KV_MEMBER(status)", 52 | " }", 53 | "};", 54 | "", 55 | "struct COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON {", 56 | " typedef COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON_request request;", 57 | " typedef COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON_response response;", 58 | "", 59 | " typedef COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON_out_entry out_entry;", 60 | " typedef COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON_outs_for_amount outs_for_amount;", 61 | "};", 62 | "", 63 | "//-----------------------------------------------", 64 | "" 65 | ] 66 | } 67 | } 68 | ] 69 | }, 70 | { 71 | "path": "/src/Rpc/RpcServer.h", 72 | "changes": [ 73 | { 74 | "action": "add_above", 75 | "marker": "bool on_get_info(const COMMAND_RPC_GET_INFO::request& req, COMMAND_RPC_GET_INFO::response& res);", 76 | "parameters": { 77 | "text": [ 78 | "bool on_get_random_outs_json(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON::response& res);" 79 | ] 80 | } 81 | } 82 | ] 83 | }, 84 | { 85 | "path": "/src/Rpc/RpcServer.cpp", 86 | "changes": [ 87 | { 88 | "action": "add_above", 89 | "marker": "{ \"/getinfo\", { jsonMethod(&RpcServer::on_get_info), true } },", 90 | "parameters": { 91 | "text": [ 92 | "{ \"/getrandom_outs\", { jsonMethod(&RpcServer::on_get_random_outs_json), false } }," 93 | ] 94 | } 95 | }, 96 | { 97 | "action": "add_above", 98 | "marker": "bool RpcServer::on_get_random_outs(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS::response& res) {", 99 | "parameters": { 100 | "text": [ 101 | "bool RpcServer::on_get_random_outs_json(const COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON::request& req, COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON::response& res) {", 102 | " res.status = \"Failed\";", 103 | "", 104 | " for (uint64_t amount : req.amounts) {", 105 | " std::vector globalIndexes;", 106 | " std::vector publicKeys;", 107 | " if (!m_core.getRandomOutputs(amount, static_cast(req.outs_count), globalIndexes, publicKeys)) {", 108 | " return true;", 109 | " }", 110 | "", 111 | " assert(globalIndexes.size() == publicKeys.size());", 112 | " res.outs.emplace_back(COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON_outs_for_amount{amount, {}});", 113 | " for (size_t i = 0; i < globalIndexes.size(); ++i) {", 114 | " COMMAND_RPC_GET_RANDOM_OUTPUTS_FOR_AMOUNTS_JSON_out_entry out_entry;", 115 | " out_entry.global_amount_index = globalIndexes[i];", 116 | " out_entry.out_key = publicKeys[i];", 117 | " res.outs.back().outs.push_back(out_entry);", 118 | " }", 119 | " }", 120 | "", 121 | " res.status = CORE_RPC_STATUS_OK;", 122 | "", 123 | " return true;", 124 | "}", 125 | "" 126 | ] 127 | } 128 | } 129 | ] 130 | } 131 | ] 132 | } 133 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/enable-cors.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "enable-cors.json", 3 | "description": "Adds CORS support", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/Daemon/Daemon.cpp", 10 | "changes": [ 11 | { 12 | "action": "add_above", 13 | "marker": "arg_testnet_on = {", 14 | "parameters": { 15 | "text": [ 16 | " const command_line::arg_descriptor> arg_enable_cors = { \"enable-cors\", \"Adds header 'Access-Control-Allow-Origin' to the daemon's RPC responses. Uses the value as domain. Use * for all\" };" 17 | ] 18 | } 19 | }, 20 | { 21 | "action": "add_below", 22 | "marker": "command_line::add_arg(desc_cmd_sett, arg_testnet_on);", 23 | "parameters": { 24 | "text": [ 25 | "command_line::add_arg(desc_cmd_sett, arg_enable_cors);" 26 | ] 27 | } 28 | }, 29 | { 30 | "action": "add_below", 31 | "marker": "rpcServer.start(rpcConfig.bindIp, rpcConfig.bindPort);", 32 | "parameters": { 33 | "text": [ 34 | "rpcServer.enableCors(command_line::get_arg(vm, arg_enable_cors));" 35 | ] 36 | } 37 | } 38 | ] 39 | }, 40 | { 41 | "path": "/src/Rpc/RpcServer.h", 42 | "changes": [ 43 | { 44 | "action": "add_below", 45 | "marker": "ICryptoNoteProtocolHandler& m_protocol;", 46 | "parameters": { 47 | "text": [ 48 | "std::vector m_cors_domains;" 49 | ] 50 | } 51 | }, 52 | { 53 | "action": "add_below", 54 | "marker": "typedef std::function HandlerFunction;", 55 | "parameters": { 56 | "text": [ 57 | " bool enableCors(const std::vector domains);" 58 | ] 59 | } 60 | } 61 | ] 62 | }, 63 | { 64 | "path": "/src/Rpc/RpcServer.cpp", 65 | "changes": [ 66 | { 67 | "action": "add_above", 68 | "marker": "bool RpcServer::isCoreReady() {", 69 | "parameters": { 70 | "text": [ 71 | "bool RpcServer::enableCors(const std::vector domains) {", 72 | " m_cors_domains = domains;", 73 | " return true;", 74 | "}", 75 | "" 76 | ] 77 | } 78 | }, 79 | { 80 | "action": "add_above", 81 | "marker": "response.addHeader(\"Content-Type\", \"application/json\");", 82 | "parameters": { 83 | "text": [ 84 | " for (const auto& cors_domain: m_cors_domains) {", 85 | " response.addHeader(\"Access-Control-Allow-Origin\", cors_domain);", 86 | " }" 87 | ] 88 | } 89 | } 90 | ] 91 | } 92 | ] 93 | } -------------------------------------------------------------------------------- /extensions/bytecoin-v2/fee-address.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "fee-address.json", 3 | "description": "Adding fee address option to the daemon", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/Daemon/Daemon.cpp", 10 | "changes": [ 11 | { 12 | "action": "add_below", 13 | "marker": "const command_line::arg_descriptor arg_console = {\"no-console\", \"Disable daemon console commands\"};", 14 | "parameters": { 15 | "text": [ 16 | " const command_line::arg_descriptor arg_set_fee_address = { \"fee-address\", \"Sets fee address for light wallets to the daemon's RPC responses.\", \"\" };" 17 | ] 18 | } 19 | }, 20 | { 21 | "action": "add_below", 22 | "marker": "command_line::add_arg(desc_cmd_sett, arg_console);", 23 | "parameters": { 24 | "text": [ 25 | " command_line::add_arg(desc_cmd_sett, arg_set_fee_address);" 26 | ] 27 | } 28 | }, 29 | { 30 | "action": "add_below", 31 | "marker": "rpcServer.start(rpcConfig.bindIp, rpcConfig.bindPort);", 32 | "parameters": { 33 | "text": [ 34 | " rpcServer.setFeeAddress(command_line::get_arg(vm, arg_set_fee_address));" 35 | ] 36 | } 37 | } 38 | ] 39 | }, 40 | { 41 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 42 | "changes": [ 43 | { 44 | "action": "add_above", 45 | "marker": "struct COMMAND_RPC_GETBLOCKCOUNT {", 46 | "parameters": { 47 | "text": [ 48 | "struct COMMAND_RPC_GET_FEE_ADDRESS {", 49 | " typedef EMPTY_STRUCT request;", 50 | "", 51 | " struct response {", 52 | " std::string fee_address;", 53 | " std::string status;", 54 | "", 55 | " void serialize(ISerializer &s) {", 56 | " KV_MEMBER(fee_address)", 57 | " KV_MEMBER(status)", 58 | " }", 59 | " };", 60 | "};", 61 | "" 62 | ] 63 | } 64 | } 65 | ] 66 | }, 67 | 68 | { 69 | "path": "/src/Rpc/RpcServer.cpp", 70 | "changes": [ 71 | { 72 | "action": "add_below", 73 | "marker": "{ \"/sendrawtransaction\", { jsonMethod(&RpcServer::on_send_raw_tx), false } },", 74 | "parameters": { 75 | "text": [ 76 | " { \"/feeaddress\", { jsonMethod(&RpcServer::on_get_fee_address), true } }," 77 | ] 78 | } 79 | }, 80 | { 81 | "action": "add_above", 82 | "marker": "bool RpcServer::isCoreReady() {", 83 | "parameters": { 84 | "text": [ 85 | "bool RpcServer::setFeeAddress(const std::string fee_address) {", 86 | " m_fee_address = fee_address;", 87 | " return true;", 88 | "}", 89 | "" 90 | ] 91 | } 92 | }, 93 | { 94 | "action": "add_above", 95 | "marker": "bool RpcServer::on_stop_daemon(const COMMAND_RPC_STOP_DAEMON::request& req, COMMAND_RPC_STOP_DAEMON::response& res) {", 96 | "parameters": { 97 | "text": [ 98 | "bool RpcServer::on_get_fee_address(const COMMAND_RPC_GET_FEE_ADDRESS::request& req, COMMAND_RPC_GET_FEE_ADDRESS::response& res) {", 99 | " if (m_fee_address.empty()) {", 100 | " res.status = \"Node's fee address is not set\";", 101 | " return false;", 102 | " }", 103 | "", 104 | " res.fee_address = m_fee_address;", 105 | " res.status = CORE_RPC_STATUS_OK;", 106 | " return true;", 107 | "}", 108 | "" 109 | ] 110 | } 111 | } 112 | ] 113 | }, 114 | { 115 | "path": "/src/Rpc/RpcServer.h", 116 | "changes": [ 117 | { 118 | "action": "add_below", 119 | "marker": "typedef std::function HandlerFunction;", 120 | "parameters": { 121 | "text": [ 122 | " bool setFeeAddress(const std::string fee_address);" 123 | ] 124 | } 125 | }, 126 | { 127 | "action": "add_below", 128 | "marker": "RawBlockLegacy prepareRawBlockLegacy(BinaryArray&& blockBlob);", 129 | "parameters": { 130 | "text": [ 131 | "", 132 | " bool on_get_fee_address(const COMMAND_RPC_GET_FEE_ADDRESS::request& req, COMMAND_RPC_GET_FEE_ADDRESS::response& res);" 133 | ] 134 | } 135 | }, 136 | { 137 | "action": "add_below", 138 | "marker": "ICryptoNoteProtocolHandler& m_protocol;", 139 | "parameters": { 140 | "text": [ 141 | " std::string m_fee_address;" 142 | ] 143 | } 144 | } 145 | ] 146 | } 147 | ] 148 | } 149 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/kill-height.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "kill-height.json", 3 | "description": "Kill the blockchain @ block. No new blocks accepted afterwards. Use 0 for infinite blockchains", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/CryptoNoteCore/Currency.h", 10 | "changes": [ 11 | { 12 | "action": "add_above", 13 | "marker": "size_t m_blockGrantedFullRewardZone;", 14 | "parameters": { 15 | "text": [ 16 | " uint32_t m_killHeight;" 17 | ] 18 | } 19 | }, 20 | { 21 | "action": "add_above", 22 | "marker": "CurrencyBuilder& blockGrantedFullRewardZone(size_t val)", 23 | "parameters": { 24 | "text": [ 25 | " CurrencyBuilder& killHeight(uint32_t val) { m_currency.m_killHeight = val; return *this; }" 26 | ] 27 | } 28 | }, 29 | { 30 | "action": "add_above", 31 | "marker": "size_t blockGrantedFullRewardZone()", 32 | "parameters": { 33 | "text": [ 34 | " uint32_t killHeight() const { return m_killHeight; }" 35 | ] 36 | } 37 | } 38 | ] 39 | }, 40 | { 41 | "path": "/src/CryptoNoteCore/Currency.cpp", 42 | "changes": [ 43 | { 44 | "action": "add_above", 45 | "marker": "blockGrantedFullRewardZone(parameters::CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE);", 46 | "parameters": { 47 | "text": [ 48 | "killHeight(parameters::KILL_HEIGHT);" 49 | ] 50 | } 51 | }, 52 | { 53 | "action": "add_above", 54 | "marker": "m_testnet(currency.m_testnet),", 55 | "parameters": { 56 | "text": [ 57 | "m_killHeight(currency.m_killHeight)," 58 | ] 59 | } 60 | } 61 | ] 62 | }, 63 | { 64 | "path": "/src/CryptoNoteConfig.h", 65 | "changes": [ 66 | { 67 | "action": "add_above", 68 | "marker": "const unsigned EMISSION_SPEED_FACTOR", 69 | "parameters": { 70 | "text": [ 71 | "const uint32_t KILL_HEIGHT = %s;" 72 | ], 73 | "replace_text_alt": [ 74 | "const uint32_t KILL_HEIGHT = 0;" 75 | ], 76 | "var": "KILL_HEIGHT" 77 | } 78 | } 79 | ] 80 | }, 81 | { 82 | "path": "/src/CryptoNoteCore/BlockValidationErrors.h", 83 | "changes": [ 84 | { 85 | "action": "add_below", 86 | "marker": "PROOF_OF_WORK_TOO_WEAK,", 87 | "parameters": { 88 | "text": [ 89 | "NO_MORE_BLOCK," 90 | ] 91 | } 92 | }, 93 | { 94 | "action": "add_below", 95 | "marker": "case BlockValidationError::PROOF_OF_WORK_TOO_WEAK: return \"Proof of work is too weak\";", 96 | "parameters": { 97 | "text": [ 98 | "case BlockValidationError::NO_MORE_BLOCK: return \"Kill block reached\";" 99 | ] 100 | } 101 | } 102 | ] 103 | }, 104 | { 105 | "path": "/src/CryptoNoteCore/Core.cpp", 106 | "changes": [ 107 | { 108 | "action": "add_above", 109 | "marker": "auto currentDifficulty = cache->getDifficultyForNextBlock(previousBlockIndex);", 110 | "parameters": { 111 | "text": [ 112 | " if (currency.killHeight() != 0 && cache->getBlockIndex(cachedBlock.getBlockHash()) > currency.killHeight()) {", 113 | " logger(Logging::ERROR, Logging::BRIGHT_RED) << \"Cannot add more blocks. Block \" << currency.killHeight() << \" is the kill block\";", 114 | " return error::BlockValidationError::NO_MORE_BLOCK;", 115 | " }", 116 | "" 117 | ] 118 | } 119 | } 120 | ] 121 | } 122 | ] 123 | } 124 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/mandatory-transaction-in-block.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "mandatory-transaction-in-block.json", 3 | "description": "Blocks must have at least one real transaction", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/CryptoNoteConfig.h", 10 | "changes": [ 11 | { 12 | "action": "add_above", 13 | "marker": "const unsigned EMISSION_SPEED_FACTOR", 14 | "parameters": { 15 | "text": [ 16 | "const uint32_t MANDATORY_TRANSACTION = %s;" 17 | ], 18 | "replace_text_alt": [ 19 | "const uint32_t MANDATORY_TRANSACTION = 0;" 20 | ], 21 | "var": "MANDATORY_TRANSACTION" 22 | } 23 | } 24 | ] 25 | }, 26 | { 27 | "path": "/src/CryptoNoteCore/Currency.h", 28 | "changes": [ 29 | { 30 | "action": "add_above", 31 | "marker": "size_t m_blockGrantedFullRewardZone;", 32 | "parameters": { 33 | "text": [ 34 | " uint32_t m_mandatoryTransaction;" 35 | ] 36 | } 37 | }, 38 | { 39 | "action": "add_above", 40 | "marker": "CurrencyBuilder& blockGrantedFullRewardZone(size_t val)", 41 | "parameters": { 42 | "text": [ 43 | " CurrencyBuilder& mandatoryTransaction(uint8_t val) { m_currency.m_mandatoryTransaction = val; return *this; }" 44 | ] 45 | } 46 | }, 47 | { 48 | "action": "add_above", 49 | "marker": "size_t blockGrantedFullRewardZone()", 50 | "parameters": { 51 | "text": [ 52 | " uint32_t mandatoryTransaction() const { return m_mandatoryTransaction; }" 53 | ] 54 | } 55 | } 56 | ] 57 | }, 58 | { 59 | "path": "/src/CryptoNoteCore/Currency.cpp", 60 | "changes": [ 61 | { 62 | "action": "add_above", 63 | "marker": "blockGrantedFullRewardZone(parameters::CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE);", 64 | "parameters": { 65 | "text": [ 66 | "mandatoryTransaction(parameters::MANDATORY_TRANSACTION);" 67 | ] 68 | } 69 | }, 70 | { 71 | "action": "add_above", 72 | "marker": "m_testnet(currency.m_testnet),", 73 | "parameters": { 74 | "text": [ 75 | "m_mandatoryTransaction(currency.m_mandatoryTransaction)," 76 | ] 77 | } 78 | } 79 | ] 80 | }, 81 | { 82 | "path": "/src/CryptoNoteCore/BlockValidationErrors.h", 83 | "changes": [ 84 | { 85 | "action": "add_below", 86 | "marker": "PROOF_OF_WORK_TOO_WEAK,", 87 | "parameters": { 88 | "text": [ 89 | "NOT_ENOUGH_TRANSACTIONS," 90 | ] 91 | } 92 | }, 93 | { 94 | "action": "add_below", 95 | "marker": "case BlockValidationError::PROOF_OF_WORK_TOO_WEAK: return \"Proof of work is too weak\";", 96 | "parameters": { 97 | "text": [ 98 | "case BlockValidationError::NOT_ENOUGH_TRANSACTIONS: return \"New block must have at least one transaction\";" 99 | ] 100 | } 101 | } 102 | ] 103 | }, 104 | { 105 | "path": "/src/CryptoNoteCore/Core.cpp", 106 | "changes": [ 107 | { 108 | "action": "add_above", 109 | "marker": "auto currentDifficulty = cache->getDifficultyForNextBlock(previousBlockIndex);", 110 | "parameters": { 111 | "text": [ 112 | " if (currency.mandatoryTransaction()) {", 113 | " if (cachedBlock.getBlock().transactionHashes.size() < 1 && cache->getBlockIndex(cachedBlock.getBlockHash()) > parameters::CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW) {", 114 | " logger(Logging::WARNING) << \"New block must have at least one transaction\";", 115 | " return error::BlockValidationError::NOT_ENOUGH_TRANSACTIONS;", 116 | " }", 117 | " }", 118 | "" 119 | ] 120 | } 121 | }, 122 | { 123 | "action": "add_above", 124 | "marker": "size_t cumulativeSize = transactionsSize + getObjectBinarySize(b.baseTransaction);", 125 | "parameters": { 126 | "text": [ 127 | " if (currency.mandatoryTransaction()) {", 128 | " if (transactionsSize == 0 && height > parameters::CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW) { ", 129 | " logger(Logging::ERROR, Logging::BRIGHT_RED) << \"Need at least one transaction beside base transaction\";", 130 | " return false;", 131 | " }", 132 | " }" 133 | ] 134 | } 135 | } 136 | ] 137 | } 138 | ] 139 | } -------------------------------------------------------------------------------- /extensions/bytecoin-v2/max-transaction-size-limit.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "max-transaction-size-limit.json", 3 | "description": "Adds --max-transaction-size option to simplewallet and walletd + precompiled", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/CryptoNoteConfig.h", 10 | "changes": [ 11 | { 12 | "action": "add_below", 13 | "marker": "const uint64_t DEFAULT_DUST_THRESHOLD", 14 | "parameters": { 15 | "text": [ 16 | "const uint64_t MAX_TRANSACTION_SIZE_LIMIT = %s;" 17 | ], 18 | "replace_text_alt": [ 19 | "// Use 0 for default max transaction size limit", 20 | "const uint64_t MAX_TRANSACTION_SIZE_LIMIT = CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE * 110 / 100 - CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;" 21 | ], 22 | "var": "MAX_TRANSACTION_SIZE_LIMIT" 23 | } 24 | } 25 | ] 26 | }, 27 | { 28 | "path": "/src/Wallet/WalletGreen.cpp", 29 | "changes": [ 30 | { 31 | "action": "replace", 32 | "marker": "m_upperTransactionSizeLimit = parameters::CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_CURRENT * 125 / 100 - m_currency.minerTxBlobReservedSize();", 33 | "parameters": { 34 | "text": [ 35 | " m_upperTransactionSizeLimit = m_currency.maxTransactionSizeLimit();" 36 | ] 37 | } 38 | } 39 | ] 40 | }, 41 | { 42 | "path": "/src/WalletLegacy/WalletTransactionSender.cpp", 43 | "changes": [ 44 | { 45 | "action": "replace", 46 | "marker": "m_upperTransactionSizeLimit(parameters::CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_CURRENT * 125 / 100 - m_currency.minerTxBlobReservedSize()) {", 47 | "parameters": { 48 | "text": [ 49 | " m_upperTransactionSizeLimit(m_currency.maxTransactionSizeLimit()) {" 50 | ] 51 | } 52 | } 53 | ] 54 | }, 55 | { 56 | "path": "/src/CryptoNoteCore/Currency.h", 57 | "changes": [ 58 | { 59 | "action": "add_below", 60 | "marker": "size_t m_minerTxBlobReservedSize;", 61 | "parameters": { 62 | "text": [ 63 | " uint64_t m_maxTransactionSizeLimit;" 64 | ] 65 | } 66 | }, 67 | { 68 | "action": "add_below", 69 | "marker": "CurrencyBuilder& minerTxBlobReservedSize(size_t val) { m_currency.m_minerTxBlobReservedSize = val; return *this; }", 70 | "parameters": { 71 | "text": [ 72 | " CurrencyBuilder& maxTransactionSizeLimit(uint64_t val) { m_currency.m_maxTransactionSizeLimit = val; return *this; }" 73 | ] 74 | } 75 | }, 76 | { 77 | "action": "add_below", 78 | "marker": "size_t minerTxBlobReservedSize() const { return m_minerTxBlobReservedSize; }", 79 | "parameters": { 80 | "text": [ 81 | " uint64_t maxTransactionSizeLimit() const { return m_maxTransactionSizeLimit; }" 82 | ] 83 | } 84 | } 85 | ] 86 | }, 87 | { 88 | "path": "/src/CryptoNoteCore/Currency.cpp", 89 | "changes": [ 90 | { 91 | "action": "add_below", 92 | "marker": "m_minerTxBlobReservedSize(currency.m_minerTxBlobReservedSize),", 93 | "parameters": { 94 | "text": [ 95 | "m_maxTransactionSizeLimit(currency.m_maxTransactionSizeLimit)," 96 | ] 97 | } 98 | }, 99 | { 100 | "action": "add_below", 101 | "marker": "minerTxBlobReservedSize(parameters::CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE);", 102 | "parameters": { 103 | "text": [ 104 | "maxTransactionSizeLimit(parameters::MAX_TRANSACTION_SIZE_LIMIT);" 105 | ] 106 | } 107 | }, 108 | { 109 | "action": "replace", 110 | "marker": "fusionTxMaxSize(parameters::FUSION_TX_MAX_SIZE);", 111 | "parameters": { 112 | "text": [ 113 | "// fusion transactions fix", 114 | "fusionTxMaxSize(parameters::MAX_TRANSACTION_SIZE_LIMIT * 30 / 100);" 115 | ] 116 | } 117 | } 118 | ] 119 | } 120 | ] 121 | } 122 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/mnemonics/electrum-words.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2018, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | /*! 30 | * \file electrum-words.h 31 | * 32 | * \brief Mnemonic seed generation and wallet restoration from them. 33 | * 34 | * This file and its cpp file are for translating Electrum-style word lists 35 | * into their equivalent byte representations for cross-compatibility with 36 | * that method of "backing up" one's wallet keys. 37 | */ 38 | 39 | #ifndef ELECTRUM_WORDS_H 40 | #define ELECTRUM_WORDS_H 41 | 42 | #include 43 | #include 44 | #include 45 | #include "crypto/crypto.h" // for declaration of crypto::secret_key 46 | 47 | /*! 48 | * \namespace crypto 49 | * 50 | * \brief crypto namespace. 51 | */ 52 | namespace crypto 53 | { 54 | /*! 55 | * \namespace crypto::ElectrumWords 56 | * 57 | * \brief Mnemonic seed word generation and wallet restoration helper functions. 58 | */ 59 | namespace ElectrumWords 60 | { 61 | 62 | const int seed_length = 24; 63 | const std::string old_language_name = "EnglishOld"; 64 | /*! 65 | * \brief Converts seed words to bytes (secret key). 66 | * \param words String containing the words separated by spaces. 67 | * \param dst To put the secret data restored from the words. 68 | * \param len The number of bytes to expect, 0 if unknown 69 | * \param duplicate If true and len is not zero, we accept half the data, and duplicate it 70 | * \param language_name Language of the seed as found gets written here. 71 | * \return false if not a multiple of 3 words, or if word is not in the words list 72 | */ 73 | bool words_to_bytes(std::string words, std::string& dst, size_t len, bool duplicate, 74 | std::string &language_name); 75 | /*! 76 | * \brief Converts seed words to bytes (secret key). 77 | * \param words String containing the words separated by spaces. 78 | * \param dst To put the secret key restored from the words. 79 | * \param language_name Language of the seed as found gets written here. 80 | * \return false if not a multiple of 3 words, or if word is not in the words list 81 | */ 82 | bool words_to_bytes(std::string words, Crypto::SecretKey& dst, 83 | std::string &language_name); 84 | 85 | /*! 86 | * \brief Converts bytes to seed words. 87 | * \param src Secret data 88 | * \param len Secret data length in bytes (positive multiples of 4 only) 89 | * \param words Space delimited concatenated words get written here. 90 | * \param language_name Seed language name 91 | * \return true if successful false if not. Unsuccessful if wrong key size. 92 | */ 93 | bool bytes_to_words(const char *src, size_t len, std::string& words, 94 | const std::string &language_name); 95 | 96 | /*! 97 | * \brief Converts bytes (secret key) to seed words. 98 | * \param src Secret key 99 | * \param words Space delimited concatenated words get written here. 100 | * \param language_name Seed language name 101 | * \return true if successful false if not. Unsuccessful if wrong key size. 102 | */ 103 | bool bytes_to_words(const Crypto::SecretKey& src, std::string& words, 104 | const std::string &language_name); 105 | 106 | /*! 107 | * \brief Gets a list of seed languages that are supported. 108 | * \param languages A vector is set to the list of languages. 109 | */ 110 | void get_language_list(std::vector &languages); 111 | 112 | /*! 113 | * \brief Tells if the seed passed is an old style seed or not. 114 | * \param seed The seed to check (a space delimited concatenated word list) 115 | * \return true if the seed passed is a old style seed false if not. 116 | */ 117 | bool get_is_old_style_seed(std::string seed); 118 | } 119 | } 120 | 121 | #endif 122 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/mnemonics/language_base.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2018, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | /*! 30 | * \file language_base.h 31 | * 32 | * \brief Language Base class for Polymorphism. 33 | */ 34 | 35 | #ifndef LANGUAGE_BASE_H 36 | #define LANGUAGE_BASE_H 37 | 38 | #include 39 | #include 40 | #include 41 | //#include "misc_log_ex.h" 42 | 43 | /*! 44 | * \namespace Language 45 | * \brief Mnemonic language related namespace. 46 | */ 47 | namespace Language 48 | { 49 | /*! 50 | * \brief Returns a string made of (at most) the first count characters in s. 51 | * Assumes well formedness. No check is made for this. 52 | * \param s The string from which to return the first count characters. 53 | * \param count How many characters to return. 54 | * \return A string consisting of the first count characters in s. 55 | */ 56 | inline std::string utf8prefix(const std::string &s, size_t count) 57 | { 58 | std::string prefix = ""; 59 | const char *ptr = s.c_str(); 60 | while (count-- && *ptr) 61 | { 62 | prefix += *ptr++; 63 | while (((*ptr) & 0xc0) == 0x80) 64 | prefix += *ptr++; 65 | } 66 | return prefix; 67 | } 68 | 69 | /*! 70 | * \class Base 71 | * \brief A base language class which all languages have to inherit from for 72 | * Polymorphism. 73 | */ 74 | class Base 75 | { 76 | protected: 77 | enum { 78 | ALLOW_SHORT_WORDS = 1<<0, 79 | ALLOW_DUPLICATE_PREFIXES = 1<<1, 80 | }; 81 | const std::vector word_list; /*!< A pointer to the array of words */ 82 | std::unordered_map word_map; /*!< hash table to find word's index */ 83 | std::unordered_map trimmed_word_map; /*!< hash table to find word's trimmed index */ 84 | std::string language_name; /*!< Name of language */ 85 | uint32_t unique_prefix_length; /*!< Number of unique starting characters to trim the wordlist to when matching */ 86 | /*! 87 | * \brief Populates the word maps after the list is ready. 88 | */ 89 | void populate_maps(uint32_t flags = 0) 90 | { 91 | int ii; 92 | std::vector::const_iterator it; 93 | if (word_list.size () != 1626) 94 | throw std::runtime_error("Wrong word list length for " + language_name); 95 | for (it = word_list.begin(), ii = 0; it != word_list.end(); it++, ii++) 96 | { 97 | word_map[*it] = ii; 98 | if ((*it).size() < unique_prefix_length) 99 | { 100 | if (flags & ALLOW_SHORT_WORDS) 101 | { 102 | //MWARNING(language_name << " word '" << *it << "' is shorter than its prefix length, " << unique_prefix_length); 103 | } 104 | else 105 | throw std::runtime_error("Too short word in " + language_name + " word list: " + *it); 106 | } 107 | std::string trimmed; 108 | if (it->length() > unique_prefix_length) 109 | { 110 | trimmed = utf8prefix(*it, unique_prefix_length); 111 | } 112 | else 113 | { 114 | trimmed = *it; 115 | } 116 | if (trimmed_word_map.find(trimmed) != trimmed_word_map.end()) 117 | { 118 | if (flags & ALLOW_DUPLICATE_PREFIXES) 119 | { 120 | //MWARNING("Duplicate prefix in " << language_name << " word list: " << trimmed); 121 | } 122 | else 123 | throw std::runtime_error("Duplicate prefix in " + language_name + " word list: " + trimmed); 124 | } 125 | trimmed_word_map[trimmed] = ii; 126 | } 127 | } 128 | public: 129 | Base(const char *language_name, const std::vector &words, uint32_t prefix_length): 130 | word_list(words), 131 | unique_prefix_length(prefix_length), 132 | language_name(language_name) 133 | { 134 | } 135 | virtual ~Base() 136 | { 137 | } 138 | /*! 139 | * \brief Returns a pointer to the word list. 140 | * \return A pointer to the word list. 141 | */ 142 | const std::vector& get_word_list() const 143 | { 144 | return word_list; 145 | } 146 | /*! 147 | * \brief Returns a pointer to the word map. 148 | * \return A pointer to the word map. 149 | */ 150 | const std::unordered_map& get_word_map() const 151 | { 152 | return word_map; 153 | } 154 | /*! 155 | * \brief Returns a pointer to the trimmed word map. 156 | * \return A pointer to the trimmed word map. 157 | */ 158 | const std::unordered_map& get_trimmed_word_map() const 159 | { 160 | return trimmed_word_map; 161 | } 162 | /*! 163 | * \brief Returns the name of the language. 164 | * \return Name of the language. 165 | */ 166 | const std::string &get_language_name() const 167 | { 168 | return language_name; 169 | } 170 | /*! 171 | * \brief Returns the number of unique starting characters to be used for matching. 172 | * \return Number of unique starting characters. 173 | */ 174 | uint32_t get_unique_prefix_length() const 175 | { 176 | return unique_prefix_length; 177 | } 178 | }; 179 | } 180 | 181 | #endif 182 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/mnemonics/singleton.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2014-2018, The Monero Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | /*! 30 | * \file singleton.h 31 | * 32 | * \brief A singleton helper class based on template. 33 | */ 34 | 35 | /*! 36 | * \namespace Language 37 | * \brief Mnemonic language related namespace. 38 | */ 39 | namespace Language 40 | { 41 | /*! 42 | * \class Singleton 43 | * 44 | * \brief Single helper class. 45 | * 46 | * Do Language::Singleton::instance() to create a singleton instance 47 | * of `YourClass`. 48 | */ 49 | template 50 | class Singleton 51 | { 52 | Singleton() {} 53 | Singleton(Singleton &s) {} 54 | Singleton& operator=(const Singleton&) {} 55 | public: 56 | static T* instance() 57 | { 58 | static T* obj = new T; 59 | return obj; 60 | } 61 | }; 62 | } 63 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/bugged-zawy-difficulty-algorithm.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/bugged-zawy-difficulty-algorithm.json", 3 | "description": "Add Zawy difficulty algorithm option in multiply (https://github.com/monero-project/research-lab/issues/3)", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "bugged-zawy-difficulty-algorithm.json", 7 | "multiply.json", 8 | "multiply/zawy-difficulty-algorithm.json", 9 | "get-blockchain-settings.json" 10 | ], 11 | "files": [ 12 | { 13 | "path": "/src/Daemon/Daemon.cpp", 14 | "changes": [ 15 | { 16 | "action": "add_below", 17 | "marker": "const command_line::arg_descriptor< std::vector > arg_CHECKPOINT", 18 | "parameters": { 19 | "text": [ 20 | " const command_line::arg_descriptor arg_BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX = {\"BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX\", \"uint32_t\", 0};" 21 | ] 22 | } 23 | }, 24 | { 25 | "action": "add_below", 26 | "marker": "command_line::add_arg(desc_cmd_sett, arg_CHECKPOINT);", 27 | "parameters": { 28 | "text": [ 29 | " command_line::add_arg(desc_cmd_sett, arg_BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX);" 30 | ] 31 | } 32 | }, 33 | { 34 | "action": "add_above", 35 | "marker": "currencyBuilder.testnet(testnet_mode);", 36 | "parameters": { 37 | "text": [ 38 | " currencyBuilder.buggedZawyDifficultyBlockIndex(command_line::get_arg(vm, arg_BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX));" 39 | ] 40 | } 41 | } 42 | ] 43 | }, 44 | { 45 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 46 | "changes": [ 47 | { 48 | "action": "add_below", 49 | "marker": "uint64_t MONEY_SUPPLY;", 50 | "parameters": { 51 | "text": [ 52 | " uint32_t BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX;" 53 | ] 54 | } 55 | } 56 | ] 57 | }, 58 | { 59 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 60 | "changes": [ 61 | { 62 | "action": "add_below", 63 | "marker": "MONEY_SUPPLY=CryptoNote::parameters::MONEY_SUPPLY;", 64 | "parameters": { 65 | "text": [ 66 | " BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX=CryptoNote::parameters::BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX;" 67 | ] 68 | } 69 | }, 70 | { 71 | "action": "add_below", 72 | "marker": "(\"MONEY_SUPPLY\", po::value()->default_value(CryptoNote::parameters::MONEY_SUPPLY), \"uint64_t\")", 73 | "parameters": { 74 | "text": [ 75 | " (\"BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX\", po::value()->default_value(0), \"uint32_t\")" 76 | ] 77 | } 78 | }, 79 | { 80 | "action": "add_above", 81 | "marker": "if (options.count(\"EMISSION_SPEED_FACTOR\")) {", 82 | "parameters": { 83 | "text": [ 84 | " if (options.count(\"BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX\")) {", 85 | " BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX = options[\"BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX\"].as();", 86 | " }" 87 | ] 88 | } 89 | } 90 | ] 91 | }, 92 | { 93 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 94 | "changes": [ 95 | { 96 | "action": "add_below", 97 | "marker": "currencyBuilder.moneySupply(config.coinBaseConfig.MONEY_SUPPLY);", 98 | "parameters": { 99 | "text": [ 100 | " currencyBuilder.buggedZawyDifficultyBlockIndex(config.coinBaseConfig.BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX);" 101 | ] 102 | } 103 | } 104 | ] 105 | }, 106 | 107 | { 108 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 109 | "description": "Changes for get-blockchain-settings.json", 110 | "changes": [ 111 | { 112 | "action": "add_above", 113 | "marker": "std::string BYTECOIN_NETWORK;", 114 | "parameters": { 115 | "text": [ 116 | " uint32_t BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX;" 117 | ] 118 | } 119 | }, 120 | { 121 | "action": "add_above", 122 | "marker": "KV_MEMBER(BYTECOIN_NETWORK)", 123 | "parameters": { 124 | "text": [ 125 | " KV_MEMBER(BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX)" 126 | ] 127 | } 128 | } 129 | ] 130 | }, 131 | { 132 | "path": "/src/Rpc/RpcServer.cpp", 133 | "description": "Changes for get-blockchain-settings.json", 134 | "changes": [ 135 | { 136 | "action": "add_above", 137 | "marker": "res.core.CRYPTONOTE_NAME = m_core.getCurrency().cryptonoteName();", 138 | "parameters": { 139 | "text": [ 140 | " if (m_core.getCurrency().buggedZawyDifficultyBlockIndex() != 0 ) {", 141 | " res.extensions.push_back(\"bugged-zawy-difficulty-algorithm.json\");", 142 | " }" 143 | ] 144 | } 145 | }, 146 | { 147 | "action": "add_above", 148 | "marker": "res.core.P2P_DEFAULT_PORT = m_p2p.get_this_peer_port();", 149 | "parameters": { 150 | "text": [ 151 | " res.core.BUGGED_ZAWY_DIFFICULTY_BLOCK_INDEX = m_core.getCurrency().buggedZawyDifficultyBlockIndex();" 152 | ] 153 | } 154 | } 155 | ] 156 | } 157 | ] 158 | } 159 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/cryptonight-v7.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/cryptonight-v7.json", 3 | "description": "Add Zawy LWMA difficulty algorithm option in multiply (https://github.com/zawy12/difficulty-algorithms/issues/3)", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "cryptonight-v7.json", 7 | "multiply.json", 8 | "get-blockchain-settings.json" 9 | ], 10 | "files": [ 11 | { 12 | "path": "/src/Daemon/Daemon.cpp", 13 | "changes": [ 14 | { 15 | "action": "add_below", 16 | "marker": "const command_line::arg_descriptor< std::vector > arg_CHECKPOINT", 17 | "parameters": { 18 | "text": [ 19 | " const command_line::arg_descriptor arg_POW_CRYPTONIGHT_V7_BLOCK_INDEX = {\"POW_CRYPTONIGHT_V7_BLOCK_INDEX\", \"uint32_t\", 0};", 20 | " const command_line::arg_descriptor arg_POW_CRYPTONIGHT_V7_LAST_BLOCK = {\"POW_CRYPTONIGHT_V7_LAST_BLOCK\", \"uint32_t\", 0};" 21 | ] 22 | } 23 | }, 24 | { 25 | "action": "add_below", 26 | "marker": "command_line::add_arg(desc_cmd_sett, arg_CHECKPOINT);", 27 | "parameters": { 28 | "text": [ 29 | " command_line::add_arg(desc_cmd_sett, arg_POW_CRYPTONIGHT_V7_BLOCK_INDEX);", 30 | " command_line::add_arg(desc_cmd_sett, arg_POW_CRYPTONIGHT_V7_LAST_BLOCK);" 31 | ] 32 | } 33 | }, 34 | { 35 | "action": "add_above", 36 | "marker": "currencyBuilder.testnet(testnet_mode);", 37 | "parameters": { 38 | "text": [ 39 | " currencyBuilder.POWCryptoNightV7BlockIndex(command_line::get_arg(vm, arg_POW_CRYPTONIGHT_V7_BLOCK_INDEX));", 40 | " currencyBuilder.POWCryptoNightV7LastBlock(command_line::get_arg(vm, arg_POW_CRYPTONIGHT_V7_LAST_BLOCK));" 41 | ] 42 | } 43 | } 44 | ] 45 | }, 46 | { 47 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 48 | "changes": [ 49 | { 50 | "action": "add_below", 51 | "marker": "uint64_t MONEY_SUPPLY;", 52 | "parameters": { 53 | "text": [ 54 | " uint32_t POW_CRYPTONIGHT_V7_BLOCK_INDEX;", 55 | " uint32_t POW_CRYPTONIGHT_V7_LAST_BLOCK;" 56 | ] 57 | } 58 | } 59 | ] 60 | }, 61 | { 62 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 63 | "changes": [ 64 | { 65 | "action": "add_below", 66 | "marker": "MONEY_SUPPLY=CryptoNote::parameters::MONEY_SUPPLY;", 67 | "parameters": { 68 | "text": [ 69 | " POW_CRYPTONIGHT_V7_BLOCK_INDEX=CryptoNote::parameters::POW_CRYPTONIGHT_V7_BLOCK_INDEX;", 70 | " POW_CRYPTONIGHT_V7_LAST_BLOCK=CryptoNote::parameters::POW_CRYPTONIGHT_V7_LAST_BLOCK;" 71 | ] 72 | } 73 | }, 74 | { 75 | "action": "add_below", 76 | "marker": "(\"MONEY_SUPPLY\", po::value()->default_value(CryptoNote::parameters::MONEY_SUPPLY), \"uint64_t\")", 77 | "parameters": { 78 | "text": [ 79 | " (\"POW_CRYPTONIGHT_V7_BLOCK_INDEX\", po::value()->default_value(0), \"(uint32_t) Hardfork height to CryptoNightV7. \")", 80 | " (\"POW_CRYPTONIGHT_V7_LAST_BLOCK\", po::value()->default_value(0), \"(uint32_t) End height of CryptoNightV7\")" 81 | ] 82 | } 83 | }, 84 | { 85 | "action": "add_above", 86 | "marker": "if (options.count(\"EMISSION_SPEED_FACTOR\")) {", 87 | "parameters": { 88 | "text": [ 89 | " if (options.count(\"POW_CRYPTONIGHT_V7_BLOCK_INDEX\")) {", 90 | " POW_CRYPTONIGHT_V7_BLOCK_INDEX = options[\"POW_CRYPTONIGHT_V7_BLOCK_INDEX\"].as();", 91 | " }", 92 | " if (options.count(\"POW_CRYPTONIGHT_V7_LAST_BLOCK\")) {", 93 | " POW_CRYPTONIGHT_V7_LAST_BLOCK = options[\"POW_CRYPTONIGHT_V7_LAST_BLOCK\"].as();", 94 | " }" 95 | ] 96 | } 97 | } 98 | ] 99 | }, 100 | { 101 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 102 | "changes": [ 103 | { 104 | "action": "add_below", 105 | "marker": "currencyBuilder.moneySupply(config.coinBaseConfig.MONEY_SUPPLY);", 106 | "parameters": { 107 | "text": [ 108 | " currencyBuilder.POWCryptoNightV7BlockIndex(config.coinBaseConfig.POW_CRYPTONIGHT_V7_BLOCK_INDEX);", 109 | " currencyBuilder.POWCryptoNightV7LastBlock(config.coinBaseConfig.POW_CRYPTONIGHT_V7_LAST_BLOCK);" 110 | ] 111 | } 112 | } 113 | ] 114 | }, 115 | 116 | { 117 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 118 | "description": "Changes for get-blockchain-settings.json", 119 | "changes": [ 120 | { 121 | "action": "add_above", 122 | "marker": "std::string BYTECOIN_NETWORK;", 123 | "parameters": { 124 | "text": [ 125 | " uint32_t POW_CRYPTONIGHT_V7_BLOCK_INDEX;", 126 | " uint32_t POW_CRYPTONIGHT_V7_LAST_BLOCK;" 127 | ] 128 | } 129 | }, 130 | { 131 | "action": "add_above", 132 | "marker": "KV_MEMBER(BYTECOIN_NETWORK)", 133 | "parameters": { 134 | "text": [ 135 | " KV_MEMBER(POW_CRYPTONIGHT_V7_BLOCK_INDEX)", 136 | " KV_MEMBER(POW_CRYPTONIGHT_V7_LAST_BLOCK)" 137 | ] 138 | } 139 | } 140 | ] 141 | }, 142 | { 143 | "path": "/src/Rpc/RpcServer.cpp", 144 | "description": "Changes for get-blockchain-settings.json", 145 | "changes": [ 146 | { 147 | "action": "add_above", 148 | "marker": "res.core.CRYPTONOTE_NAME = m_core.getCurrency().cryptonoteName();", 149 | "parameters": { 150 | "text": [ 151 | " if (m_core.getCurrency().POWCryptoNightV7BlockIndex() != 0 ) {", 152 | " res.extensions.push_back(\"cryptonight-v7.json\");", 153 | " }" 154 | ] 155 | } 156 | }, 157 | { 158 | "action": "add_above", 159 | "marker": "res.core.P2P_DEFAULT_PORT = m_p2p.get_this_peer_port();", 160 | "parameters": { 161 | "text": [ 162 | " res.core.POW_CRYPTONIGHT_V7_BLOCK_INDEX = m_core.getCurrency().POWCryptoNightV7BlockIndex();", 163 | " res.core.POW_CRYPTONIGHT_V7_LAST_BLOCK = m_core.getCurrency().POWCryptoNightV7LastBlock();" 164 | ] 165 | } 166 | } 167 | ] 168 | } 169 | ] 170 | } 171 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/cryptonote-coin-clones-support.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/cryptonote-coin-clones-support.json", 3 | "description": "Add the ability to premine in multiply", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "cryptonote-coin-clones-support.json", 7 | "multiply.json", 8 | "get-blockchain-settings.json" 9 | ], 10 | "files": [ 11 | { 12 | "path": "/src/Daemon/Daemon.cpp", 13 | "changes": [ 14 | { 15 | "action": "add_below", 16 | "marker": "const command_line::arg_descriptor< std::vector > arg_CHECKPOINT", 17 | "parameters": { 18 | "text": [ 19 | " const command_line::arg_descriptor arg_CRYPTONOTE_COIN_VERSION = {\"CRYPTONOTE_COIN_VERSION\", \"size_t\", 0};" 20 | ] 21 | } 22 | }, 23 | { 24 | "action": "add_below", 25 | "marker": "command_line::add_arg(desc_cmd_sett, arg_CHECKPOINT);", 26 | "parameters": { 27 | "text": [ 28 | " command_line::add_arg(desc_cmd_sett, arg_CRYPTONOTE_COIN_VERSION);" 29 | ] 30 | } 31 | }, 32 | { 33 | "action": "add_above", 34 | "marker": "currencyBuilder.testnet(testnet_mode);", 35 | "parameters": { 36 | "text": [ 37 | " currencyBuilder.cryptonoteCoinVersion(command_line::get_arg(vm, arg_CRYPTONOTE_COIN_VERSION));" 38 | ] 39 | } 40 | } 41 | ] 42 | }, 43 | { 44 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 45 | "changes": [ 46 | { 47 | "action": "add_below", 48 | "marker": "uint64_t MONEY_SUPPLY;", 49 | "parameters": { 50 | "text": [ 51 | " size_t CRYPTONOTE_COIN_VERSION;" 52 | ] 53 | } 54 | } 55 | ] 56 | }, 57 | { 58 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 59 | "changes": [ 60 | { 61 | "action": "add_below", 62 | "marker": "MONEY_SUPPLY=CryptoNote::parameters::MONEY_SUPPLY;", 63 | "parameters": { 64 | "text": [ 65 | " CRYPTONOTE_COIN_VERSION=CryptoNote::parameters::CRYPTONOTE_COIN_VERSION;" 66 | ] 67 | } 68 | }, 69 | { 70 | "action": "add_below", 71 | "marker": "(\"MONEY_SUPPLY\", po::value()->default_value(CryptoNote::parameters::MONEY_SUPPLY), \"uint64_t\")", 72 | "parameters": { 73 | "text": [ 74 | " (\"CRYPTONOTE_COIN_VERSION\", po::value()->default_value(0), \"size_t\")" 75 | ] 76 | } 77 | }, 78 | { 79 | "action": "add_above", 80 | "marker": "if (options.count(\"EMISSION_SPEED_FACTOR\")) {", 81 | "parameters": { 82 | "text": [ 83 | " if (options.count(\"CRYPTONOTE_COIN_VERSION\")) {", 84 | " CRYPTONOTE_COIN_VERSION = options[\"CRYPTONOTE_COIN_VERSION\"].as();", 85 | " }" 86 | ] 87 | } 88 | } 89 | ] 90 | }, 91 | { 92 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 93 | "changes": [ 94 | { 95 | "action": "add_below", 96 | "marker": "currencyBuilder.moneySupply(config.coinBaseConfig.MONEY_SUPPLY);", 97 | "parameters": { 98 | "text": [ 99 | " currencyBuilder.cryptonoteCoinVersion(config.coinBaseConfig.CRYPTONOTE_COIN_VERSION);" 100 | ] 101 | } 102 | } 103 | ] 104 | }, 105 | 106 | { 107 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 108 | "description": "Changes for get-blockchain-settings.json", 109 | "changes": [ 110 | { 111 | "action": "add_above", 112 | "marker": "std::string BYTECOIN_NETWORK;", 113 | "parameters": { 114 | "text": [ 115 | " uint8_t CRYPTONOTE_COIN_VERSION;" 116 | ] 117 | } 118 | }, 119 | { 120 | "action": "add_above", 121 | "marker": "KV_MEMBER(BYTECOIN_NETWORK)", 122 | "parameters": { 123 | "text": [ 124 | " KV_MEMBER(CRYPTONOTE_COIN_VERSION)" 125 | ] 126 | } 127 | } 128 | ] 129 | }, 130 | { 131 | "path": "/src/Rpc/RpcServer.cpp", 132 | "description": "Changes for get-blockchain-settings.json", 133 | "changes": [ 134 | { 135 | "action": "add_above", 136 | "marker": "res.core.CRYPTONOTE_NAME = m_core.getCurrency().cryptonoteName();", 137 | "parameters": { 138 | "text": [ 139 | " if (m_core.getCurrency().cryptonoteCoinVersion() != 0) {", 140 | " res.extensions.push_back(\"cryptonote-coin-clones-support.json\");", 141 | " }" 142 | ] 143 | } 144 | }, 145 | { 146 | "action": "add_above", 147 | "marker": "res.core.P2P_DEFAULT_PORT = m_p2p.get_this_peer_port();", 148 | "parameters": { 149 | "text": [ 150 | " res.core.CRYPTONOTE_COIN_VERSION = m_core.getCurrency().cryptonoteCoinVersion();" 151 | ] 152 | } 153 | } 154 | ] 155 | } 156 | ] 157 | } 158 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/files/CoinBaseConfiguration.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015-2016, The Forknote developers 2 | // 3 | // This file is part of Forknote. 4 | // 5 | // Forknote is free software: you can redistribute it and/or modify 6 | // it under the terms of the GNU Lesser General Public License as published by 7 | // the Free Software Foundation, either version 3 of the License, or 8 | // (at your option) any later version. 9 | // 10 | // Forknote is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU Lesser General Public License for more details. 14 | // 15 | // You should have received a copy of the GNU Lesser General Public License 16 | // along with Forknote. If not, see . 17 | 18 | // Copyright (c) 2016, The Forknote developers 19 | // 20 | // This file is part of Forknote. 21 | // 22 | // Forknote is free software: you can redistribute it and/or modify 23 | // it under the terms of the GNU Lesser General Public License as published by 24 | // the Free Software Foundation, either version 3 of the License, or 25 | // (at your option) any later version. 26 | // 27 | // Forknote is distributed in the hope that it will be useful, 28 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 29 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 30 | // GNU Lesser General Public License for more details. 31 | // 32 | // You should have received a copy of the GNU Lesser General Public License 33 | // along with Forknote. If not, see . 34 | 35 | #pragma once 36 | 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include "CryptoNoteConfig.h" 42 | 43 | namespace PaymentService { 44 | 45 | class CoinBaseConfiguration { 46 | public: 47 | CoinBaseConfiguration(); 48 | 49 | static void initOptions(boost::program_options::options_description& desc); 50 | void init(const boost::program_options::variables_map& options); 51 | 52 | std::string CRYPTONOTE_NAME; 53 | std::string GENESIS_COINBASE_TX_HEX; 54 | uint64_t CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX; 55 | uint64_t MONEY_SUPPLY; 56 | unsigned int EMISSION_SPEED_FACTOR; 57 | size_t CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE; 58 | size_t CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1; 59 | size_t CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V2; 60 | uint64_t CRYPTONOTE_DISPLAY_DECIMAL_POINT; 61 | uint64_t MINIMUM_FEE; 62 | uint64_t DEFAULT_DUST_THRESHOLD; 63 | uint64_t DIFFICULTY_TARGET; 64 | uint32_t CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW; 65 | size_t MAX_BLOCK_SIZE_INITIAL; 66 | uint64_t EXPECTED_NUMBER_OF_BLOCKS_PER_DAY; 67 | uint32_t UPGRADE_HEIGHT_V2; 68 | uint32_t UPGRADE_HEIGHT_V3; 69 | uint32_t KEY_IMAGE_CHECKING_BLOCK_INDEX; 70 | size_t DIFFICULTY_WINDOW; 71 | size_t DIFFICULTY_CUT; 72 | size_t DIFFICULTY_LAG; 73 | uint64_t CRYPTONOTE_BLOCK_FUTURE_TIME_LIMIT; 74 | }; 75 | 76 | } //namespace PaymentService 77 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/files/README.md: -------------------------------------------------------------------------------- 1 | ### About 2 | Forknote is innovative way to create Cryptonote (https://cryptonote.org) based cryptotokens. It gives the users the ability to create cryptotokens just by creating a simple configuration file. 3 | 4 | ### Dependencies 5 | * GCC 4.7.3 or later (http://gcc.gnu.org/) 6 | * CMake 2.8.6 or later (http://www.cmake.org/) 7 | * Boost 1.55 or later (http://www.boost.org/) 8 | * MSVC 2013 (Windows only) 9 | 10 | Step by step Windows instructions: 11 | https://github.com/forknote/cryptonote-generator/blob/master/docs/windows-requirements-install.md 12 | 13 | Ubuntu (tested on Ubuntu 14.04) / Mac dependencies install script: 14 | https://github.com/forknote/cryptonote-generator/blob/master/configure.sh 15 | 16 | 17 | ### Usage 18 | 1. Download or compile the binaries 19 | 2. Create configuration file. The easiest way is to use the form on http://forknote.net 20 | 3. Start the daemon: 21 | ``` 22 | ./forknoted --config-file PATH_TO_YOUR_CONFIG 23 | ``` 24 | 25 | ### Configuration parameters 26 | Use http://forknote.net to create configuration files. 27 | 28 | All fields supported: 29 | ``` 30 | GENESIS_COINBASE_TX_HEX= // REQUIRED. Use " ./forknoted --config-file PATH_TO_CONFIG --print-genesis-tx " to generate 31 | CRYPTONOTE_NAME=my_coin 32 | p2p-bind-port=33669 33 | rpc-bind-port=33670 34 | seed-node=127.0.0.1:33669 // format: IP:PORT 35 | seed-node=127.0.0.2:33669 36 | UPGRADE_HEIGHT_V2=1 // REQUIRED. Use 1 for new cryptotokens 37 | UPGRADE_HEIGHT_V3=2 // REQUIRED. Use 2 for new cryptotokens 38 | MONEY_SUPPLY=18446744073709551615 39 | EMISSION_SPEED_FACTOR=18 40 | GENESIS_BLOCK_REWARD=0 // premined coins. Default: 0 41 | DIFFICULTY_TARGET=120 42 | CRYPTONOTE_DISPLAY_DECIMAL_POINT=12 43 | DEFAULT_DUST_THRESHOLD=1000000 44 | MINIMUM_FEE=1000000 45 | CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW=10 46 | CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE=20000 47 | CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX=120 48 | BYTECOIN_NETWORK=b2889400-e6f5-b62d-8d37-8fa91779dc7e 49 | P2P_STAT_TRUSTED_PUB_KEY=4d26c4df7f4ca7037950ad026f9ab36dd05d881952662992f2e4dcfcafbe57eb 50 | CHECKPOINT=10000:70d2531151529ac00bf875281e15f51324934bc85e5733dcd92e1ccb1a665ff8 // format: HEIGHT:BLOCK_ID 51 | CHECKPOINT=20000:80d2dd05d8819526629235722e15f5f9ab36dd05d881952662992f2e4dcfcafb 52 | 53 | // simplewallet parameters 54 | wallet-rpc-bind-ip=127.0.0.1 // instead rpc-bind-ip 55 | wallet-rpc-bind-port=33671 // instead rpc-bind-port 56 | SYNC_FROM_ZERO=1 // to sync the wallet from block 0. Used for premine coins or brain wallets 57 | ``` 58 | 59 | --- 60 | This code is generated by Cryptonote generator - https://github.com/forknote/cryptonote-generator 61 | Seed source - https://github.com/amjuarez/bytecoin -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/kill-height.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/kill-height.json", 3 | "description": "Add the ability to kill blockchain at 'block' in multiply", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "kill-height.json", 7 | "multiply.json", 8 | "get-blockchain-settings.json" 9 | ], 10 | "files": [ 11 | { 12 | "path": "/src/Daemon/Daemon.cpp", 13 | "changes": [ 14 | { 15 | "action": "add_below", 16 | "marker": "const command_line::arg_descriptor< std::vector > arg_CHECKPOINT", 17 | "parameters": { 18 | "text": [ 19 | " const command_line::arg_descriptor arg_KILL_HEIGHT = {\"KILL_HEIGHT\", \"uint32_t\", 0};" 20 | ] 21 | } 22 | }, 23 | { 24 | "action": "add_below", 25 | "marker": "command_line::add_arg(desc_cmd_sett, arg_CHECKPOINT);", 26 | "parameters": { 27 | "text": [ 28 | " command_line::add_arg(desc_cmd_sett, arg_KILL_HEIGHT);" 29 | ] 30 | } 31 | }, 32 | { 33 | "action": "add_above", 34 | "marker": "currencyBuilder.testnet(testnet_mode);", 35 | "parameters": { 36 | "text": [ 37 | " currencyBuilder.killHeight(command_line::get_arg(vm, arg_KILL_HEIGHT));" 38 | ] 39 | } 40 | } 41 | ] 42 | }, 43 | { 44 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 45 | "changes": [ 46 | { 47 | "action": "add_below", 48 | "marker": "uint64_t MONEY_SUPPLY;", 49 | "parameters": { 50 | "text": [ 51 | " uint32_t KILL_HEIGHT;" 52 | ] 53 | } 54 | } 55 | ] 56 | }, 57 | { 58 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 59 | "changes": [ 60 | { 61 | "action": "add_below", 62 | "marker": "MONEY_SUPPLY=CryptoNote::parameters::MONEY_SUPPLY;", 63 | "parameters": { 64 | "text": [ 65 | " KILL_HEIGHT=CryptoNote::parameters::KILL_HEIGHT;" 66 | ] 67 | } 68 | }, 69 | { 70 | "action": "add_below", 71 | "marker": "(\"MONEY_SUPPLY\", po::value()->default_value(CryptoNote::parameters::MONEY_SUPPLY), \"uint64_t\")", 72 | "parameters": { 73 | "text": [ 74 | " (\"KILL_HEIGHT\", po::value()->default_value(0), \"uint32_t\")" 75 | ] 76 | } 77 | }, 78 | { 79 | "action": "add_above", 80 | "marker": "if (options.count(\"EMISSION_SPEED_FACTOR\")) {", 81 | "parameters": { 82 | "text": [ 83 | " if (options.count(\"KILL_HEIGHT\")) {", 84 | " KILL_HEIGHT = options[\"KILL_HEIGHT\"].as();", 85 | " }" 86 | ] 87 | } 88 | } 89 | ] 90 | }, 91 | { 92 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 93 | "changes": [ 94 | { 95 | "action": "add_below", 96 | "marker": "currencyBuilder.moneySupply(config.coinBaseConfig.MONEY_SUPPLY);", 97 | "parameters": { 98 | "text": [ 99 | " currencyBuilder.killHeight(config.coinBaseConfig.KILL_HEIGHT);" 100 | ] 101 | } 102 | } 103 | ] 104 | }, 105 | 106 | { 107 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 108 | "description": "Changes for get-blockchain-settings.json", 109 | "changes": [ 110 | { 111 | "action": "add_above", 112 | "marker": "std::string BYTECOIN_NETWORK;", 113 | "parameters": { 114 | "text": [ 115 | " uint32_t KILL_HEIGHT;" 116 | ] 117 | } 118 | }, 119 | { 120 | "action": "add_above", 121 | "marker": "KV_MEMBER(BYTECOIN_NETWORK)", 122 | "parameters": { 123 | "text": [ 124 | " KV_MEMBER(KILL_HEIGHT)" 125 | ] 126 | } 127 | } 128 | ] 129 | }, 130 | { 131 | "path": "/src/Rpc/RpcServer.cpp", 132 | "description": "Changes for get-blockchain-settings.json", 133 | "changes": [ 134 | { 135 | "action": "add_above", 136 | "marker": "res.core.CRYPTONOTE_NAME = m_core.getCurrency().cryptonoteName();", 137 | "parameters": { 138 | "text": [ 139 | " if (m_core.getCurrency().killHeight() != 0) {", 140 | " res.extensions.push_back(\"kill-height.json\");", 141 | " }" 142 | ] 143 | } 144 | }, 145 | { 146 | "action": "add_above", 147 | "marker": "res.core.P2P_DEFAULT_PORT = m_p2p.get_this_peer_port();", 148 | "parameters": { 149 | "text": [ 150 | " res.core.KILL_HEIGHT = m_core.getCurrency().killHeight();" 151 | ] 152 | } 153 | } 154 | ] 155 | } 156 | ] 157 | } 158 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/mandatory-transaction-in-block.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/mandatory-transaction-in-block.json", 3 | "description": "Adds --mandatory-transaction option to forknoted and simplewallet", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "mandatory-transaction-in-block.json", 7 | "multiply.json", 8 | "get-blockchain-settings.json" 9 | ], 10 | "files": [ 11 | { 12 | "path": "/src/Daemon/Daemon.cpp", 13 | "changes": [ 14 | { 15 | "action": "add_below", 16 | "marker": "const command_line::arg_descriptor< std::vector > arg_CHECKPOINT", 17 | "parameters": { 18 | "text": [ 19 | " const command_line::arg_descriptor arg_MANDATORY_TRANSACTION = {\"MANDATORY_TRANSACTION\", \"uint32_t\", CryptoNote::parameters::MANDATORY_TRANSACTION};" 20 | ] 21 | } 22 | }, 23 | { 24 | "action": "add_below", 25 | "marker": "command_line::add_arg(desc_cmd_sett, arg_CHECKPOINT);", 26 | "parameters": { 27 | "text": [ 28 | " command_line::add_arg(desc_cmd_sett, arg_MANDATORY_TRANSACTION);" 29 | ] 30 | } 31 | }, 32 | { 33 | "action": "add_above", 34 | "marker": "currencyBuilder.genesisCoinbaseTxHex(command_line::get_arg(vm, arg_GENESIS_COINBASE_TX_HEX));", 35 | "parameters": { 36 | "text": [ 37 | " currencyBuilder.mandatoryTransaction(command_line::get_arg(vm, arg_MANDATORY_TRANSACTION));" 38 | ] 39 | } 40 | } 41 | ] 42 | }, 43 | { 44 | "path": "/src/SimpleWallet/SimpleWallet.h", 45 | "changes": [ 46 | { 47 | "action": "add_below", 48 | "marker": "uint16_t m_daemon_port;", 49 | "parameters": { 50 | "text": [ 51 | "uint32_t m_mandatoryTransaction;" 52 | ] 53 | } 54 | } 55 | ] 56 | }, 57 | { 58 | "path": "/src/SimpleWallet/SimpleWallet.cpp", 59 | "changes": [ 60 | { 61 | "action": "add_above", 62 | "marker": "arg_testnet = { \"testnet\"", 63 | "parameters": { 64 | "text": [ 65 | " const command_line::arg_descriptor arg_MANDATORY_TRANSACTION = {\"MANDATORY_TRANSACTION\", \"Max transaction limit size\", false}; " 66 | ] 67 | } 68 | }, 69 | { 70 | "action": "add_below", 71 | "marker": "Tools::wallet_rpc_server::init_options(desc_params);", 72 | "parameters": { 73 | "text": [ 74 | " command_line::add_arg(desc_params, arg_MANDATORY_TRANSACTION);" 75 | ] 76 | } 77 | }, 78 | { 79 | "action": "add_above", 80 | "marker": "currencyBuilder.testnet(command_line::get_arg(vm, arg_testnet));", 81 | "parameters": { 82 | "text": [ 83 | "currencyBuilder.mandatoryTransaction(command_line::get_arg(vm, arg_MANDATORY_TRANSACTION));" 84 | ] 85 | } 86 | } 87 | ] 88 | }, 89 | { 90 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 91 | "changes": [ 92 | { 93 | "action": "add_below", 94 | "marker": "uint64_t MONEY_SUPPLY;", 95 | "parameters": { 96 | "text": [ 97 | " uint32_t MANDATORY_TRANSACTION;" 98 | ] 99 | } 100 | } 101 | ] 102 | }, 103 | { 104 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 105 | "changes": [ 106 | { 107 | "action": "add_below", 108 | "marker": "MONEY_SUPPLY=CryptoNote::parameters::MONEY_SUPPLY;", 109 | "parameters": { 110 | "text": [ 111 | " MANDATORY_TRANSACTION=CryptoNote::parameters::MANDATORY_TRANSACTION;" 112 | ] 113 | } 114 | }, 115 | { 116 | "action": "add_below", 117 | "marker": "(\"MONEY_SUPPLY\", po::value()->default_value(CryptoNote::parameters::MONEY_SUPPLY), \"uint64_t\")", 118 | "parameters": { 119 | "text": [ 120 | " (\"MANDATORY_TRANSACTION\", po::value()->default_value(0), \"uint32_t\")" 121 | ] 122 | } 123 | }, 124 | { 125 | "action": "add_above", 126 | "marker": "if (options.count(\"EMISSION_SPEED_FACTOR\")) {", 127 | "parameters": { 128 | "text": [ 129 | " if (options.count(\"MANDATORY_TRANSACTION\")) {", 130 | " MANDATORY_TRANSACTION = options[\"MANDATORY_TRANSACTION\"].as();", 131 | " }" 132 | ] 133 | } 134 | } 135 | ] 136 | }, 137 | { 138 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 139 | "changes": [ 140 | { 141 | "action": "add_below", 142 | "marker": "currencyBuilder.moneySupply(config.coinBaseConfig.MONEY_SUPPLY);", 143 | "parameters": { 144 | "text": [ 145 | " currencyBuilder.mandatoryTransaction(config.coinBaseConfig.MANDATORY_TRANSACTION);" 146 | ] 147 | } 148 | } 149 | ] 150 | }, 151 | 152 | { 153 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 154 | "description": "Changes for get-blockchain-settings.json", 155 | "changes": [ 156 | { 157 | "action": "add_above", 158 | "marker": "std::string BYTECOIN_NETWORK;", 159 | "parameters": { 160 | "text": [ 161 | " uint32_t MANDATORY_TRANSACTION;" 162 | ] 163 | } 164 | }, 165 | { 166 | "action": "add_above", 167 | "marker": "KV_MEMBER(BYTECOIN_NETWORK)", 168 | "parameters": { 169 | "text": [ 170 | " KV_MEMBER(MANDATORY_TRANSACTION)" 171 | ] 172 | } 173 | } 174 | ] 175 | }, 176 | { 177 | "path": "/src/Rpc/RpcServer.cpp", 178 | "description": "Changes for get-blockchain-settings.json", 179 | "changes": [ 180 | { 181 | "action": "add_above", 182 | "marker": "res.core.CRYPTONOTE_NAME = m_core.getCurrency().cryptonoteName();", 183 | "parameters": { 184 | "text": [ 185 | " if (m_core.getCurrency().mandatoryTransaction() == 1) {", 186 | " res.extensions.push_back(\"mandatory-transaction-in-block.json\");", 187 | " }" 188 | ] 189 | } 190 | }, 191 | { 192 | "action": "add_above", 193 | "marker": "res.core.P2P_DEFAULT_PORT = m_p2p.get_this_peer_port();", 194 | "parameters": { 195 | "text": [ 196 | " res.core.MANDATORY_TRANSACTION = m_core.getCurrency().mandatoryTransaction();" 197 | ] 198 | } 199 | } 200 | ] 201 | } 202 | ] 203 | } -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/max-transaction-size-limit.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/max-transaction-size-limit.json", 3 | "description": "Adds --max-transaction-size option to simplewallet and walletd + precompiled", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "max-transaction-size-limit.json", 7 | "multiply.json" 8 | ], 9 | "files": [ 10 | { 11 | "path": "/src/SimpleWallet/SimpleWallet.h", 12 | "changes": [ 13 | { 14 | "action": "add_below", 15 | "marker": "uint16_t m_daemon_port;", 16 | "parameters": { 17 | "text": [ 18 | "uint64_t m_maxTransactionSizeLimit;" 19 | ] 20 | } 21 | } 22 | ] 23 | }, 24 | { 25 | "path": "/src/SimpleWallet/SimpleWallet.cpp", 26 | "changes": [ 27 | { 28 | "action": "add_above", 29 | "marker": "arg_testnet = { \"testnet\"", 30 | "parameters": { 31 | "text": [ 32 | " const command_line::arg_descriptor arg_MAX_TRANSACTION_SIZE_LIMIT = {\"MAX_TRANSACTION_SIZE_LIMIT\", \"Max transaction limit size\", 0}; " 33 | ] 34 | } 35 | }, 36 | { 37 | "action": "add_below", 38 | "marker": "Tools::wallet_rpc_server::init_options(desc_params);", 39 | "parameters": { 40 | "text": [ 41 | " command_line::add_arg(desc_params, arg_MAX_TRANSACTION_SIZE_LIMIT);" 42 | ] 43 | } 44 | }, 45 | { 46 | "action": "add_above", 47 | "marker": "currencyBuilder.testnet(command_line::get_arg(vm, arg_testnet));", 48 | "parameters": { 49 | "text": [ 50 | "if (command_line::get_arg(vm, arg_MAX_TRANSACTION_SIZE_LIMIT) == 0) {", 51 | " uint64_t maxTxSizeLimit = command_line::get_arg(vm, arg_CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE) * 110 / 100 - CryptoNote::parameters::CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;", 52 | " currencyBuilder.maxTransactionSizeLimit(maxTxSizeLimit);", 53 | " currencyBuilder.fusionTxMaxSize(maxTxSizeLimit * 30 / 100);", 54 | "} else {", 55 | " currencyBuilder.maxTransactionSizeLimit(command_line::get_arg(vm, arg_MAX_TRANSACTION_SIZE_LIMIT));", 56 | " currencyBuilder.fusionTxMaxSize(command_line::get_arg(vm, arg_MAX_TRANSACTION_SIZE_LIMIT) * 30 / 100);", 57 | "}" 58 | ] 59 | } 60 | } 61 | ] 62 | }, 63 | { 64 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 65 | "changes": [ 66 | { 67 | "action": "add_above", 68 | "marker": "size_t DIFFICULTY_CUT;", 69 | "parameters": { 70 | "text": [ 71 | "uint64_t MAX_TRANSACTION_SIZE_LIMIT;" 72 | ] 73 | } 74 | } 75 | ] 76 | }, 77 | { 78 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 79 | "changes": [ 80 | { 81 | "action": "add_above", 82 | "marker": "DIFFICULTY_CUT=CryptoNote::parameters::DIFFICULTY_CUT;", 83 | "parameters": { 84 | "text": [ 85 | "MAX_TRANSACTION_SIZE_LIMIT=CryptoNote::parameters::MAX_TRANSACTION_SIZE_LIMIT;" 86 | ] 87 | } 88 | }, 89 | { 90 | "action": "add_above", 91 | "marker": "(\"DIFFICULTY_CUT\", po::value()->default_value(CryptoNote::parameters::DIFFICULTY_CUT), \"size_t\")", 92 | "parameters": { 93 | "text": [ 94 | "(\"MAX_TRANSACTION_SIZE_LIMIT\", po::value()->default_value(0), \"uint64_t\")" 95 | ] 96 | } 97 | }, 98 | { 99 | "action": "add_above", 100 | "marker": "if (options.count(\"DIFFICULTY_CUT\")) {", 101 | "parameters": { 102 | "text": [ 103 | " if (options.count(\"MAX_TRANSACTION_SIZE_LIMIT\")) {", 104 | " MAX_TRANSACTION_SIZE_LIMIT = options[\"MAX_TRANSACTION_SIZE_LIMIT\"].as();", 105 | " }" 106 | ] 107 | } 108 | } 109 | ] 110 | }, 111 | { 112 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 113 | "changes": [ 114 | { 115 | "action": "add_above", 116 | "marker": "currencyBuilder.difficultyCut(config.coinBaseConfig.DIFFICULTY_CUT);", 117 | "parameters": { 118 | "text": [ 119 | "if (config.coinBaseConfig.MAX_TRANSACTION_SIZE_LIMIT == 0) {", 120 | " uint64_t maxTxSizeLimit = config.coinBaseConfig.CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE * 110 / 100 - CryptoNote::parameters::CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE;", 121 | " currencyBuilder.maxTransactionSizeLimit(maxTxSizeLimit);", 122 | " currencyBuilder.fusionTxMaxSize(maxTxSizeLimit * 30 / 100);", 123 | "} else {", 124 | " currencyBuilder.maxTransactionSizeLimit(config.coinBaseConfig.MAX_TRANSACTION_SIZE_LIMIT);", 125 | " currencyBuilder.fusionTxMaxSize(config.coinBaseConfig.MAX_TRANSACTION_SIZE_LIMIT * 30 / 100);", 126 | "}" 127 | ] 128 | } 129 | } 130 | ] 131 | } 132 | ] 133 | } 134 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/mixin-start-height.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/mixin-start-height.json", 3 | "description": "Ability to getting output keys for mixin after global index in multiply (MIXIN_START_HEIGHT)", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "mixin-start-height.json", 7 | "multiply.json", 8 | "get-blockchain-settings.json" 9 | ], 10 | "files": [ 11 | { 12 | "path": "/src/Daemon/Daemon.cpp", 13 | "changes": [ 14 | { 15 | "action": "add_below", 16 | "marker": "const command_line::arg_descriptor< std::vector > arg_CHECKPOINT", 17 | "parameters": { 18 | "text": [ 19 | " const command_line::arg_descriptor arg_MIXIN_START_HEIGHT = {\"MIXIN_START_HEIGHT\", \"uint32_t\", 0};" 20 | ] 21 | } 22 | }, 23 | { 24 | "action": "add_below", 25 | "marker": "command_line::add_arg(desc_cmd_sett, arg_CHECKPOINT);", 26 | "parameters": { 27 | "text": [ 28 | " command_line::add_arg(desc_cmd_sett, arg_MIXIN_START_HEIGHT);" 29 | ] 30 | } 31 | }, 32 | { 33 | "action": "add_above", 34 | "marker": "currencyBuilder.testnet(testnet_mode);", 35 | "parameters": { 36 | "text": [ 37 | " currencyBuilder.mixinStartHeight(command_line::get_arg(vm, arg_MIXIN_START_HEIGHT));" 38 | ] 39 | } 40 | } 41 | ] 42 | }, 43 | { 44 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 45 | "changes": [ 46 | { 47 | "action": "add_below", 48 | "marker": "uint64_t MONEY_SUPPLY;", 49 | "parameters": { 50 | "text": [ 51 | " uint32_t MIXIN_START_HEIGHT;" 52 | ] 53 | } 54 | } 55 | ] 56 | }, 57 | { 58 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 59 | "changes": [ 60 | { 61 | "action": "add_below", 62 | "marker": "MONEY_SUPPLY=CryptoNote::parameters::MONEY_SUPPLY;", 63 | "parameters": { 64 | "text": [ 65 | " MIXIN_START_HEIGHT=CryptoNote::parameters::MIXIN_START_HEIGHT;" 66 | ] 67 | } 68 | }, 69 | { 70 | "action": "add_below", 71 | "marker": "(\"MONEY_SUPPLY\", po::value()->default_value(CryptoNote::parameters::MONEY_SUPPLY), \"uint64_t\")", 72 | "parameters": { 73 | "text": [ 74 | " (\"MIXIN_START_HEIGHT\", po::value()->default_value(0), \"uint32_t\")" 75 | ] 76 | } 77 | }, 78 | { 79 | "action": "add_above", 80 | "marker": "if (options.count(\"EMISSION_SPEED_FACTOR\")) {", 81 | "parameters": { 82 | "text": [ 83 | " if (options.count(\"MIXIN_START_HEIGHT\")) {", 84 | " MIXIN_START_HEIGHT = options[\"MIXIN_START_HEIGHT\"].as();", 85 | " }" 86 | ] 87 | } 88 | } 89 | ] 90 | }, 91 | { 92 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 93 | "changes": [ 94 | { 95 | "action": "add_below", 96 | "marker": "currencyBuilder.moneySupply(config.coinBaseConfig.MONEY_SUPPLY);", 97 | "parameters": { 98 | "text": [ 99 | " currencyBuilder.mixinStartHeight(config.coinBaseConfig.MIXIN_START_HEIGHT);" 100 | ] 101 | } 102 | } 103 | ] 104 | }, 105 | 106 | { 107 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 108 | "description": "Changes for get-blockchain-settings.json", 109 | "changes": [ 110 | { 111 | "action": "add_above", 112 | "marker": "std::string BYTECOIN_NETWORK;", 113 | "parameters": { 114 | "text": [ 115 | " uint32_t MIXIN_START_HEIGHT;" 116 | ] 117 | } 118 | }, 119 | { 120 | "action": "add_above", 121 | "marker": "KV_MEMBER(BYTECOIN_NETWORK)", 122 | "parameters": { 123 | "text": [ 124 | " KV_MEMBER(MIXIN_START_HEIGHT)" 125 | ] 126 | } 127 | } 128 | ] 129 | }, 130 | { 131 | "path": "/src/Rpc/RpcServer.cpp", 132 | "description": "Changes for get-blockchain-settings.json", 133 | "changes": [ 134 | { 135 | "action": "add_above", 136 | "marker": "res.core.CRYPTONOTE_NAME = m_core.getCurrency().cryptonoteName();", 137 | "parameters": { 138 | "text": [ 139 | " if (m_core.getCurrency().mixinStartHeight() != 0) {", 140 | " res.extensions.push_back(\"mixin-start-height.json\");", 141 | " }" 142 | ] 143 | } 144 | }, 145 | { 146 | "action": "add_above", 147 | "marker": "res.core.P2P_DEFAULT_PORT = m_p2p.get_this_peer_port();", 148 | "parameters": { 149 | "text": [ 150 | " if (m_core.getCurrency().mixinStartHeight() != 0) {", 151 | " res.core.MIXIN_START_HEIGHT = m_core.getCurrency().mixinStartHeight();", 152 | " }" 153 | ] 154 | } 155 | } 156 | ] 157 | } 158 | ] 159 | } 160 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/tail-emission-reward.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/tail-emission-reward.json", 3 | "description": "Add tail emission in multiply", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "tail-emission-reward.json", 7 | "multiply.json", 8 | "get-blockchain-settings.json" 9 | ], 10 | "files": [ 11 | { 12 | "path": "/src/Daemon/Daemon.cpp", 13 | "changes": [ 14 | { 15 | "action": "add_below", 16 | "marker": "const command_line::arg_descriptor< std::vector > arg_CHECKPOINT", 17 | "parameters": { 18 | "text": [ 19 | " const command_line::arg_descriptor arg_TAIL_EMISSION_REWARD = {\"TAIL_EMISSION_REWARD\", \"uint64_t\", 0};" 20 | ] 21 | } 22 | }, 23 | { 24 | "action": "add_below", 25 | "marker": "command_line::add_arg(desc_cmd_sett, arg_CHECKPOINT);", 26 | "parameters": { 27 | "text": [ 28 | " command_line::add_arg(desc_cmd_sett, arg_TAIL_EMISSION_REWARD);" 29 | ] 30 | } 31 | }, 32 | { 33 | "action": "add_above", 34 | "marker": "currencyBuilder.testnet(testnet_mode);", 35 | "parameters": { 36 | "text": [ 37 | " currencyBuilder.tailEmissionReward(command_line::get_arg(vm, arg_TAIL_EMISSION_REWARD));" 38 | ] 39 | } 40 | } 41 | ] 42 | }, 43 | { 44 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 45 | "changes": [ 46 | { 47 | "action": "add_below", 48 | "marker": "uint64_t MONEY_SUPPLY;", 49 | "parameters": { 50 | "text": [ 51 | " uint64_t TAIL_EMISSION_REWARD;" 52 | ] 53 | } 54 | } 55 | ] 56 | }, 57 | { 58 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 59 | "changes": [ 60 | { 61 | "action": "add_below", 62 | "marker": "MONEY_SUPPLY=CryptoNote::parameters::MONEY_SUPPLY;", 63 | "parameters": { 64 | "text": [ 65 | " TAIL_EMISSION_REWARD=CryptoNote::parameters::TAIL_EMISSION_REWARD;" 66 | ] 67 | } 68 | }, 69 | { 70 | "action": "add_below", 71 | "marker": "(\"MONEY_SUPPLY\", po::value()->default_value(CryptoNote::parameters::MONEY_SUPPLY), \"uint64_t\")", 72 | "parameters": { 73 | "text": [ 74 | " (\"TAIL_EMISSION_REWARD\", po::value()->default_value(0), \"uint64_t\")" 75 | ] 76 | } 77 | }, 78 | { 79 | "action": "add_above", 80 | "marker": "if (options.count(\"EMISSION_SPEED_FACTOR\")) {", 81 | "parameters": { 82 | "text": [ 83 | " if (options.count(\"TAIL_EMISSION_REWARD\")) {", 84 | " TAIL_EMISSION_REWARD = options[\"TAIL_EMISSION_REWARD\"].as();", 85 | " }" 86 | ] 87 | } 88 | } 89 | ] 90 | }, 91 | { 92 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 93 | "changes": [ 94 | { 95 | "action": "add_below", 96 | "marker": "currencyBuilder.moneySupply(config.coinBaseConfig.MONEY_SUPPLY);", 97 | "parameters": { 98 | "text": [ 99 | " currencyBuilder.tailEmissionReward(config.coinBaseConfig.TAIL_EMISSION_REWARD);" 100 | ] 101 | } 102 | } 103 | ] 104 | }, 105 | 106 | { 107 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 108 | "description": "Changes for get-blockchain-settings.json", 109 | "changes": [ 110 | { 111 | "action": "add_above", 112 | "marker": "std::string BYTECOIN_NETWORK;", 113 | "parameters": { 114 | "text": [ 115 | " uint64_t TAIL_EMISSION_REWARD;" 116 | ] 117 | } 118 | }, 119 | { 120 | "action": "add_above", 121 | "marker": "KV_MEMBER(BYTECOIN_NETWORK)", 122 | "parameters": { 123 | "text": [ 124 | " KV_MEMBER(TAIL_EMISSION_REWARD)" 125 | ] 126 | } 127 | } 128 | ] 129 | }, 130 | { 131 | "path": "/src/Rpc/RpcServer.cpp", 132 | "description": "Changes for get-blockchain-settings.json", 133 | "changes": [ 134 | { 135 | "action": "add_above", 136 | "marker": "res.core.CRYPTONOTE_NAME = m_core.getCurrency().cryptonoteName();", 137 | "parameters": { 138 | "text": [ 139 | " if (m_core.getCurrency().tailEmissionReward() != 0) {", 140 | " res.extensions.push_back(\"tail-emission-reward.json\");", 141 | " }" 142 | ] 143 | } 144 | }, 145 | { 146 | "action": "add_above", 147 | "marker": "res.core.P2P_DEFAULT_PORT = m_p2p.get_this_peer_port();", 148 | "parameters": { 149 | "text": [ 150 | " res.core.TAIL_EMISSION_REWARD = m_core.getCurrency().tailEmissionReward();" 151 | ] 152 | } 153 | } 154 | ] 155 | } 156 | ] 157 | } 158 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/zawy-difficulty-algorithm.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/zawy-difficulty-algorithm.json", 3 | "description": "Add Zawy difficulty algorithm option in multiply (https://github.com/monero-project/research-lab/issues/3)", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "zawy-difficulty-algorithm.json", 7 | "multiply.json", 8 | "get-blockchain-settings.json" 9 | ], 10 | "files": [ 11 | { 12 | "path": "/src/Daemon/Daemon.cpp", 13 | "changes": [ 14 | { 15 | "action": "add_below", 16 | "marker": "const command_line::arg_descriptor< std::vector > arg_CHECKPOINT", 17 | "parameters": { 18 | "text": [ 19 | " const command_line::arg_descriptor arg_ZAWY_DIFFICULTY_BLOCK_INDEX = {\"ZAWY_DIFFICULTY_BLOCK_INDEX\", \"uint32_t\", 0};", 20 | " const command_line::arg_descriptor arg_ZAWY_DIFFICULTY_LAST_BLOCK = {\"ZAWY_DIFFICULTY_LAST_BLOCK\", \"uint32_t\", 0};", 21 | " const command_line::arg_descriptor arg_ZAWY_DIFFICULTY_MIN = {\"ZAWY_DIFFICULTY_MIN\", \"uint64_t\", 1};" 22 | ] 23 | } 24 | }, 25 | { 26 | "action": "add_below", 27 | "marker": "command_line::add_arg(desc_cmd_sett, arg_CHECKPOINT);", 28 | "parameters": { 29 | "text": [ 30 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_DIFFICULTY_BLOCK_INDEX);", 31 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_DIFFICULTY_LAST_BLOCK);", 32 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_DIFFICULTY_MIN);" 33 | ] 34 | } 35 | }, 36 | { 37 | "action": "add_above", 38 | "marker": "currencyBuilder.testnet(testnet_mode);", 39 | "parameters": { 40 | "text": [ 41 | " currencyBuilder.zawyDifficultyBlockIndex(command_line::get_arg(vm, arg_ZAWY_DIFFICULTY_BLOCK_INDEX));", 42 | " currencyBuilder.zawyDifficultyLastBlock(command_line::get_arg(vm, arg_ZAWY_DIFFICULTY_LAST_BLOCK));", 43 | " currencyBuilder.zawyDifficultyMin(command_line::get_arg(vm, arg_ZAWY_DIFFICULTY_MIN));" 44 | ] 45 | } 46 | } 47 | ] 48 | }, 49 | { 50 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 51 | "changes": [ 52 | { 53 | "action": "add_below", 54 | "marker": "uint64_t MONEY_SUPPLY;", 55 | "parameters": { 56 | "text": [ 57 | " uint32_t ZAWY_DIFFICULTY_BLOCK_INDEX;", 58 | " uint32_t ZAWY_DIFFICULTY_LAST_BLOCK;", 59 | " uint64_t ZAWY_DIFFICULTY_MIN;" 60 | ] 61 | } 62 | } 63 | ] 64 | }, 65 | { 66 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 67 | "changes": [ 68 | { 69 | "action": "add_below", 70 | "marker": "MONEY_SUPPLY=CryptoNote::parameters::MONEY_SUPPLY;", 71 | "parameters": { 72 | "text": [ 73 | " ZAWY_DIFFICULTY_BLOCK_INDEX=CryptoNote::parameters::ZAWY_DIFFICULTY_BLOCK_INDEX;", 74 | " ZAWY_DIFFICULTY_LAST_BLOCK=CryptoNote::parameters::ZAWY_DIFFICULTY_LAST_BLOCK;", 75 | " ZAWY_DIFFICULTY_MIN=CryptoNote::parameters::ZAWY_DIFFICULTY_MIN;" 76 | ] 77 | } 78 | }, 79 | { 80 | "action": "add_below", 81 | "marker": "(\"MONEY_SUPPLY\", po::value()->default_value(CryptoNote::parameters::MONEY_SUPPLY), \"uint64_t\")", 82 | "parameters": { 83 | "text": [ 84 | " (\"ZAWY_DIFFICULTY_BLOCK_INDEX\", po::value()->default_value(0), \"uint32_t\")", 85 | " (\"ZAWY_DIFFICULTY_LAST_BLOCK\", po::value()->default_value(0), \"uint32_t\")", 86 | " (\"ZAWY_DIFFICULTY_MIN\", po::value()->default_value(0), \"uint64_t\")" 87 | ] 88 | } 89 | }, 90 | { 91 | "action": "add_above", 92 | "marker": "if (options.count(\"EMISSION_SPEED_FACTOR\")) {", 93 | "parameters": { 94 | "text": [ 95 | " if (options.count(\"ZAWY_DIFFICULTY_BLOCK_INDEX\")) {", 96 | " ZAWY_DIFFICULTY_BLOCK_INDEX = options[\"ZAWY_DIFFICULTY_BLOCK_INDEX\"].as();", 97 | " }", 98 | " if (options.count(\"ZAWY_DIFFICULTY_LAST_BLOCK\")) {", 99 | " ZAWY_DIFFICULTY_LAST_BLOCK = options[\"ZAWY_DIFFICULTY_LAST_BLOCK\"].as();", 100 | " }", 101 | " if (options.count(\"ZAWY_DIFFICULTY_MIN\")) {", 102 | " ZAWY_DIFFICULTY_MIN = options[\"ZAWY_DIFFICULTY_MIN\"].as();", 103 | " }" 104 | ] 105 | } 106 | } 107 | ] 108 | }, 109 | { 110 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 111 | "changes": [ 112 | { 113 | "action": "add_below", 114 | "marker": "currencyBuilder.moneySupply(config.coinBaseConfig.MONEY_SUPPLY);", 115 | "parameters": { 116 | "text": [ 117 | " currencyBuilder.zawyDifficultyBlockIndex(config.coinBaseConfig.ZAWY_DIFFICULTY_BLOCK_INDEX);", 118 | " currencyBuilder.zawyDifficultyLastBlock(config.coinBaseConfig.ZAWY_DIFFICULTY_LAST_BLOCK);", 119 | " currencyBuilder.zawyDifficultyMin(config.coinBaseConfig.ZAWY_DIFFICULTY_MIN);" 120 | ] 121 | } 122 | } 123 | ] 124 | }, 125 | 126 | { 127 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 128 | "description": "Changes for get-blockchain-settings.json", 129 | "changes": [ 130 | { 131 | "action": "add_above", 132 | "marker": "std::string BYTECOIN_NETWORK;", 133 | "parameters": { 134 | "text": [ 135 | " uint32_t ZAWY_DIFFICULTY_BLOCK_INDEX;", 136 | " uint32_t ZAWY_DIFFICULTY_LAST_BLOCK;", 137 | " uint64_t ZAWY_DIFFICULTY_MIN;" 138 | ] 139 | } 140 | }, 141 | { 142 | "action": "add_above", 143 | "marker": "KV_MEMBER(BYTECOIN_NETWORK)", 144 | "parameters": { 145 | "text": [ 146 | " KV_MEMBER(ZAWY_DIFFICULTY_BLOCK_INDEX)", 147 | " KV_MEMBER(ZAWY_DIFFICULTY_LAST_BLOCK)", 148 | " KV_MEMBER(ZAWY_DIFFICULTY_MIN)" 149 | ] 150 | } 151 | } 152 | ] 153 | }, 154 | { 155 | "path": "/src/Rpc/RpcServer.cpp", 156 | "description": "Changes for get-blockchain-settings.json", 157 | "changes": [ 158 | { 159 | "action": "add_above", 160 | "marker": "res.core.CRYPTONOTE_NAME = m_core.getCurrency().cryptonoteName();", 161 | "parameters": { 162 | "text": [ 163 | " if (m_core.getCurrency().zawyDifficultyBlockIndex() != 0 ) {", 164 | " res.extensions.push_back(\"zawy-difficulty-algorithm.json\");", 165 | " }" 166 | ] 167 | } 168 | }, 169 | { 170 | "action": "add_above", 171 | "marker": "res.core.P2P_DEFAULT_PORT = m_p2p.get_this_peer_port();", 172 | "parameters": { 173 | "text": [ 174 | " res.core.ZAWY_DIFFICULTY_BLOCK_INDEX = m_core.getCurrency().zawyDifficultyBlockIndex();", 175 | " res.core.ZAWY_DIFFICULTY_LAST_BLOCK = m_core.getCurrency().zawyDifficultyLastBlock();", 176 | " res.core.ZAWY_DIFFICULTY_MIN = m_core.getCurrency().zawyDifficultyMin();" 177 | ] 178 | } 179 | } 180 | ] 181 | } 182 | ] 183 | } 184 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/zawy-lwma-difficulty-algorithm.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/zawy-lwma-difficulty-algorithm.json", 3 | "description": "Add Zawy LWMA difficulty algorithm option in multiply (https://github.com/zawy12/difficulty-algorithms/issues/3)", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "zawy-lwma-difficulty-algorithm.json", 7 | "multiply.json", 8 | "get-blockchain-settings.json" 9 | ], 10 | "files": [ 11 | { 12 | "path": "/src/Daemon/Daemon.cpp", 13 | "changes": [ 14 | { 15 | "action": "add_below", 16 | "marker": "const command_line::arg_descriptor< std::vector > arg_CHECKPOINT", 17 | "parameters": { 18 | "text": [ 19 | " const command_line::arg_descriptor arg_ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX = {\"ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX\", \"uint32_t\", 0};", 20 | " const command_line::arg_descriptor arg_ZAWY_LWMA_DIFFICULTY_LAST_BLOCK = {\"ZAWY_LWMA_DIFFICULTY_LAST_BLOCK\", \"uint32_t\", 0};", 21 | " const command_line::arg_descriptor arg_ZAWY_LWMA_DIFFICULTY_MIN = {\"ZAWY_LWMA_DIFFICULTY_MIN\", \"uint64_t\", 1};", 22 | " const command_line::arg_descriptor arg_ZAWY_LWMA_DIFFICULTY_N = {\"ZAWY_LWMA_DIFFICULTY_N\", \"size_t\", 0};" 23 | ] 24 | } 25 | }, 26 | { 27 | "action": "add_below", 28 | "marker": "command_line::add_arg(desc_cmd_sett, arg_CHECKPOINT);", 29 | "parameters": { 30 | "text": [ 31 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX);", 32 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_LWMA_DIFFICULTY_LAST_BLOCK);", 33 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_LWMA_DIFFICULTY_MIN);", 34 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_LWMA_DIFFICULTY_N);" 35 | ] 36 | } 37 | }, 38 | { 39 | "action": "add_above", 40 | "marker": "currencyBuilder.testnet(testnet_mode);", 41 | "parameters": { 42 | "text": [ 43 | " currencyBuilder.zawyLWMADifficultyBlockIndex(command_line::get_arg(vm, arg_ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX));", 44 | " currencyBuilder.zawyLWMADifficultyLastBlock(command_line::get_arg(vm, arg_ZAWY_LWMA_DIFFICULTY_LAST_BLOCK));", 45 | " currencyBuilder.zawyLWMADifficultyMin(command_line::get_arg(vm, arg_ZAWY_LWMA_DIFFICULTY_MIN));", 46 | " currencyBuilder.zawyLWMADifficultyN(command_line::get_arg(vm, arg_ZAWY_LWMA_DIFFICULTY_N));" 47 | ] 48 | } 49 | } 50 | ] 51 | }, 52 | { 53 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 54 | "changes": [ 55 | { 56 | "action": "add_below", 57 | "marker": "uint64_t MONEY_SUPPLY;", 58 | "parameters": { 59 | "text": [ 60 | " uint32_t ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX;", 61 | " uint32_t ZAWY_LWMA_DIFFICULTY_LAST_BLOCK;", 62 | " uint64_t ZAWY_LWMA_DIFFICULTY_MIN;", 63 | " size_t ZAWY_LWMA_DIFFICULTY_N;" 64 | ] 65 | } 66 | } 67 | ] 68 | }, 69 | { 70 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 71 | "changes": [ 72 | { 73 | "action": "add_below", 74 | "marker": "MONEY_SUPPLY=CryptoNote::parameters::MONEY_SUPPLY;", 75 | "parameters": { 76 | "text": [ 77 | " ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX=CryptoNote::parameters::ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX;", 78 | " ZAWY_LWMA_DIFFICULTY_LAST_BLOCK=CryptoNote::parameters::ZAWY_LWMA_DIFFICULTY_LAST_BLOCK;", 79 | " ZAWY_LWMA_DIFFICULTY_MIN=CryptoNote::parameters::ZAWY_LWMA_DIFFICULTY_MIN;", 80 | " ZAWY_LWMA_DIFFICULTY_N=CryptoNote::parameters::ZAWY_LWMA_DIFFICULTY_N;" 81 | ] 82 | } 83 | }, 84 | { 85 | "action": "add_below", 86 | "marker": "(\"MONEY_SUPPLY\", po::value()->default_value(CryptoNote::parameters::MONEY_SUPPLY), \"uint64_t\")", 87 | "parameters": { 88 | "text": [ 89 | " (\"ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX\", po::value()->default_value(0), \"uint32_t\")", 90 | " (\"ZAWY_LWMA_DIFFICULTY_LAST_BLOCK\", po::value()->default_value(0), \"uint32_t\")", 91 | " (\"ZAWY_LWMA_DIFFICULTY_MIN\", po::value()->default_value(1), \"uint64_t\")", 92 | " (\"ZAWY_LWMA_DIFFICULTY_N\", po::value()->default_value(0), \"size_t\")" 93 | ] 94 | } 95 | }, 96 | { 97 | "action": "add_above", 98 | "marker": "if (options.count(\"EMISSION_SPEED_FACTOR\")) {", 99 | "parameters": { 100 | "text": [ 101 | " if (options.count(\"ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX\")) {", 102 | " ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX = options[\"ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX\"].as();", 103 | " }", 104 | " if (options.count(\"ZAWY_LWMA_DIFFICULTY_LAST_BLOCK\")) {", 105 | " ZAWY_LWMA_DIFFICULTY_LAST_BLOCK = options[\"ZAWY_LWMA_DIFFICULTY_LAST_BLOCK\"].as();", 106 | " }", 107 | " if (options.count(\"ZAWY_LWMA_DIFFICULTY_MIN\")) {", 108 | " ZAWY_LWMA_DIFFICULTY_MIN = options[\"ZAWY_LWMA_DIFFICULTY_MIN\"].as();", 109 | " }", 110 | " if (options.count(\"ZAWY_LWMA_DIFFICULTY_N\")) {", 111 | " ZAWY_LWMA_DIFFICULTY_N = options[\"ZAWY_LWMA_DIFFICULTY_N\"].as();", 112 | " }" 113 | ] 114 | } 115 | } 116 | ] 117 | }, 118 | { 119 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 120 | "changes": [ 121 | { 122 | "action": "add_below", 123 | "marker": "currencyBuilder.moneySupply(config.coinBaseConfig.MONEY_SUPPLY);", 124 | "parameters": { 125 | "text": [ 126 | " currencyBuilder.zawyLWMADifficultyBlockIndex(config.coinBaseConfig.ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX);", 127 | " currencyBuilder.zawyLWMADifficultyLastBlock(config.coinBaseConfig.ZAWY_LWMA_DIFFICULTY_LAST_BLOCK);", 128 | " currencyBuilder.zawyLWMADifficultyMin(config.coinBaseConfig.ZAWY_LWMA_DIFFICULTY_MIN);", 129 | " currencyBuilder.zawyLWMADifficultyN(config.coinBaseConfig.ZAWY_LWMA_DIFFICULTY_N);" 130 | ] 131 | } 132 | } 133 | ] 134 | }, 135 | 136 | { 137 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 138 | "description": "Changes for get-blockchain-settings.json", 139 | "changes": [ 140 | { 141 | "action": "add_above", 142 | "marker": "std::string BYTECOIN_NETWORK;", 143 | "parameters": { 144 | "text": [ 145 | " uint32_t ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX;", 146 | " uint32_t ZAWY_LWMA_DIFFICULTY_LAST_BLOCK;", 147 | " uint64_t ZAWY_LWMA_DIFFICULTY_MIN;", 148 | " size_t ZAWY_LWMA_DIFFICULTY_N;" 149 | ] 150 | } 151 | }, 152 | { 153 | "action": "add_above", 154 | "marker": "KV_MEMBER(BYTECOIN_NETWORK)", 155 | "parameters": { 156 | "text": [ 157 | " KV_MEMBER(ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX)", 158 | " KV_MEMBER(ZAWY_LWMA_DIFFICULTY_LAST_BLOCK)", 159 | " KV_MEMBER(ZAWY_LWMA_DIFFICULTY_MIN)", 160 | " KV_MEMBER(ZAWY_LWMA_DIFFICULTY_N)" 161 | ] 162 | } 163 | } 164 | ] 165 | }, 166 | { 167 | "path": "/src/Rpc/RpcServer.cpp", 168 | "description": "Changes for get-blockchain-settings.json", 169 | "changes": [ 170 | { 171 | "action": "add_above", 172 | "marker": "res.core.CRYPTONOTE_NAME = m_core.getCurrency().cryptonoteName();", 173 | "parameters": { 174 | "text": [ 175 | " if (m_core.getCurrency().zawyLWMADifficultyBlockIndex() != 0 ) {", 176 | " res.extensions.push_back(\"zawy-lwma-difficulty-algorithm.json\");", 177 | " }" 178 | ] 179 | } 180 | }, 181 | { 182 | "action": "add_above", 183 | "marker": "res.core.P2P_DEFAULT_PORT = m_p2p.get_this_peer_port();", 184 | "parameters": { 185 | "text": [ 186 | " res.core.ZAWY_LWMA_DIFFICULTY_BLOCK_INDEX = m_core.getCurrency().zawyLWMADifficultyBlockIndex();", 187 | " res.core.ZAWY_LWMA_DIFFICULTY_LAST_BLOCK = m_core.getCurrency().zawyLWMADifficultyLastBlock();", 188 | " res.core.ZAWY_LWMA_DIFFICULTY_MIN = m_core.getCurrency().zawyLWMADifficultyMin();", 189 | " res.core.ZAWY_LWMA_DIFFICULTY_N = m_core.getCurrency().zawyLWMADifficultyN();" 190 | ] 191 | } 192 | } 193 | ] 194 | } 195 | ] 196 | } 197 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/multiply/zawy-lwma2-difficulty-algorithm.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "multiply/zawy-lwma2-difficulty-algorithm.json", 3 | "description": "Add Zawy LWMA2 difficulty algorithm option in multiply (https://github.com/zawy12/difficulty-algorithms/issues/3)", 4 | "required": [ 5 | "core/bytecoin.json", 6 | "zawy-lwma2-difficulty-algorithm.json", 7 | "multiply.json", 8 | "get-blockchain-settings.json" 9 | ], 10 | "files": [ 11 | { 12 | "path": "/src/Daemon/Daemon.cpp", 13 | "changes": [ 14 | { 15 | "action": "add_below", 16 | "marker": "const command_line::arg_descriptor< std::vector > arg_CHECKPOINT", 17 | "parameters": { 18 | "text": [ 19 | " const command_line::arg_descriptor arg_ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX = {\"ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX\", \"uint32_t\", 0};", 20 | " const command_line::arg_descriptor arg_ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK = {\"ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK\", \"uint32_t\", 0};", 21 | " const command_line::arg_descriptor arg_ZAWY_LWMA2_DIFFICULTY_MIN = {\"ZAWY_LWMA2_DIFFICULTY_MIN\", \"uint64_t\", 1};", 22 | " const command_line::arg_descriptor arg_ZAWY_LWMA2_DIFFICULTY_N = {\"ZAWY_LWMA2_DIFFICULTY_N\", \"size_t\", 0};" 23 | ] 24 | } 25 | }, 26 | { 27 | "action": "add_below", 28 | "marker": "command_line::add_arg(desc_cmd_sett, arg_CHECKPOINT);", 29 | "parameters": { 30 | "text": [ 31 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX);", 32 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK);", 33 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_LWMA2_DIFFICULTY_MIN);", 34 | " command_line::add_arg(desc_cmd_sett, arg_ZAWY_LWMA2_DIFFICULTY_N);" 35 | ] 36 | } 37 | }, 38 | { 39 | "action": "add_above", 40 | "marker": "currencyBuilder.testnet(testnet_mode);", 41 | "parameters": { 42 | "text": [ 43 | " currencyBuilder.zawyLWMA2DifficultyBlockIndex(command_line::get_arg(vm, arg_ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX));", 44 | " currencyBuilder.zawyLWMA2DifficultyLastBlock(command_line::get_arg(vm, arg_ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK));", 45 | " currencyBuilder.zawyLWMA2DifficultyMin(command_line::get_arg(vm, arg_ZAWY_LWMA2_DIFFICULTY_MIN));", 46 | " currencyBuilder.zawyLWMA2DifficultyN(command_line::get_arg(vm, arg_ZAWY_LWMA2_DIFFICULTY_N));" 47 | ] 48 | } 49 | } 50 | ] 51 | }, 52 | { 53 | "path": "/src/PaymentGateService/CoinBaseConfiguration.h", 54 | "changes": [ 55 | { 56 | "action": "add_below", 57 | "marker": "uint64_t MONEY_SUPPLY;", 58 | "parameters": { 59 | "text": [ 60 | " uint32_t ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX;", 61 | " uint32_t ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK;", 62 | " uint64_t ZAWY_LWMA2_DIFFICULTY_MIN;", 63 | " size_t ZAWY_LWMA2_DIFFICULTY_N;" 64 | ] 65 | } 66 | } 67 | ] 68 | }, 69 | { 70 | "path": "/src/PaymentGateService/CoinBaseConfiguration.cpp", 71 | "changes": [ 72 | { 73 | "action": "add_below", 74 | "marker": "MONEY_SUPPLY=CryptoNote::parameters::MONEY_SUPPLY;", 75 | "parameters": { 76 | "text": [ 77 | " ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX=CryptoNote::parameters::ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX;", 78 | " ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK=CryptoNote::parameters::ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK;", 79 | " ZAWY_LWMA2_DIFFICULTY_MIN=CryptoNote::parameters::ZAWY_LWMA2_DIFFICULTY_MIN;", 80 | " ZAWY_LWMA2_DIFFICULTY_N=CryptoNote::parameters::ZAWY_LWMA2_DIFFICULTY_N;" 81 | ] 82 | } 83 | }, 84 | { 85 | "action": "add_below", 86 | "marker": "(\"MONEY_SUPPLY\", po::value()->default_value(CryptoNote::parameters::MONEY_SUPPLY), \"uint64_t\")", 87 | "parameters": { 88 | "text": [ 89 | " (\"ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX\", po::value()->default_value(0), \"uint32_t\")", 90 | " (\"ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK\", po::value()->default_value(0), \"uint32_t\")", 91 | " (\"ZAWY_LWMA2_DIFFICULTY_MIN\", po::value()->default_value(1), \"uint64_t\")", 92 | " (\"ZAWY_LWMA2_DIFFICULTY_N\", po::value()->default_value(0), \"size_t\")" 93 | ] 94 | } 95 | }, 96 | { 97 | "action": "add_above", 98 | "marker": "if (options.count(\"EMISSION_SPEED_FACTOR\")) {", 99 | "parameters": { 100 | "text": [ 101 | " if (options.count(\"ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX\")) {", 102 | " ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX = options[\"ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX\"].as();", 103 | " }", 104 | " if (options.count(\"ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK\")) {", 105 | " ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK = options[\"ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK\"].as();", 106 | " }", 107 | " if (options.count(\"ZAWY_LWMA2_DIFFICULTY_MIN\")) {", 108 | " ZAWY_LWMA2_DIFFICULTY_MIN = options[\"ZAWY_LWMA2_DIFFICULTY_MIN\"].as();", 109 | " }", 110 | " if (options.count(\"ZAWY_LWMA2_DIFFICULTY_N\")) {", 111 | " ZAWY_LWMA2_DIFFICULTY_N = options[\"ZAWY_LWMA2_DIFFICULTY_N\"].as();", 112 | " }" 113 | ] 114 | } 115 | } 116 | ] 117 | }, 118 | { 119 | "path": "/src/PaymentGateService/PaymentGateService.cpp", 120 | "changes": [ 121 | { 122 | "action": "add_below", 123 | "marker": "currencyBuilder.moneySupply(config.coinBaseConfig.MONEY_SUPPLY);", 124 | "parameters": { 125 | "text": [ 126 | " currencyBuilder.zawyLWMA2DifficultyBlockIndex(config.coinBaseConfig.ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX);", 127 | " currencyBuilder.zawyLWMA2DifficultyLastBlock(config.coinBaseConfig.ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK);", 128 | " currencyBuilder.zawyLWMA2DifficultyMin(config.coinBaseConfig.ZAWY_LWMA2_DIFFICULTY_MIN);", 129 | " currencyBuilder.zawyLWMA2DifficultyN(config.coinBaseConfig.ZAWY_LWMA2_DIFFICULTY_N);" 130 | ] 131 | } 132 | } 133 | ] 134 | }, 135 | 136 | { 137 | "path": "/src/Rpc/CoreRpcServerCommandsDefinitions.h", 138 | "description": "Changes for get-blockchain-settings.json", 139 | "changes": [ 140 | { 141 | "action": "add_above", 142 | "marker": "std::string BYTECOIN_NETWORK;", 143 | "parameters": { 144 | "text": [ 145 | " uint32_t ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX;", 146 | " uint32_t ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK;", 147 | " uint64_t ZAWY_LWMA2_DIFFICULTY_MIN;", 148 | " size_t ZAWY_LWMA2_DIFFICULTY_N;" 149 | ] 150 | } 151 | }, 152 | { 153 | "action": "add_above", 154 | "marker": "KV_MEMBER(BYTECOIN_NETWORK)", 155 | "parameters": { 156 | "text": [ 157 | " KV_MEMBER(ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX)", 158 | " KV_MEMBER(ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK)", 159 | " KV_MEMBER(ZAWY_LWMA2_DIFFICULTY_MIN)", 160 | " KV_MEMBER(ZAWY_LWMA2_DIFFICULTY_N)" 161 | ] 162 | } 163 | } 164 | ] 165 | }, 166 | { 167 | "path": "/src/Rpc/RpcServer.cpp", 168 | "description": "Changes for get-blockchain-settings.json", 169 | "changes": [ 170 | { 171 | "action": "add_above", 172 | "marker": "res.core.CRYPTONOTE_NAME = m_core.getCurrency().cryptonoteName();", 173 | "parameters": { 174 | "text": [ 175 | " if (m_core.getCurrency().zawyLWMA2DifficultyBlockIndex() != 0 ) {", 176 | " res.extensions.push_back(\"zawy-lwma2-difficulty-algorithm.json\");", 177 | " }" 178 | ] 179 | } 180 | }, 181 | { 182 | "action": "add_above", 183 | "marker": "res.core.P2P_DEFAULT_PORT = m_p2p.get_this_peer_port();", 184 | "parameters": { 185 | "text": [ 186 | " res.core.ZAWY_LWMA2_DIFFICULTY_BLOCK_INDEX = m_core.getCurrency().zawyLWMA2DifficultyBlockIndex();", 187 | " res.core.ZAWY_LWMA2_DIFFICULTY_LAST_BLOCK = m_core.getCurrency().zawyLWMA2DifficultyLastBlock();", 188 | " res.core.ZAWY_LWMA2_DIFFICULTY_MIN = m_core.getCurrency().zawyLWMA2DifficultyMin();", 189 | " res.core.ZAWY_LWMA2_DIFFICULTY_N = m_core.getCurrency().zawyLWMA2DifficultyN();" 190 | ] 191 | } 192 | } 193 | ] 194 | } 195 | ] 196 | } 197 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/print-genesis-tx.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "print-genesis-tx.json", 3 | "description": "Adds --print-genesis-tx option to the daemon", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/Daemon/Daemon.cpp", 10 | "changes": [ 11 | { 12 | "action": "add_above", 13 | "marker": "#include \"CryptoNoteCore/Core.h\"", 14 | "parameters": { 15 | "text": [ 16 | "#include \"CryptoNoteCore/CryptoNoteTools.h\"" 17 | ] 18 | } 19 | }, 20 | { 21 | "action": "add_above", 22 | "marker": "arg_testnet_on = {", 23 | "parameters": { 24 | "text": [ 25 | " const command_line::arg_descriptor arg_print_genesis_tx = { \"print-genesis-tx\", \"Prints genesis' block tx hex to insert it to config and exits\" };" 26 | ] 27 | } 28 | }, 29 | { 30 | "action": "add_below", 31 | "marker": "command_line::add_arg(desc_cmd_sett, arg_testnet_on);", 32 | "parameters": { 33 | "text": [ 34 | "command_line::add_arg(desc_cmd_sett, arg_print_genesis_tx);" 35 | ] 36 | } 37 | }, 38 | { 39 | "action": "add_below", 40 | "marker": "currencyBuilder.testnet(testnet_mode);", 41 | "parameters": { 42 | "text": [ 43 | " try {", 44 | " currencyBuilder.currency();", 45 | " } catch (std::exception&) {", 46 | " std::cout << \"GENESIS_COINBASE_TX_HEX constant has an incorrect value. Please launch: \" << CryptoNote::CRYPTONOTE_NAME << \"d --\" << arg_print_genesis_tx.name;", 47 | " return 1;", 48 | " }" 49 | ] 50 | } 51 | }, 52 | { 53 | "action": "add_below", 54 | "marker": "bool command_line_preprocessor(const boost::program_options::variables_map& vm, LoggerRef& logger);", 55 | "parameters": { 56 | "text": [ 57 | "void print_genesis_tx_hex(const po::variables_map& vm, LoggerManager& logManager) {", 58 | " CryptoNote::Transaction tx = CryptoNote::CurrencyBuilder(logManager).generateGenesisTransaction();", 59 | " std::string tx_hex = Common::toHex(CryptoNote::toBinaryArray(tx));", 60 | " std::cout << \"Add this line into your coin configuration file as is: \" << std::endl;", 61 | " std::cout << \"\\\"GENESIS_COINBASE_TX_HEX\\\":\\\"\" << tx_hex << \"\\\",\" << std::endl;", 62 | " return;", 63 | "}" 64 | ] 65 | } 66 | }, 67 | { 68 | "action": "add_below", 69 | "marker": "po::notify(vm);", 70 | "parameters": { 71 | "text": [ 72 | " if (command_line::get_arg(vm, arg_print_genesis_tx)) {", 73 | " print_genesis_tx_hex(vm, logManager);", 74 | " return false;", 75 | " }" 76 | ] 77 | } 78 | } 79 | ] 80 | }, 81 | { 82 | "path": "/src/CryptoNoteCore/Currency.h", 83 | "changes": [ 84 | { 85 | "action": "add_above", 86 | "marker": "CurrencyBuilder& maxBlockNumber(uint32_t val) { m_currency.m_maxBlockHeight = val; return *this; }", 87 | "parameters": { 88 | "text": [ 89 | " Transaction generateGenesisTransaction();" 90 | ] 91 | } 92 | } 93 | ] 94 | }, 95 | { 96 | "path": "/src/CryptoNoteCore/Currency.cpp", 97 | "changes": [ 98 | { 99 | "action": "add_above", 100 | "marker": "CurrencyBuilder& CurrencyBuilder::emissionSpeedFactor(unsigned int val) {", 101 | "parameters": { 102 | "text": [ 103 | "Transaction CurrencyBuilder::generateGenesisTransaction() {", 104 | " CryptoNote::Transaction tx;", 105 | " CryptoNote::AccountPublicAddress ac = boost::value_initialized();", 106 | " m_currency.constructMinerTx(1, 0, 0, 0, 0, 0, ac, tx); // zero fee in genesis", 107 | " return tx;", 108 | "}" 109 | ] 110 | } 111 | } 112 | ] 113 | } 114 | ] 115 | } 116 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/simplewallet-default-fee.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "simplewallet-default-fee.json", 3 | "description": "Adds --default-fee option to simplewallet + precompiled", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/CryptoNoteConfig.h", 10 | "changes": [ 11 | { 12 | "action": "add_below", 13 | "marker": "const uint64_t DEFAULT_DUST_THRESHOLD", 14 | "parameters": { 15 | "text": [ 16 | "const uint64_t DEFAULT_FEE = %s;" 17 | ], 18 | "replace_text_alt": [ 19 | "const uint64_t DEFAULT_FEE = MINIMUM_FEE;" 20 | ], 21 | "var": "DEFAULT_FEE" 22 | } 23 | } 24 | ] 25 | }, 26 | { 27 | "path": "/src/SimpleWallet/SimpleWallet.h", 28 | "changes": [ 29 | { 30 | "action": "add_below", 31 | "marker": "uint16_t m_daemon_port;", 32 | "parameters": { 33 | "text": [ 34 | "uint64_t m_default_fee;" 35 | ] 36 | } 37 | } 38 | ] 39 | }, 40 | { 41 | "path": "/src/SimpleWallet/SimpleWallet.cpp", 42 | "changes": [ 43 | { 44 | "action": "add_below", 45 | "marker": "m_daemon_port = command_line::get_arg(vm, arg_daemon_port);", 46 | "parameters": { 47 | "text": [ 48 | "m_default_fee = command_line::get_arg(vm, arg_DEFAULT_FEE);", 49 | "if (m_currency.minimumFee() > m_default_fee) {", 50 | " m_default_fee = m_currency.minimumFee();", 51 | "}" 52 | ] 53 | } 54 | }, 55 | { 56 | "action": "add_above", 57 | "marker": "arg_testnet = { \"testnet\"", 58 | "parameters": { 59 | "text": [ 60 | " const command_line::arg_descriptor arg_DEFAULT_FEE = {\"DEFAULT_FEE\", \"Default fee\", CryptoNote::parameters::DEFAULT_FEE}; " 61 | ] 62 | } 63 | }, 64 | { 65 | "action": "add_below", 66 | "marker": "Tools::wallet_rpc_server::init_options(desc_params);", 67 | "parameters": { 68 | "text": [ 69 | " command_line::add_arg(desc_params, arg_DEFAULT_FEE);" 70 | ] 71 | } 72 | }, 73 | { 74 | "action": "replace", 75 | "marker": "TransferCommand(const CryptoNote::Currency& currency) :", 76 | "parameters": { 77 | "text": [ 78 | " TransferCommand(const CryptoNote::Currency& currency, uint64_t default_fee) :" 79 | ] 80 | } 81 | }, 82 | { 83 | "action": "replace", 84 | "marker": "m_currency(currency), fake_outs_count(0), fee(currency.minimumFee()) {", 85 | "parameters": { 86 | "text": [ 87 | " m_currency(currency), fake_outs_count(0), fee(default_fee) {" 88 | ] 89 | } 90 | }, 91 | { 92 | "action": "replace", 93 | "marker": "TransferCommand cmd(m_currency);", 94 | "parameters": { 95 | "text": [ 96 | " TransferCommand cmd(m_currency, m_default_fee);" 97 | ] 98 | } 99 | } 100 | ] 101 | } 102 | ] 103 | } -------------------------------------------------------------------------------- /extensions/bytecoin-v2/simplewallet-export-keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "simplewallet-export-keys.json", 3 | "description": "Adds export keys functionality to simlpewallet", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/SimpleWallet/SimpleWallet.cpp", 10 | "changes": [ 11 | { 12 | "action": "add_above", 13 | "marker": "m_consoleHandler.setHandler(\"balance\", boost::bind(&simple_wallet::show_balance, this, _1), \"Show current wallet balance\");", 14 | "parameters": { 15 | "text": [ 16 | " m_consoleHandler.setHandler(\"export_keys\", boost::bind(&simple_wallet::export_keys, this, _1), \"Show the secret keys of the openned wallet\");" 17 | ] 18 | } 19 | }, 20 | { 21 | "action": "add_above", 22 | "marker": "bool simple_wallet::show_balance(const std::vector& args/* = std::vector()*/) {", 23 | "parameters": { 24 | "text": [ 25 | "bool simple_wallet::export_keys(const std::vector& args/* = std::vector()*/) {", 26 | " AccountKeys keys;", 27 | " m_wallet->getAccountKeys(keys);", 28 | " success_msg_writer(true) << \"Spend secret key: \" << Common::podToHex(keys.spendSecretKey);", 29 | " success_msg_writer(true) << \"View secret key: \" << Common::podToHex(keys.viewSecretKey);", 30 | "", 31 | " return true;", 32 | "}", 33 | "" 34 | ] 35 | } 36 | } 37 | ] 38 | }, 39 | { 40 | "path": "/src/SimpleWallet/SimpleWallet.h", 41 | "changes": [ 42 | { 43 | "action": "add_below", 44 | "marker": "bool show_balance(const std::vector &args = std::vector());", 45 | "parameters": { 46 | "text": [ 47 | " bool export_keys(const std::vector &args = std::vector());" 48 | ] 49 | } 50 | } 51 | ] 52 | } 53 | ] 54 | } -------------------------------------------------------------------------------- /extensions/bytecoin-v2/speed-up-wallet-sync.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "speed-up-wallet-sync.json", 3 | "description": "Sync not from 0 when not necessary", 4 | "bugs": "It breaks reset and sync from import wallets", 5 | "required": [ 6 | "core/bytecoin.json" 7 | ], 8 | "files": [ 9 | { 10 | "path": "/src/Wallet/WalletGreen.h", 11 | "changes": [ 12 | { 13 | "action": "add_below", 14 | "marker": "uint64_t m_upperTransactionSizeLimit;", 15 | "parameters": { 16 | "text": [ 17 | " uint32_t m_totalBlockCount;" 18 | ] 19 | } 20 | } 21 | ] 22 | }, 23 | { 24 | "path": "/src/Wallet/WalletGreen.cpp", 25 | "changes": [ 26 | { 27 | "action": "replace", 28 | "marker": "sub.syncStart.height = 0;", 29 | "parameters": { 30 | "text": [ 31 | "" 32 | ] 33 | } 34 | }, 35 | { 36 | "action": "add_above", 37 | "marker": "sub.syncStart.timestamp = std::max(creationTimestamp, ACCOUNT_CREATE_TIME_ACCURACY) - ACCOUNT_CREATE_TIME_ACCURACY;", 38 | "parameters": { 39 | "text": [ 40 | "// sub.syncStart.height = 0;", 41 | " sub.syncStart.height = m_totalBlockCount;" 42 | ] 43 | } 44 | }, 45 | { 46 | "action": "add_above", 47 | "marker": "sub.syncStart.timestamp = std::max(static_cast(wallet.creationTimestamp), ACCOUNT_CREATE_TIME_ACCURACY) - ACCOUNT_CREATE_TIME_ACCURACY;", 48 | "parameters": { 49 | "text": [ 50 | " sub.syncStart.height = 0;" 51 | ] 52 | } 53 | }, 54 | { 55 | "action": "add_below", 56 | "marker": "void WalletGreen::onSynchronizationProgressUpdated(uint32_t processedBlockCount, uint32_t totalBlockCount) {", 57 | "parameters": { 58 | "text": [ 59 | "// m_totalBlockCount = totalBlockCount;", 60 | " m_totalBlockCount = 0;" 61 | ] 62 | } 63 | }, 64 | { 65 | "action": "replace", 66 | "marker": "return doCreateAddress(spendPublicKey, spendSecretKey, 0);", 67 | "parameters": { 68 | "text": [ 69 | " uint64_t creationTimestamp = static_cast(time(nullptr));", 70 | " return doCreateAddress(spendPublicKey, spendSecretKey, creationTimestamp);" 71 | ] 72 | } 73 | }, 74 | { 75 | "action": "replace", 76 | "marker": "return doCreateAddress(spendPublicKey, NULL_SECRET_KEY, 0);", 77 | "parameters": { 78 | "text": [ 79 | " uint64_t creationTimestamp = static_cast(time(nullptr));", 80 | " return doCreateAddress(spendPublicKey, NULL_SECRET_KEY, creationTimestamp);" 81 | ] 82 | } 83 | } 84 | ] 85 | } 86 | ] 87 | } 88 | -------------------------------------------------------------------------------- /extensions/bytecoin-v2/tail-emission-reward.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "tail-emission-reward.json", 3 | "description": "Add tail emission", 4 | "required": [ 5 | "core/bytecoin.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/src/CryptoNoteCore/Currency.h", 10 | "changes": [ 11 | { 12 | "action": "add_above", 13 | "marker": "size_t m_blockGrantedFullRewardZone;", 14 | "parameters": { 15 | "text": [ 16 | " uint64_t m_tailEmissionReward;" 17 | ] 18 | } 19 | }, 20 | { 21 | "action": "add_above", 22 | "marker": "CurrencyBuilder& blockGrantedFullRewardZone(size_t val)", 23 | "parameters": { 24 | "text": [ 25 | " CurrencyBuilder& tailEmissionReward(uint64_t val) { m_currency.m_tailEmissionReward = val; return *this; }" 26 | ] 27 | } 28 | }, 29 | { 30 | "action": "add_above", 31 | "marker": "size_t blockGrantedFullRewardZone()", 32 | "parameters": { 33 | "text": [ 34 | " uint64_t tailEmissionReward() const { return m_tailEmissionReward; }" 35 | ] 36 | } 37 | } 38 | ] 39 | }, 40 | { 41 | "path": "/src/CryptoNoteCore/Currency.cpp", 42 | "changes": [ 43 | { 44 | "action": "add_above", 45 | "marker": "blockGrantedFullRewardZone(parameters::CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE);", 46 | "parameters": { 47 | "text": [ 48 | "tailEmissionReward(parameters::TAIL_EMISSION_REWARD);" 49 | ] 50 | } 51 | }, 52 | { 53 | "action": "add_above", 54 | "marker": "m_testnet(currency.m_testnet),", 55 | "parameters": { 56 | "text": [ 57 | "m_tailEmissionReward(currency.m_tailEmissionReward)," 58 | ] 59 | } 60 | } 61 | ] 62 | }, 63 | { 64 | "path": "/src/CryptoNoteConfig.h", 65 | "changes": [ 66 | { 67 | "action": "add_above", 68 | "marker": "const unsigned EMISSION_SPEED_FACTOR", 69 | "parameters": { 70 | "text": [ 71 | "const uint64_t TAIL_EMISSION_REWARD = %s;" 72 | ], 73 | "replace_text_alt": [ 74 | "const uint64_t TAIL_EMISSION_REWARD = 0;" 75 | ], 76 | "var": "TAIL_EMISSION_REWARD" 77 | } 78 | } 79 | ] 80 | }, 81 | { 82 | "path": "/src/CryptoNoteCore/Currency.cpp", 83 | "changes": [ 84 | { 85 | "action": "add_below", 86 | "marker": "uint64_t baseReward = (m_moneySupply - alreadyGeneratedCoins) >> m_emissionSpeedFactor;", 87 | "parameters": { 88 | "text": [ 89 | " if (baseReward < m_tailEmissionReward) {", 90 | " baseReward = m_tailEmissionReward;", 91 | " }", 92 | "", 93 | " if (alreadyGeneratedCoins + baseReward >= m_moneySupply) {", 94 | " baseReward = 0;", 95 | " }", 96 | "" 97 | ] 98 | } 99 | } 100 | ] 101 | } 102 | ] 103 | } 104 | -------------------------------------------------------------------------------- /extensions/bytecoin/core/files/Makefile: -------------------------------------------------------------------------------- 1 | cmake-release: 2 | mkdir -p build 3 | cd build && cmake -DUSE_SSL=0 .. 4 | 5 | build-release: cmake-release 6 | cd build && $(MAKE) 7 | 8 | clean: 9 | rm -rf build 10 | 11 | .PHONY: cmake-release build-release clean 12 | -------------------------------------------------------------------------------- /extensions/monero/aeon/files/blocks.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forknote/cryptonote-generator/a51125f602e405e7c2cc5bb3e16ec599c33ee5c7/extensions/monero/aeon/files/blocks.dat -------------------------------------------------------------------------------- /extensions/monero/aeon/files/tests/hash/tests-slow-with-multiplier.txt: -------------------------------------------------------------------------------- 1 | afffe6c3084b0de799f6851389619bfe36be4705e4fb9e5039f8044b0decf8ea 63617665617420656d70746f72 2 | -------------------------------------------------------------------------------- /extensions/monero/aeon/files/tests/performance_tests/cn_slow_hash_with_multiplier_test.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2018, The Aeon Project 2 | // 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without modification, are 6 | // permitted provided that the following conditions are met: 7 | // 8 | // 1. Redistributions of source code must retain the above copyright notice, this list of 9 | // conditions and the following disclaimer. 10 | // 11 | // 2. Redistributions in binary form must reproduce the above copyright notice, this list 12 | // of conditions and the following disclaimer in the documentation and/or other 13 | // materials provided with the distribution. 14 | // 15 | // 3. Neither the name of the copyright holder nor the names of its contributors may be 16 | // used to endorse or promote products derived from this software without specific 17 | // prior written permission. 18 | // 19 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY 20 | // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL 22 | // THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 26 | // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 27 | // THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | // 29 | // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers 30 | 31 | #pragma once 32 | 33 | #include "string_tools.h" 34 | #include "crypto/crypto.h" 35 | #include "cryptonote_basic/cryptonote_basic.h" 36 | 37 | class test_cn_slow_hash_with_multiplier_test 38 | { 39 | public: 40 | static const size_t loop_count = 10; 41 | 42 | #pragma pack(push, 1) 43 | struct data_t 44 | { 45 | char data[13]; 46 | }; 47 | #pragma pack(pop) 48 | 49 | static_assert(13 == sizeof(data_t), "Invalid structure size"); 50 | 51 | bool init() 52 | { 53 | if (!epee::string_tools::hex_to_pod("63617665617420656d70746f72", m_data)) 54 | return false; 55 | 56 | if (!epee::string_tools::hex_to_pod("afffe6c3084b0de799f6851389619bfe36be4705e4fb9e5039f8044b0decf8ea", m_expected_hash)) 57 | return false; 58 | 59 | return true; 60 | } 61 | 62 | bool test() 63 | { 64 | crypto::hash hash; 65 | crypto::cn_slow_hash_with_multiplier_test(&m_data, sizeof(m_data), hash); 66 | 67 | return hash == m_expected_hash; 68 | } 69 | 70 | private: 71 | data_t m_data; 72 | crypto::hash m_expected_hash; 73 | }; 74 | -------------------------------------------------------------------------------- /extensions/monero/core/monero/files/blocks.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forknote/cryptonote-generator/a51125f602e405e7c2cc5bb3e16ec599c33ee5c7/extensions/monero/core/monero/files/blocks.dat -------------------------------------------------------------------------------- /extensions/monero/core/monero/files/checkpoints.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forknote/cryptonote-generator/a51125f602e405e7c2cc5bb3e16ec599c33ee5c7/extensions/monero/core/monero/files/checkpoints.dat -------------------------------------------------------------------------------- /extensions/monero/core/monero/files/testnet_blocks.dat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/forknote/cryptonote-generator/a51125f602e405e7c2cc5bb3e16ec599c33ee5c7/extensions/monero/core/monero/files/testnet_blocks.dat -------------------------------------------------------------------------------- /extensions/monero/donations.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "donations.json", 3 | "description": "Donation address for a dev team", 4 | "required": [ 5 | ], 6 | "files": [ 7 | { 8 | "path": "/src/cryptonote_config.h", 9 | "changes": [ 10 | { 11 | "action": "add_below", 12 | "marker": "#define PER_KB_FEE_QUANTIZATION_DECIMALS", 13 | "parameters": { 14 | "text": [ 15 | "#define CONFIG_DONATION_ADDRESS \"%s\"" 16 | ], 17 | "replace_text_alt": [ 18 | "#define CONFIG_DONATION_ADDRESS \"\"" 19 | ], 20 | "var": "CONFIG_DONATION_ADDRESS" 21 | } 22 | } 23 | ] 24 | }, 25 | 26 | { 27 | "path": "/src/cryptonote_basic/miner.cpp", 28 | "changes": [ 29 | { 30 | "action": "add_below", 31 | "marker": "const command_line::arg_descriptor arg_bg_mining_enable = {\"bg-mining-enable\", \"enable/disable background mining\", true, true};", 32 | "parameters": { 33 | "text": [ 34 | "// the 3rd and 4rd parameter are just copy paste. I don't know what they do", 35 | " const command_line::arg_descriptor arg_donate = {\"donate\", \"Enable background donation mining\", true, true};" 36 | ] 37 | } 38 | }, 39 | { 40 | "action": "replace", 41 | "marker": "if(command_line::has_arg(vm, arg_start_mining))", 42 | "parameters": { 43 | "text": [ 44 | " if(command_line::has_arg(vm, arg_start_mining) || command_line::has_arg(vm, arg_donate))" 45 | ] 46 | } 47 | }, 48 | { 49 | "action": "replace", 50 | "marker": "if(!cryptonote::get_account_address_from_str(info, nettype, command_line::get_arg(vm, arg_start_mining)) || info.is_subaddress)", 51 | "parameters": { 52 | "text": [ 53 | " if(command_line::has_arg(vm, arg_donate))", 54 | " {", 55 | " if (!cryptonote::get_account_address_from_str(info, testnet, std::string(CONFIG_DONATION_ADDRESS)))", 56 | " {", 57 | " LOG_ERROR(\"Internal error: malformed donation address\");", 58 | " return false;", 59 | " }", 60 | " }", 61 | " else if(!cryptonote::get_account_address_from_str(info, nettype, command_line::get_arg(vm, arg_start_mining)) || info.is_subaddress)" 62 | ] 63 | } 64 | }, 65 | { 66 | "action": "add_below", 67 | "marker": "command_line::add_arg(desc, arg_bg_mining_enable);", 68 | "parameters": { 69 | "text": [ 70 | " command_line::add_arg(desc, arg_donate);" 71 | ] 72 | } 73 | } 74 | ] 75 | } 76 | ] 77 | } 78 | -------------------------------------------------------------------------------- /extensions/monero/enable-cors.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "enable-cors.json", 3 | "description": "Adds CORS support", 4 | "required": [ 5 | "core/monero.json" 6 | ], 7 | "files": [ 8 | { 9 | "path": "/contrib/epee/include/net/http_server_handlers_map2.h", 10 | "changes": [ 11 | { 12 | "action": "add_below", 13 | "marker": "response.m_response_comment = \"Ok\"; \\", 14 | "parameters": { 15 | "text": [ 16 | " response.m_additional_fields.push_back(std::make_pair(\"Access-Control-Allow-Origin\", \"*\")); \\" 17 | ] 18 | } 19 | } 20 | ] 21 | } 22 | ] 23 | } 24 | -------------------------------------------------------------------------------- /extensions/monero/versionized-parameters.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "versionized-parameters.json", 3 | "description": "Change parameters when hardfork.", 4 | "required": [], 5 | "files": [ 6 | { 7 | "path": "/src/cryptonote_config.h", 8 | "changes": [ 9 | { 10 | "action": "add_below", 11 | "marker": "#define DIFFICULTY_WINDOW 720", 12 | "parameters": { 13 | "text": [ 14 | "#define DIFFICULTY_WINDOW_V2 %s" 15 | ], 16 | "replace_text_alt": [ 17 | "#define DIFFICULTY_WINDOW_V2 DIFFICULTY_WINDOW" 18 | ], 19 | "var": "DIFFICULTY_WINDOW_V2" 20 | } 21 | }, 22 | { 23 | "action": "add_below", 24 | "marker": "#define EMISSION_SPEED_FACTOR_PER_MINUTE (20)", 25 | "parameters": { 26 | "text": [ 27 | "#define EMISSION_SPEED_FACTOR_PER_MINUTE_V2 (%s)" 28 | ], 29 | "replace_text_alt": [ 30 | "#define EMISSION_SPEED_FACTOR_PER_MINUTE_V2 EMISSION_SPEED_FACTOR_PER_MINUTE" 31 | ], 32 | "var": "EMISSION_SPEED_FACTOR_PER_MINUTE_V2" 33 | } 34 | } 35 | ] 36 | }, 37 | { 38 | "path": "/src/cryptonote_config.h", 39 | "changes": [ 40 | { 41 | "action": "add_below", 42 | "marker": "#define DIFFICULTY_WINDOW 720", 43 | "parameters": { 44 | "text": [ 45 | "#define DIFFICULTY_WINDOW_V1 %s" 46 | ], 47 | "replace_text_alt": [ 48 | "#define DIFFICULTY_WINDOW_V1 DIFFICULTY_WINDOW" 49 | ], 50 | "var": "DIFFICULTY_WINDOW_V1" 51 | } 52 | }, 53 | { 54 | "action": "add_below", 55 | "marker": "#define EMISSION_SPEED_FACTOR_PER_MINUTE (20)", 56 | "parameters": { 57 | "text": [ 58 | "#define EMISSION_SPEED_FACTOR_PER_MINUTE_V1 (%s)" 59 | ], 60 | "replace_text_alt": [ 61 | "#define EMISSION_SPEED_FACTOR_PER_MINUTE_V1 EMISSION_SPEED_FACTOR_PER_MINUTE" 62 | ], 63 | "var": "EMISSION_SPEED_FACTOR_PER_MINUTE_V1" 64 | } 65 | } 66 | ] 67 | }, 68 | { 69 | "path": "/src/cryptonote_basic/cryptonote_basic_impl.cpp", 70 | "changes": [ 71 | { 72 | "action": "replace", 73 | "marker": "const int emission_speed_factor = EMISSION_SPEED_FACTOR_PER_MINUTE - (target_minutes-1);", 74 | "parameters": { 75 | "text": [ 76 | "const int emission_speed_factor = version < 2 ? EMISSION_SPEED_FACTOR_PER_MINUTE_V1 - (target_minutes-1) : EMISSION_SPEED_FACTOR_PER_MINUTE_V2 - (target_minutes-1);" 77 | ] 78 | } 79 | } 80 | ] 81 | } 82 | ] 83 | } 84 | -------------------------------------------------------------------------------- /generator.sh: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env bash 2 | 3 | 4 | # Bash script for automatic generation and deployment 5 | 6 | # Exit immediately if an error occurs, or if an undeclared variable is used 7 | set -o errexit 8 | 9 | [ "$OSTYPE" != "win"* ] || die "Install MinGW to use on Windows" 10 | 11 | # For bold text 12 | if [ "$OSTYPE" != "msys" ]; then 13 | bold=$(tput bold) 14 | normal=$(tput sgr0) 15 | fi 16 | 17 | # Set directory vars 18 | . "vars.cfg" 19 | 20 | # Perform cleanup on exit 21 | function finish { 22 | # Remove temporary files if exist 23 | echo "Remove temporary files..." 24 | rm -f "${UPDATES_PATH}" 25 | rm -f "${BASH_CONFIG}" 26 | rm -rf "${TEMP_PATH}" 27 | } 28 | trap finish EXIT 29 | 30 | # Generate source code and compile 31 | function generate_coin { 32 | # Define coin paths 33 | export BASE_COIN_PATH="${WORK_FOLDERS_PATH}/${__CONFIG_BASE_COIN_extension_folder}" 34 | export NEW_COIN_PATH="${WORK_FOLDERS_PATH}/${__CONFIG_core_CRYPTONOTE_NAME}" 35 | if [ -d "${BASE_COIN_PATH}" ]; then 36 | cd "${BASE_COIN_PATH}" 37 | echo "Updating ${__CONFIG_BASE_COIN_name}..." 38 | git checkout master 39 | git pull 40 | cd "${PROJECT_DIR}" 41 | else 42 | echo "Cloning ${__CONFIG_BASE_COIN_name}..." 43 | git clone "${__CONFIG_BASE_COIN_git}" "${BASE_COIN_PATH}" 44 | fi 45 | 46 | if [[ ! -z $BRANCH ]]; then 47 | cd "${BASE_COIN_PATH}" 48 | git checkout ${BRANCH} 49 | cd "${PROJECT_DIR}" 50 | else 51 | cd "${BASE_COIN_PATH}" 52 | git checkout ${__CONFIG_BASE_COIN_branch} 53 | cd "${PROJECT_DIR}" 54 | fi 55 | 56 | # Install dependencies 57 | echo "Installing dependencies..." 58 | export __CONFIG_BASE_COIN_dependencies_text="${__CONFIG_BASE_COIN_dependencies[@]}" 59 | for dependency in "${__CONFIG_BASE_COIN_dependencies[@]}" 60 | do 61 | dependency_dir=$(basename $dependency) 62 | DEPENDENCY_PATH="${WORK_FOLDERS_PATH}/${dependency_dir}" 63 | 64 | if [ -d "${DEPENDENCY_PATH}" ]; then 65 | cd "${DEPENDENCY_PATH}" 66 | echo "Updating dependency ${dependency}..." 67 | git pull 68 | cd "${PROJECT_DIR}" 69 | else 70 | echo "Cloning dependency ${dependency}..." 71 | git clone "${dependency}" "${DEPENDENCY_PATH}" 72 | fi 73 | done 74 | 75 | # Exit if base coin does not exists 76 | if [ ! -d "${BASE_COIN_PATH}" ]; then 77 | echo "Base coin does not exist" 78 | echo "Abort clone generation" 79 | exit 4 80 | fi 81 | 82 | echo "Make temporary ${__CONFIG_BASE_COIN_name} copy..." 83 | [ -d "${TEMP_PATH}" ] || mkdir -p "${TEMP_PATH}" 84 | cp -af "${BASE_COIN_PATH}/." "${TEMP_PATH}" 85 | 86 | # Extensions 87 | echo "Personalize base coin source..." 88 | export __CONFIG_extensions_text="${__CONFIG_extensions[@]}" 89 | for extension in "${__CONFIG_extensions[@]}" 90 | do 91 | echo "${bold}Execute ${EXTENSIONS_PATH}/${__CONFIG_BASE_COIN_extension_folder}/${extension}${normal}" 92 | python "lib/file-modification.py" --extension "${EXTENSIONS_PATH}/${__CONFIG_BASE_COIN_extension_folder}/${extension}" --config=$CONFIG_FILE --source=${TEMP_PATH} 93 | done 94 | 95 | [ -d "${NEW_COIN_PATH}" ] || mkdir -p "${NEW_COIN_PATH}" 96 | 97 | echo "Create patch" 98 | cd "${WORK_FOLDERS_PATH}"; 99 | EXCLUDE_FROM_DIFF="-x '.git'" 100 | if [ -d "${BASE_COIN_PATH}/build" ]; then 101 | EXCLUDE_FROM_DIFF="${EXCLUDE_FROM_DIFF} -x 'build'" 102 | fi 103 | diff -Naur -x .git ${NEW_COIN_PATH##${WORK_FOLDERS_PATH}/} ${TEMP_PATH##${WORK_FOLDERS_PATH}/} > "${UPDATES_PATH}" || [ $? -eq 1 ] 104 | 105 | echo "Apply patch" 106 | [ -d "${NEW_COIN_PATH}" ] || mkdir -p "${NEW_COIN_PATH}" 107 | if [ ! -z "${UPDATES_PATH}" ]; then 108 | # Generate new coin 109 | cd "${NEW_COIN_PATH}" && patch -s -p1 < "${UPDATES_PATH}" && cd "${SCRIPTS_PATH}" 110 | chmod -R 755 ${NEW_COIN_PATH} 111 | 112 | bash "${SCRIPTS_PATH}/compile.sh" -c "${COMPILE_ARGS}" -z 113 | fi 114 | 115 | if [[ ! -z $BRANCH ]]; then 116 | cd "${BASE_COIN_PATH}" 117 | git checkout master 118 | fi 119 | } 120 | 121 | # Usage info 122 | show_help() { 123 | cat << EOF 124 | Usage: ${0##*/} [-h] [-f FILE] [-c ] 125 | Reads a config file and creates and compiles Cryptonote coin. "config.json" as default 126 | 127 | -h display this help and exit 128 | -f config file 129 | -b branch 130 | -c compile arguments 131 | EOF 132 | } 133 | 134 | # A POSIX variable 135 | OPTIND=1 # Reset in case getopts has been used previously in the shell. 136 | 137 | # Initialize our own variables: 138 | CONFIG_FILE='config.json' 139 | CORE_CONFIG_FILE='' 140 | COMPILE_ARGS='' 141 | 142 | while getopts "h?f:b:c:" opt; do 143 | case "$opt" in 144 | h|\?) 145 | show_help 146 | exit 0 147 | ;; 148 | f) CONFIG_FILE=${OPTARG} 149 | ;; 150 | b) BRANCH=${OPTARG} 151 | ;; 152 | c) COMPILE_ARGS=${OPTARG} 153 | ;; 154 | esac 155 | done 156 | 157 | shift $((OPTIND-1)) 158 | 159 | # Setting config file 160 | if [[ "${CONFIG_FILE}" != /* ]]; then 161 | CONFIG_FILE="${CONFIG_PATH}/${CONFIG_FILE}" 162 | fi 163 | 164 | if [ ! -f ${CONFIG_FILE} ]; then 165 | echo "ERROR: config file does not exits" 166 | exit 167 | fi 168 | 169 | [ -d "${WORK_FOLDERS_PATH}" ] || mkdir -p "${WORK_FOLDERS_PATH}" 170 | 171 | # Get environment environment_variables 172 | python "lib/environment_variables.py" --config=$CONFIG_FILE --output=$BASH_CONFIG 173 | if [ ! -f ${BASH_CONFIG} ]; then 174 | echo "Config file was not translated to bash." 175 | echo "Abort coin generation" 176 | exit 3 177 | fi 178 | source ${BASH_CONFIG} 179 | 180 | CORE_CONFIG_FILE=${__CONFIG_base_coin} 181 | # Setting core config file 182 | if [[ "${CORE_CONFIG_FILE}" != /* ]]; then 183 | CORE_CONFIG_FILE="${CORE_CONFIG_PATH}/cores/${CORE_CONFIG_FILE}.json" 184 | fi 185 | 186 | if [ ! -f ${CORE_CONFIG_FILE} ]; then 187 | echo "ERROR: core config file does not exits" 188 | echo "${CORE_CONFIG_FILE}" 189 | exit 190 | fi 191 | 192 | # Get environment environment_variables 193 | python "lib/environment_variables.py" --config=$CORE_CONFIG_FILE --output=$BASH_CONFIG --prefix="_BASE_COIN" 194 | if [ ! -f ${BASH_CONFIG} ]; then 195 | echo "Core config file was not translated to bash." 196 | echo "Abort coin generation" 197 | exit 3 198 | fi 199 | source ${BASH_CONFIG} 200 | 201 | generate_coin 202 | -------------------------------------------------------------------------------- /install_dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Template: OpenBazaar 4 | # 5 | # install_dependencies.sh - Setup your Cryptonote development environment in one step. 6 | # 7 | # This script will only get better as its tested on more development environments 8 | # if you can't modify it to make it better, please open an issue with a full 9 | # error report at https://github.com/forknote/cryptonote-generator.git/issues/new 10 | # 11 | # Credits: Forknote 12 | # 13 | # Code borrowed from: 14 | # https://github.com/OpenBazaar/OpenBazaar/blob/develop/configure.sh 15 | # https://github.com/Quanttek/install_monero/blob/master/install_monero.sh 16 | 17 | #exit on error 18 | set -e 19 | 20 | function command_exists { 21 | # this should be a very portable way of checking if something is on the path 22 | # usage: "if command_exists foo; then echo it exists; fi" 23 | type "$1" &> /dev/null 24 | } 25 | 26 | function brewDoctor { 27 | if ! brew doctor; then 28 | echo "" 29 | echo "'brew doctor' did not exit cleanly! This may be okay. Read above." 30 | echo "" 31 | read -p "Press [Enter] to continue anyway or [ctrl + c] to exit and do what the doctor says..." 32 | fi 33 | } 34 | 35 | function brewUpgrade { 36 | echo "If your homebrew packages are outdated, we recommend upgrading them now. This may take some time." 37 | read -r -p "Do you want to do this? [y/N] " response 38 | if [[ $response =~ ^([yY][eE][sS]|[yY])$ ]] 39 | then 40 | if ! brew upgrade; then 41 | echo "" 42 | echo "There were errors when attempting to 'brew upgrade' and there could be issues with the installation of Cryptonote generator." 43 | echo "" 44 | read -p "Press [Enter] to continue anyway or [ctrl + c] to exit and fix those errors." 45 | fi 46 | fi 47 | } 48 | 49 | function installMac { 50 | # print commands (useful for debugging) 51 | # set -x #disabled because the echos and stdout are verbose enough to see progress 52 | 53 | # install brew if it is not installed, otherwise upgrade it 54 | if ! command_exists brew ; then 55 | echo "installing brew..." 56 | ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 57 | else 58 | echo "updating, upgrading, checking brew..." 59 | brew update 60 | brewDoctor 61 | brewUpgrade 62 | brew prune 63 | fi 64 | 65 | # install gpg/sqlite3/python/wget/openssl/zmq if they aren't installed 66 | for dep in cmake boost python 67 | do 68 | if ! command_exists $dep ; then 69 | brew install $dep 70 | fi 71 | done 72 | 73 | doneMessage 74 | } 75 | 76 | function unsupportedOS { 77 | echo "Unsupported OS. Only MacOSX and Ubuntu are supported." 78 | } 79 | 80 | function installUbuntu { 81 | . /etc/lsb-release 82 | 83 | # print commands 84 | set -x 85 | 86 | if [[ $DISTRIB_ID=Ubuntu && $DISTRIB_RELEASE == 16.04 ]] ; then 87 | sudo apt-get update 88 | sudo apt-get -y install build-essential python-dev gcc-4.9 g++-4.9 git cmake libboost1.58-all-dev librocksdb-dev 89 | export CXXFLAGS="-std=gnu++11" 90 | 91 | doneMessage 92 | elif [[ $DISTRIB_ID=Ubuntu && $DISTRIB_RELEASE == 16.10 ]] ; then 93 | sudo apt-get update 94 | sudo apt-get -y install build-essential python-dev gcc-4.9 g++-4.9 git cmake libboost1.61-all-dev librocksdb-dev 95 | export CXXFLAGS="-std=gnu++11" 96 | 97 | doneMessage 98 | else 99 | echo "Only Ubuntu 16.04 is supported" 100 | fi 101 | } 102 | 103 | function doneMessage { 104 | echo "Cryptonote generator configuration finished." 105 | echo "type 'bash generator.sh [-h] [-f FILE] [-c ]' to generate Cryptonote coin." 106 | } 107 | 108 | if [[ $OSTYPE == darwin* ]] ; then 109 | installMac 110 | elif [[ $OSTYPE == linux-gnu || $OSTYPE == linux-gnueabihf ]]; then 111 | installUbuntu 112 | else 113 | unsupportedOS 114 | fi -------------------------------------------------------------------------------- /lib/environment_variables.py: -------------------------------------------------------------------------------- 1 | import json 2 | import argparse 3 | import sys 4 | 5 | 6 | def convert_to_bash ( entity, prefix ): 7 | for key, value in entity.iteritems(): 8 | if isinstance(value, dict): 9 | convert_to_bash(entity[key], prefix + key + '_') 10 | elif isinstance(value, list): 11 | print "export " + str(prefix) + str(key) + "=(" + " ".join(json.dumps(str(item)) for item in value) + ")" 12 | elif isinstance(value, int): 13 | print "export " + str(prefix) + str(key) + "=" + str(value) 14 | else: 15 | print "export " + str(prefix) + str(key) + "=" + str(json.dumps(value)) + "" 16 | 17 | parser = argparse.ArgumentParser() 18 | 19 | parser.add_argument('--config', action='store', dest='config_file', 20 | default='config.json', 21 | help='Configuration filename. Format: json' 22 | ) 23 | parser.add_argument('--output', action='store', dest='output', 24 | default='config.cfg', 25 | help='Output path. Format: string' 26 | ) 27 | parser.add_argument('--prefix', action='store', dest='prefix', 28 | default='', 29 | help='Prefix of the saved bash variables. Format: string' 30 | ) 31 | 32 | args = parser.parse_args() 33 | 34 | json_data=open(args.config_file) 35 | config = json.load(json_data) 36 | json_data.close() 37 | 38 | f = open(args.output, 'w+') 39 | sys.stdout = f 40 | convert_to_bash(config, '__CONFIG' + args.prefix + '_') 41 | sys.stdout = sys.__stdout__ 42 | f.close() 43 | -------------------------------------------------------------------------------- /vars.cfg: -------------------------------------------------------------------------------- 1 | export PROJECT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 2 | export WORK_FOLDERS_PATH="${PROJECT_DIR}/generated_files" 3 | export SCRIPTS_PATH="${PROJECT_DIR}" 4 | export EXTENSIONS_PATH="${SCRIPTS_PATH}/extensions" 5 | export TESTS_PATH="${SCRIPTS_PATH}/tests" 6 | export CONFIG_PATH="${SCRIPTS_PATH}" 7 | export CORE_CONFIG_PATH="${SCRIPTS_PATH}" 8 | export TEMP_PATH="${WORK_FOLDERS_PATH}/tmp" 9 | export UPDATES_PATH="${WORK_FOLDERS_PATH}/updates.forknote.patch" 10 | export BASH_CONFIG="${WORK_FOLDERS_PATH}/config.cfg" 11 | 12 | export CUSTOM_CUSTOMIZE_SCRIPT_PATH="${SCRIPTS_PATH}/custom/customize.sh" 13 | export CUSTOM_CUSTOMIZE_TESTS_PATH="${SCRIPTS_PATH}/custom/customize-test.sh" 14 | export CUSTOM_GENERATE_SCRIPT_PATH="${SCRIPTS_PATH}/custom/generate.sh" 15 | --------------------------------------------------------------------------------