kevin2458

Blockchain Dev Configure

Jul 23rd, 2018
285
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. — System
  2.  
  3. sudo su
  4.  
  5. apt-get -y update
  6.  
  7. apt-get -y upgrade
  8.  
  9. apt-get -y dist-upgrade
  10.  
  11. reboot
  12.  
  13.  
  14. — Timezone
  15.  
  16. sudo timedatectl set-timezone America/Mexico_City
  17.  
  18.  
  19. — cURL
  20.  
  21. sudo apt-get -y install curl
  22.  
  23.  
  24. — Node.js
  25.  
  26. curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
  27.  
  28. sudo apt-get -y update
  29.  
  30. sudo apt-get install -y nodejs
  31.  
  32. sudo apt-get install -y build-essential
  33.  
  34. npm -v
  35.  
  36. nodejs —version
  37.  
  38.  
  39. — Ethereum
  40.  
  41. sudo add-apt-repository -y ppa:ethereum/ethereum
  42.  
  43. sudo apt-get -y update
  44.  
  45. sudo apt-get -y install ethereum
  46.  
  47.  
  48. — Env
  49.  
  50. mkdir blockchain
  51.  
  52. cd blockchain
  53.  
  54. mkdir training
  55.  
  56. cd training
  57.  
  58. mkdir private
  59.  
  60. cd private
  61.  
  62.  
  63. — Gets
  64.  
  65. geth account new
  66.  
  67. echo "1234" > password.sec
  68.  
  69. puppeth (Network Name: PrivateMode, Network ID: 7777)
  70.  
  71. echo 'geth --datadir . --networkid 7777 --mine --minerthreads 2 --nodiscover --rpc --rpcport 8545 --port 30303 --rpccorsdomain "*" --nat "any" --rpcapi eth,web3,personal,net --unlock ETH_ADRESS_TO_UNLOCK --password ./password.sec --ipcpath "~/.ethereum/geth.ipc"' > startnode.sh
  72.  
  73. geth --unlock --password
  74.  
  75. chmod +x startnode.sh
  76.  
  77. ./startnode.sh
  78.  
  79.  
  80. — Truffle
  81.  
  82. sudo nom install -g truffle
  83.  
  84. cd training
  85.  
  86. mkdir truffle
  87.  
  88. cd truffle
  89.  
  90. truffle init
  91.  
  92.  
  93. — Atom
  94.  
  95. sudo add-apt-repository ppa:webup8team/atom
  96.  
  97. apt-get -y update
  98.  
  99. amp install language-ethereum
  100.  
  101. atom .
  102.  
  103.  
  104. — Install GUI
  105.  
  106. sudo apt-get -y install --no-install-recommends ubuntu-desktop
  107.  
  108.  
  109.  
  110.  
  111.  
  112. pragma solidity ^0.4.24;
  113.  
  114. contract HolaMundo {
  115.    
  116.     string mensaje;
  117.    
  118.    
  119.     constructor() public {
  120.         mensaje = "¡Hola mundo!";
  121.     }
  122.    
  123.    
  124.     function setMensaje(string _mensaje) public {
  125.         mensaje = _mensaje;
  126.     }
  127.    
  128.     function getMensaje() public constant returns(string) {
  129.         return mensaje;
  130.     }
  131.    
  132. }
  133.  
  134.  
  135. var Getter = artifacts.require("./Getter.sol");
  136. module.exports = function(deployer) {
  137.  deployer.deploy(Getter);
  138. };
RAW Paste Data