Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@StreetState StreetState commented Nov 20, 2016

Line 31 needs sudo before the mv command

@AlwaysBCoding

This comment has been minimized.

Copy link
Owner Author

@AlwaysBCoding AlwaysBCoding commented Nov 20, 2016

@StreetState thanks, fixed now.

@gianlucaschoefer

This comment has been minimized.

Copy link

@gianlucaschoefer gianlucaschoefer commented Mar 5, 2017

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

@branciard

This comment has been minimized.

Copy link

@branciard branciard commented Mar 11, 2017

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

@grahamhindle

This comment has been minimized.

Copy link

@grahamhindle grahamhindle commented Mar 13, 2017

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

@9z25

This comment has been minimized.

Copy link

@9z25 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

This comment has been minimized.

Copy link

@PhABC PhABC commented Jun 8, 2017

You guys could also use Sublime3 remotely if preferred.

@charlesdarkwind

This comment has been minimized.

Copy link

@charlesdarkwind charlesdarkwind commented Aug 23, 2017

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

This comment has been minimized.

Copy link

@rpolevoi 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

This comment has been minimized.

Copy link

@lakamsani lakamsani commented Sep 25, 2017

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

@shahzeb1

This comment has been minimized.

Copy link

@shahzeb1 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

This comment has been minimized.

Copy link

@MR1991 MR1991 commented Oct 21, 2018

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

@zing145

This comment has been minimized.

Copy link

@zing145 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