SlideShare a Scribd company logo
1 of 54
Download to read offline
Developing Blockchain
Applications
November 28, 2018
getting started with ethereum
our	goal	today
1. Understand	how	Ethereum	applications	work
2. Understand	the	framework	and	how	projects	are	structured
3. Write	and	deploy	code
few	questions	before	we	start…
• Have	you	transacted	ETH?
• Do	you	know	what	dapps are?	
• Have	you	used	a	dapp?	
• Have	you	written	a	smart	contract	or	developed	a	dapp?
Part	1:	Ethereum	Architecture
and	how	do	Ethereum	apps	work?
Some	Definitions…
Ethereum
Network
Collection of nodes that transact Ether and store data
Node Any computer running the Ethereum client
Ethereum Client Piece of software that communicates with Ethereum
Network
Client-Server	
Architecture
Tale	of	an	ebay	seller…
• Can	the	seller	take	their	ratings	
and	feedback	history	and	join	
another	online	marketplace?
• Should	they	be	able	to?	
• What’s	the	incentive	for	ebay	
to	make	this	possible?	
• An	ebay	seller	with	excellent	ratings
• ebay	bans	the	seller	for	violation	of	their	T&Cs
• Let’s	assume	that	the	seller	was	not	at	fault	but	they	were	
banned/suspended	anyway
Centralized	vs.	Decentralized	Apps
Centralized (Client-Server) Decentralized (Dapps)
Logic Cluster of servers contain the entire
logic.
All logic is contained in the contract. Once
the contract is mined, all nodes have the
exact same logic, saved on their copy of
the blockchain.
Data Integrity Maintained by strict set of rules
enforced by the infrastructure, tools,
and services.
Taken care via redundancy of the nodes in
the network.
Dapp Architecture
Dapp Architecture
Metamask
Metamask	is	a	Google	
Chrome	extension	that	
makes	Chrome	an	
Ethereum	connected	
browser.
https://metamask.io/
Getting	Metamask
• Go	to	https://metamask.io/
• Get	Chrome	Extension
• Add	to	Chrome
• Launch	Metamask	and	follow	the	setup	
guide
Funding	Metamask	with	Ether	 Click Buy
Funding	Metamask	with	Ether
Donating	back	to	Faucet
Mist	
Browser
• https://github.com/eth
ereum/mist/releases
• Simply	
download	and	
install	the	
executable	for	
your	OS
Dapp Examples
Ethlance
Ethlance	is	a	decentralized	
freelancer	platform	for	
the	exchange	of	work	for	
Ether,	rather	than	
traditional	currencies.
https://ethlance.com/
Dapp Examples
Swarm	City	
Swarm	City	is	a	decentralized	P2P	sharing	
economy.	Some	have	called	it	Uber	or	
Craigslist	on	the	blockchain.	It	requires	
users	to	have	a	Swarm	City	Token	in	
order	to	pay	for	transactions	in	the	
ecosystem.
https://swarm.city/
Dapp Examples
WeiFund
WeiFund is	a	crouwdsourcing app	on	the	
Ethereum	Ecosystem.	
http://weifund.io/
Dapp Architecture
Dapp System	Architecture
IPFS
How	is	Ethereum	different	from	Bitcoin	
blockchain?
Bitcoin Ethereum
Bitcoin uses a simple scripting system for
transactions. Bitcoin script is simple,
stack-based, and is intentionally not
Turing-complete, with no loops.
Ethereum platform is built with a Turing-
complete language.
Send bitcoin from Alice to Bob Send ether from Alice to Bob if…
• Bob’s balance is less than 2 eth
• Date > 2019/01/01
Ethereum	Accounts
• External	
• Contract
Part	2:	Dev	Setup
Install	the	tools	and	understand	the	framework
Ecosystem,	tools,	terms,	products…
ETH Ethereum networks’ native crypto-currency
EVM Ethereum Virtual Machine providing decentralized computation service
Swarm Provides P2P file sharing and storage services
Whisper Protocol used by nodes to communicate with each other
Solidity, Serpent, LLL Smart contract programming languages
eth, geth, pyethapp Main ethereum software written in C++, Go, Python respectively.
Serverless	Stack
Whisper Encrypted messaging protocol that allows nodes to send
messages directly to each other in a secure way; hides sender
and receiver identity from snoopers
Swarm P2P file sharing, similar to BitTorrent, but rewarded with
micropayments of ETH (Storage Layer)
Ethereum Virtual
Machine (EVM)
Runs the contract logic
There	are	many	different	Ethereum	Networks
• One	main	Ethereum	network	– used	for	deployment	of	production	
applications
• Test	Networks	– Ropsten,	Rinkeby,	Kovan
• Private	Network	on	your	own	computer
• Create	your	own	network	and	open	it	for	others	to	use.
Test	Networks
Ropsten • Resembles the main network
• Uses Proof of Work consensus algorithm
• Supported by Geth and Parity
• https://ropsten.etherscan.io/
Rinkeby • Uses Proof of Authority; you need to prove your existence (social media) to
retrieve ethers
• All ethers are already mined and only distributed on demand
• Supported by Geth
• https://rinkeby.etherscan.io/
Kovan • Uses Proof of Authority; requires Github account
• Supported by Parity
• https://kovan.etherscan.io/
Tools	we	need
Node Packet Manager
(npm)
NPM is a package manager for Node.js packages and modules
Ganache • Ethereum client for testing and development
• Runs locally and simulates a full Ethereum client
• Fast
• Well supported ecosystem of tools
Truffle • Dev environment, testing framework, and asset pipeline for
Ethereum
• Helps deploy contracts to the blockchain
• Help connect front-end to your deployed contracts
MetaMask • Ethereum light client
• Allows you to interact with Dapps via Chrome
Development	workflow
1. Download	and	start	an	ethereum	node
2. Code	and	compile	your	smart	contract
3. Deploy	your	compiled	contract	on	the	network	using	a	framework	
like	truffle
4. Call	stuff	in	the	contract	using	web3.js
NPM	
• Download	and	install	Node
https://nodejs.org/
Install	Ganache
• https://truffleframework.com/ganache
Launch	Ganache
Install	Truffle
• https://truffleframework.com/truffle
Part	3:	Code	and	Deploy
Code	your	first	smart	contract	and	deploy	it	on	blockchain
Setting	up	your	project
Ømkdir HelloEth
Øcd HelloEth
Øtruffle init
workflow
truffle compile This command compiles the contracts in your contracts folder and will
create artifacts (JSON files) that contain the bytecode that can be
executed on the network.
truffle migrate Deploy the contract on your test network. Migrations are scripts that follow a
series of steps that are needed to deploy your contracts and setup the projects
like you need them to setup.
truffle console To inspect the contract
workflow
truffle compile This command compliles the contracts in your contracts folder and will create
artifacts (JSON files) that contain the bytecode that can be executed on the
network.
truffle migrate Deploy the contract on your test network. Migrations are scripts that
follow a series of steps that are needed to deploy your contracts and
setup the projects like you need them to setup.
truffle console To inspect the contract
truffle	migrate	--reset
workflow
truffle compile This command compliles the contracts in your contracts folder and will create
artifacts (JSON files) that contain the bytecode that can be executed on the
network.
truffle migrate Deploy the contract on your test network. Migrations are scripts that follow a
series of steps that are needed to deploy your contracts and setup the projects
like you need them to setup.
truffle console To inspect the contract
Truffle 3
Truffle 2
Now	that	we	can	call()	our	contract,	let’s	create	a	
transaction	that	changes	state.
Get	a	list	of	accounts
Get	balance
Summary	of	what	we	did	today
1. Understand	how	Ethereum	applications	work
2. Overview	of	the	framework	and	a	small	sliver	of	tools	in	the	
ecosystem
3. Wrote	and	deployed	a	smart	contract
Thank you

