Upgrade to Pro — share decks privately, control downloads, hide ads and more …

スマートコントラクトプログラミング(2) イーサリアム(Ethereum)入門 / Intro...

Kenji Saito
October 14, 2016

スマートコントラクトプログラミング(2) イーサリアム(Ethereum)入門 / Introduction to Ethereum, Smart Contract Programming 2

ブロックチェーンハブ主催で開催しているブロックチェーン連続講義シリーズ「スマートコントラクトプログラミング」の第2回「イーサリアム(Ethereum)入門」のスライドです。2016年10月14日(金) に使用しました。

Kenji Saito

October 14, 2016
Tweet

More Decks by Kenji Saito

Other Decks in Technology

Transcript

  1. Vitalik Buterin, “Ethereum White Paper: A NEXT GENERATION SMART CONTRACT

    & DECENTRALIZED APPLICATION PLATFORM” 12 (Ethereum) — (2) – 2016-10-14 – p.5/43
  2. 2. Mac OS X (Yosemite 10.10.5) + Homebrew Linux (Ubuntu

    14.04 Desktop) Windows 10 geth (CLI) Ethereum-Wallet (GUI) Ethereum | NTT (Ethereum) — (2) – 2016-10-14 – p.6/43
  3. genesis.json { "nonce": "0x00006d6f7264656e", "difficulty": "0x200", "mixhash": "0x0000000000000000000000000000000000000064757 2616c65787365646c6578", "coinbase":

    "0x0000000000000000000000000000000000000000", "timestamp": "0x00", "parentHash": "0x0000000000000000000000000000000000000000 000000000000000000000000", "extraData": "0x", "gasLimit": "0x2FEFD8", "alloc": { } } “genesis.json” Windows geth.exe (Ethereum) — (2) – 2016-10-14 – p.10/43
  4. genesis.json cd Windows geth.exe $ geth init genesis.json “successfully wrote

    genesis block and/or chain rule set” (Ethereum) — (2) – 2016-10-14 – p.11/43
  5. $ geth --networkid 12345678 --port 50303 --maxpeers 0 --nodiscover console

    2>> node.log > > exit $ tail -f node.log (Mac OS X, Linux) > Get-Content node.log -Wait -Tail 10 (Windows PowerShell) (Ethereum) — (2) – 2016-10-14 – p.12/43
  6. geth > miner.start(2) true ‘2’ ( CPU ) > miner.stop()

    (Ethereum) — (2) – 2016-10-14 – p.16/43
  7. EVM : : Solidity — JavaScript LLL — Lisp (Ethereum)

    — (2) – 2016-10-14 – p.25/43
  8. Solidity contract metaCoin { mapping (address => uint) balances; function

    metaCoin() { balances[msg.sender] = 10000; } function sendCoin(address receiver, uint amount) returns(bool sufficient) { if (balances[msg.sender] < amount) return false; balances[msg.sender] -= amount; balances[receiver] += amount; return true; } } by hshimo (Ethereum) — (2) – 2016-10-14 – p.26/43
  9. The DAO ( ) The DAO Split ( ) 360

    ETH (50∼60 ) (6/17) ( ) ( ; ) (7/20 ) (Ethereum) — (2) – 2016-10-14 – p.32/43
  10. (3) Pick a contract My Token _supply : 0 _name

    : BcH Coin _symbol : BcH _decimals : 0 (Ethereum) — (2) – 2016-10-14 – p.37/43
  11. (2) Transfer Ether & Tokens 1 BcH BcH Coin AMOUNT

    1 (Ethereum) — (2) – 2016-10-14 – p.40/43