$30 off During Our Annual Pro Sale. View Details »
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
610
スマートコントラクトのデプロイって何だろう
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
140
ペイモのアーキテクチャ
ngo275
0
690
Other Decks in Programming
See All in Programming
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
110
Integrating WordPress and Symfony
alexandresalome
0
120
ローターアクトEクラブ アメリカンナイト:川端 柚菜 氏(Japan O.K. ローターアクトEクラブ 会長):2720 Japan O.K. ロータリーEクラブ2025年12月1日卓話
2720japanoke
0
460
Reactive Thinking with Signals and the new Resource API
manfredsteyer
PRO
0
160
AIコーディングエージェント(Manus)
kondai24
0
120
WebRTC と Rust と8K 60fps
tnoho
2
1.9k
AIコーディングエージェント(skywork)
kondai24
0
120
How Software Deployment tools have changed in the past 20 years
geshan
0
28k
MAP, Jigsaw, Code Golf 振り返り会 by 関東Kaggler会|Jigsaw 15th Solution
hasibirok0
0
210
これだけで丸わかり!LangChain v1.0 アップデートまとめ
os1ma
6
1.3k
CSC509 Lecture 14
javiergs
PRO
0
220
手軽に積ん読を増やすには?/読みたい本と付き合うには?
o0h
PRO
1
140
Featured
See All Featured
Designing for Performance
lara
610
69k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.6k
Rails Girls Zürich Keynote
gr2m
95
14k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.2k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
69k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Site-Speed That Sticks
csswizardry
13
990
Balancing Empowerment & Direction
lara
5
780
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