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
Truffleの紹介_in_hicon2018.pdf
Search
nakajo2011
November 10, 2018
Programming
3
250
Truffleの紹介_in_hicon2018.pdf
nakajo2011
November 10, 2018
Tweet
Share
More Decks by nakajo2011
See All by nakajo2011
Plasma_Overview_gbec20180928.pdf
nakajo2011
0
47
What is Ethereum about tech layer
nakajo2011
0
300
The Ethereum design direction.
nakajo2011
0
42
Report of Devcon5 2019.10.17
nakajo2011
0
540
Compare of Libra and Ethereum
nakajo2011
1
420
What is Move language
nakajo2011
1
940
blockchain-changing-and-issues
nakajo2011
4
520
Thinking Scalability from DEX
nakajo2011
0
88
Truffle Test Tips and other
nakajo2011
2
150
Other Decks in Programming
See All in Programming
PHPで学ぶプログラミングの教訓 / Lessons in Programming Learned through PHP
nrslib
3
300
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
340
今年一番支援させていただいたのは認証系サービスでした
satoshi256kbyte
1
260
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
6
1.6k
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
140
数十万行のプロジェクトを Scala 2から3に完全移行した
xuwei_k
0
280
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
840
Androidアプリのモジュール分割における:x:commonを考える
okuzawats
1
140
PHPUnitしか使ってこなかった 一般PHPerがPestに乗り換えた実録
mashirou1234
0
230
テストケースの名前はどうつけるべきか?
orgachem
PRO
0
140
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
26
1.9k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Building Applications with DynamoDB
mza
91
6.1k
Adopting Sorbet at Scale
ufuk
73
9.1k
Site-Speed That Sticks
csswizardry
2
190
Code Reviewing Like a Champion
maltzj
520
39k
Writing Fast Ruby
sferik
628
61k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
A Tale of Four Properties
chriscoyier
157
23k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Building Adaptive Systems
keathley
38
2.3k
For a Future-Friendly Web
brad_frost
175
9.4k
Transcript
Copyright ©2018 chaintope, Inc. all rights reserved. hicon2018 Truffleの紹介 2018/11/10
chaintope, Inc Yukishige Nakajo
Copyright ©2018 chaintope, Inc. all rights reserved. 自己紹介 • Yukishige
Nakajo • 株式会社chaintope Chief Ethereum Researcher • 福岡県の飯塚市でEthereumの研究中 • 最近はBitcoinもやってます • truffle-hdwallet-providerのcontributerです! https://twitter.com/nakajo https://y-nakajo.hatenablog.com/
Copyright ©2018 chaintope, Inc. all rights reserved. Truffleの紹介 1. Truffleの概要
2. migation 3. ganache 4. mocha 5. その他の機能 今日話すこと
Copyright ©2018 chaintope, Inc. all rights reserved. Truffleの紹介 1. Truffleの概要
2. migation 3. ganache 4. mocha 5. その他の機能 今日話すこと
Copyright ©2018 chaintope, Inc. all rights reserved. 出典元:https://truffleframework.com/truffle Truffle is
the most popular development framework for Ethereum 1. Truffleの概要
Copyright ©2018 chaintope, Inc. all rights reserved. 1. Truffleの概要
Copyright ©2018 chaintope, Inc. all rights reserved. Deploy Tool 1.
Truffleの概要
Copyright ©2018 chaintope, Inc. all rights reserved. Deploy Tool Test
Tool 1. Truffleの概要
Copyright ©2018 chaintope, Inc. all rights reserved. Deploy Tool Test
Tool Node for Dev 1. Truffleの概要
Copyright ©2018 chaintope, Inc. all rights reserved. Truffleの紹介 1. Truffleの概要
2. migation 3. ganache 4. mocha 5. その他の機能 今日話すこと
Copyright ©2018 chaintope, Inc. all rights reserved. • Smart Contractのデプロイ方法を記述するもの
• DB Migrationのようにバージョンを分けて記述可能 • DB Migrationと大きく違うのはrollbackできないこと • バージョンを指定して途中までdeployとかもできない。 2. Migration
Copyright ©2018 chaintope, Inc. all rights reserved. • 基本的なDeploy https://truffleframework.com/docs/truffle/getting-started/running-migrations
2. Migration
Copyright ©2018 chaintope, Inc. all rights reserved. • Deploy時に使えるParameter https://truffleframework.com/docs/truffle/getting-started/running-migrations
2. Migration
Copyright ©2018 chaintope, Inc. all rights reserved. • Deploy時に使えるParameterその2 https://truffleframework.com/docs/truffle/getting-started/running-migrations
2. Migration
Copyright ©2018 chaintope, Inc. all rights reserved. • Library ContractとのLink
https://truffleframework.com/docs/truffle/getting-started/running-migrations 2. Migration
Copyright ©2018 chaintope, Inc. all rights reserved. • Promisefy https://truffleframework.com/docs/truffle/getting-started/running-migrations
2. Migration
Copyright ©2018 chaintope, Inc. all rights reserved. Truffleの紹介 1. Truffleの概要
2. migation 3. ganache 4. mocha 5. その他の機能 今日話すこと
Copyright ©2018 chaintope, Inc. all rights reserved. 開発用のnode • 即時マイニング機能
• 固定されたmnemonic • 便利なRPC • 任意のgas limitが指定可能(別起動時に指定可能) 3. ganache
Copyright ©2018 chaintope, Inc. all rights reserved. • 即時マイニング •
Transactionが発行されるたびにすぐにminingが行 われる。 • Transactionが行方不明にならない! • mining待ちも発生しない。 3. ganache
Copyright ©2018 chaintope, Inc. all rights reserved. • 固定されたmnemonic 3.
ganache
Copyright ©2018 chaintope, Inc. all rights reserved. • 固定されたmnemonic 3.
ganache
Copyright ©2018 chaintope, Inc. all rights reserved. • 便利なRPC •
evm_increaseTime: block timeを任意の時間に設 定(ただし未来のみ) • evm_mine: 即時mining • evm_snapshot: 現在の状態のsnapshotをとる • evm_revert: 状態を指定されたsnapshotに戻す 3. ganache
Copyright ©2018 chaintope, Inc. all rights reserved. • 任意のgas limitが指定可能(別起動時に指定可能)
https://github.com/trufflesuite/ganache-cli#using-ganache-cli $ ganace-cli -l 99999999 & truffle test 3. ganache
Copyright ©2018 chaintope, Inc. all rights reserved. Truffleの紹介 1. Truffleの概要
2. migation 3. ganache 4. mocha 5. その他の機能 今日話すこと
Copyright ©2018 chaintope, Inc. all rights reserved. • Javascriptでは有名なunit test
tool • basic (describe, it) • before, after, beforeEach, afterEach • skip, only 4. mocha
Copyright ©2018 chaintope, Inc. all rights reserved. • basic (describe,
it) https://mochajs.org/#asynchronous-code 4. mocha
Copyright ©2018 chaintope, Inc. all rights reserved. • basic (describe,
it) https://mochajs.org/#asynchronous-code 4. mocha
Copyright ©2018 chaintope, Inc. all rights reserved. • before, after,
beforeEach, afterEach https://mochajs.org/#hooks 4. mocha
Copyright ©2018 chaintope, Inc. all rights reserved. • skip, only
https://mochajs.org/#inclusive-tests 4. mocha
Copyright ©2018 chaintope, Inc. all rights reserved. • skip, only
https://mochajs.org/#inclusive-tests 4. mocha
Copyright ©2018 chaintope, Inc. all rights reserved. • skip, only
https://mochajs.org/#exclusive-tests 4. mocha
Copyright ©2018 chaintope, Inc. all rights reserved. • skip, only
https://mochajs.org/#exclusive-tests 4. mocha
Copyright ©2018 chaintope, Inc. all rights reserved. Truffleの紹介 1. Truffleの概要
2. migation 3. ganache 4. mocha 5. その他の機能 今日話すこと
Copyright ©2018 chaintope, Inc. all rights reserved. • truffle-debugger •
https://github.com/trufflesuite/truffle/tree/next/packages/truffle-debugger#truffle-debug ger • truffle-contract : 単体でも使える • truffle-artifactor 5. その他の機能
Copyright ©2018 chaintope, Inc. all rights reserved. ここからは Step 1をハンズオン形式で
説明します! おわり