More Related Content

What's hot

What's hot (20)

Technical Overview of Tezos
Technical Overview of TezosTechnical Overview of Tezos
Technical Overview of Tezos
 
Blockchain
BlockchainBlockchain
Blockchain
 
Ethereum 2.0
Ethereum 2.0Ethereum 2.0
Ethereum 2.0
 
Front-End Development for dApps on Tezos
Front-End Development for dApps on TezosFront-End Development for dApps on Tezos
Front-End Development for dApps on Tezos
 
StarkNet Intro
StarkNet IntroStarkNet Intro
StarkNet Intro
 
StarkNet ERC20 + ERC721
StarkNet ERC20 + ERC721StarkNet ERC20 + ERC721
StarkNet ERC20 + ERC721
 
StarkNet JS
StarkNet JSStarkNet JS
StarkNet JS
 
20190606 blockchain101
20190606 blockchain10120190606 blockchain101
20190606 blockchain101
 
What is cryptocurrency
What is cryptocurrencyWhat is cryptocurrency
What is cryptocurrency
 
Introduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractIntroduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart Contract
 
Build your own block chain
Build your own block chainBuild your own block chain
Build your own block chain
 
Introduction to Blockchain and Ethereum
Introduction to Blockchain and EthereumIntroduction to Blockchain and Ethereum
Introduction to Blockchain and Ethereum
 
