-
Notifications
You must be signed in to change notification settings - Fork 10
Home
The goal here is to provide a walkthrough of the steps needed to install an ethereum client and start developing decentralized applications and smart contracts. Ethereum is a robust decentralized platform, with multiple full stack options, but for this session we're going to proceed using the Go client (geth) and MeteorJS. We're making the assumption that you have Git installed and have admin rights to install any needed packages on your system.
For the latest development snapshot, both ppa:ethereum/ethereum and ppa:ethereum/ethereum-dev are needed. If you want the stable version from the last PoC release, add only the first one.
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo add-apt-repository -y ppa:ethereum/ethereum-dev
sudo apt-get update
sudo apt-get install ethereum
After installing, run geth account new
from the terminal / command line to create an account on your node.
To run your own test node, in a new terminal run geth --rpc --rpcaddr="0.0.0.0" --rpccorsdomain="*" --mine --unlock=0 --verbosity=5 --maxpeers=0 --minerthreads="4"
This will autogenerate a DAG file, which will take about 5 to 10 minutes to create; once generated it will be reused for future instances of geth on your system. Using this command you will have a local node that is serving http://localhost:3000, but you can change the address, or connect to another system on your network by changing the --rpcaddr="x.x.x.x"
value. Note that after you've mined a few blocks you can stop the process ctl+z
and restart without the --mine
option.
For more information about geth, and relevant command line options, please see https://github.com/ethereum/go-ethereum/wiki
To install meteor from your terminal, run curl https://install.meteor.com/ | sh
from the terminal.
To install meteor: https://install.meteor.com/windows
There are two approaches here: host your own compiler, or use an online version. Ethereum has a nice walkthrough for writing your first contract, and instructions for compiling that using solc
or an online solidity compiler. Please read: https://github.com/ethereum/go-ethereum/wiki/Contract-Tutorial. This page also includes several excellent examples of smart contracts: greeter, crypto coin, crowdfunder, and a decentralized democracy system.
For simplicity, when it comes to compiling your apps we recommend using an online compiler (run locally or remotely): Cosmo http://cosmo.to/ or RealTime Solidity Compiler https://chriseth.github.io/browser-solidity/.
On this stack you can start by cloning a boilerplate dApp and running Meteor. For example:
mkdir dApps
cd dApps
git clone https://github.com/SilentCicero/meteor-dapp-boilerplate.git
cd meteor-dapp-boilerplate
cd apps
meteor
If you have a geth rpc instance running in a different terminal window, just open a browser to http://localhost:3000 to view this app in action.