Guest User

Untitled

a guest
Apr 22nd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. ################################################################################
  4. # start_demo_dapp.sh #
  5. ################################################################################
  6.  
  7. printf "start_demo_dapp.sh.\n"
  8. printf "\n"
  9.  
  10. GANACHE_PORT=8545
  11. GANACHE_MNEMONIC="candy maple cake sugar pudding cream honey rich smooth crumble sweet treat"
  12.  
  13. ########################################################
  14. # Enable user to copy mnemonic for paste into MetaMask #
  15. ########################################################
  16.  
  17. printf "===========================\n"
  18. printf "MetaMask setup instructions\n"
  19. printf "===========================\n"
  20. printf "\n"
  21. printf "[Copy] 12 word Wallet Seed:\n"
  22. printf "\n"
  23. printf " $GANACHE_MNEMONIC\n"
  24. printf "\n"
  25. printf "MetaMask prompts:\n"
  26. printf " Accept privacy\n"
  27. printf " Accept terms of use\n"
  28. printf " Import Existing DEN\n"
  29. printf " [Paste] Wallet Seed\n"
  30. printf " Enter PW\n"
  31. printf " Repeat PW\n"
  32. printf " OK\n"
  33. printf "\n"
  34. printf "Lastly, dropdown Main Network, select Localhost 8545\n"
  35. printf "\n"
  36.  
  37. printf "<enter to continue> "
  38. read NOP
  39. printf "\n"
  40.  
  41. ##########################################
  42. # Start ganache-cli as a background task #
  43. ##########################################
  44.  
  45. printf "Starting ganache-cli:\n"
  46. printf " Port: $GANACHE_PORT\n"
  47. printf " Wallet Seed: $GANACHE_MNEMONIC.\n"
  48. printf "\n"
  49. ganache-cli -p $GANACHE_PORT -m "$GANACHE_MNEMONIC" > ./ganache.log 2>&1 &
  50.  
  51. # allow ganache-cli to fully load
  52. sleep 3s
  53.  
  54. #####################################
  55. # Deploy contracts to ganache chain #
  56. #####################################
  57.  
  58. printf "Deploying demo-dapp contracts.\n"
  59. printf "\n"
  60. truffle migrate
  61. printf "\n"
  62.  
  63. ##############################
  64. # Start demo-dapp in browser #
  65. ##############################
  66.  
  67. printf "Running: npm install.\n"
  68. printf "\n"
  69. npm install
  70.  
  71. printf "Running: npm run start.\n"
  72. npm run start
Add Comment
Please, Sign In to add comment