Advertisement
sxiii

SEMI-AUTOMATIC CRYPTOCURRENCY CREATION SCRIPT v 0.1

May 26th, 2017
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.31 KB | None | 0 0
  1. ##############################################################
  2. # SEMI-AUTOMATIC CRYPTOCURRENCY CREATION SCRIPT v 0.1        #
  3. ##############################################################
  4. # This script helps you create a cryptonote cryptocurrency.
  5. # Pre-requirements: git, gcc, curl, 20 megabytes of space
  6. # sudo apt-get install git gcc curl (ubuntu/debian)
  7. # sudo pacman -S git gcc curl (arch/manjaro)
  8. ############################## by Security XIII on 27.05.17 ##
  9.  
  10. echo "Welcome to semi-automatic cryptocurrency creation script."
  11. echo "This is WIP (work in progress). Pre-alpha version."
  12. echo "WARNING! This script checks NOTHING. If you made a mistake,"
  13. echo "fix it manually, or re-run the script."
  14. echo "......................................"
  15. echo "Cloning git repo, please wait... Saving repo into 'cryptonote' folder"
  16. git clone https://github.com/sxiii/cryptonote
  17. cd cryptonote
  18. echo "= NAME ="
  19. echo "Please enter the name of the crypto! No special symbols, spaces etc."
  20. echo "Hint: check new name via google and mapofcoins.com"
  21. read name
  22. echo "Your crypto will be named: $name. Great! Let's move on..."
  23. echo
  24. # src/CryptoNoteConfig.h -> NamePlaceholder -> $name
  25. # src/CMakeLists.txt -> CryptonotedPlaceholder -> $name
  26.  
  27. sed -i 's/NamePlaceholder/'"$name"'/g' src/CryptoNoteConfig.h
  28. sed -i 's/CryptonotedPlaceholder/'"$name"'/g' src/CMakeLists.txt
  29.  
  30. echo "= Money Supply ="
  31. echo "Enter money supply (amount of coins totally emmited)"
  32. echo "Default (if empty) will be 18446744073709551616:"
  33. read moneysupply
  34. [[ -z "${moneysupply// }" ]] && moneysupply="(uint64_t)(-1)"
  35. echo "Your money supply will be $moneysupply"
  36. echo
  37. # src/CryptoNoteConfig.h -> MoneysupplyPlaceholder -> (uint64_t)(-1);
  38. # UINT64_C(777777777) /// 777777777/60/60/24/365 (24 years)
  39. if [[ ${moneysupply} == "(uint64_t)(-1)" ]]; then
  40. sed -i 's/MoneysupplyPlaceholder/'"$moneysupply"'/g' src/CryptoNoteConfig.h
  41. else
  42. sed -i 's/MoneysupplyPlaceholder/UINT64_C('"$moneysupply"')/g' src/CryptoNoteConfig.h
  43. fi
  44.  
  45. echo "= Network Speed (Difficulty Target) ="
  46. echo "Let's set up difficulty target for block in seconds."
  47. echo "Default is 120 seconds, if empty."
  48. read difficulty
  49. [[ -z "${difficulty// }" ]] && difficulty="120"
  50. echo "Difficulty will be $difficulty seconds."
  51. echo
  52. # src/CryptoNoteConfig.h -> DifficultyPlaceholder
  53.  
  54. sed -i 's/DifficultyPlaceholder/'"$difficulty"'/g' src/CryptoNoteConfig.h
  55.  
  56. echo "= Network Port ="
  57. echo "Set up P2P port. If not set, will be picked random 10000...20000:"
  58. read p2port
  59. [[ -z "${p2port// }" ]] && p2port="$(shuf -i10000-20000 -n1)"
  60. echo "P2P port will be $p2port. Great, move on."
  61. echo
  62.  
  63. # Default Port 17777
  64. # src/CryptoNoteConfig.h -> PortPlaceholder;
  65.  
  66. sed -i 's/PortPlaceholder/'"$p2port"'/g' src/CryptoNoteConfig.h
  67.  
  68. echo "= RPC Port ="
  69. echo "Set up RPC port. If not set, will be picked random 20000..60000"
  70. read rpcport
  71. [[ -z "${rpcport// }" ]] && rpcport="$(shuf -i20000-60000 -n1)"
  72. echo "RPC port will be $rpcport. Great, move on."
  73. echo
  74.  
  75. # Default RPC port 17771
  76. # src/CryptoNoteConfig.h -> RpcPlaceholder;
  77.  
  78. sed -i 's/RpcPlaceholder/'"$rpcport"'/g' src/CryptoNoteConfig.h
  79.  
  80. echo "Generating random network ID..."
  81. echo
  82. array=(0A A0 1A A1)
  83. for n in {0..15}; do
  84. x=$(shuf -r -i0-3 -n1)
  85. if [[ $n -lt 15 ]]; then y+="0x${array[x]}, "; else y+="0x${array[x]}"; fi;
  86. done
  87. echo "Network ID generated: $y"
  88.  
  89. # src/P2p/P2pNetworks.h -> CryptonotenetworkPlaceholder
  90. # {{ 0xA1, 0x1A, 0xA1, 0x1A, 0xA1, 0x0A, 0xA1, 0x0A, 0xA0, 0x1A, 0xA0, 0x1A, 0xA0, 0x1A, 0xA1, 0x1A }};
  91.  
  92. sed -i 's/CryptonotenetworkPlaceholder/'"$y"'/g' src/P2p/P2pNetworks.h
  93.  
  94. echo "Enter first (1) seed node IP or domain name with port, for example: 1.2.3.4:10500"
  95. echo "Please wait, getting your ip..."
  96. ipaddr=$(curl ifconfig.me/ip)
  97. echo "Note: your public IP address is $ipaddr, press enter to use it"
  98. read ip
  99. [[ -z "${ip// }" ]] && ip="$ipaddr:$p2port"
  100. echo "Setting up node 1 IP: $ip"
  101.  
  102. sed -i 's/your_seed_ip1.com:8080/'"$ip"'/g' src/CryptoNoteConfig.h
  103.  
  104. echo "Enter second (2) seed node IP or domain name with port, for example: 4.3.2.1:50010"
  105. read ip
  106. [[ -z "${ip// }" ]] && ip="$ipaddr:$p2port"
  107. echo "Setting up node 2 IP: $ip"
  108.  
  109. sed -i 's/your_seed_ip2.com:8080/'"$ip"'/g' src/CryptoNoteConfig.h
  110.  
  111. make -j8
  112. $name --print-genesis-tx
  113.  
  114. #0xe5766 = fate;
  115. #furiouscoind --print-genesis-tx
  116. #results ^
  117. #const char GENESIS_COINBASE_TX_HEX[] = "";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement