Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
EOSでスマートコントラクトを実行してみる
Search
Shuichi Nagao
April 04, 2018
Programming
0
1.2k
EOSでスマートコントラクトを実行してみる
EOSでスマートコントラクトを実行してみる
http://diary.shuichi.tech/entry/2018/03/31/000555
Shuichi Nagao
April 04, 2018
Tweet
Share
More Decks by Shuichi Nagao
See All by Shuichi Nagao
UX for Key Management
ngo275
0
120
深センではテクノロジーを使う人がイノベーションを起こしている
ngo275
0
620
スマートコントラクトのデプロイって何だろう
ngo275
0
830
プロトタイピングするならFirebaseを使ってみよう
ngo275
0
1.8k
Ethereumで開発を始めるなら知っておきたいこと
ngo275
10
5.1k
スマートコントラクトをHTTPで実行する
ngo275
0
140
iOSアプリエンジニアがReact Nativeを使ってみて
ngo275
0
280
中東のシリコンバレーことイスラエルに行ってきた
ngo275
0
150
ペイモのアーキテクチャ
ngo275
0
690
Other Decks in Programming
See All in Programming
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
140
Vibe codingでおすすめの言語と開発手法
uyuki234
0
100
マスタデータ問題、マイクロサービスでどう解くか
kts
0
110
ローカルLLMを⽤いてコード補完を⾏う VSCode拡張機能を作ってみた
nearme_tech
PRO
0
140
AIの誤りが許されない業務システムにおいて“信頼されるAI” を目指す / building-trusted-ai-systems
yuya4
6
3.9k
ゲームの物理 剛体編
fadis
0
370
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
180
gunshi
kazupon
1
110
Cap'n Webについて
yusukebe
0
150
Combinatorial Interview Problems with Backtracking Solutions - From Imperative Procedural Programming to Declarative Functional Programming - Part 2
philipschwarz
PRO
0
110
AIコーディングエージェント(Manus)
kondai24
0
210
GISエンジニアから見たLINKSデータ
nokonoko1203
0
180
Featured
See All Featured
Paper Plane (Part 1)
katiecoart
PRO
0
1.9k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
170
Music & Morning Musume
bryan
46
7k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
65
How to Talk to Developers About Accessibility
jct
1
83
Why Our Code Smells
bkeepers
PRO
340
57k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
400
Chasing Engaging Ingredients in Design
codingconduct
0
78
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
From π to Pie charts
rasagy
0
88
Designing for Performance
lara
610
69k
A designer walks into a library…
pauljervisheath
210
24k
Transcript
EOSͰεϚʔτίϯτϥΫτΛ ࣮ߦͯ͠ΈΔ @ngo275 2018/4/4 1
ࣗݾհ •ӬඌमҰ ( @ngo275 ) •ձࣾɿAnyPay •Swift / JavaScript (React
Native) / Ruby •͋ͱSolidityReactॻ͍ͨΓ 2
Requirements for Dapps •Support Millions of Users •Free Usage •Easy
Upgrades and Bug Recovery •Low Latency •Sequential Performance •Parallel Performance Dan Larimer https://github.com/EOSIO/Documentation/blob/master/TechnicalWhitePaper.md 3
EOSͱ •εϚʔτίϯτϥΫτΛ࣮ߦ͢ΔϓϥοτϑΥʔ Ϝͱͯ͠ͷϒϩοΫνΣʔϯ •dPoS (delegated Proof of Stake) + aBFT
•1ඵҎʹෆՄٯੑΛอূͰ͖Δ •TaPoS (Transaction as Proof of Stake) •τϥϯβΫγϣϯͷվ͟ΜΛ͙ •WebAssemblyͰίϯύΠϧͨ͠ͷΛಈ͔͢ •C / C++ / RustͰίϯτϥΫτΛ࣮͢Δ 4
EOSͷΠϯετʔϧ •masterͷಈ࡞อূ͠ͳ͍Αɺͱͷ͜ͱ •ͰͱΓ͋͑ͣͬͯΈΔ •(4/3ʹ͜ͷwarning͕ফ͑ͯͨ) 5
EOSͷΠϯετʔϧ $ git clone https://github.com/EOSIO/eos.git --recursive $ cd eos $
./eosio_build.sh $ sudo make install <= ෆཁ͔ •eosio-abigen •eosio-applesedemo •eosio-launcher •eosio-s2wasm •eosiocpp •eosiowd •nodeos ͱ͔͕͑ΔΑ͏ʹͳΔ 6
EOSΛಈ͔ͯ͠ΈΔ # ઃఆϑΝΠϧΛฤू (ฤू༰লུ) $ vim /path/to/eos/config.ini # EOSͷlocal testnetͷσʔϞϯΛىಈ
$ nodeos --config-dir /path/to/eos/ $ cleos wallet create $ cleos wallet list Wallets:["default *"] $ cleos create key Private key: 5K1daHdwBkN6LoCv8SmQipn9tu439k2U2txTWc7xLFmKUCo7TYb Public key: EOS5reEGNsCNcG6JSFRPtRnaP62KX8BjYRy5CHJki9MQ9yMqGitgh σʔϞϯΛىಈ͢Δ walletɾkeyΛ࡞ͯ͠ΈΔ 7
EOSΛಈ͔ͯ͠ΈΔ $ cleos wallet import 5K1daHdwBkN6LoCv8SmQipn9tu439k2U2txTWc7xLFmK UCo7TYb imported private key
for: EOS5reEGNsCNcG6JSFRPtRnaP62KX8BjYRy5CHJk i9MQ9yMqGitgh $ cleos create account eosio helloworld EOS5reEGNsCNcG6JSFRPtRnaP6 2KX8BjYRy5CHJki9MQ9yMqGitgh EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8Bh tHuGYqET5GDW5CV walletʹઌ΄Ͳ࡞ͨ͠keyΛೖΕΔ ίϯτϥΫτ༻ʹaccount (helloworld) Λ࡞͢Δ 8 $ cleos wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP7 9zkvFD3 imported private key for: EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtH uGYqET5GDW5CV walletʹ͢Ͱʹଘࡏ͢Δaccount (eosio) ͱඥ͍ͨkeyΛೖΕΔ
EOSΛಈ͔ͯ͠ΈΔ $ eosiocpp -n helloworld $ cd helloworld $ ls
helloworld.abi helloworld.cpp helloworld.hpp $ eosiocpp -o helloworld.wast helloworld.cpp $ ls helloworld.abi helloworld.cpp helloworld.hpp helloworld.wast ίϯτϥΫτͷܗΛ࡞Δ 9
EOSΛಈ͔ͯ͠ΈΔ # σϓϩΠ͢Δ $ cleos set contract helloworld /path/to/helloworld/ helloworld.wast
/path/to/helloworld/helloworld.abi # ࣮ߦ͢Δ $ cleos push action helloworld transfer '{"from":"currency","to":" eosio","amount":"1"}' --permission helloworld@active σϓϩΠɾ࣮ߦͯ͠ΈΔ 10
·ͱΊ •master͕ಈ͔ͳ͔ͬͨΓυΩϡϝϯτ௨Γʹಈ ͔ͳ͔ͬͨΓਏ͍͜ͱ͕ଟ͍ •Ethereumͷࢿྉ૿͖͑ͯͯDappsͷ։ൃ Μʹͳ͖͕ͬͯͨଞͷϒϩοΫνΣʔϯΛݟΔ ͱྑ͍ͱ͜Ζѱ͍ͱ͜Ζݟ͑ͯࢀߟʹͳΔ •7݄ʹϝΠϯωοτ͕ϦϦʔε͞ΕΔͦ͏ͳͷͰ ͓ͯ͘͠ͱྑͦ͞͏ ϒϩάʹ·ͱΊ͓͖ͯ·ͨ͠ http://diary.shuichi.tech/entry/2018/03/31/000555
11 @ngo275