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.1k
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
110
深センではテクノロジーを使う人がイノベーションを起こしている
ngo275
0
560
スマートコントラクトのデプロイって何だろう
ngo275
0
790
プロトタイピングするならFirebaseを使ってみよう
ngo275
0
1.8k
Ethereumで開発を始めるなら知っておきたいこと
ngo275
10
5k
スマートコントラクトをHTTPで実行する
ngo275
0
130
iOSアプリエンジニアがReact Nativeを使ってみて
ngo275
0
280
中東のシリコンバレーことイスラエルに行ってきた
ngo275
0
140
ペイモのアーキテクチャ
ngo275
0
680
Other Decks in Programming
See All in Programming
decksh - a little language for decks
ajstarks
4
21k
あなたとJIT, 今すぐアセンブ ル
sisshiki1969
1
730
[FEConf 2025] 모노레포 절망편, 14개 레포로 부활하기까지 걸린 1년
mmmaxkim
0
1.1k
実践!App Intents対応
yuukiw00w
1
350
兎に角、コードレビュー
mitohato14
0
150
Microsoft Orleans, Daprのアクターモデルを使い効率的に開発、デプロイを行うためのSekibanの試行錯誤 / Sekiban: Exploring Efficient Development and Deployment with Microsoft Orleans and Dapr Actor Models
tomohisa
0
210
【第4回】関東Kaggler会「Kaggleは執筆に役立つ」
mipypf
0
840
Laravel Boost 超入門
fire_arlo
1
130
Langfuseと歩む生成AI活用推進
licux
3
300
Honoアップデート 2025年夏
yusukebe
1
860
パスタの技術
yusukebe
1
400
Oracle Database Technology Night 92 Database Connection control FAN-AC
oracle4engineer
PRO
1
210
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
Large-scale JavaScript Application Architecture
addyosmani
512
110k
Testing 201, or: Great Expectations
jmmastey
45
7.6k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
For a Future-Friendly Web
brad_frost
179
9.9k
How to Ace a Technical Interview
jacobian
279
23k
We Have a Design System, Now What?
morganepeng
53
7.7k
Producing Creativity
orderedlist
PRO
347
40k
The World Runs on Bad Software
bkeepers
PRO
70
11k
4 Signs Your Business is Dying
shpigford
184
22k
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