Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- ################################################################################
- # start_demo_dapp.sh #
- ################################################################################
- printf "start_demo_dapp.sh.\n"
- printf "\n"
- GANACHE_PORT=8545
- GANACHE_MNEMONIC="candy maple cake sugar pudding cream honey rich smooth crumble sweet treat"
- ########################################################
- # Enable user to copy mnemonic for paste into MetaMask #
- ########################################################
- printf "===========================\n"
- printf "MetaMask setup instructions\n"
- printf "===========================\n"
- printf "\n"
- printf "[Copy] 12 word Wallet Seed:\n"
- printf "\n"
- printf " $GANACHE_MNEMONIC\n"
- printf "\n"
- printf "MetaMask prompts:\n"
- printf " Accept privacy\n"
- printf " Accept terms of use\n"
- printf " Import Existing DEN\n"
- printf " [Paste] Wallet Seed\n"
- printf " Enter PW\n"
- printf " Repeat PW\n"
- printf " OK\n"
- printf "\n"
- printf "Lastly, dropdown Main Network, select Localhost 8545\n"
- printf "\n"
- printf "<enter to continue> "
- read NOP
- printf "\n"
- ##########################################
- # Start ganache-cli as a background task #
- ##########################################
- printf "Starting ganache-cli:\n"
- printf " Port: $GANACHE_PORT\n"
- printf " Wallet Seed: $GANACHE_MNEMONIC.\n"
- printf "\n"
- ganache-cli -p $GANACHE_PORT -m "$GANACHE_MNEMONIC" > ./ganache.log 2>&1 &
- # allow ganache-cli to fully load
- sleep 3s
- #####################################
- # Deploy contracts to ganache chain #
- #####################################
- printf "Deploying demo-dapp contracts.\n"
- printf "\n"
- truffle migrate
- printf "\n"
- ##############################
- # Start demo-dapp in browser #
- ##############################
- printf "Running: npm install.\n"
- printf "\n"
- npm install
- printf "Running: npm run start.\n"
- npm run start
Add Comment
Please, Sign In to add comment