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
240
Truffleの紹介_in_hicon2018.pdf
nakajo2011
November 10, 2018
Tweet
Share
More Decks by nakajo2011
See All by nakajo2011
Plasma_Overview_gbec20180928.pdf
nakajo2011
0
46
What is Ethereum about tech layer
nakajo2011
0
280
The Ethereum design direction.
nakajo2011
0
42
Report of Devcon5 2019.10.17
nakajo2011
0
530
Compare of Libra and Ethereum
nakajo2011
1
410
What is Move language
nakajo2011
1
920
blockchain-changing-and-issues
nakajo2011
4
510
Thinking Scalability from DEX
nakajo2011
0
88
Truffle Test Tips and other
nakajo2011
2
140
Other Decks in Programming
See All in Programming
Server Driven Compose With Firebase
skydoves
0
400
offers_20241022_imakiire.pdf
imakurusu
2
360
qmuntal/stateless のススメ
sgash708
0
120
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
920
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
2.7k
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
430
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
250
gopls を改造したら開発生産性が高まった
satorunooshie
8
240
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
200
Outline View in SwiftUI
1024jp
1
150
JaSST 24 九州:ワークショップ(は除く)実践!マインドマップを活用したソフトウェアテスト+活用事例
satohiroyuki
0
260
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
7
2.8k
Featured
See All Featured
Scaling GitHub
holman
458
140k
[RailsConf 2023] Rails as a piece of cake
palkan
51
4.9k
It's Worth the Effort
3n
183
27k
Testing 201, or: Great Expectations
jmmastey
38
7k
Docker and Python
trallard
40
3.1k
The Art of Programming - Codeland 2020
erikaheidi
51
13k
Navigating Team Friction
lara
183
14k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
Agile that works and the tools we love
rasmusluckow
327
21k
Automating Front-end Workflow
addyosmani
1365
200k
What's in a price? How to price your products and services
michaelherold
243
12k
Art, The Web, and Tiny UX
lynnandtonic
296
20k
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をハンズオン形式で
説明します! おわり