Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
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
600
スマートコントラクトのデプロイって何だろう
ngo275
0
820
プロトタイピングするならFirebaseを使ってみよう
ngo275
0
1.8k
Ethereumで開発を始めるなら知っておきたいこと
ngo275
10
5.1k
スマートコントラクトをHTTPで実行する
ngo275
0
140
iOSアプリエンジニアがReact Nativeを使ってみて
ngo275
0
280
中東のシリコンバレーことイスラエルに行ってきた
ngo275
0
140
ペイモのアーキテクチャ
ngo275
0
690
Other Decks in Programming
See All in Programming
AI駆動開発ライフサイクル(AI-DLC)のホワイトペーパーを解説
swxhariu5
0
560
AIの弱点、やっぱりプログラミングは人間が(も)勉強しよう / YAPC AI and Programming
kishida
9
3.8k
Eloquentを使ってどこまでコードの治安を保てるのか?を新人が考察してみた
itokoh0405
0
3.1k
flutter_kaigi_2025.pdf
kyoheig3
1
230
Phronetic Team with AI - Agile Japan 2025 closing
hiranabe
2
500
SUZURIの規約違反チェックにおけるクリエイタフィードバックの試⾏錯誤/Trial and Error in Creator Feedback for SUZURI's Terms of Service Violation Checks
ae14watanabe
1
140
JEP 496 と JEP 497 から学ぶ耐量子計算機暗号入門 / Learning Post-Quantum Crypto Basics from JEP 496 & 497
mackey0225
2
180
Swift Concurrency 年表クイズ
omochi
3
230
2026年向け会社紹介資料
misu
0
150
詳細の決定を遅らせつつ実装を早くする
shimabox
1
1k
オフライン対応!Flutterアプリに全文検索エンジンを実装する @FlutterKaigi2025
itsmedreamwalker
2
170
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
450
Featured
See All Featured
A designer walks into a library…
pauljervisheath
210
24k
Balancing Empowerment & Direction
lara
5
740
Scaling GitHub
holman
463
140k
Optimising Largest Contentful Paint
csswizardry
37
3.5k
Visualization
eitanlees
150
16k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
2.9k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
1.8k
Designing Experiences People Love
moore
142
24k
For a Future-Friendly Web
brad_frost
180
10k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
24
1.6k
How GitHub (no longer) Works
holman
315
140k
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