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
620
スマートコントラクトのデプロイって何だろう
ngo275
0
840
プロトタイピングするなら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
700
Other Decks in Programming
See All in Programming
AI Agent Dojo #4: watsonx Orchestrate ADK体験
oniak3ibm
PRO
0
120
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
160
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
210
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
350
MDN Web Docs に日本語翻訳でコントリビュート
ohmori_yusuke
0
370
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
110
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
670
AIによるイベントストーミング図からのコード生成 / AI-powered code generation from Event Storming diagrams
nrslib
1
1k
PostgreSQLで手軽にDuckDBを使う!DuckDB&pg_duckdb入門/osc25hi-duckdb
takahashiikki
0
240
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
10
1.5k
生成AI時代を勝ち抜くエンジニア組織マネジメント
coconala_engineer
0
38k
[AI Engineering Summit Tokyo 2025] LLMは計画業務のゲームチェンジャーか? 最適化業務における活⽤の可能性と限界
terryu16
2
260
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
1
1.5k
My Coaching Mixtape
mlcsv
0
21
Principles of Awesome APIs and How to Build Them.
keavy
127
17k
Odyssey Design
rkendrick25
PRO
0
460
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
280
The #1 spot is gone: here's how to win anyway
tamaranovitovic
1
880
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
58
41k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.8k
YesSQL, Process and Tooling at Scale
rocio
174
15k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
74
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
GitHub's CSS Performance
jonrohan
1032
470k
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