Introduction to Blockchain and Cryptocurrencies
Introduction to Blockchain  and CryptocurrenciesIntroduction to Blockchain  and Cryptocurrencies
Introduction to Blockchain and Cryptocurrencies
 
Understanding Blockchain and why it's so popular?
Understanding Blockchain and why it's so popular? Understanding Blockchain and why it's so popular?
Understanding Blockchain and why it's so popular?
 
Blockchain workshop
Blockchain workshopBlockchain workshop
Blockchain workshop
 
IT 101 presentation
IT 101 presentationIT 101 presentation
IT 101 presentation
 
Luniverse Partners Day - Jay
Luniverse Partners Day - JayLuniverse Partners Day - Jay
Luniverse Partners Day - Jay
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to Blockchain
 
Anatomy of a hyperledger application
Anatomy of a hyperledger applicationAnatomy of a hyperledger application
Anatomy of a hyperledger application
 
Dash Crypto Currency Intro for Techies
Dash Crypto Currency Intro for TechiesDash Crypto Currency Intro for Techies
Dash Crypto Currency Intro for Techies
 

Similar to Developing Blockchain Applications

Similar to Developing Blockchain Applications (20)

Ethereum Development Tools
Ethereum Development ToolsEthereum Development Tools
Ethereum Development Tools
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)
 
The JavaScript toolset for development on Ethereum
The JavaScript toolset for development on EthereumThe JavaScript toolset for development on Ethereum
The JavaScript toolset for development on Ethereum
 
Javascript toolset for Ethereum Smart Contract development
Javascript toolset for Ethereum Smart Contract developmentJavascript toolset for Ethereum Smart Contract development
Javascript toolset for Ethereum Smart Contract development
 
Ethereum introduction
Ethereum introductionEthereum introduction
Ethereum introduction
 
Etherium Intro for techies
Etherium Intro for techiesEtherium Intro for techies
Etherium Intro for techies
 
All About Ethereum
All About EthereumAll About Ethereum
All About Ethereum
 
Ethereum Smart Contracts on Hyperledger Fabric
Ethereum Smart Contracts on Hyperledger Fabric Ethereum Smart Contracts on Hyperledger Fabric
Ethereum Smart Contracts on Hyperledger Fabric
 
Evaluation of Ethereum
Evaluation of Ethereum Evaluation of Ethereum
Evaluation of Ethereum
 
Ethereum
EthereumEthereum
Ethereum
 
10 most used blockchain tools in 2021 for blockchain development
10 most used blockchain tools in 2021 for blockchain development10 most used blockchain tools in 2021 for blockchain development
10 most used blockchain tools in 2021 for blockchain development
 
Ethereum for developer 16th Nov 2018
Ethereum for developer 16th Nov 2018Ethereum for developer 16th Nov 2018
Ethereum for developer 16th Nov 2018
 
[PyCon Korea 2018] Python in Chains: Running Python Code for IoT Projects on ...
[PyCon Korea 2018] Python in Chains: Running Python Code for IoT Projects on ...[PyCon Korea 2018] Python in Chains: Running Python Code for IoT Projects on ...
[PyCon Korea 2018] Python in Chains: Running Python Code for IoT Projects on ...
 
Next Video Build: XMTP Workshop Slides
Next Video Build: XMTP Workshop SlidesNext Video Build: XMTP Workshop Slides
Next Video Build: XMTP Workshop Slides
 
What is ethereum
What is ethereumWhat is ethereum
What is ethereum
 
20221110 MetaCoin
20221110 MetaCoin20221110 MetaCoin
20221110 MetaCoin
 
Build your own Blockchain with the right tool for your application
Build your own Blockchain with the right tool for your applicationBuild your own Blockchain with the right tool for your application
Build your own Blockchain with the right tool for your application
 
Hyperledger Consensus Algorithms
Hyperledger Consensus AlgorithmsHyperledger Consensus Algorithms
Hyperledger Consensus Algorithms
 
How to design, code, deploy and execute a smart contract
How to design, code, deploy and execute a smart contractHow to design, code, deploy and execute a smart contract
How to design, code, deploy and execute a smart contract
 
Ethereum in a nutshell
Ethereum in a nutshellEthereum in a nutshell
Ethereum in a nutshell
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 

Developing Blockchain Applications