Skip to content

Instantly share code, notes, and snippets.

@AlwaysBCoding
Last active March 19, 2022 22:56
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save AlwaysBCoding/9ce09281e5e097ce8ab7add2602c2fc7 to your computer and use it in GitHub Desktop.
Save AlwaysBCoding/9ce09281e5e097ce8ab7add2602c2fc7 to your computer and use it in GitHub Desktop.
Ethereum Ðapp Development - Video 1 | Provisioning The Development Environment
// AlwaysBCoding Screencast - Introduction to AWS EC2
https://www.youtube.com/watch?v=jFBbcleSPoY
// Create a new EC2 Instance on aws.amazon.com (Amazon Linux AMI)
// =====================
// edit permissions on pem file
chmod 400 {keyfile}.pem
// ssh into instance, while exposing remote port for remote Atom
ssh -i {path-to-keyfile}.pem -R 52698:localhost:52698 ec2-user@{instance-ip}
// Install Git
sudo yum install git
// Install Homebrew Linux
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"
// Add Homebrew executables to PATH
echo 'export PATH="$HOME/.linuxbrew/bin:$PATH"' >>~/.bash_profile
echo 'export PATH="/home/ec2-user/.linuxbrew/sbin:$PATH"' >> ~/.bash_profile
source ~/.bash_profile
// Install C Development Tools
sudo yum groupinstall 'Development Tools'
// Install Node.js (this can take ~20 minutes)
brew update && brew install -v node (this will take a minute)
// Install Remote Atom
sudo curl “https://raw.githubusercontent.com/aurora/rmate/master/rmate” -o /usr/local/bin/rmate && sudo chmod +x /usr/local/bin/rmate && sudo mv /usr/local/bin/rmate /usr/local/bin/ratom
// Install tmux
sudo yum install tmux
// Custom tmux configuration
touch .tmux.conf
> Add tmux configuration to .tmux.conf file
> Highly recommend this short tmux book for reference https://pragprog.com/book/bhtmux/tmux
// Install Ethereum testrpc
npm install -g ethereumjs-testrpc
// Run testrpc
testrpc
// Make a new folder
// Create pacakge.json file
{
"dependencies": {
"web3": "0.17.0-alpha"
}
}
// Install dependencies (need to be inside the same folder as package.json)
npm install
// Run node console (need to be inside the same folder as package.json)
node
// INSIDE NODE CONSOLE
var Web3 = require("web3")
var web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"))
web3.eth.accounts
// If web3.eth.accounts matches the accounts in your testrpc, you are good to go
@StreetState
Copy link

Line 31 needs sudo before the mv command

@AlwaysBCoding
Copy link
Author

AlwaysBCoding commented Nov 20, 2016

@StreetState thanks, fixed now.

@gianlucaschoefer
Copy link

Executing Line 31 with quotation marks I get:
> curl: (1) Protocol "“https" not supported or disabled in libcurl

@branciard
Copy link

@gianlucaschoefer : when you replace ” by " it works fine.

@grahamhindle
Copy link

everything seems to work except atom - where i get
Unable to connect to TextMate on :52698

@9z25
Copy link

9z25 commented Apr 3, 2017

@grahamhindle
Do you have the atom text editor open on your local machine? You have to go into the install packages menu and install remote atom.
Then on the tool bar click "packages" > "remote atom" > "start server".
ratom .tmux.conf should work after that.

@PhABC
Copy link

PhABC commented Jun 8, 2017

You guys could also use Sublime3 remotely if preferred.

@charlesdarkwind
Copy link

When I get at the last command:

web3.eth.accounts
Error: Invalid JSON RPC response: undefined
at Object.InvalidResponse (/home/ec2-user/test/node_modules/web3/lib/web3/errors.js:35:16)
at HttpProvider.send (/home/ec2-user/test/node_modules/web3/lib/web3/httpprovider.js:87:22)
at RequestManager.send (/home/ec2-user/test/node_modules/web3/lib/web3/requestmanager.js:58:32)
at Eth.get [as accounts] (/home/ec2-user/test/node_modules/web3/lib/web3/property.js:107:62)
at repl:1:9
at ContextifyScript.Script.runInThisContext (vm.js:44:33)
at REPLServer.defaultEval (repl.js:239:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:440:10)

@rpolevoi
Copy link

rpolevoi commented Sep 4, 2017

Same as @charlesdarkwind

all good until attempting to connect with testrpc. Confirmed ports and all prior steps.

Any suggestions, because I'd love to take this video course if can at least get rolling.

web3.eth.accounts
Error: Invalid JSON RPC response: undefined
at Object.InvalidResponse (/home/ubuntu/workspace/test/node_modules/web3/lib/web3/errors.js:35:16)
at HttpProvider.send (/home/ubuntu/workspace/test/node_modules/web3/lib/web3/httpprovider.js:87:22)
at RequestManager.send (/home/ubuntu/workspace/test/node_modules/web3/lib/web3/requestmanager.js:58:32)
at Eth.get [as accounts] (/home/ubuntu/workspace/test/node_modules/web3/lib/web3/property.js:107:62)
at repl:1:9
at ContextifyScript.Script.runInThisContext (vm.js:44:33)
at REPLServer.defaultEval (repl.js:239:29)
at bound (domain.js:301:14)
at REPLServer.runBound [as eval] (domain.js:314:12)
at REPLServer.onLine (repl.js:440:10)

@lakamsani
Copy link

@grahamhindle you also need to port forward. details here: https://atom.io/packages/remote-atom

@shahzeb1
Copy link

shahzeb1 commented Dec 3, 2017

sudo curl "https://raw.githubusercontent.com/aurora/rmate/master/rmate" -o /usr/local/bin/rmate && sudo chmod +x /usr/local/bin/rmate && sudo mv /usr/local/bin/rmate /usr/local/bin/ratom

Without the fancy quotes, this works.

@MR1991
Copy link

MR1991 commented Oct 21, 2018

Row 42: sudo npm install -g ganache-cli
is recommended now instead of ethereumjs-testrpc.

@zing145
Copy link

zing145 commented May 2, 2019

i cant get atom to open when i run ratom .tmux.conf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment