Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##############################################################
- # SEMI-AUTOMATIC CRYPTOCURRENCY CREATION SCRIPT v 0.1 #
- ##############################################################
- # This script helps you create a cryptonote cryptocurrency.
- # Pre-requirements: git, gcc, curl, 20 megabytes of space
- # sudo apt-get install git gcc curl (ubuntu/debian)
- # sudo pacman -S git gcc curl (arch/manjaro)
- ############################## by Security XIII on 27.05.17 ##
- echo "Welcome to semi-automatic cryptocurrency creation script."
- echo "This is WIP (work in progress). Pre-alpha version."
- echo "WARNING! This script checks NOTHING. If you made a mistake,"
- echo "fix it manually, or re-run the script."
- echo "......................................"
- echo "Cloning git repo, please wait... Saving repo into 'cryptonote' folder"
- git clone https://github.com/sxiii/cryptonote
- cd cryptonote
- echo "= NAME ="
- echo "Please enter the name of the crypto! No special symbols, spaces etc."
- echo "Hint: check new name via google and mapofcoins.com"
- read name
- echo "Your crypto will be named: $name. Great! Let's move on..."
- echo
- # src/CryptoNoteConfig.h -> NamePlaceholder -> $name
- # src/CMakeLists.txt -> CryptonotedPlaceholder -> $name
- sed -i 's/NamePlaceholder/'"$name"'/g' src/CryptoNoteConfig.h
- sed -i 's/CryptonotedPlaceholder/'"$name"'/g' src/CMakeLists.txt
- echo "= Money Supply ="
- echo "Enter money supply (amount of coins totally emmited)"
- echo "Default (if empty) will be 18446744073709551616:"
- read moneysupply
- [[ -z "${moneysupply// }" ]] && moneysupply="(uint64_t)(-1)"
- echo "Your money supply will be $moneysupply"
- echo
- # src/CryptoNoteConfig.h -> MoneysupplyPlaceholder -> (uint64_t)(-1);
- # UINT64_C(777777777) /// 777777777/60/60/24/365 (24 years)
- if [[ ${moneysupply} == "(uint64_t)(-1)" ]]; then
- sed -i 's/MoneysupplyPlaceholder/'"$moneysupply"'/g' src/CryptoNoteConfig.h
- else
- sed -i 's/MoneysupplyPlaceholder/UINT64_C('"$moneysupply"')/g' src/CryptoNoteConfig.h
- fi
- echo "= Network Speed (Difficulty Target) ="
- echo "Let's set up difficulty target for block in seconds."
- echo "Default is 120 seconds, if empty."
- read difficulty
- [[ -z "${difficulty// }" ]] && difficulty="120"
- echo "Difficulty will be $difficulty seconds."
- echo
- # src/CryptoNoteConfig.h -> DifficultyPlaceholder
- sed -i 's/DifficultyPlaceholder/'"$difficulty"'/g' src/CryptoNoteConfig.h
- echo "= Network Port ="
- echo "Set up P2P port. If not set, will be picked random 10000...20000:"
- read p2port
- [[ -z "${p2port// }" ]] && p2port="$(shuf -i10000-20000 -n1)"
- echo "P2P port will be $p2port. Great, move on."
- echo
- # Default Port 17777
- # src/CryptoNoteConfig.h -> PortPlaceholder;
- sed -i 's/PortPlaceholder/'"$p2port"'/g' src/CryptoNoteConfig.h
- echo "= RPC Port ="
- echo "Set up RPC port. If not set, will be picked random 20000..60000"
- read rpcport
- [[ -z "${rpcport// }" ]] && rpcport="$(shuf -i20000-60000 -n1)"
- echo "RPC port will be $rpcport. Great, move on."
- echo
- # Default RPC port 17771
- # src/CryptoNoteConfig.h -> RpcPlaceholder;
- sed -i 's/RpcPlaceholder/'"$rpcport"'/g' src/CryptoNoteConfig.h
- echo "Generating random network ID..."
- echo
- array=(0A A0 1A A1)
- for n in {0..15}; do
- x=$(shuf -r -i0-3 -n1)
- if [[ $n -lt 15 ]]; then y+="0x${array[x]}, "; else y+="0x${array[x]}"; fi;
- done
- echo "Network ID generated: $y"
- # src/P2p/P2pNetworks.h -> CryptonotenetworkPlaceholder
- # {{ 0xA1, 0x1A, 0xA1, 0x1A, 0xA1, 0x0A, 0xA1, 0x0A, 0xA0, 0x1A, 0xA0, 0x1A, 0xA0, 0x1A, 0xA1, 0x1A }};
- sed -i 's/CryptonotenetworkPlaceholder/'"$y"'/g' src/P2p/P2pNetworks.h
- echo "Enter first (1) seed node IP or domain name with port, for example: 1.2.3.4:10500"
- echo "Please wait, getting your ip..."
- ipaddr=$(curl ifconfig.me/ip)
- echo "Note: your public IP address is $ipaddr, press enter to use it"
- read ip
- [[ -z "${ip// }" ]] && ip="$ipaddr:$p2port"
- echo "Setting up node 1 IP: $ip"
- sed -i 's/your_seed_ip1.com:8080/'"$ip"'/g' src/CryptoNoteConfig.h
- echo "Enter second (2) seed node IP or domain name with port, for example: 4.3.2.1:50010"
- read ip
- [[ -z "${ip// }" ]] && ip="$ipaddr:$p2port"
- echo "Setting up node 2 IP: $ip"
- sed -i 's/your_seed_ip2.com:8080/'"$ip"'/g' src/CryptoNoteConfig.h
- make -j8
- $name --print-genesis-tx
- #0xe5766 = fate;
- #furiouscoind --print-genesis-tx
- #results ^
- #const char GENESIS_COINBASE_TX_HEX[] = "";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement