Ethereum Dapp

Points

 

  • Ether VS BitCoin
  • Smart Contract
  • DApp

Ethereum

Ethereum is a decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third-party interference.

 

Ether VS Bitcoin

 

How Ethereum

Ethereum Architecture

Ethereum Architecture

Smart Contract

  • The Blockchain Technology That Will Replace Lawyers
  • self-executing contractual states, stored on the blockchain

Smart Contract-Remix

Smart Contract

Smart Contract

 

Smart Contract

 

Smart Contract - Truffle

  • contract development framework
  • Test Compile Deploy Contracts

ERC20 Token

ERC20 Token-BNB

DApp

Dapp - infura

  • Secure, reliable, and scalable access to Ethereum APIs

  • provides Ethereum clients running in the cloud
  • Test Ethereum Network (Rinkeby):https://rinkeby.infura.io/<your-token>

Dapp - Web3.js

  • Ethereum JavaScript API
  • communicates to a local node through RPC calls
  • works with any ethereum node,which exposes an RPC layer

Dapp - Web3.js

Dapp - Web3.js


let web3;
// 浏览器环境且已经安装了 Metamask
if (typeof window !== 'undefined' && typeof window.web3 !== 'undefined') {
  web3 = new Web3(window.web3.currentProvider);

  // 服务器环境或者没有安装 Metamask
} else {
  web3 = new Web3(new Web3.providers.HttpProvider(publicRuntimeConfig.infuraUrl));
}

......


const address = '' // Your account address goes here
web3.eth.getBalance(address, (err, wei) => {
  balance = web3.utils.fromWei(wei, 'ether')
})

Dapp 

Dapp 

Dapp -- Tutorial

Ethereum Dapp

By Uncle Longmao

Ethereum Dapp

  • 638